checkpoint
This commit is contained in:
parent
05f7483a22
commit
620db3d640
3 changed files with 36 additions and 5 deletions
|
|
@ -19,6 +19,7 @@ from vocode.models.transcriber import (
|
||||||
)
|
)
|
||||||
from vocode.models.agent import (
|
from vocode.models.agent import (
|
||||||
ChatGPTAgentConfig,
|
ChatGPTAgentConfig,
|
||||||
|
FillerAudioConfig,
|
||||||
RESTfulUserImplementedAgentConfig,
|
RESTfulUserImplementedAgentConfig,
|
||||||
WebSocketUserImplementedAgentConfig,
|
WebSocketUserImplementedAgentConfig,
|
||||||
EchoAgentConfig,
|
EchoAgentConfig,
|
||||||
|
|
@ -43,12 +44,14 @@ if __name__ == "__main__":
|
||||||
input_device=microphone_input,
|
input_device=microphone_input,
|
||||||
output_device=speaker_output,
|
output_device=speaker_output,
|
||||||
transcriber_config=DeepgramTranscriberConfig.from_input_device(
|
transcriber_config=DeepgramTranscriberConfig.from_input_device(
|
||||||
microphone_input, endpointing_config=PunctuationEndpointingConfig()
|
microphone_input
|
||||||
),
|
),
|
||||||
agent_config=ChatGPTAgentConfig(
|
agent_config=ChatGPTAgentConfig(
|
||||||
initial_message=BaseMessage(text="Hello!"),
|
initial_message=BaseMessage(text="Hello!"),
|
||||||
prompt_preamble="The AI is having a pleasant conversation about life.",
|
prompt_preamble="The AI is having a pleasant conversation about life.",
|
||||||
generate_responses=True,
|
generate_responses=False,
|
||||||
|
end_conversation_on_goodbye=True,
|
||||||
|
send_filler_audio=FillerAudioConfig(use_typing_noise=True),
|
||||||
),
|
),
|
||||||
synthesizer_config=AzureSynthesizerConfig.from_output_device(speaker_output),
|
synthesizer_config=AzureSynthesizerConfig.from_output_device(speaker_output),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,15 @@
|
||||||
|
from vocode.models.synthesizer import AzureSynthesizerConfig
|
||||||
|
from vocode.output_device.telephone_output import TelephoneOutput
|
||||||
from vocode.telephony.outbound_call import OutboundCall
|
from vocode.telephony.outbound_call import OutboundCall
|
||||||
from vocode.models.telephony import CallEntity
|
from vocode.models.telephony import CallEntity
|
||||||
from vocode.models.agent import EchoAgentConfig, WebSocketUserImplementedAgentConfig
|
from vocode.models.agent import (
|
||||||
|
EchoAgentConfig,
|
||||||
|
ChatGPTAgentConfig,
|
||||||
|
WebSocketUserImplementedAgentConfig,
|
||||||
|
)
|
||||||
|
from vocode.models.message import BaseMessage
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == "__main__":
|
||||||
call = OutboundCall(
|
call = OutboundCall(
|
||||||
recipient=CallEntity(
|
recipient=CallEntity(
|
||||||
phone_number="+11234567890",
|
phone_number="+11234567890",
|
||||||
|
|
@ -10,6 +17,15 @@ if __name__ == '__main__':
|
||||||
caller=CallEntity(
|
caller=CallEntity(
|
||||||
phone_number="+11234567890",
|
phone_number="+11234567890",
|
||||||
),
|
),
|
||||||
agent_config=EchoAgentConfig(initial_message="Hello!")
|
agent_config=ChatGPTAgentConfig(
|
||||||
|
initial_message=BaseMessage(text="the quick fox jumped over the lazy dog "),
|
||||||
|
prompt_preamble="respond two sentences at a time",
|
||||||
|
generate_responses=True,
|
||||||
|
end_conversation_on_goodbye=True,
|
||||||
|
send_filler_audio=True,
|
||||||
|
),
|
||||||
|
synthesizer_config=AzureSynthesizerConfig.from_output_device(
|
||||||
|
output_device=TelephoneOutput(), voice_name="en-US-JennyNeural"
|
||||||
|
),
|
||||||
)
|
)
|
||||||
call.start()
|
call.start()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
from typing import Optional, Union
|
from typing import Optional, Union
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
|
from pydantic import validator
|
||||||
|
|
||||||
from vocode.models.message import BaseMessage
|
from vocode.models.message import BaseMessage
|
||||||
from .model import TypedModel, BaseModel
|
from .model import TypedModel, BaseModel
|
||||||
|
|
||||||
|
|
@ -23,6 +25,16 @@ class AgentType(str, Enum):
|
||||||
|
|
||||||
class FillerAudioConfig(BaseModel):
|
class FillerAudioConfig(BaseModel):
|
||||||
silence_threshold_seconds: float = FILLER_AUDIO_DEFAULT_SILENCE_THRESHOLD_SECONDS
|
silence_threshold_seconds: float = FILLER_AUDIO_DEFAULT_SILENCE_THRESHOLD_SECONDS
|
||||||
|
use_phrases: bool = True
|
||||||
|
use_typing_noise: bool = False
|
||||||
|
|
||||||
|
@validator("use_typing_noise")
|
||||||
|
def typing_noise_excludes_phrases(cls, v, values):
|
||||||
|
if v and values.get("use_phrases"):
|
||||||
|
values["use_phrases"] = False
|
||||||
|
if not v and not values.get("use_phrases"):
|
||||||
|
raise ValueError("must use either typing noise or phrases for filler audio")
|
||||||
|
return v
|
||||||
|
|
||||||
|
|
||||||
class AgentConfig(TypedModel, type=AgentType.BASE):
|
class AgentConfig(TypedModel, type=AgentType.BASE):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue