semantic-kernel icon indicating copy to clipboard operation
semantic-kernel copied to clipboard

.Net: Bug: Can set extra_body for OpenAIChatPromptExecutionSettings

Open youyiying opened this issue 7 months ago • 5 comments

#11813 dotnet need it too

Unhandled exception. Microsoft.SemanticKernel.HttpOperationException: HTTP 400 (invalid_request_error: invalid_parameter_error)

parameter.enable_thinking must be set to false for non-streaming calls
 ---> System.ClientModel.ClientResultException: HTTP 400 (invalid_request_error: invalid_parameter_error)

parameter.enable_thinking must be set to false for non-streaming calls
   at OpenAI.ClientPipelineExtensions.ProcessMessageAsync(ClientPipeline pipeline, PipelineMessage message, RequestOptions options)
   at OpenAI.Chat.ChatClient.CompleteChatAsync(BinaryContent content, RequestOptions options)
   at OpenAI.Chat.ChatClient.CompleteChatAsync(IEnumerable`1 messages, ChatCompletionOptions options, CancellationToken cancellationToken)
   at Microsoft.SemanticKernel.Connectors.OpenAI.ClientCore.RunRequestAsync[T](Func`1 request)
   --- End of inner exception stack trace ---
   at Microsoft.SemanticKernel.Connectors.OpenAI.ClientCore.RunRequestAsync[T](Func`1 request)
   at Microsoft.SemanticKernel.Connectors.OpenAI.ClientCore.GetChatMessageContentsAsync(String targetModel, ChatHistory chatHistory, PromptExecutionSettings executionSettings, Kernel kernel, CancellationToken cancellationToken)
   at Microsoft.SemanticKernel.KernelFunctionFromPrompt.GetChatCompletionResultAsync(IChatCompletionService chatCompletion, Kernel kernel, PromptRenderingResult promptRenderingResult, CancellationToken cancellationToken)
   at Microsoft.SemanticKernel.KernelFunctionFromPrompt.InvokeCoreAsync(Kernel kernel, KernelArguments arguments, CancellationToken cancellationToken)
   at Microsoft.SemanticKernel.KernelFunction.<>c__DisplayClass31_0.<<InvokeAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---

youyiying avatar May 29 '25 07:05 youyiying

I also need this feature

checkmateTowindn avatar Aug 28 '25 01:08 checkmateTowindn

Bump

budgetdevv avatar Sep 09 '25 06:09 budgetdevv

I also need this feature

yangfan-zz avatar Sep 26 '25 10:09 yangfan-zz

This feature fix is urgently needed to support configuring certain LLM thinking modes, such as ChatGLM. It's a critical capability for our use case. cc @moonbox3 — thanks again for previously fixing this in the Python version!

p3p3pp3 avatar Oct 29 '25 03:10 p3p3pp3

Adding @markwallace-microsoft

moonbox3 avatar Oct 29 '25 04:10 moonbox3