Fix top_p null still sent in API requests after #385#415
Open
toslali-ibm wants to merge 1 commit intoalgorithmicsuperintelligence:mainfrom
Open
Fix top_p null still sent in API requests after #385#415toslali-ibm wants to merge 1 commit intoalgorithmicsuperintelligence:mainfrom
toslali-ibm wants to merge 1 commit intoalgorithmicsuperintelligence:mainfrom
Conversation
…lligence#385 PR algorithmicsuperintelligence#385 made top_p optional and defaulted it to None in LLMConfig, but openai.py still unconditionally includes top_p in the request params dict. This sends "top_p": null to providers like AWS Bedrock that don't strip null values, causing 400 errors. Only include top_p in params when it is explicitly set. Fixes algorithmicsuperintelligence#414 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR #385 (closing #378) made
top_poptional and defaulted it toNoneinLLMConfig, but the API call layer inopenevolve/llm/openai.pystill unconditionally includestop_pin the request params:This puts
"top_p": Noneinto the params dict. Providers like AWS Bedrock, LiteLLM, and other OpenAI-compatible wrappers may serialize it as"top_p": nullin the JSON body, triggering a 400 error.Fix: Only include
top_pin params when it is explicitly set (notNone).Changes
openevolve/llm/openai.py: Conditionally includetop_pin request params only when notNoneTest plan
Fixes #414