Skip to content

feat: Add reasoning content for openai model provider #187

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

Merged
merged 8 commits into from
Jun 26, 2025

Conversation

xiehust
Copy link
Contributor

@xiehust xiehust commented Jun 6, 2025

Description

[Provide a detailed description of the changes in this PR]
Add reasoning content output for OpenAI model provider.
Now agent can output reasoningText when use 'DeepSeek-R1' via OpenAI model provider

async for event in agent.stream_async(query):
      if 'reasoningText' in event:
          print(event['reasoningText'],end="",flush=True)
      if "data" in event:
          # Only stream text chunks to the client
          print(event['data'],end="",flush=True)

Related Issues

[Link to related issues using #issue-number format]

Documentation PR

[Link to related associated PR in the agent-docs repo]

Type of Change

  • New feature

Testing

[How have you tested the change?]
YES

  • hatch fmt --linter
  • hatch fmt --formatter
  • hatch test --all
  • Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli

Checklist

  • I have read the CONTRIBUTING document
  • I have added tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@xiehust xiehust requested a review from a team as a code owner June 6, 2025 14:51
@xiehust
Copy link
Contributor Author

xiehust commented Jun 23, 2025

Hi, Any comment about it? This feature is import when we use the reasoning model on OpenAI providers such as deepseek-r1

pgrayy
pgrayy previously approved these changes Jun 26, 2025
@xiehust xiehust temporarily deployed to manual-approval June 26, 2025 14:41 — with GitHub Actions Inactive
@pgrayy pgrayy merged commit 2ba7459 into strands-agents:main Jun 26, 2025
12 checks passed
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.

2 participants