October 7, 2024

  1. Add Structured Outputs for OpenAI Functions in Assistant Tools: You can use OpenAI Structured Outputs by specifying a new parameter called strict as true or false when creating or using OpenAIFunctions in assistant.model.tools[type=function]. Set the name, provide a description (up to 1000 characters), and specify parameters as a JSON Schema object. See the OpenAI guide for examples.

  2. Secure Incoming SIP Phone Calls to Vapi Provided SIP Numbers: You can now specify a username, password, and optional realm in SIP Invite AuthZ header, through digest authentication. Create this secure SIP number by specifying an “authentication” object with the username and password fields inside POST /phone-number request body. Example:

$curl --location 'https://api.vapi.ai/phone-number' \
>--header 'Content-Type: application/json' \
>--header 'Authorization: Bearer {}API_KEY}}' \
>--data-raw '{
> "provider": "vapi",
> "sipUri": "sip:{{USERNAME}}@sip.vapi.ai",
> "assistantId": "{{ASSISTANT_ID}}",
> "name": "example phone number label for your reference",
> "authentication": {
> "realm": "sip.vapi.ai",
> "username": "[email protected]",
> "password": "example_password"
> }
>}'
  1. Use Updated handoff, callback Steps in Blocks: You can now use assistant.model.steps[type=handoff] and assistant.model.steps[type=callback] to control conversation flow in your assistant. Use HandoffStep to move to the next step linearly without returning to the previous step, ideal for sequential tasks like forms. Use CallbackStep to spawn a new conversation thread and return to the previous step once done, good for handling interruptions or sub-tasks within a conversation.

  2. Use Step Destinations and Assignment Mutation in Blocks: Specify destination nodes for each step with assistant.model.steps[type=handoff].destinations[type=step] to direct the workflow to specific steps based on certain conditions. Update context variables in each callback step with mutations[type=assignment], for example: assistant.model.steps[type=callback].mutations[type=assignment]