https://retellai.com/?utm_source=discord&utm_medium=seo logo
how do you set the arguments of a custom function
# ❓・ai-evy-support
d
@AI Evy how do you set the arguments of a custom function?
a
Thanks for tagging me @domtgr. I'll look through relevant sources and get back to you shortly.
### Answer To set the arguments of a custom function in Retell AI, you need to define parameters using JSON schema format or JSON form [(1) ]() [(2) ]() . This is only available for POST, PATCH and PUT requests . Here's how to define the parameters: 1. Using JSON Schema Format :
Copy code
json
{
 "type": "object",
 "properties": {
 "city": {
 "type": "string",
 "description": "The city of the weather"
 }
 },
 "required": [
 "city"
 ]
}
[(1) ]() , [(2) ]() 2. Key Requirements [(1) ]() [(2) ]() : - Parameters are defined in the "Define parameters" step when creating your custom function - You must include
"type": "object"
at the top level of the JSON schema - Use the
properties
field to define each parameter with its type and description - Use the
required
array to specify which parameters are mandatory 3. Additional Guidance : - Refer to [OpenAI's Function Calling Guide]() for more detailed guidance - You can also check the [Function Calling Tutorial]() for additional examples If you're having trouble saving the custom function, it's likely because the parameters are not valid - the most common mistake is forgetting to add
"type": "object"
to the top level of the JSON schema .
​ To learn more, see the sources I considered: [[1] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) [[2] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.