Skip to content

Conversation

@DouweM
Copy link
Collaborator

@DouweM DouweM commented Jul 23, 2025

Fixes #2244

@github-actions
Copy link

github-actions bot commented Jul 23, 2025

Docs Preview

commit: f72ad2f
Preview URL: https://da9c15e8-pydantic-ai-previews.pydantic.workers.dev

@DouweM
Copy link
Collaborator Author

DouweM commented Jul 23, 2025

@Kludex Can you please review this?

@DouweM DouweM assigned DouweM and Kludex and unassigned DouweM Jul 23, 2025
@DouweM DouweM requested a review from Kludex July 23, 2025 21:26
@DouweM DouweM merged commit 7eb4491 into main Jul 24, 2025
18 checks passed
@DouweM DouweM deleted the streaming-think-tags branch July 24, 2025 19:23
KRRT7 pushed a commit to aseembits93/pydantic-ai that referenced this pull request Jul 24, 2025
@AlbertoLanaro
Copy link

AlbertoLanaro commented Jul 28, 2025

I think that “START_THINK_TAG” and "END_THINK_TAG" should be customizable at the model level. In fact, sometimes some models (e.g Claude 4), even though prompted to use CoT with <think> tags, use different tag content, such as <thinking>, and these are not parsed correctly.

@DouweM
Copy link
Collaborator Author

DouweM commented Jul 28, 2025

@AlbertoLanaro Make sense, can you please file a new feature request issue for that? Note that with Claude, we currently expect thoughts to come in as a specific field in the API response, so I'd be curious to see when it comes as tags in the text response instead.

@AlbertoLanaro
Copy link

can you please file a new feature request issue for that?

Sure, no problem.

Note that with Claude, we currently expect thoughts to come in as a specific field in the API response, so I'd be curious to see when it comes as tags in the text response instead.

I am using Claude via OpenRouter, so I am using OpenAIModel and OpenAIProvider to access it.

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.

<think> tags in text parts are not parsed into thinking parts when streaming

4 participants