weiqingy opened a new issue, #1038:
URL: https://github.com/apache/flink-agents/issues/1038

   ### Search before asking
   
   - [X] I searched in the 
[issues](https://github.com/apache/flink-agents/issues) and found nothing 
similar.
   
   ### Description
   
   The Anthropic chat model defaults to `claude-sonnet-4-20250514` when the 
caller omits `model`. That model is deprecated, so a user who takes the default 
silently gets a deprecated model today and will hit a hard failure whenever it 
retires.
   
   The stale value lives in both language runtimes and is restated in several 
more places, so a user meets it regardless of which API they use:
   
   - Java, `AnthropicChatModelSetup.DEFAULT_MODEL` 
(`integrations/chat-models/anthropic/src/main/java/org/apache/flink/agents/integrations/chatmodels/anthropic/AnthropicChatModelSetup.java:78`),
 plus the Javadoc parameter list (`:40`) and the Javadoc usage example (`:63`)
   - Python, `DEFAULT_ANTHROPIC_MODEL` 
(`python/flink_agents/integrations/chat_models/anthropic/anthropic_chat_model.py:453`),
 plus the docstring that repeats it (`:467`)
   - Docs, the `AnthropicChatModelSetup` parameter tables and code examples for 
both languages (`docs/content/docs/development/chat_models.md:290`, `:305`, 
`:342`, `:367`)
   
   Anthropic is also the only chat model integration whose default is a dated 
snapshot. Every other one uses an undated alias: `gpt-4o-mini`, `gpt-4o`, 
`gemini-3.1-pro-preview`, `qwen-plus`. The dated form is what let this default 
go stale unnoticed, since an alias tracks the current snapshot of its model 
version on its own.
   
   Two related problems sit next to it in the same files. The Python docstring 
repeats the literal value rather than naming the constant, unlike the OpenAI 
(`openai_chat_model.py:318`) and Tongyi (`tongyi_chat_model.py:232`) 
integrations, which is why it drifted alongside the constant. And the docs list 
of available models (`chat_models.md:385-388`) recommends four models of which 
three are no longer current, including `claude-3-7-sonnet-20250219`, which is 
retired, and `claude-opus-4-1-20250805`, which is past its retirement date.
   
   Proposed fix: move the default to `claude-sonnet-4-5` in both runtimes, 
update every restatement, make the Python docstring name its constant, and 
prune the docs model list. `claude-sonnet-4-5` is the same tier as the model it 
replaces, so callers who rely on the default see no change in cost or class of 
model, and it is already the name the connection tests use as their 
structured-output-capable example.
   
   This is the same defect, and the same fix, as #905 for the OpenAI 
integration.
   
   ### Are you willing to submit a PR?
   
   - [X] I'm willing to submit a PR!
   


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