Files
hack/tools/scripts/llm-key-hunter/results/_cache/content/bcefghj_multi-agent-meeting-assistant.json
T

1 line
7.7 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{"repo": "bcefghj/multi-agent-meeting-assistant", "files": {".env.example": {"dbb721ce896829cd38ed2310326231323d732bef": {"t": 1785604099.0141478, "n": 1120, "h": "c0f2d6c95b69d0c0", "c": "# ============================================\n# 多Agent智能会议助手系统 - 环境变量配置模板\n# 复制此文件为 .env 并填入真实值\n# cp .env.example .env\n# ============================================\n\n# ---------- LLM API ----------\n# MiniMax API (推荐,支持中文)\nMINIMAX_API_KEY=your_minimax_api_key_here\nMINIMAX_GROUP_ID=your_group_id_here\nMINIMAX_MODEL=abab6.5s-chat\n\n# OpenAI API (备选)\nOPENAI_API_KEY=your_openai_api_key_here\nOPENAI_MODEL=gpt-4o\n\n# ---------- 语音转写 ----------\n# Whisper 配置\nWHISPER_MODEL_SIZE=large-v2\nWHISPER_LANGUAGE=zh\nWHISPER_DEVICE=cuda\n\n# ---------- Jira 集成 ----------\nJIRA_SERVER=https://your-company.atlassian.net\nJIRA_EMAIL=your_email@company.com\nJIRA_API_TOKEN=your_jira_api_token\nJIRA_PROJECT_KEY=MEET\n\n# ---------- 飞书集成 ----------\nFEISHU_APP_ID=your_feishu_app_id\nFEISHU_APP_SECRET=your_feishu_app_secret\nFEISHU_WEBHOOK_URL=https://open.feishu.cn/open-apis/bot/v2/hook/your_webhook_token\n\n# ---------- 数据库 ----------\nDATABASE_URL=postgresql://postgres:password@localhost:5432/meeting_assistant\nREDIS_URL=redis://localhost:6379/0\n\n# ---------- 服务配置 ----------\nSERVER_HOST=0.0.0.0\nSERVER_PORT=8000\nWEBSOCKET_PORT=8001\nLOG_LEVEL=INFO\n"}}, "python/src/integrations/minimax_client.py": {"53ccea64570980d2b7acca18ada91cf395079b8f": {"t": 1785674030.3280056, "n": 3104, "h": "649e3a9ab060ca35", "c": "\"\"\"MiniMax LLM 客户端 - 支持 M2.7 模型调用\"\"\"\n\nfrom __future__ import annotations\n\nimport json\nimport os\nfrom typing import Any\n\nimport httpx\nfrom loguru import logger\nfrom tenacity import retry, stop_after_attempt, wait_exponential\n\n\nclass MiniMaxClient:\n \"\"\"\n MiniMax API 客户端\n\n 支持 MiniMax M2.7 模型,兼容 OpenAI 接口格式。\n 文档: https://platform.minimaxi.com/document/guides/chat-model/chat/api\n \"\"\"\n\n BASE_URL = \"https://api.minimax.chat/v1\"\n\n def __init__(\n self,\n api_key: str | None = None,\n group_id: str | None = None,\n model: str = \"abab6.5s-chat\",\n ):\n self.api_key = api_key or os.getenv(\"MINIMAX_API_KEY\", \"\")\n self.group_id = group_id or os.getenv(\"MINIMAX_GROUP_ID\", \"\")\n self.model = model\n self._client = httpx.AsyncClient(\n timeout=60.0,\n headers={\"Authorization\": f\"Bearer {self.api_key}\"},\n )\n\n @retry(stop=stop_after_attempt(3), wait=wait_exponential(min=1, max=10))\n async def chat(\n self,\n messages: list[dict[str, str]],\n temperature: float = 0.7,\n max_tokens: int = 4096,\n response_format: dict | None = None,\n ) -> str:\n \"\"\"\n 调用 MiniMax 聊天接口\n\n Args:\n messages: 消息列表 [{\"role\": \"user\", \"content\": \"...\"}]\n temperature: 温度参数\n max_tokens: 最大生成token数\n response_format: 输出格式约束 (如 {\"type\": \"json_object\"})\n\n Returns:\n 模型生成的文本\n \"\"\"\n payload: dict[str, Any] = {\n \"model\": self.model,\n \"messages\": messages,\n \"temperature\": temperature,\n \"max_tokens\": max_tokens,\n }\n if response_format:\n payload[\"response_format\"] = response_format\n\n url = f\"{self.BASE_URL}/text/chatcompletion_v2\"\n if self.group_id:\n url = f\"{url}?GroupId={self.group_id}\"\n\n response = await self._client.post(url, json=payload)\n response.raise_for_status()\n\n data = response.json()\n if \"choices\" in data and len(data[\"choices\"]) > 0:\n return data[\"choices\"][0][\"message\"][\"content\"]\n\n logger.error(f\"MiniMax API unexpected response: {data}\")\n raise ValueError(f\"Unexpected API response: {data}\")\n\n async def chat_json(\n self,\n messages: list[dict[str, str]],\n temperature: float = 0.3,\n max_tokens: int = 4096,\n ) -> dict:\n \"\"\"调用聊天接口并解析 JSON 输出\"\"\"\n text = await self.chat(\n messages=messages,\n temperature=temperature,\n max_tokens=max_tokens,\n response_format={\"type\": \"json_object\"},\n )\n try:\n return json.loads(text)\n except json.JSONDecodeError:\n start = text.find(\"{\")\n end = text.rfind(\"}\") + 1\n if start >= 0 and end > start:\n return json.loads(text[start:end])\n raise\n\n async def close(self):\n await self._client.aclose()\n\n async def __aenter__(self):\n return self\n\n async def __aexit__(self, *args):\n await self.close()\n"}}, "docs/tutorial/02-first-agent.md": {"53ccea64570980d2b7acca18ada91cf395079b8f": {"t": 1785674030.6217542, "n": 1824, "h": "897b3ec8fd02a13a", "c": "# 教程 02 - 第一个 Agent\n\n> 用 30 行代码写一个最简单的 Agent\n\n---\n\n## 目标\n\n写一个能自动总结文本的 Agent。输入一段文字,Agent 调用 LLM 返回摘要。\n\n---\n\n## 代码实现\n\n创建文件 `my_first_agent.py`:\n\n```python\n\"\"\"我的第一个 Agent - 文本摘要\"\"\"\n\nimport os\nimport httpx\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nclass SummaryAgent:\n \"\"\"一个最简单的 Agent:接收文本,返回摘要\"\"\"\n\n def __init__(self):\n self.api_key = os.getenv(\"MINIMAX_API_KEY\", \"\")\n self.base_url = \"https://api.minimax.chat/v1\"\n\n def summarize(self, text: str) -> str:\n \"\"\"调用 LLM 生成摘要\"\"\"\n response = httpx.post(\n f\"{self.base_url}/text/chatcompletion_v2\",\n headers={\"Authorization\": f\"Bearer {self.api_key}\"},\n json={\n \"model\": \"abab6.5s-chat\",\n \"messages\": [\n {\"role\": \"system\", \"content\": \"你是一个摘要助手,用3句话总结用户输入的文本。\"},\n {\"role\": \"user\", \"content\": text}\n ],\n \"temperature\": 0.3,\n },\n timeout=30,\n )\n data = response.json()\n return data[\"choices\"][0][\"message\"][\"content\"]\n\n\nif __name__ == \"__main__\":\n agent = SummaryAgent()\n\n text = \"\"\"\n 今天的Q3预算评审会议讨论了三个主要议题。\n 首先,Q2预算执行率为87%,研发投入占比42%。\n 其次,Q3计划将预算上调15%,主要投入AI基础设施和人才招聘。\n 王芳建议招聘3名高级算法工程师,年薪80万。\n 最后,赵伟正在对比服务器供应商,下周一出采购方案。\n \"\"\"\n\n print(\"原文:\", text)\n print(\"\\n摘要:\", agent.summarize(text))\n```\n\n运行:\n```bash\npython my_first_agent.py\n```\n\n---\n\n## 代码解读\n\n1. **`__init__`**: 初始化 Agent,加载 API Key\n2. **`summarize`**: Agent 的核心能力——调用 LLM 生成摘要\n3. **System Prompt**: 定义 Agent 的角色和行为规则\n4. **Temperature 0.3**: 低随机性,摘要需要稳定输出\n\n---\n\n## 进化:让 Agent 更强大\n\n这只是最基础的 Agent。在后续教程中,我们将逐步添加:\n- **结构化输出**: JSON Schema 约束(教程03)\n- **多Agent协作**: LangGraph 编排(教程03)\n- **工具调用**: Jira/飞书集成(教程04)\n- **实时处理**: WebSocket + 流式(教程04)\n\n---\n\n下一篇: [03 - 多Agent编排](03-multi-agent.md)\n"}}}}