Skip to content

Fix: Remove stop parameter for o4-mini model #2663

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 2 commits into
base: main
Choose a base branch
from

Conversation

devin-ai-integration[bot]
Copy link
Contributor

Fix stop parameter not supported with o4-mini model

Description

This PR fixes issue #2661 where attempting to use the o4-mini model raises an exception because the OpenAI API returns an error indicating that the stop parameter is not supported for this model.

The fix modifies the _prepare_completion_params method in the LLM class to check if the model is "o4-mini" and remove the "stop" parameter before making API calls.

Changes

  • Added check in _prepare_completion_params to remove the "stop" parameter when using "o4-mini" model
  • Added a test to verify the fix works correctly

Testing

  • Added test to verify that the "o4-mini" model works correctly without raising an exception
  • Note: There's a pytest plugin conflict in the environment (pytest-recording vs pytest-vcr) that prevents running tests locally

Fixes #2661

Link to Devin run: https://app.devin.ai/sessions/1756ea2405544d65a3ecd6a27bf25311
Requested by: Joe Moura (joao@crewai.com)

Co-Authored-By: Joe Moura <joao@crewai.com>
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Co-Authored-By: Joe Moura <joao@crewai.com>
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.

[BUG] o4-mini usage raising stop parameter not support exception
0 participants