IBM watsonx.ai

Interact with IBM watsonx.ai foundation models for text generation, chat, embeddings, and more.

What’s inside

Please refer to the above links for usage and configuration details.

Maven coordinates

<dependency>
    <groupId>org.apache.camel.springboot</groupId>
    <artifactId>camel-ibm-watsonx-ai-starter</artifactId>
</dependency>

Spring Boot Auto-Configuration

The starter supports 36 options, which are listed below.

Name Description Default Type

camel.component.ibm-watsonx-ai.api-key

IBM Cloud API key for authentication

String

camel.component.ibm-watsonx-ai.autowired-enabled

Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.

true

Boolean

camel.component.ibm-watsonx-ai.base-url

The watsonx.ai base URL (e.g., https://us-south.ml.cloud.ibm.com)

String

camel.component.ibm-watsonx-ai.configuration

The component configuration. The option is a org.apache.camel.component.ibm.watsonx.ai.WatsonxAiConfiguration type.

WatsonxAiConfiguration

camel.component.ibm-watsonx-ai.cos-url

Cloud Object Storage URL

String

camel.component.ibm-watsonx-ai.deployment-id

Deployed model ID (for deployment operations)

String

camel.component.ibm-watsonx-ai.detect-hap

Whether to detect HAP (Harmful, Abusive, Profane content)

false

Boolean

camel.component.ibm-watsonx-ai.detect-pii

Whether to detect PII (Personal Identifiable Information)

false

Boolean

camel.component.ibm-watsonx-ai.detection-threshold

Detection threshold (0.0 to 1.0)

Double

camel.component.ibm-watsonx-ai.document-bucket

COS bucket for document storage

String

camel.component.ibm-watsonx-ai.document-connection-id

COS connection ID for document storage

String

camel.component.ibm-watsonx-ai.enabled

Whether to enable auto configuration of the ibm-watsonx-ai component. This is enabled by default.

Boolean

camel.component.ibm-watsonx-ai.frequency-penalty

Frequency penalty for chat

Double

camel.component.ibm-watsonx-ai.lazy-start-producer

Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.

false

Boolean

camel.component.ibm-watsonx-ai.log-requests

Whether to log HTTP requests to the watsonx.ai API

false

Boolean

camel.component.ibm-watsonx-ai.log-responses

Whether to log HTTP responses from the watsonx.ai API

false

Boolean

camel.component.ibm-watsonx-ai.max-completion-tokens

Maximum completion tokens for chat

Integer

camel.component.ibm-watsonx-ai.max-new-tokens

Maximum new tokens to generate

Integer

camel.component.ibm-watsonx-ai.model-id

Foundation model ID (e.g., ibm/granite-13b-instruct-v2)

String

camel.component.ibm-watsonx-ai.oauth-profile

OAuth profile name for obtaining an access token via the OAuth 2.0 Client Credentials grant. When set, the token is acquired from the configured identity provider and used as apiKey. Requires camel-oauth on the classpath.

String

camel.component.ibm-watsonx-ai.operation

The operation to perform

WatsonxAiOperations

camel.component.ibm-watsonx-ai.presence-penalty

Presence penalty for chat

Double

camel.component.ibm-watsonx-ai.project-id

IBM Cloud project ID

String

camel.component.ibm-watsonx-ai.repetition-penalty

Repetition penalty

Double

camel.component.ibm-watsonx-ai.rerank-top-n

Number of top results to return for reranking

Integer

camel.component.ibm-watsonx-ai.result-bucket

COS bucket for result storage

String

camel.component.ibm-watsonx-ai.result-connection-id

COS connection ID for result storage

String

camel.component.ibm-watsonx-ai.return-documents

Whether to return documents in rerank response

false

Boolean

camel.component.ibm-watsonx-ai.space-id

IBM Cloud deployment space ID (alternative to projectId)

String

camel.component.ibm-watsonx-ai.temperature

Temperature for randomness (0.0 to 2.0)

Double

camel.component.ibm-watsonx-ai.timeout

Request timeout in milliseconds

Long

camel.component.ibm-watsonx-ai.top-k

Top K (top-k sampling)

Integer

camel.component.ibm-watsonx-ai.top-p

Top P (nucleus sampling)

Double

camel.component.ibm-watsonx-ai.truncate-input-tokens

Maximum number of tokens accepted per input for embeddings. Truncates from the end if exceeded.

Integer

camel.component.ibm-watsonx-ai.verify-ssl

Whether to verify SSL certificates

true

Boolean

camel.component.ibm-watsonx-ai.wx-url

The watsonx.ai WX platform URL for tool operations (e.g., https://api.dataplatform.cloud.ibm.com/wx)

String