-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
226 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import requests | ||
|
||
CHUNK_SIZE = 1024 | ||
url = "https://api.elevenlabs.io/v1/text-to-speech/7p1Ofvcwsv7UBPoFNcpI?output_format=pcm_16000" | ||
|
||
headers = { | ||
"Accept": "audio/wav", | ||
"Content-Type": "application/json", | ||
"xi-api-key": "<key>" | ||
} | ||
|
||
data = { | ||
"text": "<prosody rate=\"medium\">To verify your account, I will need 3 things:<break time=\"0.5s\"/> your full name,<break time=\"0.3s\"/> your date of birth,<break time=\"0.3s\"/> and your address. Can you provide me those 3 things please?</prosody>", | ||
"model_id": "eleven_monolingual_v1", | ||
"voice_settings": { | ||
"stability": 0.5, | ||
"similarity_boost": 0.5 | ||
} | ||
} | ||
|
||
response = requests.post(url, json=data, headers=headers) | ||
with open('11-labs-output-e1.wav', 'wb') as f: | ||
for chunk in response.iter_content(chunk_size=CHUNK_SIZE): | ||
if chunk: | ||
f.write(chunk) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
{ | ||
"DEFAULTS": { | ||
"repromtOnDisconfirm": "Sorry, I did not hear it.", | ||
"prefixes": { | ||
"noInput": [ | ||
"Sorry, I did not hear it.", | ||
"Sorry, I still did not hear it." | ||
], | ||
"noMatch": [ | ||
"Sorry, I did not get it.", | ||
"Sorry, I still did not get it." | ||
] | ||
} | ||
}, | ||
"GRAMMARS": { | ||
"NameCheck": { | ||
"type": "JJSGF", | ||
"parameters": { | ||
"tag-format": "semantics/1.0-literals" | ||
}, | ||
"grammar": "namecheck", | ||
"public": { | ||
"root": "<Bob> {Bob} | <Frank> {Frank} " | ||
}, | ||
"rules": { | ||
"Bob": "(Bob)", | ||
"Frank": "(Frank)" | ||
} | ||
} | ||
}, | ||
"ENTRY": { | ||
"type": "VOID", | ||
"voice": "catherine", | ||
"next": "Welcome" | ||
}, | ||
"ERROR": { | ||
"type": "DISCONNECT", | ||
"prompt": "Sorry, there was an error. Please call back later", | ||
"reason": "ERROR" | ||
}, | ||
"Welcome": { | ||
"type": "OUTPUT", | ||
"voice": "catherine", | ||
"prompt": "Welcome to Transfer Genie", | ||
"next": "HandleUserSelection" | ||
}, | ||
"HandleUserSelection": { | ||
"type": "INPUT", | ||
"name": "userSelect", | ||
"voice": "catherine", | ||
"prompt": "Please say the name of the person you want to talk to", | ||
"bargeIn": true, | ||
"grammar": [ | ||
"NameCheck" | ||
], | ||
"noInputMax": 2, | ||
"noMatchMax": 2, | ||
"confirmation": { | ||
"threshold": 0.5, | ||
"prompt": "You selected ${userSelect}. Is that correct?" | ||
}, | ||
"fail": "CallHealth", | ||
"next": "ProcessUserSelection" | ||
}, | ||
"ProcessUserSelection": { | ||
"type": "EVAL", | ||
"eval": "'${userSelect}'", | ||
"case": [ | ||
{ | ||
"expr": "'${1}'=='Bob'", | ||
"next": "TransferforBob" | ||
}, | ||
{ | ||
"expr": "'${1}'=='Frank'", | ||
"next": "TransferforFrank" | ||
} | ||
] | ||
}, | ||
"TransferforBob": { | ||
"type": "TRANSFER", | ||
"voice": "catherine", | ||
"prompt": "Dialing Bob's extension 20955088", | ||
"phone": { | ||
"phoneNumber": "+13212918281,www20955088" | ||
}, | ||
"fail": "TransferFailed" | ||
}, | ||
"TransferforFrank": { | ||
"type": "TRANSFER", | ||
"voice": "catherine", | ||
"prompt": "Dialing Frank's extension 703", | ||
"phone": { | ||
"phoneNumber": "+19725180863,www7w0w3" | ||
}, | ||
"fail": "TransferFailed" | ||
}, | ||
"TransferFailed": { | ||
"type": "DISCONNECT", | ||
"prompt": "Sorry, the transfer failed. Good bye.", | ||
"reason": "Transfer Failed" | ||
}, | ||
"CallHealth": { | ||
"type": "DISCONNECT", | ||
"prompt": "I have trouble understanding you. Please call back later", | ||
"reason": "CALL-HEALTH" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
--- | ||
DEFAULTS: | ||
repromtOnDisconfirm: Sorry, I did not hear it. | ||
prefixes: | ||
noInput: | ||
- Sorry, I did not hear it. | ||
- Sorry, I still did not hear it. | ||
noMatch: | ||
- Sorry, I did not get it. | ||
- Sorry, I still did not get it. | ||
GRAMMARS: | ||
NameCheck: | ||
type: JJSGF | ||
parameters: | ||
tag-format: semantics/1.0-literals | ||
grammar: namecheck | ||
public: | ||
root: "<Bob> {Bob} | <Frank> {Frank} " | ||
rules: | ||
Bob: "(Bob)" | ||
Frank: "(Frank)" | ||
|
||
ENTRY: | ||
type: VOID | ||
voice: catherine | ||
next: Welcome | ||
ERROR: | ||
type: DISCONNECT | ||
prompt: Sorry, there was an error. Please call back later | ||
reason: ERROR | ||
Welcome: | ||
type: OUTPUT | ||
voice: catherine | ||
prompt: Welcome to Transfer Genie | ||
next: HandleUserSelection | ||
HandleUserSelection: | ||
type: INPUT | ||
name: userSelect | ||
voice: catherine | ||
prompt: Please say the name of the person you want to talk to | ||
bargeIn: true | ||
grammar: | ||
- NameCheck | ||
noInputMax: 2 | ||
noMatchMax: 2 | ||
confirmation: | ||
threshold: 0.5 | ||
prompt: 'You selected ${userSelect}. Is that correct?' | ||
fail: CallHealth | ||
next: ProcessUserSelection | ||
ProcessUserSelection: | ||
type: EVAL | ||
eval: "'${userSelect}'" | ||
case: | ||
- expr: "'${1}'=='Bob'" | ||
next: TransferforBob | ||
- expr: "'${1}'=='Frank'" | ||
next: TransferforFrank | ||
TransferforBob: | ||
type: TRANSFER | ||
voice: catherine | ||
prompt: Dialing Bob's extension | ||
phone: | ||
phoneNumber: "+19725180863,wwww700" | ||
fail: TransferFailed | ||
TransferforFrank: | ||
type: TRANSFER | ||
voice: catherine | ||
prompt: Dialing Frank's extension | ||
phone: | ||
phoneNumber: "+19725180863,wwww701" | ||
fail: TransferFailed | ||
TransferFailed: | ||
type: DISCONNECT | ||
prompt: Sorry, the transfer failed. Good bye. | ||
reason: Transfer Failed | ||
CallHealth: | ||
type: DISCONNECT | ||
prompt: I have trouble understanding you. Please call back later | ||
reason: CALL-HEALTH | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters