Skip to content

Conversation

@codelion
Copy link
Member

Summary

This PR incorporates the fix from #378 with the following changes:

  • Make temperature and top_p parameters optional (float | None)
  • Change default top_p from 0.95 to None in LLMConfig
  • Add logic to remove None values before dacite parsing to avoid type errors
  • Add example Anthropic config files for circle_packing example
  • Update test to mock ANTHROPIC_API_KEY environment variable for config validation

Problem: When using certain Anthropic models, passing both temperature and top_p results in an error:

Error code: 400 - {'error': {'code': 'invalid_request_error', 'message': '`temperature` and `top_p` cannot both be specified for this model.'}}

Solution: Make these parameters optional so users can omit one of them when using Anthropic models.

Test plan

  • All 264 tests pass
  • Config validation test updated to handle ${ANTHROPIC_API_KEY} in new config files

Closes #378

🤖 Generated with Claude Code

codelion and others added 2 commits January 28, 2026 11:48
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>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@codelion codelion merged commit b0a5ca8 into main Jan 28, 2026
3 checks passed
@codelion codelion deleted the fix-anthropic-models-params branch January 28, 2026 03:49
codelion added a commit that referenced this pull request Jan 28, 2026
Add comprehensive tests for recently merged PRs:

- test_llm_config_optional_params.py: Tests for optional temperature/top_p
  parameters (PR #385 - Anthropic model compatibility)

- test_snapshot_artifacts_limit.py: Tests for configurable max_snapshot_artifacts
  (PR #386)

- test_visualization_sanitization.py: Tests for -inf/+inf/NaN sanitization
  in visualization (PR #384)

- test_early_stopping_config.py: Tests for event-based early stopping
  configuration (PR #375)

- test_changes_description.py: Tests for large codebase support via
  changes description (PR #376)

Total tests increased from 264 to 326.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
codelion added a commit that referenced this pull request Jan 28, 2026
* Make max snapshot artifacts limit configurable

Add `database.max_snapshot_artifacts` config option to control how many
program artifacts are included in worker process snapshots. Default
remains 100 for backward compatibility.

- Set to a higher number to include more artifacts in prompts
- Set to `null` (None) for unlimited artifacts (use with caution for
  large populations as this can significantly increase memory usage)

Note: This limit only affects artifacts passed to worker processes,
not the total artifacts stored. All program code is always available
regardless of this setting.

Closes #383

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add tests for recent features

Add comprehensive tests for recently merged PRs:

- test_llm_config_optional_params.py: Tests for optional temperature/top_p
  parameters (PR #385 - Anthropic model compatibility)

- test_snapshot_artifacts_limit.py: Tests for configurable max_snapshot_artifacts
  (PR #386)

- test_visualization_sanitization.py: Tests for -inf/+inf/NaN sanitization
  in visualization (PR #384)

- test_early_stopping_config.py: Tests for event-based early stopping
  configuration (PR #375)

- test_changes_description.py: Tests for large codebase support via
  changes description (PR #376)

Total tests increased from 264 to 326.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add integration tests for example validation

Add comprehensive integration tests that verify:
- Example config files load correctly
- Initial programs have EVOLVE-BLOCK markers
- Evaluators exist and have required functions
- Evaluators can run on initial programs
- Cascade evaluation functions are detected
- Database stores and retrieves programs correctly
- Program evolution tracking works

Tests cover function_minimization, circle_packing, and signal_processing
examples, plus general structure validation for all examples.

Total tests: 346 (was 326)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.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.

2 participants