From 83482fa3dc15b2e02b39f1cca2e367cc5b33d83a Mon Sep 17 00:00:00 2001 From: Anton Potapov <47938145+Flagro@users.noreply.github.com> Date: Tue, 3 Dec 2024 14:58:59 +0400 Subject: [PATCH] Simplify lower methods calls --- bot/rp_bot/ai_agent/agent_tools/base_tool.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bot/rp_bot/ai_agent/agent_tools/base_tool.py b/bot/rp_bot/ai_agent/agent_tools/base_tool.py index cf02842..ad4ead7 100644 --- a/bot/rp_bot/ai_agent/agent_tools/base_tool.py +++ b/bot/rp_bot/ai_agent/agent_tools/base_tool.py @@ -38,8 +38,9 @@ async def ask_yes_no_question(self, question: str) -> bool: temperature=self.models_toolkit.ai_config.TextGeneration.temperature, ) text_response = response.choices[0].message.content - if "yes" in text_response.lower(): + lower_response = text_response.lower() + if "yes" in lower_response: return True - if "no" in text_response.lower(): + if "no" in lower_response: return False return False