-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Description
Describe the bug
When running the test from the SK repo https://github.com/microsoft/semantic-kernel/blob/main/dotnet/samples/GettingStartedWithAgents/OpenAIResponse/Step02_OpenAIResponseAgent_ConversationState.cs, the application throws a ClientResultException due to an invalid value in the request payload when an Assistant message is included in the chat history.
GettingStarted.OpenAIResponseAgents.Step02_OpenAIResponseAgent_ConversationState.ManuallyConstructPastConversationAsync
Duration: 9.7 sec
Message:
System.ClientModel.ClientResultException : HTTP 400 (invalid_request_error: invalid_value)
Parameter: input[1].content[0]
Invalid value: 'input_text'. Supported values are: 'output_text' and 'refusal'.
Stack Trace:
ClientPipelineExtensions.ProcessMessageAsync(ClientPipeline pipeline, PipelineMessage message, RequestOptions options)
OpenAIResponseClient.CreateResponseAsync(BinaryContent content, RequestOptions options)
OpenAIResponseClient.CreateResponseAsync(IEnumerable1 inputItems, ResponseCreationOptions options, CancellationToken cancellationToken) ResponseThreadActions.InvokeAsync(OpenAIResponseAgent agent, ChatHistory history, AgentThread agentThread, AgentInvokeOptions options, CancellationToken cancellationToken)+MoveNext() line 48 Boolean>.GetResult() OpenAIResponseAgent.InvokeAsync(ICollection
1 messages, AgentThread thread, AgentInvokeOptions options, CancellationToken cancellationToken)+MoveNext() line 62
OpenAIResponseAgent.InvokeAsync(ICollection`1 messages, AgentThread thread, AgentInvokeOptions options, CancellationToken cancellationToken)+MoveNext() line 62
Boolean>.GetResult()
Step02_OpenAIResponseAgent_ConversationState.ManuallyConstructPastConversationAsync() line 39
Step02_OpenAIResponseAgent_ConversationState.ManuallyConstructPastConversationAsync() line 39
--- End of stack trace from previous location ---
Standard Output:
# user: knock knock.
# assistant: Who's there?
# user: Orange.
To Reproduce
Steps to reproduce the behavior:
Clone the Semantic Kernel repo from GitHub.
Navigate to dotnet/samples/GettingStartedWithAgents/OpenAIResponse/.
Open and run Step02_OpenAIResponseAgent_ConversationState.cs.
Ensure the chat history includes an Assistant message with input_text as the content type.
Observe the error thrown during execution.
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots

Platform
Language: C#
Source: GitHub main branch of Semantic Kernel repo
AI model: OpenAI:GPT-4.1
IDE: Visual Studio
OS: Windows
Additional context