Croway opened a new pull request, #30869:
URL: https://github.com/apache/camel/pull/30869

   ## Summary
   
   Aligns `camel-ibm-watsonx-ai` with the IBM watsonx.ai Java SDK, after 
running the integration tests against watsonx.ai SaaS (eu-de) and reviewing the 
component against the SDK. One commit per topic, each with its JIRA key.
   
   1. **Fixes** (CAMEL-27570)
      - The tool calling loop sends the whole conversation: `chat` sets 
`CamelIBMWatsonxAiMessages` to the messages it sent when the model calls tools, 
so the next turn starts with the system message and the question instead of 
only the tool calls and results. Stale `CamelIBMWatsonxAiToolCalls` headers are 
removed.
      - `oauthProfile` sends its token as a Bearer token, asked from 
camel-oauth on every request, instead of posting it to IBM Cloud IAM as an API 
key once at startup. The services of an endpoint share one authenticator; a new 
`authenticator` option takes any SDK authenticator (e.g. CP4D). `apiKey` is no 
longer marked required.
      - `forecast` / `deploymentForecast` send the prediction length and the 
future data (new `predictionLength` option and headers; Maps accepted for 
YAML/XML).
      - `CamelIBMWatsonxAiToolChoice`, `CamelIBMWatsonxAiFoundationModelFilter` 
and `CamelIBMWatsonxAiFoundationModelTechPreview` are read (new `toolChoice` 
option). Granite Guardian's "No" no longer sets `CamelIBMWatsonxAiDetected`. 
`deploymentInfo` falls back to the project. `CamelIBMWatsonxAiTokens` is 
`List<String>`.
      - Integration tests and docs use current models (`ibm/granite-4-h-small`, 
`intfloat/multilingual-e5-large`); examples read the region URLs from 
placeholders and set `wxUrl` for tools.
   2. **SDK 0.50.0** (CAMEL-27571): the SDK no longer ships Jackson, so the 
component adds `com.ibm.watsonx:watsonx-ai-jackson2`. API version 2026-10-28. 
Sources unchanged.
   3. **Chat options of the SDK** (CAMEL-27572) for `chat`, `chatStreaming` and 
`deploymentChat` (which ignored all options), as plain options with header 
overrides: response format / JSON schema, guided decoding, seed, stop, number 
of choices, per-request model, reasoning (with the reasoning in a header), 
HAP/PII/Granite Guardian guardrails (findings in a header), tool choice. 
Streaming sends tools, returns tool calls, fails on the first stream error, 
waits at most timeout + 30 s, and can send chunks to a `streamEndpoint`.
   4. **`detectContext` and `detectGenerated`** (CAMEL-27573): context 
relevance, faithfulness and answer relevance, with a `governanceInstanceId` 
option and a `detectors` option taking plain names.
   5. **Text extraction and classification parameters** (CAMEL-27574) as 13 
plain options, removal of uploaded/output files, a processing timeout, and 
`textExtractionAndFetch` / `textClassificationAndFetch` for documents already 
in COS.
   
   Upgrade guide (4.24) entries cover the behaviour changes.
   
   ## Tests
   
   - Module unit tests: 100, including option/header → SDK request mapping 
against a fake server.
   - Integration tests against watsonx.ai SaaS eu-de: **67 run, 64 pass, 0 
fail, 3 skipped** (deployment ITs, no deployment id). On `main` the same 
environment gave 46 run, 39 pass, 4 fail (retired models), 3 skipped.
   - Verified live beyond the old suite: OAuth Bearer path, tool loop 
conversation, forced/disabled tool choice, JSON schema / JSON object / several 
choices / per-request model, streaming with tools and to an endpoint, PII 
guardrail blocking, Granite Guardian "No", context relevance (0.98 relevant vs 
0.03 unrelated), faithfulness and answer relevance, model filter, forecast 
horizon, extraction with parameters and file removal.
   
   ## Not in this PR
   
   - Batch and File services (the Files API is only deployed in us-south), 
Model Gateway services (need an admin-configured gateway), the four schema 
services, deployment streaming, and the extra text generation / embedding / 
rerank options.
   - `logprobs` (the SDK response drops them) and a time limit option (the SDK 
also uses `time_limit` as the HTTP timeout, so a request reaching the limit 
fails client-side) — to be reported to the SDK.
   - Guided decoding is honoured by Mistral Small 3.1 but ignored by Granite 4 
and Llama 3.3 on the service side; reasoning is only verified as accepted, as 
eu-de offers no reasoning model.
   - CAMEL-27093 (unchecked `List<String>` cast of embedding/rerank inputs) is 
not addressed here.
   - Expect a small conflict with the camel-ibm-watsonx-data PR (CAMEL-27575) 
in the 4.24 upgrade guide.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to