Unterminated JSON string for tool.function calls

Sometimes my fine tuned model passes incorrectly formatted json objects to the functions through the Assistants API. I didn’t train it with incorrect formatting of JSON files. What I mostly get is unterminated json objects, but also other stuff like not putting the arguments in " ". For some reason letting it use shorter inputs solves the unterminated json object problem. However I will at some point need to have a longer input.

Maybe that’s a matter of low max_token?

Otherwise adding more example might help.

The more the better and a json example should be at the end.

Adding a “start the output with { and end the output with }” at the end helps too.

So the example helped the formatting issue. But the input the assistant is supposed to give is not fully given, it’s like it gets cut off. Where can I change the max_token? I can’t find it anywhere

Would you mind sharing some code?