|
1 | 1 | # Standard library imports
|
2 |
| -import logging |
3 | 2 | import os
|
4 | 3 | import sys
|
5 | 4 |
|
| 5 | +from dotenv import load_dotenv |
| 6 | + |
6 | 7 | # Third-party imports
|
7 | 8 | from fastapi import FastAPI
|
8 |
| -from vocode.streaming.models.telephony import TwilioConfig |
| 9 | +from loguru import logger |
9 | 10 | from pyngrok import ngrok
|
10 |
| -from vocode.streaming.telephony.config_manager.redis_config_manager import ( |
11 |
| - RedisConfigManager, |
12 |
| -) |
13 |
| -from vocode.streaming.models.agent import ChatGPTAgentConfig |
14 |
| -from vocode.streaming.models.message import BaseMessage |
15 |
| -from vocode.streaming.telephony.server.base import ( |
16 |
| - TwilioInboundCallConfig, |
17 |
| - TelephonyServer, |
18 |
| -) |
19 |
| -from dotenv import load_dotenv |
20 | 11 |
|
21 | 12 | # Local application/library specific imports
|
22 |
| -from speller_agent import ( |
23 |
| - SpellerAgentFactory, |
24 |
| - SpellerAgentConfig, |
25 |
| -) |
| 13 | +from speller_agent import SpellerAgentFactory |
| 14 | + |
| 15 | +from vocode.logging import configure_pretty_logging |
| 16 | +from vocode.streaming.models.agent import ChatGPTAgentConfig |
| 17 | +from vocode.streaming.models.message import BaseMessage |
| 18 | +from vocode.streaming.models.telephony import TwilioConfig |
| 19 | +from vocode.streaming.telephony.config_manager.redis_config_manager import RedisConfigManager |
| 20 | +from vocode.streaming.telephony.server.base import TelephonyServer, TwilioInboundCallConfig |
26 | 21 |
|
27 | 22 | # if running from python, this will load the local .env
|
28 | 23 | # docker-compose will load the .env file by itself
|
29 | 24 | load_dotenv()
|
30 | 25 |
|
31 |
| -app = FastAPI(docs_url=None) |
| 26 | +configure_pretty_logging() |
32 | 27 |
|
33 |
| -logging.basicConfig() |
34 |
| -logger = logging.getLogger(__name__) |
35 |
| -logger.setLevel(logging.DEBUG) |
| 28 | +app = FastAPI(docs_url=None) |
36 | 29 |
|
37 |
| -config_manager = RedisConfigManager( |
38 |
| - logger=logger, |
39 |
| -) |
| 30 | +config_manager = RedisConfigManager() |
40 | 31 |
|
41 | 32 | BASE_URL = os.getenv("BASE_URL")
|
42 | 33 |
|
|
66 | 57 | ),
|
67 | 58 | # uncomment this to use the speller agent instead
|
68 | 59 | # agent_config=SpellerAgentConfig(
|
69 |
| - # initial_message=BaseMessage(text="im a speller agent, say something to me and ill spell it out for you"), |
| 60 | + # initial_message=BaseMessage( |
| 61 | + # text="im a speller agent, say something to me and ill spell it out for you" |
| 62 | + # ), |
70 | 63 | # generate_responses=False,
|
71 | 64 | # ),
|
72 | 65 | twilio_config=TwilioConfig(
|
|
76 | 69 | )
|
77 | 70 | ],
|
78 | 71 | agent_factory=SpellerAgentFactory(),
|
79 |
| - logger=logger, |
80 | 72 | )
|
81 | 73 |
|
82 | 74 | app.include_router(telephony_server.get_router())
|
0 commit comments