Matthew
Matthew4mo 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 Chadha4mo 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
MatthewOP4mo ago
thank you! Have you messed around with hume workflows?
Gaurav Chadha
Gaurav Chadha4mo ago
No, what's error are you getting, you can post at #❓・buildship-help
Matthew
MatthewOP4mo 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 Chadha4mo ago
You can use this modified node
Matthew
MatthewOP4mo ago
Confir,ing on where to put this?
Gaurav Chadha
Gaurav Chadha4mo ago
paste this from the node's explorer, its the modified node
Matthew
MatthewOP4mo ago
here?
No description
Gaurav Chadha
Gaurav Chadha4mo 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 Chadha4mo ago
this
Matthew
MatthewOP4mo 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 Chadha4mo ago
don't add array, it only accepts string/text
Matthew
MatthewOP4mo ago
Then what is the point of json mode?
Gaurav Chadha
Gaurav Chadha4mo 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. ...