Update anthropic provider types#355
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 451cf7d1f0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "Codex (@codex) address that feedback".
| #[serde(rename = "web_search_20260318")] | ||
| WebSearch20260318(WebSearchTool20260318), |
There was a problem hiding this comment.
Restore tool_search variants to the Anthropic Tool enum
The checked-in Anthropic spec still includes ToolSearchToolBM25_20251119 and ToolSearchToolRegex_20251119 in the request tools union (specs/anthropic/openapi.yml:33116-33117) and their type enums include values such as tool_search_tool_regex_20251119 (specs/anthropic/openapi.yml:36813-36814), but this enum now goes from web_search directly to Custom. For any valid Anthropic request whose tools contains one of those tool_search tools, CreateMessageParams deserialization/validation now rejects the request, and the adapter still emits that same tool_search type for discovery, so round-trips and existing payload cases break. Please fix the generator or typed adapter so these schema variants remain accepted.
Useful? React with 👍 / 👎.
| "text/plain" => { | ||
| Some(generated::Base64ImageSourceMediaType::TextPlain) | ||
| } | ||
| _ => None, |
There was a problem hiding this comment.
Preserve a media type for text document fallbacks
For non-URL UserContentPart::File values with a media type outside the explicit list, such as application/octet-stream, this now sets anthropic_media_type to None but still emits a document source with source_type: Text. The checked-in OpenAPI schema requires media_type for PlainTextSource (specs/anthropic/openapi.yml:34213-34216), so the generated Anthropic request is invalid; previously the fallback sent text/plain, which satisfied that source shape.
Useful? React with 👍 / 👎.
Automated update of Lingua provider types.
Provider:
anthropicFeedback: comment
/bt goodor/bt badto log review feedback to the Braintrust trace.Validation
./pipelines/generate-provider-types.sh anthropic: failure./pipelines/generate-provider-types.sh anthropic: successmake generate-types: successmake generate-types: successcargo fmt --all: successcargo build --all-features: successcargo clippy --all-targets --all-features -- -D warnings: successmake typed-boundary-check: successcargo test -p coverage-report --test cross_provider_test cross_provider_transformations_have_no_unexpected_failures: failureThis PR is created even when validation fails so the generated update and repair attempt are available for manual follow-up.