Error in some Anthropic models when both top_k and temperature are passed#378
Closed
twaclaw wants to merge 1 commit intoalgorithmicsuperintelligence:mainfrom
Closed
Error in some Anthropic models when both top_k and temperature are passed#378twaclaw wants to merge 1 commit intoalgorithmicsuperintelligence:mainfrom
twaclaw wants to merge 1 commit intoalgorithmicsuperintelligence:mainfrom
Conversation
…h `temperature` and `top_k` are passed. - Added alternative configurations for circle packing example
codelion
added a commit
that referenced
this pull request
Jan 28, 2026
When using certain Anthropic models, passing both `temperature` and `top_p` results in an error. This PR makes these parameters optional by: - Changing type annotations for `temperature` and `top_p` to `float | None` - Changing default `top_p` from 0.95 to None in LLMConfig - Adding logic to remove None values before dacite parsing to avoid type errors - Adding example Anthropic config files for circle_packing - Updating test to mock ANTHROPIC_API_KEY for config validation Closes #378 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2 tasks
codelion
added a commit
that referenced
this pull request
Jan 28, 2026
…#385) * Fix Anthropic models error when both temperature and top_p are passed When using certain Anthropic models, passing both `temperature` and `top_p` results in an error. This PR makes these parameters optional by: - Changing type annotations for `temperature` and `top_p` to `float | None` - Changing default `top_p` from 0.95 to None in LLMConfig - Adding logic to remove None values before dacite parsing to avoid type errors - Adding example Anthropic config files for circle_packing - Updating test to mock ANTHROPIC_API_KEY for config validation Closes #378 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Bump version to 0.2.26 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
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.
When using certain Anthropic models, passing both
temperatureandtop_presults in an error.It is not possible to omit one of the parameters or to set them to
nullbecause the values are passed by default.This PR makes the parameters
temperatureandtop_poptional.I tested it adding alternative configurations for the circle packing example.
The results I obtained look better than the documented ones. Actually, better than the reference (someone have a look because I might be overseeing something).
Evolution complete! Best program metrics: validity: 1.0000 sum_radii: 2.6360 target_ratio: 1.0004 combined_score: 1.0004 eval_time: 60.8053{ "id": "82ab7add-e783-4a71-a605-d8099259ff84", "generation": 5, "iteration": 85, "timestamp": 1767982561.3161228, "parent_id": "8e2dc578-5bde-493f-a13f-c7b2be33b846", "metrics": { "validity": 1.0, "sum_radii": 2.6359832412776205, "target_ratio": 1.0003731465949224, "combined_score": 1.0003731465949224, "eval_time": 60.80532908439636 }, "language": "python", "saved_at": 1767982936.7021089 }