Skip to content

Support anthropic streaming tool calls#81

Open
knjiang wants to merge 1 commit intomainfrom
ken/support-anthropic-streaming-tool-calls
Open

Support anthropic streaming tool calls#81
knjiang wants to merge 1 commit intomainfrom
ken/support-anthropic-streaming-tool-calls

Conversation

@knjiang
Copy link
Contributor

@knjiang knjiang commented Feb 5, 2026

This PR adds support for anthropic streaming tool calls.

"target": "*",
"fields": [
{ "pattern": "choices[*].delta.refusal", "reason": "ChatCompletions refusal field has no equivalent in other providers" },
{ "pattern": "choices[*].delta.tool_calls", "reason": "Streaming tool_calls transformation not yet implemented" }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the big one to remove choices[*].delta.tool_calls and what was blocking loop anthropic from working.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the way the testing works here is the following:
we have coverage-report binary that produces an HTML matrix report -> https://github.com/braintrustdata/lingua/actions/runs/21727047150?pr=81

^ the HTML report is helpful for when u want the AI to crank at supporting smth.

in addition we run https://github.com/braintrustdata/lingua/blob/main/crates/coverage-report/tests/cross_provider_test.rs

which runs cargo test on the coverage-report matrix and basically it'll fail if we see an "unexpected diff" where it's not listed in crates/coverage-report/src/streaming_expected_differences.json.

curerntly we don't have full support for all providers so we are flagging them in one by one, the "strict" mode tests only run for:

const REQUIRED_PROVIDERS: &[ProviderFormat] = &[
    ProviderFormat::Responses,
    ProviderFormat::OpenAI, // ChatCompletions
    ProviderFormat::Anthropic,
];

@knjiang knjiang requested a review from clutchski February 5, 2026 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant