https://retellai.com/?utm_source=discord&utm_medium=seo logo
I see deterministic char corruption in enum when f...
# ❓・ai-evy-support
r
@AI Evy I see deterministic char corruption in enum when function schema exceeds certain size. Function: add_tag_by_phone (POST) Success vs Failure: a) Fails every time: add_task_by_phone (POST) { "type": "object", "properties": { "task_description": { "type": "string", "description": "a summary of the transcript so far." }, "app_auth_type": { "type": "string", "enum": [ "oauth" ] }, "task_due_delay_hrs": { "type": "string", "enum": [ "0" ] }, "account_auth": { "type": "string", "enum": [ "OENBbdowB0ei2nfJDJ848nNDj2oifnN" ] }, "phone": { "type": "string", "description": "The caller's phone number (automatically available from call context - do not ask user), available as {{user_number}}" }, "task_title": { "type": "string", "description": "a summary title of the conversation so far" }, "assignee": { "type": "string", "description": "Enter the exact 20-character staff ID if task should be assigned. Valid IDs - Jakin: obbkjqajhadfluawkbe, Sarah: aiuwebbwoidneiandjtx", "enum": [ "obbkjqajhadfluawkbe, aiuwebbwoidneiandjtx" ] }, "app_auth_string": { "type": "string", "enum": [ "bus|xxx" ] }, "assignee_name": { "type": "string", "description": "Try to decipher which of the contacts the task should be assigned to", "enum": [ "null, Jakin, Sarah" ] }, "location_id": { "type": "string", "enum": [ "qSiRvYlZaoSYGZKNp4ih" ] } }, "required": [...] } Observed Expect: qSiRvYlZaoSYGZKNp4ih Actual: qSiRvYlZaoSYGKNp4ih (missing or extra char) We tried re-creating the function from scratch → same issue I will follow up with a nearly identical call for creating tags, that succeeds withuot this issue.
a
Thanks for tagging me @RFA. I'll look through relevant sources and get back to you shortly.
### Answer The issue you're describing with character corruption in enum values when function schemas exceed a certain size isn't specifically documented in the available sources. However, I can see some potential issues with your JSON schema that might be contributing to the problem. Looking at similar issues reported in the community, there have been problems with argument extraction where the arguments object comes back empty [(1) ]() . One common issue is with enum formatting - in your schema, you have enum values that contain multiple comma-separated values in a single string:
Copy code
json
"assignee": {
  "enum": [
    "obbkjqajhadfluawkbe, aiuwebbwoidneiandjtx"
  ]
}
This should likely be formatted as separate enum values:
Copy code
json
"assignee": {
  "enum": [
    "obbkjqajhadfluawkbe",
    "aiuwebbwoidneiandjtx"
  ]
}
The same issue appears in your
assignee_name
field . For function calling reliability, you might also want to enable the Structured Output option, which enforces the output to be in the pre-defined schema, yielding more reliable output for function calling [(2) ]() . While this option can make agent auto-save slower due to schema caching, it helps ensure more consistent function calling behavior . If the character corruption persists after fixing the enum formatting, this could be a platform-specific issue that would need to be reported directly to Retell AI support, as it's not covered in the available documentation.
​ To learn more, see the sources I considered: [[1] Problem with argument extraction](https://discord.com/channels/1186424376300679209/1360323456796725279) [[2] Configure LLM options](https://docs.retellai.com/build/llm-options) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.