https://retellai.com/?utm_source=discord&utm_medium=seo logo
custom function json format
# ❓・bug-report
h
when ever i tries to gave different json format its throwing any error
h
checked this
const handleAddNewGeneralTool = (e)=>{ e.preventDefault(); // Default parameters structure const defaultParameters = { type: "object", properties: { input: { type: "string" } }, required: ["input"] } if(generalToolsSelectedItem == "0" || generalToolsSelectedItem.anchorKey == "0") setGeneralTools([...generalTools, {name: "", type: "end_call", description: ""}]) else if(generalToolsSelectedItem == "1" || generalToolsSelectedItem.anchorKey == "1") setGeneralTools([...generalTools, {name: "", number: "", type: "transfer_call", description: ""}]) else if(generalToolsSelectedItem == "2" || generalToolsSelectedItem.anchorKey == "2") setGeneralTools([...generalTools, {name: "", url: "", parameters: defaultParameters, type: "custom", description: "", speak_during_execution:true, execution_message_description:t("agent.execution_message_description"), speak_after_execution:true}]) }
can u please help me on this
n
I think other things are fine. Are you setting the url, name and description while calling the API to add the tool?
They are required fields
Also the name has to be lowercase without spaces
use underscores
h
i am getting parameters problem like i used Default model in Infrontend otherwise its throwing any a error
Copy code
{
  "type": "object",
  "properties": {
    "email_info": {
      "name": "Name of the student",
      "body": "string",
      "email": "string",
      "subject": "string"
    }
  },
  "required": [
    "email_info"
  ]
}
Somehow I'm not able to add this custom function json schema to agent
r
you will want to break that down differently, @harshith_56829
name, body, email, subject are all seperate properties
I'm pretty sure you can't nest them like that.
I suggest referring to OpenAI's documentation on function calling, as Retell is using the exact same format for parameters. https://platform.openai.com/docs/guides/function-calling
h
hey i try by break it but its not working
can you check my code if something is wrong or missing