semblance-dev/backend/app/services
michael 6ee80e67aa Create fresh LLM clients per call instead of caching
The previous event loop tracking approach still caused issues - when replacing
a cached client, its garbage collection triggers aclose() which tries to close
the aiohttp session on the wrong event loop.

Simplest fix: create a fresh client for each call. The overhead is minimal
compared to the actual LLM API call, and this completely avoids all event
loop mismatch issues in ASGI environments.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 16:56:36 -06:00
..
ai_moderator_service.py changed permissions 2025-12-19 19:26:16 +00:00
ai_persona_service.py changed permissions 2025-12-19 19:26:16 +00:00
ai_runner_service.py changed permissions 2025-12-19 19:26:16 +00:00
autonomous_conversation_controller.py changed permissions 2025-12-19 19:26:16 +00:00
bulk_persona_export_service.py changed permissions 2025-12-19 19:26:16 +00:00
conversation_context_service.py changed permissions 2025-12-19 19:26:16 +00:00
conversation_decision_service.py changed permissions 2025-12-19 19:26:16 +00:00
conversation_state_manager.py changed permissions 2025-12-19 19:26:16 +00:00
customer_data_service.py changed permissions 2025-12-19 19:26:16 +00:00
focus_group_response_service.py changed permissions 2025-12-19 19:26:16 +00:00
focus_group_service.py changed permissions 2025-12-19 19:26:16 +00:00
focus_group_summary_service.py changed permissions 2025-12-19 19:26:16 +00:00
image_description_service.py changed permissions 2025-12-19 19:26:16 +00:00
key_theme_service.py changed permissions 2025-12-19 19:26:16 +00:00
llm_service.py Create fresh LLM clients per call instead of caching 2025-12-19 16:56:36 -06:00
msal_service.py changed permissions 2025-12-19 19:26:16 +00:00
persona_export_service.py changed permissions 2025-12-19 19:26:16 +00:00
persona_modification_service.py changed permissions 2025-12-19 19:26:16 +00:00
task_manager.py changed permissions 2025-12-19 19:26:16 +00:00