Skip to content

feat: add random choice default tool - #1541

Open
lntutor wants to merge 1 commit into
simonw:mainfrom
lntutor:feat/random-choice-tool-1178
Open

feat: add random choice default tool#1541
lntutor wants to merge 1 commit into
simonw:mainfrom
lntutor:feat/random-choice-tool-1178

Conversation

@lntutor

@lntutor lntutor commented Jul 19, 2026

Copy link
Copy Markdown

Summary

Adds the llm_random_choice default tool proposed in #1178. The tool accepts a list of strings and returns one entry using random.choice, and is registered alongside llm_version and llm_time.

The regression test patches the chooser deterministically and invokes the tool through the real llm -T CLI path, covering registration, argument decoding, and the returned tool result.

Fixes #1178.

Testing

  • uv run pytest tests/test_tools.py (35 passed)
  • uv run ruff check llm/tools.py llm/default_plugins/default_tools.py tests/test_tools.py
  • uv run black --check llm/tools.py llm/default_plugins/default_tools.py tests/test_tools.py
  • git diff --check

@lntutor
lntutor force-pushed the feat/random-choice-tool-1178 branch from 3ead037 to a0e4d05 Compare July 27, 2026 14:47
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.

llm_random perhaps?

1 participant