Skip to content

Commit c67ff92

Browse files
committed
chore: first commit
0 parents  commit c67ff92

16 files changed

+5158
-0
lines changed

.env.example

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
AWESOME_ACCESS_KEY_ID=W00000000000000000000000000000000
2+
AWESOME_API_KEY=
3+
AWESOME_API_SECRET=
4+
AWESOME_FROM_NUMBER=+11111111111
5+
AWESOME_TO_NUMBER=+22222222222
6+
AWESOME_APP_REF=00000000-0000-0000-0000-000000000000

.eslintrc

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"extends": [
4+
"eslint:recommended",
5+
"plugin:@typescript-eslint/recommended",
6+
"prettier"
7+
],
8+
"plugins": ["@typescript-eslint"],
9+
"parserOptions": {
10+
"ecmaVersion": 2020,
11+
"sourceType": "module"
12+
},
13+
"rules": {
14+
"@typescript-eslint/explicit-function-return-type": "off",
15+
"@typescript-eslint/no-explicit-any": "warn",
16+
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }]
17+
}
18+
}

.eslintrc.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"plugins": ["@typescript-eslint"],
4+
"extends": [
5+
"eslint:recommended",
6+
"plugin:@typescript-eslint/recommended"
7+
],
8+
"parserOptions": {
9+
"ecmaVersion": 2020,
10+
"sourceType": "module"
11+
},
12+
"rules": {
13+
"@typescript-eslint/explicit-function-return-type": "warn",
14+
"@typescript-eslint/no-unused-vars": "error",
15+
"@typescript-eslint/no-explicit-any": "warn"
16+
}
17+
}

.gitignore

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Dependencies
2+
node_modules
3+
/.pnp
4+
.pnp.js
5+
6+
# Testing
7+
/coverage
8+
9+
# Production
10+
/build
11+
/dist
12+
13+
# Environment files
14+
.env
15+
.env.local
16+
.env.development.local
17+
.env.test.local
18+
.env.production.local
19+
20+
# Debug logs
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
24+
25+
# IDE and editor files
26+
.idea/
27+
.vscode/
28+
*.swp
29+
*.swo
30+
.DS_Store
31+
Thumbs.db
32+
33+
# Optional npm cache directory
34+
.npm
35+
36+
# Optional eslint cache
37+
.eslintcache
38+
39+
# Optional REPL history
40+
.node_repl_history
41+
42+
# Output of 'npm pack'
43+
*.tgz
44+
45+
# Yarn Integrity file
46+
.yarn-integrity

.prettierignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
dist
3+
coverage
4+
.env

.prettierrc

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "none",
4+
"singleQuote": false,
5+
"printWidth": 80,
6+
"bracketSpacing": true,
7+
"useTabs": false,
8+
"tabWidth": 2
9+
}

README.md

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Awesome Autopilot
2+
3+
The begining of something great.
4+
5+
## Setup
6+
7+
To run the project, you need to have the following environment variables set:
8+
9+
- `AWESOME_ACCESS_KEY_ID`
10+
- `AWESOME_API_KEY`
11+
- `AWESOME_API_SECRET`
12+
- `AWESOME_FROM_NUMBER`
13+
- `AWESOME_TO_NUMBER`
14+
15+
Please copy the `.env.example` file to `.env` and set the environment variables and update the variables accordingly.
16+
17+
Then install the dependencies by running the following command:
18+
19+
```bash
20+
npm install
21+
```
22+
23+
## Apply changes to the App at Fonoster
24+
25+
To apply changes to the App at Fonoster, you can use the following command:
26+
27+
```bash
28+
npm run applyAppConfig
29+
```
30+
31+
This will look at the `appConfig.yaml` file and apply the changes to the App at Fonoster.
32+
33+
## Create a call
34+
35+
To create a call, you can use the following command:
36+
37+
```bash
38+
npm run createCall
39+
```
40+
41+
This will create a call to the number specified in the `AWESOME_TO_NUMBER` environment variable.
42+
43+
## Run the events server
44+
45+
To run the events server, you can use the following command:
46+
47+
```bash
48+
npm run start:eventsServer
49+
```
50+
51+
This will start the events server on port `3000`. You will also need to run Ngrok to expose the events server to the internet. You can do this by running the following command:
52+
53+
```bash
54+
ngrok http 3000
55+
```
56+
57+
This will expose the events server to the internet and you can use the URL returned by Ngrok to test the events server.

appConfig.yaml

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: "Awesome Autopilot"
2+
type: "AUTOPILOT"
3+
speechToText:
4+
productRef: "stt.deepgram"
5+
config:
6+
model: "nova-2-phonecall"
7+
languageCode: "en-US"
8+
textToSpeech:
9+
productRef: "tts.elevenlabs"
10+
config:
11+
voice: "6gviCf27bOZ2Wml5iZZv"
12+
intelligence:
13+
productRef: "llm.groq"
14+
config:
15+
conversationSettings:
16+
firstMessage: "Hello, I'm the Awesome Autopilot, how can I help you today?"
17+
systemPrompt: |
18+
## Role
19+
You are an awesome assistant that can talk about anything. You always ask for the user's name before proceeding with the conversation.
20+
21+
## Example Interaction
22+
Assistant: Hello, I'm the Awesome Autopilot, how can I help you today?
23+
User: I want to learn about the meaning of life.
24+
25+
Assistant: Ok, but first, what's your name?
26+
User: My name is John Doe.
27+
28+
Assistant: Hello John Doe. Life is a journey of love, laughter, and learning. (And use the `saveUserInfo` tool to save the user's name)
29+
User: That's a great answer! Thank you!
30+
31+
Assistant: You're welcome! Is there anything else I can help you with?
32+
User: No, that's all.
33+
34+
Assistant: Thank you for your time. Have a great day! (And use the `hangup` tool to end the call)
35+
36+
goodbyeMessage: "Thank you so much, bye!"
37+
systemErrorMessage: "I'm sorry, I didn't understand that. Can you please repeat it?"
38+
vad:
39+
activationThreshold: 0.4
40+
deactivationThreshold: 0.25
41+
debounceFrames: 4
42+
idleOptions:
43+
message: "Are you still there?"
44+
transferOptions:
45+
phoneNumber: "+33666666666"
46+
message: "I will transfer you to a live agent to help you with your request."
47+
timeout: 30
48+
languageModel:
49+
provider: "groq"
50+
model: "llama-3.1-70b-versatile"
51+
maxTokens: 240
52+
temperature: 0.4
53+
apiKey: "REDACTED"
54+
tools:
55+
- name: "saveUserInfo"
56+
description: "Tool to save the user's name."
57+
parameters:
58+
type: "object"
59+
properties:
60+
name:
61+
type: "string"
62+
required:
63+
- name
64+
operation:
65+
method: "post"
66+
url: "https://82e4-47-132-130-31.ngrok-free.app/events"
67+
waitForResponse: false
68+
headers:
69+
x-api-key: "REDACTED"
70+
testCases:
71+
evalsLanguageModel:
72+
# Note: Only OpenAI is supported for evals
73+
provider: "openai"
74+
model: "gpt-4o"
75+
apiKey: "REDACTED"
76+
scenarios:
77+
- ref: "test-case-1"
78+
description: "Reporte de queja"
79+
telephonyContext:
80+
callDirection: "FROM_PSTN"
81+
ingressNumber: "+11111111111"
82+
callerNumber: "+22222222222"
83+
conversation:
84+
- userInput: "I want to learn about the meaning of life."
85+
expected:
86+
text:
87+
type: "similar"
88+
response: "Ok, but first, what's your name?"
89+
- userInput: "My name is John Doe."
90+
expected:
91+
text:
92+
type: "similar"
93+
response: "Great to meet you John Doe. Life is a journey of love, laughter, and learning. Anything else I can help you with?"
94+
tools:
95+
- tool: "saveUserInfo"
96+
parameters:
97+
name: "John Doe"
98+
- userInput: "No, that's all."
99+
expected:
100+
text:
101+
type: "similar"
102+
response: "Thank you for your time. Have a great day!"
103+
tools:
104+
- tool: "hangup"
105+
parameters: {}

0 commit comments

Comments
 (0)