Make get_chat_session a callback context manager (#137146)

This commit is contained in:
Paulus Schoutsen
2025-02-01 23:37:24 -05:00
committed by GitHub
parent 2ce585463c
commit dd9bd8ef73
8 changed files with 69 additions and 72 deletions

View File

@@ -349,7 +349,7 @@ class DefaultAgent(ConversationEntity):
async def async_process(self, user_input: ConversationInput) -> ConversationResult:
"""Process a sentence."""
response: intent.IntentResponse | None = None
async with (
with (
chat_session.async_get_chat_session(
self.hass, user_input.conversation_id
) as session,