Skip to content

fix(openai): do not force temperature in compatible requests - #73

Open
imMamdouhaboammar wants to merge 2 commits into
MagicCube:mainfrom
imMamdouhaboammar:fix/openai-no-default-temperature
Open

fix(openai): do not force temperature in compatible requests#73
imMamdouhaboammar wants to merge 2 commits into
MagicCube:mainfrom
imMamdouhaboammar:fix/openai-no-default-temperature

Conversation

@imMamdouhaboammar

Copy link
Copy Markdown

Summary

Stop OpenAIModelProvider from injecting temperature: 0 into every OpenAI-compatible Chat Completions request.

Root cause

The adapter is used for both OpenAI and third-party OpenAI-compatible endpoints, but _baseChatCompletionParams() imposed a sampling policy even when the caller supplied no sampling options. That creates avoidable compatibility failures for models/endpoints with different parameter support and prevents the provider from using each model's API default.

The Chat Completions API defines temperature as optional. Adapter defaults should therefore omit it unless a caller explicitly requests a value.

Changes

  • remove the hard-coded temperature: 0 field from base request params
  • preserve caller control through options.temperature
  • add regression coverage proving no temperature is emitted by default and an explicit caller value passes through unchanged

This keeps the provider generic and moves sampling policy to the caller that knows the selected model's contract.

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