Skip to content

Example code snippets #454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 63 commits into from
Jun 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
554aec0
feat: add phone support agent workflow example
goosewin May 26, 2025
4769ff0
feat: update navigation to link new customer support hotline example
goosewin May 26, 2025
44ab9ad
feat: add screenshots for customer support hotline example
goosewin May 26, 2025
a6c90a6
fix: customer support hotline intro paragraph
goosewin May 26, 2025
e7f9bf0
fix(customer-support-hotline): image URLs
goosewin May 26, 2025
e9ad9e1
fix(customer-support-hotline): remove broken link from outro
goosewin May 26, 2025
6a69671
chore (customer-support-hotline): refine copy, add videos
goosewin May 26, 2025
07ced34
chore(customer-support-hotline): delete unnecessary screenshots
goosewin May 26, 2025
d9f31a0
fix(customer-support-hotline): slug
goosewin May 26, 2025
568958d
feat(appointment-scheduling): initial commit
goosewin May 26, 2025
69221a1
feat(banking-customer-support): update example to cover a banking use…
goosewin May 26, 2025
77aaefd
Merge branch 'main' into feature/customer-support-hotline-example
goosewin May 26, 2025
721c0b3
chore(inbound-support): address review feedback, fix system prompt
goosewin May 26, 2025
b1afd64
Merge branch 'feature/customer-support-hotline-example' into feature/…
goosewin May 26, 2025
35d4096
feat(appointment-scheduling): new workflow example
goosewin May 28, 2025
20676bc
feat(clinic-triage-scheduling): new workflow example
goosewin May 28, 2025
99d9ed0
feat(ecommerce-order-management): new workflow example
goosewin May 28, 2025
35e858b
feat(outbound-sales): new workflow example
goosewin May 28, 2025
cffa8e6
chore: delete pizza example
goosewin May 28, 2025
d87d303
fix: broken video URLs
goosewin May 28, 2025
75b3387
chore: update navigation to include new workflow examples
goosewin May 28, 2025
aa45fae
fix(inbound-support): broken video URL
goosewin May 28, 2025
6515261
chore: update `overview.mdx` to display new examples
goosewin May 28, 2025
40ac27a
feat(call-forwarding): update doc to incentivize use of dashboard
goosewin May 28, 2025
f77e415
feat(using-query-tool): update doc to incentivize use of dashboard
goosewin May 28, 2025
11a6198
feat(custom-tools): update doc to incentivize use of dashboard
goosewin May 28, 2025
6f43a80
Merge branch 'main' into feature/workflow-examples
goosewin May 30, 2025
68a902f
feat(workflows/overview): add doc
goosewin May 30, 2025
f865d93
feat(workflows/quickstart): add doc
goosewin May 30, 2025
372f490
feat(workflows): move docs, add new videos
goosewin May 30, 2025
67b61a9
chore: update nav to include workflow docs
goosewin May 30, 2025
379c224
feat(docs-agent): add code snippets
goosewin May 30, 2025
0b6c1c8
feat(examples/inbound-support): add code snippets
goosewin May 30, 2025
56f4cd5
feat(examples/outbound-call-python): add code snippets
goosewin May 30, 2025
c8d494c
feat(examples/voice-widget): add code snippets
goosewin May 30, 2025
5a551a3
feat(quickstart/dashboard): add code snippets
goosewin May 30, 2025
090f786
feat(workflows/quickstart): add code snippets
goosewin May 30, 2025
58b12c8
feat(workflows/appointment-scheduling): add code snippets
goosewin May 30, 2025
894b5f6
feat(workflows/clinic-triage-scheduling): add code snippets
goosewin May 30, 2025
93783fc
feat(workflows/ecommerce-order-management): add code snippets
goosewin May 30, 2025
908aeb1
feat(workflows/outbound-sales): add code snippets
goosewin May 30, 2025
919b808
Merge branch 'main' into feature/examples-code
goosewin Jun 1, 2025
009a9b4
Merge branch 'main' into feature/examples-code
goosewin Jun 3, 2025
06c324e
chore: delete `.DS_Store`
goosewin Jun 3, 2025
b5a5f4b
Merge branch 'main' into feature/examples-code
goosewin Jun 3, 2025
d822315
feat(workflows/quickstart): new code examples
goosewin Jun 3, 2025
a8c3dbb
feat(examples/docs-agent): new code examples
goosewin Jun 3, 2025
f30f81c
feat(examples/inbound-support): new code examples
goosewin Jun 3, 2025
551bd36
feat(examples/voice-widget): new code examples
goosewin Jun 3, 2025
ca02191
feat(quickstart/dashboard): new code examples
goosewin Jun 3, 2025
d2ad299
feat(quickstart/phone): new code examples
goosewin Jun 3, 2025
c45b072
feat(workflows/outbound-sales): new code examples
goosewin Jun 3, 2025
df4ecd3
feat(workflows/ecommerce-order-management): new code examples
goosewin Jun 3, 2025
6650fd1
feat(workflows/appointment-scheduling): new code examples
goosewin Jun 3, 2025
7e6fa59
feat(workflows/clinic-triage-scheduling): new code examples
goosewin Jun 3, 2025
ffc7375
chore: add other pm install options, cleanup
goosewin Jun 3, 2025
ab24710
chore: replace `gpt-4` occurrences with `gpt-4o` to stay up-to-date
goosewin Jun 3, 2025
924a316
chore: replace `gpt-3.5-turbo` occurrences with `gpt-4o` to stay up-t…
goosewin Jun 3, 2025
a41fb3a
chore: delete `outbound-call-python` example
goosewin Jun 3, 2025
54a286a
fix: code examples
goosewin Jun 3, 2025
b4dd48a
fix: delete duplicate merge doc
goosewin Jun 3, 2025
a8d3d8d
chore: cleanup video assets
goosewin Jun 3, 2025
538001b
chore: cleanup merge duplicates, restructure dirs for consistency
goosewin Jun 3, 2025
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
2 changes: 1 addition & 1 deletion fern/assistants/personalization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ This approach is ideal for use cases like customer support, account management,
name: "Dynamic Customer Support Assistant",
model: {
provider: "openai",
model: "gpt-4",
model: "gpt-4o",
messages: [{
role: "system",
content: `You are helping ${customer.name}, a ${customer.tier} member since ${customer.createdAt}.`
Expand Down
6 changes: 3 additions & 3 deletions fern/customization/custom-llm/tool-calling-integration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ Once your endpoints are set up, try testing them with these cURL commands.
curl -X POST https://custom-llm-url/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-3.5-turbo",
"model": "gpt-4o",
"messages": [
{"role": "user", "content": "I need a payment link."}
],
Expand All @@ -268,7 +268,7 @@ Streaming chunks eventually include the result (e.g., a payment link) returned b
curl -X POST https://custom-llm-url/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-3.5-turbo",
"model": "gpt-4o",
"messages": [
{"role": "user", "content": "Please transfer my call."}
],
Expand Down Expand Up @@ -423,4 +423,4 @@ By building each layer step by step and testing with cURL, you can fine-tune you
For your convenience, you can find the complete source code for this Custom LLM integration here:

**[Custom LLM with Vapi Integration – Complete Code](https://codesandbox.io/p/devbox/gfwztp)**
```
```
18 changes: 18 additions & 0 deletions fern/customization/custom-transcriber.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,26 @@ You'll learn how to:
mkdir vapi-custom-transcriber
cd vapi-custom-transcriber
npm init -y
```

<CodeBlocks>
```bash title="npm"
npm install ws express dotenv @deepgram/sdk
```

```bash title="yarn"
yarn add ws express dotenv @deepgram/sdk
```

```bash title="pnpm"
pnpm add ws express dotenv @deepgram/sdk
```

```bash title="bun"
bun add ws express dotenv @deepgram/sdk
```
</CodeBlocks>

Create a `.env` file with the following content:
```env
DEEPGRAM_API_KEY=your_deepgram_api_key
Expand Down
15 changes: 2 additions & 13 deletions fern/customization/jwt-authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ For example, it can be used to restrict which API endpoints the token can access

<Note>
As of writing, the only publicly scoped API endpoint is
https://api.vapi.ai//call/web, which is used for Web Call creation. All other
https://api.vapi.ai/call/web, which is used for Web Call creation. All other
endpoints are privately scoped.
</Note>

Expand Down Expand Up @@ -136,18 +136,7 @@ If you set the scope to `public`, you can use it to make authenticated API reque
```
import Vapi from '@vapi-ai/web';

const vapi = new Vapi({
token: 'your-jwt-token',
});
const vapi = new Vapi('your-jwt-token');

vapi.start('your-assistant-id');
```

## Notes

- With the generated token, you can authenticate API requests to any endpoint requiring authentication. The token will be valid for the duration specified in the options (1 hour in this case).
- If you don't specify `token` in the JWT payload, the token will be public.

## Conclusion

This documentation covered the basics of generating a JWT token and demonstrated how to use the token to make authenticated API requests. Ensure that your environment variables (e.g., `ORG_ID` and `PRIVATE_KEY`) are correctly set up before running the code.
4 changes: 1 addition & 3 deletions fern/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -746,15 +746,13 @@ redirects:
- source: "/multilingual/introduction"
destination: "/multilingual"
- source: "/outbound_sales"
destination: "/examples/outbound-sales"
destination: "/examples/lead-qualification"
- source: "/technical_support"
destination: "/examples/inbound-support"
- source: "/pizza_website"
destination: "/examples/inbound-support"
- source: "/examples/pizza-website"
destination: "/examples/inbound-support"
- source: "/outbound_call_python"
destination: "/examples/outbound-call-python"
- source: "/voice_widget"
destination: "/examples/voice-widget"
- source: "/clients"
Expand Down
Loading
Loading