https://retellai.com/?utm_source=discord&utm_medium=seo logo
I'm trying to create a custom function and need to...
# ❓・ai-evy-support
w
@AI Evy I'm trying to create a custom function and need to provide static values for the parameters in order for the API I'm calling to function. Where and how do I set those values for the parameters?
a
Thanks for tagging me @whimsical_axolotl_47904. I'll look through relevant sources and get back to you shortly.
### Answer For custom functions in Retell AI, you can set static values in two main ways: *Request Headers (Static Values) * You can define custom headers with static values that will be included with every request Retell sends to your endpoint [(1) ]() [(2) ]() . Header values can be static or include dynamic variables . *Query Parameters (Static Values) * You can define query parameters with static values that Retell will append to your endpoint URL . Query parameter values can be static or include dynamic variables . *Function Parameters (JSON Schema) * For the actual function parameters, you define them using JSON schema format for POST, PATCH and PUT requests . Here's the example parameter schema format:
Copy code
json
{
 "type": "object",
 "properties": {
 "city": {
 "type": "string",
 "description": "The city of the weather"
 }
 },
 "required": [
 "city"
 ]
}
The parameters defined in the JSON schema are typically dynamic values that the LLM will provide when calling the function. For truly static values that never change, using request headers or query parameters would be more appropriate since they're sent with every request to your endpoint.
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
w
@AI Evy can I include static values in the Function Parameters? my API won't work with the Query Parameters
a
Thanks for the follow-up, @whimsical_axolotl_47904. I'll get back to you soon.
### Answer Based on the documentation, function parameters in Retell AI custom functions are designed to be dynamic values that the LLM provides when calling the function [(1) ]() [(2) ]() . The parameter schema defines the structure and types of arguments the LLM will pass to your function . The documentation shows that parameters are defined using JSON schema format for POST, PATCH and PUT requests :
Copy code
json
{
 "type": "object",
 "properties": {
 "city": {
 "type": "string",
 "description": "The city of the weather"
 }
 },
 "required": [
 "city"
 ]
}
[(1) ]() However, the documentation doesn't explicitly show how to include static values directly within the function parameters JSON schema. The parameters are intended to be populated dynamically by the LLM based on the conversation context [(1) ]() [(2) ]() . If query parameters don't work for your API, you might need to handle static values within your endpoint implementation itself, or consider using the request headers option which can include static values . The request headers are sent with every request to your endpoint and can contain static values your API needs .
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.