Skip to content

RetrieveAssistantAsync is throwing System.Text.Json.JsonException #357

Answered by edvanr
edvanr asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @StephenHodgson ,
I tried to write some test code which basically did this...

using var api = new OpenAIClient("API KEY");
var newAssistant = await api.AssistantsEndpoint.CreateAssistantAsync(new OpenAI.Assistants.CreateAssistantRequest(name: "Test assistant"));
var retrieveAssistant = await api.AssistantsEndpoint.RetrieveAssistantAsync(newAssistant.Id);

This worked fine and it seems to be happening for my existing assistants, however newly created ones are fine.

I intercepted the JSON coming back from the API with the RetrieveAssistant call and noticed the response_format looks different for my legacy Assistants versus a newly created one. Hope this helps...

Legacy Assistant...
"resp…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@StephenHodgson
Comment options

Answer selected by StephenHodgson
Comment options

You must be logged in to vote
1 reply
@StephenHodgson
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #356 on August 20, 2024 12:23.