wenjin272 commented on code in PR #843:
URL: https://github.com/apache/flink-agents/pull/843#discussion_r3569499416


##########
integrations/chat-models/openai/src/main/java/org/apache/flink/agents/integrations/chatmodels/openai/OpenAICompletionsConnection.java:
##########
@@ -119,6 +121,11 @@ public OpenAICompletionsConnection(
         this.client = builder.build();
     }
 
+    @Override
+    protected boolean supportsNativeStructuredOutput() {
+        return true;

Review Comment:
   According to the [OpenAI API 
documentation](https://developers.openai.com/api/docs/guides/structured-outputs#structured-outputs-vs-json-mode),
 only `gpt-4o-mini`, `gpt-4o-2024-08-06`, and later models support structured 
outputs. However, since the `DEFAULT_MODEL` in `OpenAICompletionsSetup` is set 
to `gpt-3.5-turbo`, requests using the default configuration will fail when 
sending `response_format: json_schema`, rather than gracefully falling back to 
the prompt.
   
   I think we can move `supportsNativeStructuredOutput` to `ChatModelSetup`, or 
alternatively, change the `DEFAULT_MODEL`.



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