Repository navigation
[Feat]Add new claude 4-6 feat for v1/messages #20733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
8cd8a01
d41df60
3307f3d
20440bc
29e6efa
b822e2e
c3b1c0a
319453d
ef55d37
5611974
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -68,6 +68,29 @@ def validate_anthropic_messages_environment( | |
| if existing_beta: | ||
| beta_values.update(b.strip() for b in existing_beta.split(",")) | ||
|
|
||
| # Check for context management | ||
| context_management_param = optional_params.get("context_management") | ||
| if context_management_param is not None: | ||
| # Check edits array for compact_20260112 type | ||
| edits = context_management_param.get("edits", []) | ||
|
Comment on lines
+72
to
+75
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Context management header misfire |
||
| has_compact = False | ||
| has_other = False | ||
|
|
||
| for edit in edits: | ||
| edit_type = edit.get("type", "") | ||
| if edit_type == "compact_20260112": | ||
| has_compact = True | ||
| else: | ||
| has_other = True | ||
|
|
||
| # Add compact header if any compact edits exist | ||
| if has_compact: | ||
| beta_values.add(ANTHROPIC_BETA_HEADER_VALUES.COMPACT_2026_01_12.value) | ||
|
|
||
| # Add context management header if any other edits exist | ||
| if has_other: | ||
| beta_values.add(ANTHROPIC_BETA_HEADER_VALUES.CONTEXT_MANAGEMENT_2025_06_27.value) | ||
|
|
||
| # Check for web search tool | ||
| for tool in tools: | ||
| if isinstance(tool, dict) and tool.get("type", "").startswith(ANTHROPIC_HOSTED_TOOLS.WEB_SEARCH.value): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect provider support claim
This section states:
Compaction is supported on Anthropic, Bedrock Invoke Azure AI, and Vertex AI.but/v1/messagescompaction is typically not supported on Bedrock Invoke (it requiresanthropic_betasupport for the compact feature, which Bedrock Invoke filters/whitelists). Given the code inlitellm/llms/bedrock/.../anthropic_claude3_transformation.pyexplicitly filters provider betas, this doc line is misleading and should be corrected (and also add the missing comma: “Bedrock Invoke, Azure AI”).