davsclaus commented on code in PR #30256:
URL: https://github.com/apache/camel/pull/30256#discussion_r4600353085
##########
components/camel-ibm/camel-ibm-watsonx-ai/src/main/docs/ibm-watsonx-ai-component.adoc:
##########
@@ -208,6 +208,22 @@ NOTE: Document processing operations require Cloud Object
Storage (COS) configur
If you don't specify an operation explicitly, you must set it via the
`operation` parameter.
+=== Message body read as text
+
+Many operations read the message body as text: the prompt of `textGeneration`,
`tokenize`, `detect` and
+`deploymentGenerate`, the user message of the chat operations, the texts of
`embedding` and `rerank`, and the file
Review Comment:
Done in 9e56d20a044a: `textGenerationStreaming` reads its prompt with the
same `getInput` as `textGeneration`, so it is listed now (also in the catalog
copy of the page).
_Claude Code on behalf of davsclaus_
##########
components/camel-ibm/camel-ibm-watsonx-ai/src/main/java/org/apache/camel/component/ibm/watsonx/ai/handler/AbstractWatsonxAiHandler.java:
##########
@@ -184,6 +192,52 @@ private static List<ChatMessage> toChatMessages(List<?>
list, String source) {
return messages;
}
+ /**
+ * The body as the text an operation reads, whether it sends it to the
model or uses it as a file path or a request
+ * id: text, bytes, a stream or a file is read as it is, and so is any
other body Camel converts to its text, such
+ * as a {@code char[]} or a {@code ByteBuffer}. A Map or a POJO fails
instead, since Camel has no conversion for it
+ * other than its {@code toString()}, so the model would be asked about a
map written in Java notation, or the
+ * request would name such a map as its file (CAMEL-26521).
+ *
+ * @param what the input in the words of the operation, such as "the
prompt", for the error message of a body that
+ * is not text
+ */
Review Comment:
Done in 9e56d20a044a: added `@param in` and `@return` (the text, or null
when the body is null).
_Claude Code on behalf of davsclaus_
--
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]