https://retellai.com/?utm_source=discord&utm_medium=seo logo
update retell llm option 6 general_tools + documen...
# ❓・bug-report
u
Patching
general_tools
with a list of objects that have
type
set to
custom
results in a 400 informing the requester that
custom
must be one of:
end_call
etc. Unless I'm missing something, this doesn't align with the docs and the endpoint should accept a patch of this nature without issue.
This is fairly urgent, if that has any relevance.
This endpoint also allows for literally any key to be given to it without throwing an error (unless that key is expected, at which point it will throw an error). Status errors should reflect what actually happened as closely as possible. If I give you a key value of
BAHUMBUG:[{...}]
there is no world in which that should return a 200 unless a property of
BAHUMBUG
is actually available.
????? Additionally, adding a custom function from the frontend -> Viewing network requests, you are patching the entire object? Is this also expected of users? This should be a
PUT
.
s
HI @._carter thanks for reaching out.You're absolutely right: trying to patch general_tools with type: "custom" results in a 400 error because that type isn't in the allowed enum. The correct way to define a custom function is using type: "custom_function" and matching the OpenAI tools schema. So "custom" is invalid use "custom_function" instead. Here is a example { "general_tools": [ { "type": "custom_function", "name": "get_user_info", "description": "Fetch user info", "endpoint": "https://api.example.com/user", "method": "POST", "headers": {}, "parameters": { "type": "object", "properties": { "user_id": { "type": "string" } }, "required": ["user_id"] } } ] }
s
I just made a request that is verbatim the example you provided which resulted in the same error. The documentation and the endpoint are currently unusable. Here is the body for your confirmation:
Copy code
{
  "general_tools": [
    {
      "type": "custom_function",
      "name": "get_user_info",
      "description": "Fetch user info",
      "endpoint": "https://api.example.com/user",
      "method": "POST",
      "parameters": {
        "type": "object",
        "properties": {
          "user_id": {
            "type": "string"
          }
        },
        "required": [
          "user_id"
        ]
      }
    }
  ]
}
o
Try this format
Copy code
{
  "model": "gpt-4o-mini",
  "general_tools": [
    {
      "type": "custom",
      "name": "test",
      "description": "est",
      "execution_message_description": "e.",
      "speak_after_execution": true,
      "speak_during_execution": true,
      "parameters": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": ""
          }
        },
        "required": [
          "address"
        ]
      },
      "url": "https://test.me"
    }
  ]
}