feat: 添加天气、网页搜索mcp

This commit is contained in:
gouhanke
2026-03-05 18:45:04 +08:00
parent 9375dc29ee
commit 5b2573c0ca
12 changed files with 313 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ from autogen_core.models import ModelFamily
from autogen_ext.models.ollama import OllamaChatCompletionClient
from . import config
from .mcp_tools import get_weather, web_search
class AvatarAgentService:
@@ -19,10 +20,18 @@ class AvatarAgentService:
"structured_output": True,
},
)
# 定义可用的 MCP 工具
tools = [
get_weather,
web_search,
]
self._agent = AssistantAgent(
name="avatar",
model_client=model_client,
system_message=config.SYSTEM_MESSAGE,
tools=tools,
)
async def reply(self, user_text: str, image_b64: str) -> str: