Andrea Cosentino created CAMEL-24345:
----------------------------------------

             Summary: camel-google-vertexai: streamOutputMode and jsonMode 
options are never applied
                 Key: CAMEL-24345
                 URL: https://issues.apache.org/jira/browse/CAMEL-24345
             Project: Camel
          Issue Type: Bug
          Components: camel-google
            Reporter: Andrea Cosentino
            Assignee: Andrea Cosentino


{{GoogleVertexAIConfiguration}} declares two documented options that no code 
ever reads:
{code:java}
// GoogleVertexAIConfiguration.java:79-84
@UriParam(label = "producer", description = "Streaming output mode: complete 
(default) or chunks",
          defaultValue = "complete", enums = "complete,chunks")
private String streamOutputMode = "complete";

@UriParam(label = "producer", description = "Whether to use JSON 
request/response format", defaultValue = "false")
private boolean jsonMode;
{code}
{{generateChatStreaming}} always accumulates the full response 
({{GoogleVertexAIProducer:154-177}}), so {{streamOutputMode=chunks}} silently 
behaves like {{complete}}. {{GoogleVertexAIConstants.STREAM_OUTPUT_MODE}} (:55) 
is likewise never read. The existing test only asserts that the setter 
round-trips the value.

Either implement the two options or remove them from the configuration and the 
catalog.

Related: {{generateChat}} (:140-143) and {{generateCode}} (:266-269) both 
delegate verbatim to {{generateText}} while being advertised as distinct 
operations in the {{enums}} list - they should either differ or be documented 
as aliases.

Also {{buildRawPredictRequestBody}} (:507-508) calls {{body.getClass()}} on the 
failure path, which NPEs when the message body is null instead of reporting the 
unsupported type.

Found during a source audit of the {{components/camel-google}} module family 
against main @ c3b01310be15.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to