Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -438,14 +438,12 @@ private async Task<RoleDialogModel> InnerCreateResponseStreamingAsync(Agent agen
var allowMultiModal = settings != null && settings.MultiModal;
renderedInstructions = [];

float? temperature = float.Parse(_state.GetState("temperature", "0.0"));
var maxTokens = int.TryParse(_state.GetState("max_tokens"), out var tokens)
? tokens
: agent.LlmConfig?.MaxOutputTokens ?? LlmConstant.DEFAULT_MAX_OUTPUT_TOKEN;

var options = new CreateResponseOptions(_model, [])
{
Temperature = temperature,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Responses ignore requested temperature 🐞 Bug ≡ Correctness

Removing CreateResponseOptions.Temperature makes the Responses API ignore the documented
MessageConfig.Temperature value stored by the conversation controller. Because UseResponseApi is
enabled by default in WebStarter, callers can request a sampling temperature but receive output
generated with the provider default instead.
Agent Prompt
## Issue description
The Responses API path no longer propagates the caller's temperature, so the public temperature control is silently ignored and generation uses the provider default.

## Issue Context
`MessageConfig.Temperature` is documented as controlling completion creativity and is stored in conversation state. WebStarter enables the Responses API by default, while the sibling Chat Completions path still reads and applies the same state. Preserve temperature for compatible non-reasoning requests while omitting it only for models/options that reject it.

## Fix Focus Areas
- src/Plugins/BotSharp.Plugin.OpenAI/Providers/Chat/ChatCompletionProvider.Response.cs[441-459]
- src/Plugins/BotSharp.Plugin.OpenAI/Providers/Chat/ChatCompletionProvider.Chat.cs[612-639]
- src/Infrastructure/BotSharp.Abstraction/Models/MessageConfig.cs[23-26]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

MaxOutputTokenCount = maxTokens,
};

Expand All @@ -458,11 +456,6 @@ private async Task<RoleDialogModel> InnerCreateResponseStreamingAsync(Agent agen
ReasoningEffortLevel = reasoningEffortLevel.Value,
ReasoningSummaryVerbosity = ResponseReasoningSummaryVerbosity.Auto
};

if (reasoningEffortLevel != ResponseReasoningEffortLevel.None)
{
options.Temperature = null;
}
}

// Response format
Expand Down
Loading