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


##########
python/flink_agents/integrations/chat_models/openai/openai_chat_model.py:
##########
@@ -50,7 +50,7 @@
     resolve_openai_credentials,
 )
 
-DEFAULT_OPENAI_MODEL = "gpt-4o-mini"
+DEFAULT_OPENAI_MODEL = "gpt-6-luna"

Review Comment:
   The Python setup still sends `max_tokens` when configured, which 
`gpt-6-luna` rejects with HTTP 400, asking for `max_completion_tokens` instead. 
I verified that GPT-4o, GPT-4o-mini, and GPT-4.1 also accept the new parameter 
and enforce its limit.
   
   Since we haven't committed to API compatibility yet, I'd suggest renaming 
the Chat Completions configuration to `max_completion_tokens` consistently 
across Java, Python, and YAML. Java already sends this field internally.
   
   This can be addressed here or in a separate PR that lands before the 
default-model switch.



##########
integrations/chat-models/openai/src/main/java/org/apache/flink/agents/integrations/chatmodels/openai/OpenAICompletionsSetup.java:
##########
@@ -148,6 +173,24 @@ public OpenAICompletionsSetup(
                 resourceContext);
     }
 
+    /**
+     * Resolves the connection, prompt and tools, then picks the default 
{@code reasoning_effort}
+     * described on this class. The default depends on the resolved tools, so 
it is chosen here
+     * rather than in the constructor.
+     */
+    @Override
+    public void open() throws Exception {
+        defaultReasoningEffort = null;

Review Comment:
   Could we remove the `defaultReasoningEffort` reset and the tests for 
repeated `open()` calls in both Java and Python? A setup instance is only 
opened once in the current lifecycle, so we don't need to handle recomputing 
the default after its tools change. The corresponding Python reset branch and 
re-open documentation can also be removed.



##########
docs/content/docs/development/calling-llms/chat-models/providers.md:
##########
@@ -1004,13 +1004,13 @@ OpenAI provides cloud-based chat models with 
state-of-the-art performance for a
 
 | Parameter | Type | Default | Description |
 |-----------|------|---------|-------------|
-| `model` | str | `"gpt-4o-mini"` | Name of the chat model to use |
+| `model` | str | `"gpt-6-luna"` | Name of the chat model to use |
 | `temperature` | float | `0.1` | Sampling temperature (0.0 to 2.0) |
 | `max_tokens` | int | None | Maximum number of tokens to generate |
 | `logprobs` | bool | None | Whether to return log probabilities per token |
 | `top_logprobs` | int | `0` | Number of top token log probabilities to return 
(0-20) |
 | `strict` | bool | `False` | Enable strict mode for tool calling and schemas |
-| `reasoning_effort` | str | None | Reasoning effort level for reasoning 
models ("low", "medium", "high") |
+| `reasoning_effort` | str | None | Reasoning effort level for reasoning 
models ("none", "low", "medium", "high"). Unset by default, except on 
`gpt-6-luna` and `gpt-6-sol`, which call functions through Chat Completions 
only with `"none"`: a setup on one of them with at least one tool, including 
the tools added for skills and sub-agents, sends `"none"` unless 
`reasoning_effort` is set here or in `additional_kwargs` |

Review Comment:
   Could we move the GPT-6 Sol/Luna-specific behavior into an info hint below 
the parameter tables, using the existing `{{< hint info >}}` format? The 
`reasoning_effort` rows can simply list the accepted values and state that it 
is unset by default. The hint can explain that Chat Completions automatically 
uses `"none"` for these models when tools are configured and the user hasn't 
explicitly set a value, either directly or in `additional_kwargs`. This would 
avoid repeating the full explanation in both language tables.



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