Malformed JSON Response from Assistant API: Extra Bracket at the Start of Response #1265
Open
1 task done
Labels
bug
Something isn't working
Confirm this is a Node library issue and not an underlying OpenAI API issue
Describe the bug
I created the Assistant with
response_format: { type: "json_object" }
. Also In the Assistant instructions I informed it to respond with valid JSON only.The issue is that the response is always returned with an extra characters in the beginning before the actual JSON object. Sometimes it's a
{"
or[
.After some debugging I found that this extra character is returned in the "textCreated" stream event when running the thread.
To Reproduce
this.openai.beta.threads.runs.stream()
Code snippets
OS
Windows 10
Node version
Node v22.13.0
Library version
openai v4.78.1
The text was updated successfully, but these errors were encountered: