https://retellai.com/?utm_source=discord&utm_medium=seo logo
Malformed JSON output in Custom Function (GPT-4.1-...
# ❓・bug-report
q
Even when adding "use exact text 'true'" to the description, the model ignores the instruction and hallucinates conversational text in the field. Note: I can't use "const" here because I need the specific value to show up in the logs for debugging, so I need a prompt-based fix or a model adjustment. Example: Call ID: call_14cd623c81f0b2b8df667b4bac7 Expected: "initial": "true" Actual: "initial": "Schedule a private venue tour for the caller." _ "properties": { "initial": { "type": "string", "description": "use this exact text 'true'" } } Part of Actual JSON Sent to Backend: { "initial": "Schedule a private venue tour for the caller." ...... } https://cdn.discordapp.com/attachments/1463101676666884176/1463101677837090816/image.png?ex=6979d59f&is=6978841f&hm=d1676f6a193dc73b5a7786b8eebd84b35cfe3bd1e4c2217a7d277d211ce83634&
s
hello
you need to use "const" value it will appear in your backend logs since it's sent in the actual request body
If you still need a prompt-based workaround, you could also try enabling Structured Output in LLM options, which constrains the model to output only valid function calls matching your schema.
q
const value does not show value in Retell's "Details Logs" which is not understandable why would anyone in Retail thought it was good idea at first place.
I guess you mean edit it here? but that is just for OpenAI models right?
s
not limited to just OpenAI models. You'll need to check your dashboard to see if it's supported for your selected model
q
sorry I would also add Claude, but Gemini doesn't support that right? and what are reasons behind it?
s
Its because each LLM provider have different structured output capabilities. You need to try different provider as there is no specific list of which provider support it
q
fair, thanks mate.
@Shah - support @ Retell AI could you confrim please - If I set GPT5.2 fast at "Global settings", does it mean nodes that has undefined LLM in Node settings will use setting that is in Global Settings. E.g. Conversional node ->LLM is off, by default it will use GPT5.2 fast right? https://cdn.discordapp.com/attachments/1463101676666884176/1463889675902255115/image.png?ex=69737900&is=69722780&hm=b56ab7625bb83a4e2868fad4a6879dc579e206a3f92f57157b3a8a666eef8967&
s
yes