-
Notifications
You must be signed in to change notification settings - Fork 400
/
main.py
41 lines (33 loc) 路 1.12 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import logging
import os
from fastapi import FastAPI
from vocode.streaming.telephony.config_manager.redis_config_manager import (
RedisConfigManager,
)
from vocode.streaming.models.agent import ChatGPTAgentConfig
from vocode.streaming.models.message import BaseMessage
from vocode.streaming.telephony.server.base import InboundCallConfig, TelephonyServer
from speller_agent import SpellerAgentFactory
app = FastAPI(docs_url=None)
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
config_manager = RedisConfigManager()
BASE_URL = os.environ["BASE_URL"]
telephony_server = TelephonyServer(
base_url=BASE_URL,
config_manager=config_manager,
inbound_call_configs=[
InboundCallConfig(
url="/inbound_call",
agent_config=ChatGPTAgentConfig(
initial_message=BaseMessage(text="What up"),
prompt_preamble="Have a pleasant conversation about life",
generate_responses=True,
),
)
],
agent_factory=SpellerAgentFactory(),
logger=logger,
)
app.include_router(telephony_server.get_router())