Skip to content

Fix error for GPT-5 not supporting the stop parameter #1662

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 1 commit into from
Aug 8, 2025

Conversation

Xmader
Copy link
Contributor

@Xmader Xmader commented Aug 7, 2025

The gpt-5, gpt-5-mini, and gpt-5-nano models do not support the stop parameter.

smolagents.utils.AgentGenerationError: Error while generating output:
Error code: 400 - {'error': {'message': "Unsupported parameter: 'stop' is not supported with this model.", 'type': 'invalid_request_error', 'param': 'stop', 'code': 'unsupported_parameter'}}

The gpt-5 series do not support the `stop` parameter
@Xmader Xmader changed the title The gpt-5 series do not support the stop parameter Fix GPT-5 not supporting the stop parameter Aug 7, 2025
@Xmader Xmader changed the title Fix GPT-5 not supporting the stop parameter Fix error for GPT-5 not supporting the stop parameter Aug 7, 2025
Copy link
Member

@albertvillanova albertvillanova left a comment

Choose a reason for hiding this comment

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

Thanks for fixing the error for the recently released GPT-5!

@albertvillanova albertvillanova merged commit 561bc45 into huggingface:main Aug 8, 2025
3 checks passed
@KingJacM
Copy link

KingJacM commented Aug 8, 2025

Is this change reflected in v1.21.0?

@albertvillanova
Copy link
Member

@KingJacM, no, this PR was merged just after the v1.21.0 release.

@de-code
Copy link

de-code commented Aug 11, 2025

Would be lovely to have a new release with that fix in.

@albertvillanova
Copy link
Member

Thanks for the suggestion, @de-code: we just made a patch release with the fix for GPT-5: https://github.com/huggingface/smolagents/releases/tag/v1.21.1

@pramitchoudhary
Copy link

I think a few additional changes might be needed to allow reasoning and verbosity param for customization.

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.

5 participants