From 2e7f2d0632981f46d1e8929cde3ed500b91cc29a Mon Sep 17 00:00:00 2001 From: Kirill Kirilenko Date: Sun, 8 Feb 2026 17:56:13 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=20=D0=BA=D0=BE=D0=BD=D1=84=D0=B8?= =?UTF-8?q?=D0=B3=D0=B0=20=D1=83=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D0=B0=20?= =?UTF-8?q?=D1=82=D0=B5=D0=BC=D0=BF=D0=B5=D1=80=D0=B0=D1=82=D1=83=D1=80?= =?UTF-8?q?=D0=B0=20=D0=BC=D0=BE=D0=B4=D0=B5=D0=BB=D0=B8=20(=D0=BF=D0=B0?= =?UTF-8?q?=D1=80=D0=B0=D0=BC=D0=B5=D1=82=D1=80=D1=8B=20=D0=BF=D0=BE=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=B1=D1=83=D0=B4=D1=83=D1=82=20=D0=B7=D0=B0=D0=B4?= =?UTF-8?q?=D0=B0=D0=B2=D0=B0=D1=82=D1=8C=D1=81=D1=8F=20=D0=B2=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B5=D1=81=D0=B5=D1=82=D0=B5=20OpenRouter).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ai_agent.py | 10 ++++------ tg/__main__.py | 1 - vk/__main__.py | 1 - 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/ai_agent.py b/ai_agent.py index acd570d..c80fc77 100644 --- a/ai_agent.py +++ b/ai_agent.py @@ -30,14 +30,13 @@ class Message: class AiAgent: - def __init__(self, api_token: str, model: str, model_temp: float, db: BasicDatabase): + def __init__(self, api_token: str, model: str, db: BasicDatabase): retry_config = RetryConfig(strategy="backoff", backoff=BackoffStrategy( initial_interval=2000, max_interval=8000, exponent=2, max_elapsed_time=14000), retry_connection_errors=True) self.db = db self.model = model - self.model_temp = model_temp self.client = OpenRouter(api_key=api_token, retry_config=retry_config) async def get_group_chat_reply(self, bot_id: int, chat_id: int, @@ -56,8 +55,7 @@ class AiAgent: response = await self.client.chat.send_async( model=self.model, messages=context, - max_tokens=500, - temperature=self.model_temp + max_tokens=500 ) # Extract AI response @@ -136,6 +134,6 @@ class AiAgent: agent: AiAgent -def create_ai_agent(api_token: str, model: str, model_temp: float, db: BasicDatabase): +def create_ai_agent(api_token: str, model: str, db: BasicDatabase): global agent - agent = AiAgent(api_token, model, model_temp, db) + agent = AiAgent(api_token, model, db) diff --git a/tg/__main__.py b/tg/__main__.py index af58428..6edd133 100644 --- a/tg/__main__.py +++ b/tg/__main__.py @@ -26,7 +26,6 @@ async def main() -> None: create_ai_agent(config['openrouter_token'], config['openrouter_model'], - config['openrouter_model_temp'], database.DB) bots: list[Bot] = [] diff --git a/vk/__main__.py b/vk/__main__.py index 3073d4d..fb31f06 100644 --- a/vk/__main__.py +++ b/vk/__main__.py @@ -26,7 +26,6 @@ if __name__ == '__main__': create_ai_agent(config['openrouter_token'], config['openrouter_model'], - config['openrouter_model_temp'], database.DB) bot = Bot(labeler=handlers.labeler)