feat: add --temperature CLI flag (default 0)#6
Conversation
Expose the LLM sampling temperature as a `--temperature` Click option (float, default 0.0) so callers can trade determinism for creativity. Threads through `make_client()` into both `AnthropicClient` and `OpenAIClient`; behaviour is unchanged when the flag is omitted. Closes Cyberfilo#1 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Thanks @Priyansh2116 — clean, and Two technical things before I pull it in: 1. Range validation. 2. Reasoning-model branch. In Heads-up on a seam: #7 (Ollama) currently hardcodes |
- Switch type=float to type=click.FloatRange(0.0, 2.0) so out-of-range values produce a clean CLI error instead of an opaque provider 400 - Add a comment in the OpenAI reasoning-model branch explaining why self.temperature is not forwarded there (those models reject it) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Thanks for the detailed review!
Both changes are in the latest commit. Happy to thread the flag into the Ollama client (#7) in a follow-up once that PR lands. |
Summary
Closes #1
--temperatureClick option (float, default0.0, shown in--help) to the CLItemperatureon bothAnthropicClientandOpenAIClientand uses it ingenerate()make_client()so both the SQL-generator and selector LLM respect the flag--temperatureis omitted (default0preserves existing determinism)Test plan
promptquery --helpshows--temperature FLOAT Sampling temperature passed to the LLM (0 = deterministic). [default: 0.0]pytest tests/)--temperature 0.7forwards the value to the LLM API call🤖 Generated with Claude Code