Matthew
Matthew3mo ago

Matthew - Hey guys! Any idea on how to turn on ...

Hey guys! Any idea on how to turn on json mode for the openai assistant??
14 Replies
Gaurav Chadha
Gaurav Chadha3mo ago
@Matthew, you can change the return response line in the node logic of Assistant to return response in JSON - "response": JSON.stringify({ "content": messages.body.data[0].content[0].text?.value }),
No description
Matthew
Matthew3mo ago
thank you! Have you messed around with hume workflows?
Gaurav Chadha
Gaurav Chadha3mo ago
No, what's error are you getting, you can post at #❓・buildship-help
Matthew
Matthew3mo ago
So i made the change and im getting 400 Missing required parameter: 'messages[0].content[0].type'. and 400 Invalid tools: all tools must be of type function when response_format is of type json_object.
Gaurav Chadha
Gaurav Chadha3mo ago
You can use this modified node
Matthew
Matthew3mo ago
Confir,ing on where to put this?
Gaurav Chadha
Gaurav Chadha3mo ago
paste this from the node's explorer, its the modified node
Matthew
Matthew3mo ago
here?
No description
Gaurav Chadha
Gaurav Chadha3mo ago
Copy & Paste – BuildShip
A unified resource to start building your backend with low-code. Dive into triggers, nodes, and step-by-step guidance to jumpstart your workflow creation.
Gaurav Chadha
Gaurav Chadha3mo ago
this
Matthew
Matthew3mo ago
ah Yeah sadly still getting 400 Missing required parameter: 'messages[0].content[0].type'. and i have json mode turned on as well. Im inputting an array to the user prompt
Gaurav Chadha
Gaurav Chadha3mo ago
don't add array, it only accepts string/text
Matthew
Matthew3mo ago
Then what is the point of json mode?
Gaurav Chadha
Gaurav Chadha3mo ago
it is form based config, changing the types to unsupported by the API will result in error, it's the OpenAI which has sepcified the input types, https://community.openai.com/t/assistants-api-is-not-considering-the-entire-input-json-file-while-answering-questions/718171
OpenAI Developer Forum
Assistants API is not considering the entire input JSON file while ...
I’m using chatgpt assistants API (retrieval). I have uploaded a file and passed the fileId to the thread and then if I run the thread, it is not considering the entire JSON file while answering the questions. Also which is the best file format to upload and ask answers from. Uploading CSV file with assistants api for retrieval is not working. ...