Skip to content

Configurable LLM Client Settings#12

Open
hmshuv wants to merge 3 commits intogoogle-deepmind:mainfrom
hmshuv:feature/configurable-client
Open

Configurable LLM Client Settings#12
hmshuv wants to merge 3 commits intogoogle-deepmind:mainfrom
hmshuv:feature/configurable-client

Conversation

@hmshuv
Copy link
Copy Markdown

@hmshuv hmshuv commented Dec 22, 2025

Configurable LLM Client Settings

Summary

Introduces a configuration system using pydantic-settings to allow users to customize LLM client behavior (retry logic and default models) via environment variables, replacing hardcoded values.

Changes

New Module:

  • Added strategicwm/_src/config.py with Settings class for configuration management

Updated Modules:

  • Modified strategicwm/_src/client_lib.py to use config.settings.RETRY_* instead of hardcoded values

Dependencies:

  • Added pydantic-settings to pyproject.toml

Testing:

  • Added strategicwm/_src/config_test.py to verify configuration overrides

Motivation

Hardcoded retry attempts (tries=10) and delays (delay=10) made the library inflexible for different network conditions or model requirements. This change allows users to tune parameters without modifying code.

Related Issue

Closes #11

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Usage Example

# Set custom retry behavior
export SWM_RETRY_COUNT=5
export SWM_RETRY_DELAY=15
export SWM_MODEL_NAME=gpt-4

# Run your code - settings are automatically loaded
python your_script.py

Checklist

  • Code follows project style guidelines
  • Self-reviewed code
  • Added tests proving feature works
  • All tests pass locally
  • Documentation updated

Ready for review! Let me know if you have any questions.

- Add logging_utils module
- Update client_lib, direct, and bfs to use logger
- Add tests for logging configuration
- Add config module with pydantic
- Update client_lib to use config settings
- update pyproject.toml dependencies
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.

Configurable LLM Client Settings

1 participant