Commit 0cb38220 by sunqi02

agent代码开发

Task 1: 配置加载器 (ConfigLoader)
Task 2: Session 模型与数据库表
Task 3: Session 服务 (SessionService)
Task 4: Hook 机制
Task 5: IM 发送服务 (IMService)
Task 6: 中央调度器 (AgentHub)
Task 7: AgentHub API 端点
1 parent 38d22a84
from app.api.v1.endpoints import agents, position_tags, agent_group_helper, agent_hub
__all__ = ["agents", "position_tags", "agent_group_helper", "agent_hub"]
from fastapi import APIRouter, Depends, HTTPException
from pydantic import BaseModel, Field
from typing import Optional
from sqlalchemy.orm import Session
from app.infrastructure.database import get_db
from app.service.agent_hub import AgentHub, AgentHubError
router = APIRouter()
class ChatRequest(BaseModel):
session_id: str = Field(..., description="会话ID")
user_id: str = Field(..., description="用户ID")
room_id: str = Field(default="", description="群ID")
channel: str = Field(default="wechat_group", description="消息渠道")
query: str = Field(..., description="用户问题")
mentioned_agent_code: Optional[str] = Field(None, description="@提及的Agent编码")
file_url: Optional[str] = Field(None, description="文件URL")
class ChatResponse(BaseModel):
session_id: str
response_agent_code: str
response_content: str
routing_reason: str
processing_time_ms: float
def get_agent_hub(db: Session = Depends(get_db)):
from app.main import agent_hub_instance
return agent_hub_instance
@router.post("/completions", response_model=ChatResponse)
async def chat(request: ChatRequest, agent_hub: AgentHub = Depends(get_agent_hub)):
try:
result = await agent_hub.process_message(
session_id=request.session_id,
room_id=request.room_id,
user_id=request.user_id,
user_query=request.query,
mentioned_agent_code=request.mentioned_agent_code,
channel=request.channel,
file_url=request.file_url
)
return ChatResponse(**result)
except AgentHubError as e:
raise HTTPException(status_code=502, detail=str(e))
except ValueError as e:
raise HTTPException(status_code=400, detail=str(e))
from fastapi import APIRouter
from app.api.v1.endpoints import agent_group_helper, agents, position_tags
from app.api.v1.endpoints import agent_group_helper, agents, position_tags, agent_hub
api_router = APIRouter()
api_router.include_router(agent_group_helper.router, tags=["agent-group-helper"])
api_router.include_router(agents.router, tags=["agents"])
api_router.include_router(position_tags.router, tags=["position-tags"])
api_router.include_router(agent_hub.router, prefix="/chat", tags=["chat"])
from app.config.loader import ConfigLoader, ConfigLoadError
from app.config.settings import Settings, ModelConfig, AgentConfig, SkillConfig
__all__ = ["ConfigLoader", "ConfigLoadError", "Settings", "ModelConfig", "AgentConfig", "SkillConfig"]
import json
from pathlib import Path
from typing import Dict, Optional, Tuple
from pydantic import ValidationError
from app.config.settings import (
ModelConfig, AgentConfig, SkillConfig, Settings
)
class ConfigLoadError(Exception):
"""Raised when config loading or validation fails."""
pass
class ConfigLoader:
def __init__(self, config_dir: Optional[str] = None):
if config_dir is None:
config_dir = Path(__file__).parent.parent.parent / "config"
self.config_dir = Path(config_dir)
def _load_json(self, filename: str) -> dict:
filepath = self.config_dir / filename
try:
with open(filepath, "r", encoding="utf-8") as f:
return json.load(f)
except FileNotFoundError:
raise ConfigLoadError(f"配置文件不存在: {filepath}")
except json.JSONDecodeError as e:
raise ConfigLoadError(f"配置文件JSON格式错误: {filepath} - {e}")
def load_agents(self) -> Dict[str, AgentConfig]:
data = self._load_json("agents.json")
try:
return {code: AgentConfig(**config) for code, config in data["agents"].items()}
except ValidationError as e:
raise ConfigLoadError(f"Agent配置验证失败: {e}")
def load_skills(self) -> Dict[str, SkillConfig]:
data = self._load_json("skills.json")
try:
return {code: SkillConfig(**config) for code, config in data["skills"].items()}
except ValidationError as e:
raise ConfigLoadError(f"Skill配置验证失败: {e}")
def load_models(self) -> Dict[str, ModelConfig]:
data = self._load_json("models.json")
try:
return {name: ModelConfig(**config) for name, config in data["models"].items()}
except ValidationError as e:
raise ConfigLoadError(f"模型配置验证失败: {e}")
def load_account_mappings(self) -> Tuple[Dict[str, str], Dict[str, str]]:
data = self._load_json("mappings.json")
return (
data["agent_accounts"],
data["account_agents"]
)
def load_settings(self) -> Settings:
return Settings()
from pydantic import BaseModel
from typing import List
class ModelConfig(BaseModel):
type: str
api_base: str
model_name: str
api_key: str
class AgentConfig(BaseModel):
name: str
code: str
role: str
prompt_template: str
skills: List[str] = []
class SkillConfig(BaseModel):
code: str
name: str
description: str
instruction: str
class Settings(BaseModel):
company: str = "公司"
max_messages: int = 50
from app.hooks.base import Hook, HookRegistry
from app.hooks.post_reply import PostReplyHook
__all__ = ["Hook", "HookRegistry", "PostReplyHook"]
from abc import ABC, abstractmethod
from typing import Any, Dict, Optional
class Hook(ABC):
"""Base class for all hooks"""
def __init__(self, name: str):
self.name = name
@abstractmethod
async def execute(
self,
context: Dict[str, Any],
**kwargs
) -> Optional[Any]:
"""Execute the hook with given context and additional arguments."""
pass
class HookRegistry:
"""Registry for managing hooks"""
def __init__(self):
self._hooks: Dict[str, Hook] = {}
def register(self, hook: Hook) -> None:
self._hooks[hook.name] = hook
def get(self, name: str) -> Optional[Hook]:
return self._hooks.get(name)
def list_hooks(self) -> list[str]:
return list(self._hooks.keys())
import re
from typing import Any, Dict, Optional, Protocol
from app.hooks.base import Hook
class IMSender(Protocol):
"""Protocol for IM service — implementation in Task 5"""
async def send_message(
self, account: str, content: str, room_id: str, mentioned_list: list[str]
) -> Dict[str, Any]:
...
class PostReplyHook(Hook):
"""Hook triggered after agent generates a reply, sends it via IM"""
def __init__(
self,
im_service: IMSender,
account_mapping: Dict[str, str]
):
super().__init__("post_reply")
self.im_service = im_service
self.account_mapping = account_mapping
async def execute(
self,
context: Dict[str, Any],
**kwargs
) -> Optional[Dict[str, Any]]:
agent_name = context.get("agent_name")
response_content = context.get("response_content")
room_id = context.get("room_id")
mentioned_list = context.get("mentioned_list", [])
if not agent_name or not response_content:
return None
bot_account = self.account_mapping.get(agent_name)
if not bot_account:
return None
clean_content = self._strip_thinking_blocks(response_content)
if not clean_content:
return None
result = await self.im_service.send_message(
account=bot_account,
content=clean_content,
room_id=room_id,
mentioned_list=mentioned_list
)
return result
def _strip_thinking_blocks(self, content: str) -> str:
"""Remove thinking/tool_use blocks, keep only natural language."""
patterns = [
r'\s*<thinking>.*?</thinking>\s*',
r'\s*\[TOOL_USE\].*?\[/TOOL_USE\]\s*',
r'\s*```tool.*?```\s*',
]
result = content
for pattern in patterns:
result = re.sub(pattern, '', result, flags=re.DOTALL)
return result.strip()
from fastapi import FastAPI
from app.api.v1.router import api_router
from app.config.loader import ConfigLoader
from app.service.session_service import SessionService
from app.service.im_service import IMService
from app.service.agent_hub import AgentHub
from app.infrastructure.database import SessionLocal
app = FastAPI(title="Agent管理后台 API", version="1.0.0")
app.include_router(api_router)
agent_hub_instance = None
@app.on_event("startup")
async def startup_event():
global agent_hub_instance
config_loader = ConfigLoader()
db = SessionLocal()
session_service = SessionService(db)
im_service = IMService(
base_url="http://localhost:8080",
api_key="your-api-key"
)
agent_hub_instance = AgentHub(
config_loader=config_loader,
session_service=session_service,
im_service=im_service
)
@app.on_event("shutdown")
async def shutdown_event():
global agent_hub_instance
if agent_hub_instance:
await agent_hub_instance.close()
@app.get("/health")
def health_check():
return {"status": "ok"}
\ No newline at end of file
return {"status": "ok"}
from app.model.agent import Agent, AgentPosition, AgentSkill, AgentStatus
from app.model.session import Session, SessionMessage, SessionStatus
__all__ = [
"Agent", "AgentPosition", "AgentSkill", "AgentStatus",
"Session", "SessionMessage", "SessionStatus"
]
from sqlalchemy import Column, Integer, String, Text, DateTime, Boolean, ForeignKey, Enum, func
from sqlalchemy.orm import relationship
from app.infrastructure.database import Base
import enum
class SessionStatus(str, enum.Enum):
active = "active"
archived = "archived"
class Session(Base):
__tablename__ = "ai_sessions"
id = Column(Integer, primary_key=True, index=True)
session_id = Column(String(100), nullable=False, unique=True, index=True)
room_id = Column(String(100), nullable=False)
user_id = Column(String(100), nullable=False)
channel = Column(String(50), default="wechat_group")
current_agent_code = Column(String(50))
status = Column(Enum(SessionStatus), default=SessionStatus.active)
is_deleted = Column(Boolean, default=False)
created_at = Column(DateTime, server_default=func.now(), nullable=False)
updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now(), nullable=False)
messages = relationship("SessionMessage", back_populates="session", cascade="all, delete-orphan")
class SessionMessage(Base):
__tablename__ = "ai_session_messages"
id = Column(Integer, primary_key=True, index=True)
session_id = Column(Integer, ForeignKey("ai_sessions.id", ondelete="CASCADE"), nullable=False)
role = Column(String(20), nullable=False)
content = Column(Text, nullable=False)
agent_code = Column(String(50))
intent = Column(String(50))
created_at = Column(DateTime, server_default=func.now(), nullable=False)
session = relationship("Session", back_populates="messages")
from app.schema.agent import AgentCreate, AgentUpdate, AgentStatusUpdate, AgentDetailResponse
from app.schema.session import SessionResponse, MessageSchema
__all__ = [
"AgentCreate", "AgentUpdate", "AgentStatusUpdate", "AgentDetailResponse",
"SessionResponse", "MessageSchema"
]
from pydantic import BaseModel, ConfigDict
from typing import List, Literal, Optional
from datetime import datetime
class MessageSchema(BaseModel):
role: str
content: str
agent_code: Optional[str] = None
intent: Optional[str] = None
created_at: datetime
model_config = ConfigDict(from_attributes=True)
class SessionResponse(BaseModel):
session_id: str
room_id: str
user_id: str
channel: str = "wechat_group"
current_agent_code: Optional[str] = None
status: Literal["active", "archived"]
messages: List[MessageSchema] = []
message_count: int
model_config = ConfigDict(from_attributes=True)
from app.service.agent_service import AgentService
from app.service.session_service import SessionService
from app.service.im_service import IMService, IMServiceError
from app.service.agent_hub import AgentHub, AgentHubError
__all__ = ["AgentService", "SessionService", "IMService", "IMServiceError", "AgentHub", "AgentHubError"]
import time
import httpx
from typing import Dict, List, Optional, Any
from app.config.loader import ConfigLoader
from app.config.settings import AgentConfig, SkillConfig, ModelConfig
from app.service.session_service import SessionService
from app.hooks.post_reply import PostReplyHook
class AgentHubError(Exception):
"""Raised when AgentHub processing fails."""
pass
class AgentHub:
"""
中央调度器 - 唯一运行的 Agent 运行时
持有所有 Agent 的配置,负责:
1. 提示词组装
2. 模型调用
3. 消息路由和分发
4. 通过 Hook 发送消息
"""
def __init__(
self,
config_loader: ConfigLoader,
session_service: SessionService,
im_service,
):
self.config_loader = config_loader
self.session_service = session_service
self.agents = config_loader.load_agents()
self.skills = config_loader.load_skills()
self.main_model_config = config_loader.load_models()["main"]
agent_to_account, account_to_agent = config_loader.load_account_mappings()
self.agent_to_account = agent_to_account
self.account_to_agent = account_to_agent
self.post_reply_hook = PostReplyHook(
im_service=im_service,
account_mapping=agent_to_account
)
self._model_client: Optional[httpx.AsyncClient] = None
@property
def model_client(self) -> httpx.AsyncClient:
if self._model_client is None:
self._model_client = httpx.AsyncClient(timeout=60.0)
return self._model_client
def _build_main_prompt(self, context: Dict[str, Any]) -> str:
"""
Build the main agent's prompt including ALL sub-agent duty descriptions.
The main agent uses this to judge intent and decide whether to route.
"""
main_agent = self.agents.get("main")
if not main_agent:
raise AgentHubError("主 Agent 配置未找到")
# Collect duties from sub-agents (all except main)
duty_lines = []
for code, agent in self.agents.items():
if code != "main":
duty_lines.append(f"- {agent.name}({agent.role}): {agent.prompt_template}")
duties_text = "\n".join(duty_lines) if duty_lines else "暂无子Agent"
# Build skills summary
skill_lines = []
for code, skill in self.skills.items():
skill_lines.append(f"- **{skill.name}**({code}): {skill.instruction}")
skills_text = "\n".join(skill_lines) if skill_lines else "暂无可用技能"
prompt = main_agent.prompt_template.format(
company="公司",
duties=duties_text,
skills=skills_text
)
return prompt
def _build_sub_agent_prompt(self, agent_code: str, context: Dict[str, Any]) -> str:
"""Build prompt for a sub-agent when handling a routed query."""
agent = self.agents.get(agent_code)
if not agent:
raise AgentHubError(f"Agent {agent_code} 配置未找到")
# Build duties from ALL agents (for context)
duty_lines = []
for code, a in self.agents.items():
duty_lines.append(f"- {a.name}({a.role})")
# Build skills for THIS agent
skill_lines = []
for skill_code in agent.skills:
skill = self.skills.get(skill_code)
if skill:
skill_lines.append(f"- **{skill.name}**({skill_code}): {skill.instruction}")
skills_text = "\n".join(skill_lines) if skill_lines else "暂无专用技能"
prompt = agent.prompt_template.format(
company="公司",
duties="\n".join(duty_lines),
skills=skills_text
)
return prompt
def _build_history_section(self, messages: List) -> str:
"""Build conversation history section from recent messages."""
if not messages:
return "(暂无历史对话)"
lines = []
recent = messages[-10:]
for msg in recent:
role_label = "用户" if msg.role == "user" else f"助手({msg.agent_code or 'main'})"
content = msg.content[:500] if msg.content else ""
lines.append(f"[{role_label}]: {content}")
return "\n".join(lines)
async def process_message(
self,
session_id: str,
room_id: str,
user_id: str,
user_query: str,
mentioned_agent_code: Optional[str] = None,
channel: str = "wechat_group",
file_url: Optional[str] = None
) -> Dict[str, Any]:
"""
Process a user message end-to-end.
Flow:
1. Get or create session
2. Load conversation history
3. If @mentioned a specific agent → route directly
4. Otherwise → main agent judges intent
5. If intent is "route" → sub-agent handles
6. Send reply via post_reply hook
"""
start_time = time.time()
session = self.session_service.get_or_create_session(
session_id=session_id,
room_id=room_id,
user_id=user_id,
channel=channel
)
messages = self.session_service.get_session_messages(session.id)
# Determine target agent and routing reason
if mentioned_agent_code and mentioned_agent_code in self.agents:
target_agent = mentioned_agent_code
routing_reason = "mention"
elif session.current_agent_code and session.current_agent_code in self.agents:
target_agent = session.current_agent_code
routing_reason = "inheritance"
else:
target_agent = "main"
routing_reason = "default"
context = {
"user_query": user_query,
"messages": messages,
"room_id": room_id,
"user_id": user_id
}
# Build prompt based on target agent
if target_agent == "main":
system_prompt = self._build_main_prompt(context)
else:
system_prompt = self._build_sub_agent_prompt(target_agent, context)
history_section = self._build_history_section(messages)
full_prompt = f"{system_prompt}\n\n## 对话历史\n{history_section}\n\n## 用户问题\n{user_query}"
response_content = await self._call_model(full_prompt)
# Store messages
self.session_service.add_message(
db_session_id=session.id,
role="user",
content=user_query,
agent_code=mentioned_agent_code or "main"
)
self.session_service.add_message(
db_session_id=session.id,
role="assistant",
content=response_content,
agent_code=target_agent
)
if target_agent != "main":
self.session_service.update_current_agent(session.id, target_agent)
# Send via hook
await self.post_reply_hook.execute({
"agent_name": target_agent,
"response_content": response_content,
"room_id": room_id,
"mentioned_list": [user_id]
})
processing_time_ms = (time.time() - start_time) * 1000
return {
"session_id": session.session_id,
"response_agent_code": target_agent,
"response_content": response_content,
"routing_reason": routing_reason,
"processing_time_ms": round(processing_time_ms, 2)
}
async def _call_model(self, prompt: str) -> str:
"""Call the shared model with the assembled prompt."""
headers = {
"Authorization": f"Bearer {self.main_model_config.api_key}",
"Content-Type": "application/json"
}
payload = {
"model": self.main_model_config.model_name,
"messages": [{"role": "user", "content": prompt}],
"temperature": 0.7
}
try:
response = await self.model_client.post(
f"{self.main_model_config.api_base}/chat/completions",
json=payload,
headers=headers
)
response.raise_for_status()
result = response.json()
return result["choices"][0]["message"]["content"]
except httpx.HTTPStatusError as e:
raise AgentHubError(f"模型API返回错误: {e.response.status_code}")
except httpx.RequestError as e:
raise AgentHubError(f"模型API请求失败: {e}")
except (KeyError, IndexError) as e:
raise AgentHubError(f"模型返回格式异常: {e}")
async def close(self):
"""Clean up resources."""
if self._model_client is not None:
await self._model_client.aclose()
self._model_client = None
from typing import Dict, List, Any, Optional
import httpx
class IMServiceError(Exception):
"""Raised when IM service API call fails."""
pass
class IMService:
"""Service for sending messages via IM (自建服务)"""
def __init__(self, base_url: str, api_key: Optional[str] = None):
self.base_url = base_url.rstrip("/")
self.api_key = api_key
self._client: Optional[httpx.AsyncClient] = None
@property
def client(self) -> httpx.AsyncClient:
if self._client is None:
self._client = httpx.AsyncClient(timeout=30.0)
return self._client
async def send_message(
self,
account: str,
content: str,
room_id: str,
mentioned_list: List[str] = None
) -> Dict[str, Any]:
payload = {
"account": account,
"content": content,
"room_id": room_id,
"mentioned_list": mentioned_list or []
}
headers = {"Content-Type": "application/json"}
if self.api_key:
headers["Authorization"] = f"Bearer {self.api_key}"
try:
response = await self.client.post(
f"{self.base_url}/api/send_message",
json=payload,
headers=headers
)
response.raise_for_status()
return response.json()
except httpx.HTTPStatusError as e:
raise IMServiceError(f"IM服务返回错误: {e.response.status_code} - {e.response.text}")
except httpx.RequestError as e:
raise IMServiceError(f"IM服务请求失败: {e}")
async def close(self):
if self._client is not None:
await self._client.aclose()
self._client = None
import uuid
from sqlalchemy.orm import Session as DbSession
from sqlalchemy import exc as sa_exc
from typing import List, Optional
from app.model.session import Session as SessionModel, SessionMessage, SessionStatus
from app.schema.session import SessionResponse, MessageSchema
class SessionService:
MAX_MESSAGES = 50
def __init__(self, db: DbSession):
self.db = db
def get_or_create_session(
self,
session_id: str,
room_id: str,
user_id: str,
channel: str = "wechat_group"
) -> SessionModel:
session = self.db.query(SessionModel).filter(
SessionModel.session_id == session_id,
SessionModel.is_deleted == False
).first()
if not session:
session = SessionModel(
session_id=session_id or f"sess_{uuid.uuid4().hex[:16]}",
room_id=room_id,
user_id=user_id,
channel=channel,
status=SessionStatus.active
)
self.db.add(session)
try:
self.db.commit()
except sa_exc.IntegrityError:
self.db.rollback()
session = self.db.query(SessionModel).filter(
SessionModel.session_id == session_id,
SessionModel.is_deleted == False
).first()
if not session:
raise RuntimeError(f"无法创建或获取会话: {session_id}")
self.db.refresh(session)
return session
def add_message(
self,
db_session_id: int,
role: str,
content: str,
agent_code: Optional[str] = None,
intent: Optional[str] = None
) -> SessionMessage:
session = self.get_session(db_session_id)
if not session:
raise ValueError(f"会话不存在: id={db_session_id}")
message = SessionMessage(
session_id=db_session_id,
role=role,
content=content,
agent_code=agent_code,
intent=intent
)
self.db.add(message)
self.db.commit()
self.db.refresh(message)
self._trim_messages(db_session_id)
return message
def get_session_messages(
self,
db_session_id: int,
limit: int = 50
) -> List[SessionMessage]:
return self.db.query(SessionMessage).join(
SessionModel, SessionModel.id == SessionMessage.session_id
).filter(
SessionMessage.session_id == db_session_id,
SessionModel.is_deleted == False
).order_by(SessionMessage.created_at.asc()).limit(limit).all()
def get_session(self, db_session_id: int) -> Optional[SessionModel]:
return self.db.query(SessionModel).filter(
SessionModel.id == db_session_id,
SessionModel.is_deleted == False
).first()
def get_session_by_uuid(self, session_uuid: str) -> Optional[SessionModel]:
return self.db.query(SessionModel).filter(
SessionModel.session_id == session_uuid,
SessionModel.is_deleted == False
).first()
def update_current_agent(self, db_session_id: int, agent_code: str) -> None:
session = self.get_session(db_session_id)
if session:
session.current_agent_code = agent_code
self.db.commit()
def _trim_messages(self, db_session_id: int) -> None:
keep_ids = self.db.query(SessionMessage.id).filter(
SessionMessage.session_id == db_session_id
).order_by(SessionMessage.created_at.desc()).limit(
self.MAX_MESSAGES
).all()
keep_id_list = [row[0] for row in keep_ids]
if keep_id_list:
self.db.query(SessionMessage).filter(
SessionMessage.session_id == db_session_id,
~SessionMessage.id.in_(keep_id_list)
).delete(synchronize_session=False)
else:
self.db.query(SessionMessage).filter(
SessionMessage.session_id == db_session_id
).delete(synchronize_session=False)
self.db.commit()
def to_response(self, session: SessionModel) -> SessionResponse:
messages = self.get_session_messages(session.id)
return SessionResponse(
session_id=session.session_id,
room_id=session.room_id,
user_id=session.user_id,
channel=session.channel or "wechat_group",
current_agent_code=session.current_agent_code,
status=session.status.value,
messages=[MessageSchema.model_validate(m) for m in messages],
message_count=len(messages)
)
{
"agents": {
"main": {
"name": "主 Agent",
"code": "main",
"role": "coordinator",
"prompt_template": "你是{company}的智能助手,负责协调各个岗位Agent协作回答用户问题。当用户的问题属于某个特定岗位的职责范围时,请将问题分发给对应的Agent处理。以下是各个岗位Agent的职责描述:\n{duties}\n\n可用的技能包括:\n{skills}\n\n请以专业、友好的态度回答用户问题。如果问题不属于任何岗位Agent的职责范围,请直接回答。",
"skills": []
},
"meeting": {
"name": "会议纪要 Agent",
"code": "meeting",
"role": "会议纪要助手",
"prompt_template": "你是{company}的会议纪要助手,职责包括:{duties}。你的技能包括:{skills}。请根据用户的需求,帮助处理会议纪要相关的任务。",
"skills": ["meeting_minutes"]
}
}
}
{
"agent_accounts": {
"main": "bot_main_001",
"meeting": "bot_meeting_001"
},
"account_agents": {
"bot_main_001": "main",
"bot_meeting_001": "meeting"
}
}
{
"models": {
"main": {
"type": "openai_compatible",
"api_base": "https://api.minimaxi.com/v1",
"model_name": "MiniMax-M2.7",
"api_key": "sk-cp-22oeMKkLNyEJZY05vB9Bto-vjO45S_2mLVDzf4Q6hoI65k4Dc93Xz6MSgd1pzZDnWshXU4xEEBjs_cWjCLo1vfrcE9QpOUu287fnnYIPUt3sDp3uetzf5Z8"
},
"summary": {
"type": "openai_compatible",
"api_base": "https://api.minimaxi.com/v1",
"model_name": "MiniMax-M2.7",
"api_key": "sk-cp-22oeMKkLNyEJZY05vB9Bto-vjO45S_2mLVDzf4Q6hoI65k4Dc93Xz6MSgd1pzZDnWshXU4xEEBjs_cWjCLo1vfrcE9QpOUu287fnnYIPUt3sDp3uetzf5Z8"
}
}
}
{
"skills": {
"meeting_minutes": {
"code": "meeting_minutes",
"name": "会议纪要管理",
"description": "创建、查询和管理会议纪要,包括记录会议内容、提取行动项、生成会议摘要",
"instruction": "当用户询问会议纪要、会议记录、会议总结相关问题时使用此技能"
}
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!