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)