File tree Expand file tree Collapse file tree
Infrastructure/BotSharp.Core/Instructs/Services
Plugins/BotSharp.Plugin.OpenAI/Providers/Chat Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -251,13 +251,7 @@ private async Task<InstructResult> RunLlm(
251251 var templateLlmConfig = agent . Templates ? . FirstOrDefault ( x => x . Name . IsEqualTo ( templateName ) ) ? . LlmConfig ;
252252 if ( templateLlmConfig ? . IsValid == true )
253253 {
254- llmConfig = new AgentLlmConfig
255- {
256- Provider = templateLlmConfig . Provider ,
257- Model = templateLlmConfig . Model ,
258- MaxOutputTokens = templateLlmConfig . MaxOutputTokens ,
259- ReasoningEffortLevel = templateLlmConfig . ReasoningEffortLevel
260- } ;
254+ llmConfig = new AgentLlmConfig ( templateLlmConfig ) ;
261255 }
262256 }
263257 else
Original file line number Diff line number Diff line change 22using BotSharp . Abstraction . MessageHub . Models ;
33using BotSharp . Core . Infrastructures . Streams ;
44using BotSharp . Core . MessageHub ;
5- using OpenAI . Chat ;
65using OpenAI . Responses ;
76
87namespace BotSharp . Plugin . OpenAI . Providers . Chat ;
@@ -425,12 +424,14 @@ private async Task<RoleDialogModel> InnerCreateResponseStreamingAsync(Agent agen
425424 var allowMultiModal = settings != null && settings . MultiModal ;
426425 renderedInstructions = [ ] ;
427426
427+ float ? temperature = float . Parse ( _state . GetState ( "temperature" , "0.0" ) ) ;
428428 var maxTokens = int . TryParse ( _state . GetState ( "max_tokens" ) , out var tokens )
429429 ? tokens
430430 : agent . LlmConfig ? . MaxOutputTokens ?? LlmConstant . DEFAULT_MAX_OUTPUT_TOKEN ;
431431
432432 var options = new CreateResponseOptions ( _model , [ ] )
433433 {
434+ Temperature = temperature ,
434435 MaxOutputTokenCount = maxTokens
435436 } ;
436437
@@ -442,6 +443,11 @@ private async Task<RoleDialogModel> InnerCreateResponseStreamingAsync(Agent agen
442443 ReasoningEffortLevel = reasoningEffortLevel . Value ,
443444 ReasoningSummaryVerbosity = ResponseReasoningSummaryVerbosity . Auto
444445 } ;
446+
447+ if ( reasoningEffortLevel != ResponseReasoningEffortLevel . None )
448+ {
449+ options . Temperature = null ;
450+ }
445451 }
446452
447453 // Prepare instruction and functions
You can’t perform that action at this time.
0 commit comments