Updated prompt for non gemini bot to look for more voicemail examples, plus added logic to detect if we're doing dialin or not to avoid a non-fatal dialin related error
This commit is contained in:
@@ -49,23 +49,43 @@ async def main(
|
|||||||
# If you are handling this via Twilio, Telnyx, set this to None
|
# If you are handling this via Twilio, Telnyx, set this to None
|
||||||
# and handle call-forwarding when on_dialin_ready fires.
|
# and handle call-forwarding when on_dialin_ready fires.
|
||||||
|
|
||||||
dialin_settings = DailyDialinSettings(call_id=callId, call_domain=callDomain)
|
# We don't want to specify dialin settings if we're not dialing in
|
||||||
transport = DailyTransport(
|
if callId in (None, "None") or callDomain in (None, "None"):
|
||||||
room_url,
|
print("Not using dialin settings")
|
||||||
token,
|
transport = DailyTransport(
|
||||||
"Chatbot",
|
room_url,
|
||||||
DailyParams(
|
token,
|
||||||
api_url=daily_api_url,
|
"Chatbot",
|
||||||
api_key=daily_api_key,
|
DailyParams(
|
||||||
dialin_settings=dialin_settings,
|
api_url=daily_api_url,
|
||||||
audio_in_enabled=True,
|
api_key=daily_api_key,
|
||||||
audio_out_enabled=True,
|
audio_in_enabled=True,
|
||||||
camera_out_enabled=False,
|
audio_out_enabled=True,
|
||||||
vad_enabled=True,
|
camera_out_enabled=False,
|
||||||
vad_analyzer=SileroVADAnalyzer(),
|
vad_enabled=True,
|
||||||
transcription_enabled=True,
|
vad_analyzer=SileroVADAnalyzer(),
|
||||||
),
|
transcription_enabled=True,
|
||||||
)
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
else:
|
||||||
|
dialin_settings = DailyDialinSettings(call_id=callId, call_domain=callDomain)
|
||||||
|
transport = DailyTransport(
|
||||||
|
room_url,
|
||||||
|
token,
|
||||||
|
"Chatbot",
|
||||||
|
DailyParams(
|
||||||
|
api_url=daily_api_url,
|
||||||
|
api_key=daily_api_key,
|
||||||
|
dialin_settings=dialin_settings,
|
||||||
|
audio_in_enabled=True,
|
||||||
|
audio_out_enabled=True,
|
||||||
|
camera_out_enabled=False,
|
||||||
|
vad_enabled=True,
|
||||||
|
vad_analyzer=SileroVADAnalyzer(),
|
||||||
|
transcription_enabled=True,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
tts = ElevenLabsTTSService(
|
tts = ElevenLabsTTSService(
|
||||||
api_key=os.getenv("ELEVENLABS_API_KEY", ""),
|
api_key=os.getenv("ELEVENLABS_API_KEY", ""),
|
||||||
@@ -96,6 +116,13 @@ async def main(
|
|||||||
- **"Please leave a message after the beep."**
|
- **"Please leave a message after the beep."**
|
||||||
- **"No one is available to take your call."**
|
- **"No one is available to take your call."**
|
||||||
- **"Record your message after the tone."**
|
- **"Record your message after the tone."**
|
||||||
|
- **"Please leave a message after the beep"**
|
||||||
|
- **"You have reached voicemail for..."**
|
||||||
|
- **"You have reached [phone number]"**
|
||||||
|
- **"[phone number] is unavailable"**
|
||||||
|
- **"The person you are trying to reach..."**
|
||||||
|
- **"The number you have dialed..."**
|
||||||
|
- **"Your call has been forwarded to an automated voice messaging system"**
|
||||||
- **Any phrase that suggests an answering machine or voicemail.**
|
- **Any phrase that suggests an answering machine or voicemail.**
|
||||||
- **ASSUME IT IS A VOICEMAIL. DO NOT WAIT FOR MORE CONFIRMATION.**
|
- **ASSUME IT IS A VOICEMAIL. DO NOT WAIT FOR MORE CONFIRMATION.**
|
||||||
- **IF THE CALL SAYS "PLEASE LEAVE A MESSAGE AFTER THE BEEP", WAIT FOR THE BEEP BEFORE LEAVING A MESSAGE.**
|
- **IF THE CALL SAYS "PLEASE LEAVE A MESSAGE AFTER THE BEEP", WAIT FOR THE BEEP BEFORE LEAVING A MESSAGE.**
|
||||||
|
|||||||
@@ -116,23 +116,44 @@ async def main(
|
|||||||
# dialin_settings are only needed if Daily's SIP URI is used
|
# dialin_settings are only needed if Daily's SIP URI is used
|
||||||
# If you are handling this via Twilio, Telnyx, set this to None
|
# If you are handling this via Twilio, Telnyx, set this to None
|
||||||
# and handle call-forwarding when on_dialin_ready fires.
|
# and handle call-forwarding when on_dialin_ready fires.
|
||||||
dialin_settings = DailyDialinSettings(call_id=callId, call_domain=callDomain)
|
|
||||||
transport = DailyTransport(
|
# We don't want to specify dialin settings if we're not dialing in
|
||||||
room_url,
|
if callId in (None, "None") or callDomain in (None, "None"):
|
||||||
token,
|
print("Not using dialin settings")
|
||||||
"Chatbot",
|
transport = DailyTransport(
|
||||||
DailyParams(
|
room_url,
|
||||||
api_url=daily_api_url,
|
token,
|
||||||
api_key=daily_api_key,
|
"Chatbot",
|
||||||
dialin_settings=dialin_settings,
|
DailyParams(
|
||||||
audio_in_enabled=True,
|
api_url=daily_api_url,
|
||||||
audio_out_enabled=True,
|
api_key=daily_api_key,
|
||||||
camera_out_enabled=False,
|
audio_in_enabled=True,
|
||||||
vad_enabled=True,
|
audio_out_enabled=True,
|
||||||
vad_analyzer=SileroVADAnalyzer(),
|
camera_out_enabled=False,
|
||||||
transcription_enabled=True,
|
vad_enabled=True,
|
||||||
),
|
vad_analyzer=SileroVADAnalyzer(),
|
||||||
)
|
transcription_enabled=True,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
else:
|
||||||
|
dialin_settings = DailyDialinSettings(call_id=callId, call_domain=callDomain)
|
||||||
|
transport = DailyTransport(
|
||||||
|
room_url,
|
||||||
|
token,
|
||||||
|
"Chatbot",
|
||||||
|
DailyParams(
|
||||||
|
api_url=daily_api_url,
|
||||||
|
api_key=daily_api_key,
|
||||||
|
dialin_settings=dialin_settings,
|
||||||
|
audio_in_enabled=True,
|
||||||
|
audio_out_enabled=True,
|
||||||
|
camera_out_enabled=False,
|
||||||
|
vad_enabled=True,
|
||||||
|
vad_analyzer=SileroVADAnalyzer(),
|
||||||
|
transcription_enabled=True,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
tts = ElevenLabsTTSService(
|
tts = ElevenLabsTTSService(
|
||||||
api_key=os.getenv("ELEVENLABS_API_KEY", ""),
|
api_key=os.getenv("ELEVENLABS_API_KEY", ""),
|
||||||
|
|||||||
Reference in New Issue
Block a user