Skip to content

[Fix] Pass temperature=0.0 to OpenAI/AzureAI instead of dropping it - #1504

Open
RezaRahemtola wants to merge 1 commit into
guidance-ai:mainfrom
RezaRahemtola:fix/openai-temperature-zero
Open

[Fix] Pass temperature=0.0 to OpenAI/AzureAI instead of dropping it#1504
RezaRahemtola wants to merge 1 commit into
guidance-ai:mainfrom
RezaRahemtola:fix/openai-temperature-zero

Conversation

@RezaRahemtola

Copy link
Copy Markdown

gen(temperature=0.0) on OpenAI/AzureAI silently falls back to the endpoint's default temperature (1.0) instead of passing 0.0.

The kwarg is gated on if node.temperature:, which is falsy for 0.0 in Python. It looks like the same fix was applied to subgrammar() in #1459 but missed the model adapters.

This PR swaps the truthiness guard for is not None, matching the rest of the codebase. Also fixed the same pattern in the experimental sglang and litellm adapters, and added a regression test.

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.

1 participant