Unexpected CreateMessageAsync Method Failure regarding Content-Type UTF-8 #246
Replies: 7 comments 1 reply
-
I have not seen any changes made to the spec for a few days https://github.com/openai/openai-openapi/pulls I will look and see what we're setting the content type to, but I suspect that it is the default. |
Beta Was this translation helpful? Give feedback.
-
Yes, dont see a Change there as well. Have this behaviour since Yesterday in an untouched Code. |
Beta Was this translation helpful? Give feedback.
-
Interesting change from the node client: |
Beta Was this translation helpful? Give feedback.
-
I have the exact same issue when I'm trying to create a new assistant |
Beta Was this translation helpful? Give feedback.
-
Sorry but I am unable to repro. Ran all the tests just now |
Beta Was this translation helpful? Give feedback.
-
Hi guys, I have the same issue like a @disintegr8te |
Beta Was this translation helpful? Give feedback.
-
Any updates here? I still have not been able to repro this directly |
Beta Was this translation helpful? Give feedback.
-
Bug Report
Overview
The
CreateMessageAsync
method stopped working today, resulting in a BadRequest error. This issue is likely due to API changes made by OpenAI, as the error message indicates a problem with theContent-Type
header being set to'application/json; charset=utf-8'
instead of the expected'application/json'
.To Reproduce
Steps to reproduce the behavior:
CreateMessageAsync
method by providing a validthreadId
andCreateMessageRequest
object.Unsupported content type
error.Expected behavior
The expected behavior was that the
CreateMessageAsync
method would successfully post the message data to the corresponding API endpoint without encountering a BadRequest error. The message creation should be processed by the OpenAI API and return a success response.Screenshots
Not applicable, as the error is within the response body of an API call.
Additional context
Content-Type
.Unsupported content type: 'application/json; charset=utf-8'
is not accepted, hinting at a recent change in OpenAI's API to enforce a strict'application/json'
content type without charset specification.CreateMessageAsync
method to strictly set theContent-Type
header to'application/json'
without including the charset.Suggested Solution
I suggest adjusting the handling of the
Content-Type
header within the request preparation of theCreateMessageAsync
method to comply with the API requirements.Beta Was this translation helpful? Give feedback.
All reactions