Refactor OpenAI class to use asynchronous room check for generating response.
- Replaced synchronous room check with asynchronous room check using `await`. - Updated the code to use the `await` keyword before calling `self.room_uses_assistant(room)`. - This change enables the code to generate assistant response asynchronously.
This commit is contained in:
parent
65bf724a0b
commit
c3fe074b1e
1 changed files with 1 additions and 1 deletions
|
@ -167,7 +167,7 @@ class OpenAI:
|
||||||
"""
|
"""
|
||||||
self.logger.log(f"Generating response to {len(messages)} messages using {self.chat_model}...")
|
self.logger.log(f"Generating response to {len(messages)} messages using {self.chat_model}...")
|
||||||
|
|
||||||
if self.room_uses_assistant(room):
|
if await self.room_uses_assistant(room):
|
||||||
return await self.generate_assistant_response(messages, room, user)
|
return await self.generate_assistant_response(messages, room, user)
|
||||||
|
|
||||||
chat_partial = partial(
|
chat_partial = partial(
|
||||||
|
|
Loading…
Reference in a new issue