feat: 添加天气、网页搜索mcp
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user