Update anthropic provider types#334
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6e97850b52
ℹ️ 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), | ||
|
|
||
| #[serde(untagged)] | ||
| Custom(CustomTool), |
There was a problem hiding this comment.
Preserve tool-search tool variants in Anthropic Tool
This regenerated enum now falls through from web_search_20260318 to Custom, so tool_search_tool_regex_20251119/BM25 payloads no longer deserialize because CustomTool requires input_schema. That is still valid according to the OpenAPI in this commit (specs/anthropic/openapi.yml:36689-36690), and the adapter still emits exactly that shape in anthropic_tool_value() (crates/lingua/src/providers/anthropic/adapter.rs:54-63), so transforms or passthrough validation involving tool discovery now fail instead of round-tripping. Please fix the generator to re-add those variants rather than treating the fixture as invalid.
Useful? React with 👍 / 👎.
| pub name: String, | ||
| /// How this tool's result blocks appear in the API response when the result was consumed by a completed code_execution call in the same turn. 'full' returns the complete content (default). 'excluded' drops the nested server_tool_use and result block pair entirely. Results from direct calls, or from code_execution calls that paused before completing, are always returned in full so they can be sent back on the next turn. | ||
| #[serde(skip_serializing_if = "Option::is_none")] | ||
| pub response_inclusion: Option<String>, |
There was a problem hiding this comment.
Type response_inclusion as the enum
The imported schema limits response_inclusion to "full" or "excluded" (and this file even generates ResponseInclusion), but this field is Option<String>. As a result validate_anthropic_request and CreateMessageParams will accept arbitrary values on the new 20260318 web fetch/search tools and pass them through until Anthropic rejects the request; wire this field to ResponseInclusion (same issue in WebSearchTool20260318) to keep provider-boundary validation strict.
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.