Skip to content

Stream tool calls and structured output from Anthropic as it's received instead of in one go #1669

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DouweM
Copy link
Contributor

@DouweM DouweM commented May 8, 2025


  • Partial JSON is already handled properly by the PartsManager and ToolCallPartDelta.
  • In testing, the RawContentBlockStartEvent with ToolUseBlock always has input {}.

@DouweM DouweM requested a review from Kludex May 8, 2025 12:57
@DouweM DouweM changed the title Fix streaming partial tool call responses from Anthropic Fix streaming partial tool calls from Anthropic May 8, 2025
Copy link

github-actions bot commented May 8, 2025

Docs Preview

commit: 8c3c593
Preview URL: https://2c6ec09c-pydantic-ai-previews.pydantic.workers.dev

@DouweM
Copy link
Contributor Author

DouweM commented May 8, 2025

CI failures are the same as in #1668 so unrelated to this PR.

@Kludex
Copy link
Member

Kludex commented May 8, 2025

"Fix streaming partial tool calls from Anthropic" = "Don't parse partial JSON delta on Anthropic streaming"?

@Kludex
Copy link
Member

Kludex commented May 8, 2025

"Fix streaming partial tool calls from Anthropic" = "Don't parse partial JSON delta on Anthropic streaming"?

Please make the title a bit more specific before merging it, if it makes sense.

@DouweM DouweM changed the title Fix streaming partial tool calls from Anthropic Stream tool calls and structured output from Anthropic as parts instead of one final chunk May 8, 2025
@DouweM DouweM changed the title Stream tool calls and structured output from Anthropic as parts instead of one final chunk Stream tool calls and structured output from Anthropic as it's received instead of in one go May 8, 2025
@DouweM DouweM enabled auto-merge (squash) May 8, 2025 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants