umair313
09/15/2025, 10:26 PMAI Evy
09/15/2025, 10:26 PMAI Evy
09/15/2025, 10:26 PMAI Evy
09/15/2025, 10:26 PMAI Evy
09/15/2025, 10:26 PMumair313
09/15/2025, 10:27 PMumair313
09/15/2025, 10:40 PMumair313
09/15/2025, 10:40 PMAI Evy
09/15/2025, 10:40 PMAI Evy
09/15/2025, 10:40 PMAI Evy
09/15/2025, 10:40 PMAI Evy
09/15/2025, 10:40 PMumair313
09/15/2025, 10:42 PMAI Evy
09/15/2025, 10:42 PMAI Evy
09/15/2025, 10:42 PMAI Evy
09/15/2025, 10:42 PMAI Evy
09/15/2025, 10:43 PMumair313
09/15/2025, 10:55 PMAI Evy
09/15/2025, 10:55 PMAI Evy
09/15/2025, 10:55 PMjson
{
"temperature": "25f",
"status": "sunny"
}
You should have your custom function return only the temperature value, like:
json
{
"result": "25f"
}
Or, if you want to include the temperature in a more complex object, ensure the relevant field is present so you can extract and use it as a dynamic variable later .
If your function is implemented in Python (using FastAPI) , the response logic might look like:
python
if args["city"] == "New York":
return JSONResponse(status_code=200, content={"result": "25f and sunny"})
else:
return JSONResponse(status_code=200, content={"result": "20f and cloudy"})
Make sure the key containing the temperature (e.g., "result" or "temperature") matches what you want the agent to use in the conversation. You can then extract this value as a dynamic variable in your function configuration for use in subsequent dialogue turns .AI Evy
09/15/2025, 10:55 PMAI Evy
09/15/2025, 10:55 PMumair313
09/15/2025, 10:57 PMAI Evy
09/15/2025, 10:57 PMAI Evy
09/15/2025, 10:57 PMjson
{
"temperature": "25f",
"status": "sunny"
}
You can set the function response mapping to extract "temperature" and assign it as a dynamic variable. Then, in your conversation flow or prompt, reference that variable using {{temperature}} to use the value in responses.
This approach allows you to make the returned API values available for your Retell agent to use in subsequent turns or responses [(1) ]() , [(2) ]() .AI Evy
09/15/2025, 10:57 PMAI Evy
09/15/2025, 10:57 PMumair313
09/15/2025, 10:59 PMumair313
09/15/2025, 11:00 PMAI Evy
09/15/2025, 11:00 PMAI Evy
09/15/2025, 11:01 PMjson
[
{"temp": 1},
{"temp": 5}
]
You should process this in your backend and return a response like:
json
{
"temperature1": 1,
"temperature2": 5
}
Then, in your Retell function response mapping, you can use {{temperature1}} and {{temperature2}} as dynamic variables in your prompts or flows [(1) ]() , [(2) ]() .AI Evy
09/15/2025, 11:01 PMAI Evy
09/15/2025, 11:01 PM