Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions fern/assistants/assistant-hooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Supported events include:
- `customer.speech.interrupted`: When the customer's speech is interrupted
- `customer.speech.timeout`: When the customer doesn't speak within a specified time

You can combine actions and add filters to control when hooks trigger. Multiple `customer.speech.timeout` hooks can be attached to an assistant with staggered trigger delay to support different actions at different timing in the conversation.
You can combine actions and add filters to control when hooks trigger. Multiple `customer.speech.timeout` hooks can be attached to an assistant with staggered trigger delays to support different actions at different times in the conversation.

## How hooks work

Expand All @@ -28,7 +28,7 @@ Hooks are defined in the `hooks` array of your assistant configuration. Each hoo
- `name`: (Optional) Custom name to identify the hook

**Action Types:**
- `say`: Speak a message. Use `exact` for predetermined text or `prompt` for AI-generated responses
- `say`: Speak a message. Use `exact` for predetermined text or `prompt` for AI-generated responses.
- `tool`: Execute a tool like `transferCall`, `function`, `endCall`, etc.

<Note>
Expand Down Expand Up @@ -166,7 +166,7 @@ Respond when the assistant's speech is interrupted by the customer:
}
```

Handle customer speech interruptions in a similar way:
Handle customer speech interruptions similarly:

```json
{
Expand Down Expand Up @@ -211,7 +211,7 @@ The `customer.speech.timeout` hook supports special options:

## Example: End call if user hasn't spoken for 30s

Assistant checks with the user at the 10 and 20s mark from when the user is silent, and ends the call after 30s of silence.
Assistant checks with the user at the 10- and 20-second marks from when the user is silent, and ends the call after 30s of silence.

```json
{
Expand Down
2 changes: 1 addition & 1 deletion fern/assistants/background-messages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ For example, you might want to log when a user presses a button or when a backgr
- `vapi.send`: The primary function to interact with your assistant, handling various requests or commands.
- `type: "add-message"`: Specifies the command to add a new message.
- `message`: This is the actual message that you want to add to the message history.
- `role`: "system" Designates the message origin as 'system', ensuring the addition is unobtrusive. Other possible values of role are 'user' | 'assistant' | 'tool' | 'function'
- `role`: "system" Designates the message origin as 'system', ensuring the addition is unobtrusive. Other possible role values are 'user' | 'assistant' | 'tool' | 'function'.
- `content`: The actual message text to be added.
</Step>
</Steps>
Expand Down
2 changes: 1 addition & 1 deletion fern/assistants/call-analysis.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ slug: assistants/call-analysis

## Overview

Call analysis automatically summarizes and evaluates every call for insights and quality control. As soon as a call ends, analysis is triggered in the background and typically completes within a few seconds. The system uses the latest version of Anthropic's Claude Sonnet (with OpenAI GPT-4o as fallback) to:
Call analysis automatically summarizes and evaluates every call for insights and quality control. As soon as a call ends, analysis is triggered in the background and typically completes within a few seconds. The system uses the latest version of Anthropic's Claude Sonnet (with OpenAI GPT-4o as a fallback) to:
- Summarize the call
- Extract structured data
- Evaluate call success
Expand Down
4 changes: 2 additions & 2 deletions fern/assistants/call-recording.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: Learn how to configure artifact plans to record calls, generate tra

## Overview

Vapi's artifact plan system provides comprehensive call recording, logging, and transcription capabilities that allow you to capture, store, and analyze voice conversations for quality assurance, training, and compliance purposes.
Vapi's artifact plan system provides comprehensive call recording, logging, and transcription capabilities that let you capture, store, and analyze voice conversations for quality assurance, training, and compliance purposes.

**Artifact plans enable you to:**
- Record audio conversations for quality monitoring
Expand Down Expand Up @@ -112,7 +112,7 @@ Alternatively, you can implement custom consent flows using squads:
}
```

The consent assistant runs without generating artifacts, while the main assistant records the actual conversation after consent is obtained.
The consent assistant does not generate artifacts, while the main assistant records the actual conversation after consent is obtained.

## Artifact Plan Configuration

Expand Down
4 changes: 2 additions & 2 deletions fern/assistants/dynamic-variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ These variables are automatically filled based on the current (UTC) time, so you

## Advanced date and time usage

You can use advanced date and time formatting in any prompt or message that supports dynamic variables in the dashboard or API. We use [LiquidJS](https://liquidjs.com/) for formatting - see their docs for details.
You can use advanced date and time formatting in any prompt or message that supports dynamic variables in the dashboard or API. We use [LiquidJS](https://liquidjs.com/) for formatting - see its docs for details.

Format a date or time using the LiquidJS `date` filter:

Expand Down Expand Up @@ -114,7 +114,7 @@ Outputs: `Monday, January 01, 2024, 03:45 PM`
| `%Y-%m-%d` | 2024-01-01 | Year-Month-Day |
| `%I:%M %p` | 03:45 PM | Hour:Minute AM/PM |
| `%H:%M` | 15:45 | 24-hour time |
| `%A` | Monday | Day of week |
| `%A` | Monday | Day of the week |
| `%b %d, %Y` | Jan 01, 2024 | Abbrev. Month Day |
```

Expand Down
2 changes: 1 addition & 1 deletion fern/assistants/examples/docs-agent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ You'll learn to:
- Create a RAG tool for document retrieval
- Create an assistant with Claude 3.5 Sonnet and attach the tool
- Use the Web SDK to create a widget
- Analyze user sessions and improve the quality of your agent overtime
- Analyze user sessions and improve the quality of your agent over time

## Prerequisites

Expand Down
2 changes: 1 addition & 1 deletion fern/assistants/examples/inbound-support.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,7 @@ You have access to CSV files with account and transaction data:

Just like that, you've built a 24/7 customer support hotline that can handle inbound calls, create support tickets, and run automated tests to ensure it's working as expected.

Consider the reading the following guides to further enhance your assistant:
Consider reading the following guides to further enhance your assistant:

* [**Knowledge Bases**](../knowledge-base/) - Learn more about knowledge bases to build knowledge-based agents.
* [**External Integrations**](../tools/) - Configure integrations with [Google Calendar](../tools/google-calendar), [Google Sheets](../tools/google-sheets), [Slack](../tools/slack), etc.
Expand Down
2 changes: 1 addition & 1 deletion fern/assistants/examples/support-escalation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ We will build a customer support escalation system for TechCorp that intelligent
- `issue_category` (string): Category of customer issue (technical, billing, account, product)
- `complexity_level` (string): Issue complexity (basic, intermediate, advanced, critical)
- `customer_context` (string): Relevant customer information for routing
- `escalation_reason` (string): Why this needs escalation vs self-service
- `escalation_reason` (string): Why this needs escalation versus self-service
</Step>
</Steps>
</Tab>
Expand Down
19 changes: 9 additions & 10 deletions fern/assistants/flush-syntax.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -178,27 +178,26 @@ const systemPrompt = `When providing lengthy responses, use <flush /> after ackn

<AccordionGroup>
<Accordion title="Flush tags appear in voice output">
**Cause**: `chunkPlan.enabled` is set to `false` or missing **Solution**: -
Verify `chunkPlan.enabled: true` in voice configuration - Check assistant
configuration in dashboard or API calls - Test with a minimal configuration
to isolate the issue
**Cause**: `chunkPlan.enabled` is set to `false` or missing. **Solution**:
- Verify `chunkPlan.enabled: true` in voice configuration
- Check assistant configuration in dashboard or API calls
- Test with a minimal configuration to isolate the issue
</Accordion>

{" "}
<Accordion title="Syntax not recognized">
**Cause**: Malformed flush syntax or typos **Solution**: - Use exact formats:
`<flush />
`, `<flush>`, or `</flush>` - Avoid extra parameters or attributes - Check for
typos in tag spelling
**Cause**: Malformed flush syntax or typos. **Solution**:
- Use exact formats: `<flush />`, `<flush>`, or `</flush>`
- Avoid extra parameters or attributes
- Check for typos in tag spelling
</Accordion>

<Accordion title="Audio sounds choppy or fragmented">
**Cause**: Overuse of flush syntax
**Solution**:
- Reduce flush frequency in responses
- Place only at sentence boundaries
- Test with real users to
validate experience
- Test with real users to validate the experience
</Accordion>
</AccordionGroup>

Expand Down
4 changes: 2 additions & 2 deletions fern/assistants/idle-messages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Idle messages automatically prompt users during periods of inactivity to maintai

## How idle messages work

When a user stops speaking, Vapi starts a timer. Based on the configured timeout periods in `customer.speech.timeout` hooks, the assistant will trigger the action, which can be configured to say messages to the user.
When a user stops speaking, Vapi starts a timer. Based on the configured timeout periods in `customer.speech.timeout` hooks, the assistant triggers the action, which can be configured to say messages to the user.

<CardGroup cols={3}>
<Card title="Detection" icon="timer" iconType="solid">
Expand Down Expand Up @@ -205,7 +205,7 @@ curl -X POST "https://api.vapi.ai/assistant" \
"triggerMaxCount": 3,
"triggerResetMode": "onUserSpeech"
},
"do": [{ "type": "say", "prompt": "The user has not responded in 20s. Based on the above conversation in {{transcript}} ask the user if they need help or if not you will be ending the call" }]
"do": [{ "type": "say", "prompt": "The user has not responded in 20s. Based on the above conversation in {{transcript}}, ask the user if they need help or, if not, you will be ending the call" }]
},
{
"on": "customer.speech.timeout",
Expand Down
4 changes: 2 additions & 2 deletions fern/assistants/persistent-assistants.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ slug: assistants/persistent-assistants
---


You might be wondering whether or not you should create an assistant using the `/assistant` endpoint with its `assistantId`. Or, can you just specify the assistant configuration when starting a call?
You might be wondering whether you should create an assistant using the `/assistant` endpoint with its `assistantId`. Or, can you just specify the assistant configuration when starting a call?

The `/assistant` endpoint is there for convenience to save you creating your own assistants table.
The `/assistant` endpoint exists for convenience so you don’t need to create your own assistants table.

<Accordion title="Use cases">
- You won't be adding more assistant properties on top of ours.
Expand Down
2 changes: 1 addition & 1 deletion fern/assistants/structured-outputs-quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ You can create an assistant via the Dashboard or API, then use its ID in the exa
</Step>

<Step title="Have a conversation">
Try saying: "Hi, my name is John Smith. My email is john@example.com. I'm having trouble logging into my account - it keeps showing an error message. This is pretty urgent for me."
Try saying: "Hi, my name is John Smith. My email is john@example.com. I'm having trouble logging in to my account it keeps showing an error message. This is pretty urgent for me."
</Step>

<Step title="End the call">
Expand Down
10 changes: 5 additions & 5 deletions fern/assistants/voice-formatting-plan.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ slug: assistants/voice-formatting-plan

## Overview

Voice formatting automatically transforms raw text from your language model (LLM) into a format that sounds natural when spoken by a text-to-speech (TTS) provider. This process—called **Voice Input Formatted**—is enabled by default for all assistants.
Voice formatting automatically transforms raw text from your language model (LLM) into a format that sounds natural when spoken by a text-to-speech (TTS) provider. This process—called **Voice Input Formatting**—is enabled by default for all assistants.

Formatting helps with things like:

Expand All @@ -18,7 +18,7 @@ You can turn off formatting if you want the TTS to read the raw LLM output.

## How voice input formatting works

When enabled, the formatter runs a series of transformations on your text, each handled by a specific function. Here's the order and what each function does:
When enabled, the formatter runs a series of transformations on the text, each handled by a specific function. Here's the order and what each function does:

| **Step** | **Function Name** | **Description** | **Before** | **After** | **Default** | **Precedence** |
| :------- | :---------------- | :-------------- | :--------- | :-------- | :---------- | :------------ |
Expand All @@ -28,11 +28,11 @@ When enabled, the formatter runs a series of transformations on your text, each
| 4 | `replaceNewLinesWithPeriods` | Converts new lines (`\n`) to periods for smoother speech. | `Hello world\n to say\nWe have NASA` | `Hello world . to say . We have NASA` | ✅ | 0 |
| 5 | `replaceColonsWithPeriods` | Replaces `:` with `.` for better phrasing. | `price: $42.50` | `price. $42.50` | ✅ | 0 |
| 6 | `formatAcronyms` | Converts known acronyms to lowercase (e.g., NASA → nasa) or spaces out unknown all-caps words unless they contain vowels. | `NASA and .NET` | `nasa and .net` | ✅ | 0 |
| 7 | `formatDollarAmounts` | Converts currency amounts to spoken words. | `$42.50` | `forty two dollars and fifty cents` | ✅ | 0 |
| 7 | `formatDollarAmounts` | Converts currency amounts to spoken words. | `$42.50` | `forty-two dollars and fifty cents` | ✅ | 0 |
| 8 | `formatEmails` | Replaces `@` with "at" and `.` with "dot" in emails. | `JOHN.DOE@example.COM` | `JOHN dot DOE at example dot COM` | ✅ | 0 |
| 9 | `formatDates` | Converts date strings into spoken date format. | `2023 05 10` | `Wednesday, May 10, 2023` | ✅ | 0 |
| 10 | `formatTimes` | Expands or simplifies time expressions. | `14:00` | `14` | ✅ | 0 |
| 11 | `formatDistances`, `formatUnits`, `formatPercentages`, `formatPhoneNumbers` | Converts units, distances, percentages, and phone numbers into spoken words. | `5km`, `43 lb`, `50%`, `123-456-7890` | `5 kilometers`, `forty three pounds`, `50 percent`, `1 2 3 4 5 6 7 8 9 0` | ✅ | 0 |
| 11 | `formatDistances`, `formatUnits`, `formatPercentages`, `formatPhoneNumbers` | Converts units, distances, percentages, and phone numbers into spoken words. | `5km`, `43 lb`, `50%`, `123-456-7890` | `5 kilometers`, `forty-three pounds`, `50 percent`, `1 2 3 4 5 6 7 8 9 0` | ✅ | 0 |
| 12 | `formatNumbers` | Formats general numbers: years read as digits, large numbers spelled out, negative and decimal numbers clarified. | `-9`, `2.5`, `2023` | `minus nine`, `two point five`, `2023` | ✅ | 0 |
| 13 | `removeAsterisks` | Removes all asterisk characters from the text. | `**Bold** and *italic*` | `Bold and italic` | ✅ | 1 |
| 14 | `Applying Replacements` | Applies user-defined final replacements like expanding street abbreviations. | `320 ST 21 RD` | `320 STREET 21 ROAD` | ✅ | - |
Expand All @@ -41,7 +41,7 @@ When enabled, the formatter runs a series of transformations on your text, each

## Customizing the formatting plan

You can control some aspects of formatting:
You can control certain aspects of formatting:

### Enabled
Formatting is on by default. To disable, set:
Expand Down
Loading