Remove instantiation of unused http client session
These examples don't make any HTTP requests with `session` so there doesn't seem be a need to create one in the first place. Probably a copy-paste from a previous example.
This commit is contained in:
@@ -77,7 +77,6 @@ async def configure_livekit():
|
|||||||
|
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
async with aiohttp.ClientSession() as session:
|
|
||||||
(url, token, room_name) = await configure_livekit()
|
(url, token, room_name) = await configure_livekit()
|
||||||
|
|
||||||
transport = LiveKitTransport(
|
transport = LiveKitTransport(
|
||||||
|
|||||||
@@ -82,8 +82,6 @@ transport_params = {
|
|||||||
async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_sigint: bool):
|
async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_sigint: bool):
|
||||||
logger.info(f"Starting bot")
|
logger.info(f"Starting bot")
|
||||||
|
|
||||||
# Create an HTTP session for API calls
|
|
||||||
async with aiohttp.ClientSession() as session:
|
|
||||||
llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"))
|
llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"))
|
||||||
|
|
||||||
messages = [
|
messages = [
|
||||||
@@ -133,6 +131,7 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si
|
|||||||
"show_video_container": False,
|
"show_video_container": False,
|
||||||
"show_debug_container": False,
|
"show_debug_container": False,
|
||||||
}
|
}
|
||||||
|
|
||||||
rtvi_frame = RTVIServerMessageFrame(data=messages)
|
rtvi_frame = RTVIServerMessageFrame(data=messages)
|
||||||
await task.queue_frames([rtvi_frame])
|
await task.queue_frames([rtvi_frame])
|
||||||
|
|
||||||
|
|||||||
@@ -92,8 +92,6 @@ transport_params = {
|
|||||||
async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_sigint: bool):
|
async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_sigint: bool):
|
||||||
logger.info(f"Starting bot")
|
logger.info(f"Starting bot")
|
||||||
|
|
||||||
# Create an HTTP session for API calls
|
|
||||||
async with aiohttp.ClientSession() as session:
|
|
||||||
stt = DeepgramSTTService(api_key=os.getenv("DEEPGRAM_API_KEY"))
|
stt = DeepgramSTTService(api_key=os.getenv("DEEPGRAM_API_KEY"))
|
||||||
|
|
||||||
llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"))
|
llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"))
|
||||||
|
|||||||
Reference in New Issue
Block a user