wide-dress-57902
08/21/2025, 12:03 AMtall-airline-16756
08/21/2025, 12:03 AMtall-airline-16756
08/21/2025, 12:04 AMwide-dress-57902
08/21/2025, 12:07 AMtall-airline-16756
08/21/2025, 12:07 AMwide-dress-57902
08/21/2025, 12:08 AMtall-airline-16756
08/21/2025, 12:09 AMGROQ_API_KEY and OPENAI_API_KEY are set up correctly as environment variables or passed properly to the LLM constructors.
2. Try using a FallbackAdapter: This lets you switch between providers automatically if one hits a snag. Here’s a quick example:
llm=llm.FallbackAdapter([
openai.LLM(model="gpt-4o"),
openai.LLM.with_azure(model="gpt-4o", azure_endpoint="<AZURE_ENDPOINT>"),
])
1. Keep an eye on error recoverability: Listen for the error event from AgentSession. If the recoverable flag is False, you might need to step in manually.
2. Adjust your retry and timeout settings: Tweak APIConnectOptions like timeout and max_retry to give your requests enough chances without failing too quickly.
3. Review your provider-specific settings: Double-check that model names and base URLs (like <GROQ_BASE_URL> for Groq) are spot on.
4. Turn on logging and monitor: Enable debugging with something like LK_OPENAI_DEBUG and take a look at the logs for more clues.
Hopefully, these tips help you pinpoint and fix the issue. If you want to chat through any of these steps or need a hand, just let me know—I’m here to help!
Sources: livekit-plugins/livekit-plugins-google/livekit/plugins/google/llm.py | plugins/openai/src/llm.ts | Events and error handling | LiveKit Docs