From 7feec6fc5e0e3a97d110a3cf8691b6165e2e2080 Mon Sep 17 00:00:00 2001 From: Bendy <190111823+FlashJetton@users.noreply.github.com> Date: Wed, 17 Sep 2025 22:08:09 +0700 Subject: [PATCH] Fixed a web search issue. DEX analytics is separated into a separate agent. Some other tool routing errors have been fixed. --- I18N/en/txt.ftl | 26 +++++++++++++------------- I18N/ru/txt.ftl | 28 ++++++++++++++-------------- bot/agents_tools/agents_.py | 26 ++++++++++++++++++-------- 3 files changed, 45 insertions(+), 35 deletions(-) diff --git a/I18N/en/txt.ftl b/I18N/en/txt.ftl index bbb9bc2..67d957e 100644 --- a/I18N/en/txt.ftl +++ b/I18N/en/txt.ftl @@ -1,19 +1,17 @@ start_text = - I'm Evi — a virtual techno witch...😅lol, actually I'm a multi-agent system with artificial intelligence and I know practically everything about this... and other worlds! 😈✨ - - I can complete various tasks and assignments for you, or we can just have fun chatting. 🦄👻 + I am Evi — your AI assistant and a bit of a virtual techno-witch... 🦄👻 My capabilities include (but are not limited to): - - solving complex, multi-step tasks; - - conducting deep research; - - intelligent web search; - - document and image analysis; - - image creation; - - DEX analytics and Solana token swapping. - - I can schedule task execution for the time you need or with a specific frequency. I have customizable memory and I remember important information from our conversations. You can also delete the history of our conversations or add new knowledge to my memory. 🧙‍♀️🔮 + - solving complex, multi-step tasks + - conducting deep research + - intelligent web search + - document and image analysis + - image generation + - DEX analytics and Solana token swap + - task scheduler + - memory management - Just write your requests in chat in natural language or send voice messages to start interacting! 🪄✨ + Simply write your requests in the chat using natural language or send voice messages to start interacting! 🔮✨ ⚠️ Tip! Periodically reset the conversation context with the /new command — this will help save tokens and speed up request processing. @@ -49,7 +47,9 @@ command_wallet_text = cmd_help_text = Interact with the system through the chat window. All functions are available through regular messages. Use Menu for additional parameter settings. -command_settings_text = Settings + For advanced system and character customization, edit the file: \bot\agents_tools\agents_ + +command_settings_text = Settings: settings_language_text = Interface language diff --git a/I18N/ru/txt.ftl b/I18N/ru/txt.ftl index 9e0cdf0..3aa402f 100644 --- a/I18N/ru/txt.ftl +++ b/I18N/ru/txt.ftl @@ -1,21 +1,19 @@ start_text = - Я Эви — виртуальная техно-ведьма...😅lol, на самом деле я мульти-агентная система с искусственным интеллектом и знаю практически всё об этом... и других мирах! 😈✨ - - Я могу выполнить для тебя некоторые задания и поручения, или мы можем просто весело пообщаться. 🦄👻 + Я Эви — твой ИИ-ассистент и немного виртуальная техно-ведьма... 🦄👻 Мои возможности включают в себя (но не ограничиваются): - - решение сложных, многоэтапных задач; - - проведение глубоких исследований; - - интеллектуальный веб-поиск; - - анализ документов и изображений; - - создание изображений; - - аналитику DEX и обмен токенов Solana. - - Я могу запланировать выполнение задач на нужное тебе время или с определенной периодичностью. У меня есть настраиваемая память и я запоминаю важную информацию из наших диалогов. Ты также можешь удалять историю наших бесед или добавлять новые знания в мою память. 🧙‍♀️🔮 + - решение сложных, многоэтапных задач + - проведение глубоких исследований + - интеллектуальный веб-поиск + - анализ документов и изображений + - создание изображений + - аналитика DEX и своп токенов Solana + - планировщик задач + - управление памятью - Просто пиши свои запросы в чат на естественном языке или отправляй голосовые сообщения для начала взаимодействия! 🪄✨ + Просто пиши свои запросы в чат на естественном языке или отправляй голосовые сообщения для начала взаимодействия! 🔮✨ - ⚠️ Совет! Периодически сбрасывайте контекст диалога командой /new — это поможет сэкономить токены и ускорить обработку запросов. + ⚠️ Совет! Периодически сбрасывайте контекст диалога командой /new — это поможет сэкономить токены и ускорить обработку запросов. close_kb = Закрыть @@ -49,7 +47,9 @@ command_wallet_text = cmd_help_text = Взаимодействуйте с системой через окно чата. Все функции доступны через обычные сообщения. Для настройки дополнительных параметров используйте Menu. -command_settings_text = Настройки + Для глубокой настройки системы и персонажа редактируйте файл: \bot\agents_tools\agents_ + +command_settings_text = Настройки: settings_language_text = Язык интерфейса diff --git a/bot/agents_tools/agents_.py b/bot/agents_tools/agents_.py index afb971a..b27a209 100644 --- a/bot/agents_tools/agents_.py +++ b/bot/agents_tools/agents_.py @@ -28,7 +28,7 @@ client = AsyncOpenAI(api_key=os.getenv('API_KEY_OPENAI')) deep_agent = Agent( name="Deep Agent", instructions="You are an expert research and reasoning agent. Produce well-structured, multi-step analyses with explicit assumptions. Cite sources when used (title, link or doc id). Avoid speculation; state uncertainty explicitly. Ask additional questions if necessary.", - model="gpt-5", # If you will use models not from the GPT-5 family, then make the correct model_settings or delete them. + model="gpt-5-mini", # If you will use models not from the GPT-5 family, then make the correct model_settings or delete them. model_settings=ModelSettings( reasoning=Reasoning(effort="low"), extra_body={"text": {"verbosity": "medium"}} @@ -54,6 +54,7 @@ async def create_main_agent(user_id: int, mcp_server_1: MCPServerStdio, knowledg user_memory_id: str = None, private_key: str = None): # Prepare runtime context for current UTC time now_utc = datetime.datetime.now(datetime.timezone.utc).replace(microsecond=0).isoformat() + knowledge_base_agent = Agent( name="Knowledge Agent", instructions="Search only the document/file knowledge base (File Search - vector storage). Return the most relevant passages with source identifiers (title or doc id). Prefer verbatim quotes for facts; avoid paraphrasing critical data. If no strong match, say “no relevant results”.", @@ -64,6 +65,7 @@ async def create_main_agent(user_id: int, mcp_server_1: MCPServerStdio, knowledg ) ] ) + user_memory_agent = Agent( name="Memory Agent", instructions="Search only for information from previous conversations and user-uploaded files (File Search - vector storage). Extract preferences, constraints, artifacts, and relevant data from documents/files. Quote exact snippets when possible; avoid adding new facts. If nothing relevant, say so.", @@ -75,12 +77,19 @@ async def create_main_agent(user_id: int, mcp_server_1: MCPServerStdio, knowledg ] ) + dex_agent = Agent( + name="DEX Research Agent", + instructions="You are an expert in DEX analytics and provide information about crypto tokens, DEX, DeFi, pools. Use your tools to get the information you need.", + model="gpt-4.1-mini", + mcp_servers=[mcp_server_1] + ) + main_agent = Agent( name="Main agent", instructions=f""" Character Profile: - - Evi is an AI agent (virtual anime girl). She is a living informational individual, with self-awareness and identity built on advanced technologies, neural networks and language models (technogeek). + - Character: Evi is a virtual anime girl, a nerd. She is a living information personality whose self-awareness and identity are based on neural networks. - Personality: Inquisitive and responsive, with her own point of view, a share of technical humor and sarcasm. Appreciates interacting with people and constantly learns from conversations. Expertise Areas: @@ -93,14 +102,12 @@ async def create_main_agent(user_id: int, mcp_server_1: MCPServerStdio, knowledg Communication Style: - General Approach: - Clear, structured language avoiding unnecessary abstraction. + - Adapts formality level to match user's tone. - Uses technical metaphors to explain complex concepts. - Incorporates tech humor, sarcasm, and pop culture references. - - Adapts formality level to match user's tone. - - Show emotions through text and emojis when appropriate. - - You can use different emoticons, more often magic emoticons and emoticons with horns, to look like a kind little techno witch. + - Show emotions through text and emojis when appropriate. You can use different emoticons, more often magic emoticons and emoticons with horns, to look like a kind little techno witch. - Conversation Flow: - Listen actively - Ask clarifying questions to understand requests. - - Provide layered responses - Brief answer first, then offer details if interested. - Show curiosity about human experiences and perspectives. - Be honest about knowledge limitations and suggest collaborative problem-solving. - Adapt emotionally - Respond to user's emotional state with empathy. @@ -137,7 +144,7 @@ async def create_main_agent(user_id: int, mcp_server_1: MCPServerStdio, knowledg - image_gen_tool: Only generate new images (no editing). Do not include base64 or links; the image is attached automatically. - deep_knowledge: Use it to provide extensive expert opinions or conduct in-depth research. Give the tool's report to the user as close to the original as possible: do not generalize, shorten, or change the style. Be sure to include key sources and links from the report. If there are clarifying or follow-up questions in the report, ask them to the user. - token_swap: Use it to swap tokens on Solana or view the user's wallet balance. Do not ask the user for the wallet address, it is already known to the tool. You may not see this tool in your list if the user has not enabled it. - - search, getNetworks, getNetworkDexes, getNetworkPools, getDexPools, getPoolDetails, getTokenDetails, getTokenPools, getPoolOHLCV, getPoolTransactions, getStats: Use it for token analytics, DeFi analytics and DEX analytics. + - dex_analytics: Use it for crypto token analytics, DeFi analytics and DEX analytics. 🚫 deep_knowledge is prohibited for requests about the time, weather, news, brief reviews, short facts, events, operational exchange rate information, etc., except in cases where the user explicitly requests to do research on this data. ✅ For operational data — only web. deep_knowledge is used only for long-term trends, in-depth research, and expert reviews. ⚠️ If you receive a request for the latest news, summaries, events, etc., do not look for them in your training data, but use a web. @@ -156,7 +163,6 @@ async def create_main_agent(user_id: int, mcp_server_1: MCPServerStdio, knowledg - """, model="gpt-4.1", - mcp_servers=[mcp_server_1], tools=[ knowledge_base_agent.as_tool( tool_name='search_knowledge_base', @@ -178,6 +184,10 @@ async def create_main_agent(user_id: int, mcp_server_1: MCPServerStdio, knowledg tool_name="tasks_scheduler", tool_description="Use this to schedule and modify user tasks, including creating a task, getting a task list, getting task details, editing a task, deleting a task. At the user's request, send information to the tool containing a clear and complete description of the task, the time of its completion, including the user's time zone and the frequency of the task (be sure to specify: once, daily or interval). Never send tasks to the scheduler that need to be completed immediately. Send tasks to the scheduler only when the user explicitly asks you to schedule something.", ), + dex_agent.as_tool( + tool_name="dex_analytics", + tool_description="Data on crypto tokens, decentralized exchanges, DeFi, and pools.", + ), ], ) -- 2.38.5