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

   <!-- claude-projects-attribution: {"github_login":"ravismash"} -->
   _Requested by **Ravi** ยท [project 
thread](https://claude.ai/code/project/chan_01AnxMWGzhRWeKLVvuxdesQv?thread=cmsg_01AnxMWGzhRWeKLVvuxdesQv9bnwGqQWRMLS3zU5qgUSX3)_
   
   `AbstractWatsonxAiHandler.getInputs` cast a List body, and the list in the 
`CamelIbmWatsonxAiInputs` header, to `List<String>` without looking at the 
elements, so a non-String element reached the watsonx.ai SDK.
   
   Each element is now checked the way `toChatMessages` checks chat messages 
(CAMEL-26222):
   - a String is an input text
   - a value whose `toString()` is its text (UUID, URI, a date) is read as 
text, as a single body is since CAMEL-26521
   - anything else fails with an `IllegalArgumentException` naming its index 
and class, before a request is sent
   
   Tests in `WatsonxAiMessageBodyTest`: a non-String element in the body 
(embedding), a null element in the header, a UUID element read as text, a Map 
element (rerank).
   
   JIRA: https://issues.apache.org/jira/browse/CAMEL-27093
   
   Note: #30869 rewrites AbstractWatsonxAiHandler and will likely conflict with 
this change. Happy to rebase whichever way is easier; if #30869 merges first 
I'll rebase this on main.
   
   _Claude Code on behalf of Ravi_
   


-- 
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