Configuring an assistant in an assistant-request response

I see in the docs and also successfully tested this with the following response from my serverUrl:

{
    "assistant": {
        "firstMessage": "Hey Ryan, how are you?",
        "model": {
            "provider": "openai",
            "model": "gpt-3.5-turbo",
            "messages": [
                {
                    "role": "system",
                    "content": "You're Ryan's assistant..."
                }
            ]
        }
    }
}

However, I'm also trying to add more configuration like functions, maxDuration, maxTokens, etc. that are available on the create assistant API. Now I'm getting an "assistant-request-returned-invalid-assistant" error but with no details about what is causing the problem. An example of my response is this:

{
    "assistant": {
        "firstMessage": "Hi!",
        "maxDurationSeconds": 89,
        "maxTokens": 250,
        "functions": [
            {
                "name": "get_weather",
                "async": false,
                "description": "Get the weather",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "zip": {
                            "description": "This is the user provided zip code",
                            "type": "string"
                        }
                    }
                },
                "serverUrl": "https://serverurl.com"
            }
        ],
        "transcriber": {
            "provider": "deepgram",
            "model": "nova-2-phonecall",
            "language": "en-US"
        },
        "model": {
            "provider": "openai",
            "model": "gpt-4o",
            "messages": [
                {
                    "role": "system",
                    "content": "You are very helpful..."
                }
            ]
        }
    }
}
Was this page helpful?