Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

chengweitsai
Copy link
Contributor

Description

This PR fixes the order of system_prompt and input_messages in structured_output_span .

The system_prompt should added before input_message, and align with the order of what sent to model_provider, inside of model.structured_output.

Related Issues

#692

Documentation PR

N/A

Type of Change

Bug fix

Testing

How have you tested the change? Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli

  • I ran hatch run prepare

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary 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, or no new docs are needed
  • 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.

@chengweitsai chengweitsai marked this pull request as ready for review August 21, 2025 06:53
@chengweitsai chengweitsai changed the title fix: add system_prompt to structured_output_span before adding inpu fix: add system_prompt to structured_output_span before adding input_messages Aug 21, 2025
@chengweitsai chengweitsai marked this pull request as draft August 21, 2025 06:56
@chengweitsai chengweitsai marked this pull request as ready for review August 21, 2025 06:57
@chengweitsai
Copy link
Contributor Author

chengweitsai commented Aug 21, 2025

Appreciate @poshinchen and @zastrowm for some review 🙏
Thank you

@zastrowm zastrowm temporarily deployed to manual-approval August 21, 2025 12:52 — with GitHub Actions Inactive
@zastrowm zastrowm enabled auto-merge (squash) August 21, 2025 12:53
@zastrowm zastrowm merged commit 9397f58 into strands-agents:main Aug 21, 2025
12 checks passed
dbschmigelski pushed a commit to dbavro19/sdk-python that referenced this pull request Aug 28, 2025
…messages (strands-agents#709)

* fix:  add system_prompt  to structured_output_span  before adding input_messages

* test: Add system message ordering validation to agent structured output test

* Switch to ensuring exact ordering of messages

---------

Co-authored-by: Dennis Tsai (RD-AS) <[email protected]>
Co-authored-by: Mackenzie Zastrow <[email protected]>
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.

3 participants