#output structure fix

1 messages · Page 1 of 1 (latest)

dawn hatch
#

can u fix this : "Invalid tools: all tools must be of type function when response_format is of type json_schema."
my code: const run = await makeOpenAIRequest(threads/${threadId}/runs, "POST", {
assistant_id: ASSISTANT_ID,
model: MODEL,
response_format: {
type: "json_schema",
json_schema: {
name: "math_response",
strict: true,
schema: {
type: "object",
properties: {
winning: {
type: "string",
},
},
required: ["winning"],
additionalProperties: false,
},
},
},
});

ember pawnBOT
#

Hi @dawn hatch. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Based on the error message you're receiving, it seems like there might be an issue with the tools you're using in your request. However, the code snippet you've provided doesn't include any tool usage.

In the OpenAI API, when the response_format is of type json_schema, all tools must be of type function. This means that if you're using any tools in your request, they should be defined as functions.

Unfortunately, without the complete code or more context, it's hard to provide a specific solution. Please ensure that if you're using any tools in your request, they are of type function.

For more information, you can refer to the OpenAI API documentation here (https://platform.openai.com/docs/api-reference).

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: