natanio
06/04/2024, 1:34 PM{
"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..."
}
]
}
}
}
Vapi Support
06/04/2024, 1:34 PMVapi Support
06/04/2024, 1:35 PMserverUrl
. The error you mentioned, "assistant-request-returned-invalid-assistant," typically indicates that the assistant configuration you're passing doesn't conform to the expected schema defined by Vapi.
Based on your configuration snippet, a few things need to be verified:
1. **Parameter and Field Validation**: Ensure all fields and parameters are named and used correctly as per Vapi's standards. You mentioned using maxDurationSeconds
and maxTokens
, which are not part of the assistant's settings retrieved or modified through the serverUrl
response in the documentation.
2. **JSON Structure**: The JSON must be correctly structured and all required fields must be included. If the functions
array or any other components are not structured or named exactly as expected, that could trigger an error.
Since the detailed schema for what can be returned in an assistant-request isn't explicitly covered in the provided documents, I recommend ensuring that your implementation strictly adheres to what is defined in the Vapi documentation for creating or updating assistants. Here are some key aspects you can check:
- **Transcriber and Model Compliance**: Ensure the transcriber
and model
configuration adhere strictly to the schemas provided in the documentation. For instance, the model type (nova-2-phonecall
for transcriber
or gpt-4o
for model
) should be validated against what's permissible in the API references.
- **Function Configuration**: The structure of the functions
array should precisely match the expected format. Make sure that all necessary sub-fields are provided and correctly formatted.
For now, you may need to limit adjustments through the serverUrl
to parameters known to be suppoVapi Support
06/04/2024, 1:35 PMVapi Support
06/04/2024, 1:39 PMVapi Support
06/04/2024, 2:30 PMSahil
06/05/2024, 3:46 AMnatanio
06/07/2024, 3:03 AMSahil
06/07/2024, 9:30 AM