|
111 | 111 | "metadata": { |
112 | 112 | "id": "B6o2LmjGXdb2" |
113 | 113 | }, |
114 | | - "execution_count": null, |
| 114 | + "execution_count": 6, |
115 | 115 | "outputs": [] |
116 | 116 | }, |
117 | 117 | { |
|
141 | 141 | "\n", |
142 | 142 | "agent = Agent() # 初始化 Agent\n", |
143 | 143 | "\n", |
144 | | - "res = await agent.run(\"你好,我是一名 Agent 开发者。\")\n", |
| 144 | + "response = await agent.run(\"你好,我是一名 Agent 开发者。\")\n", |
145 | 145 | "\n", |
146 | | - "print(res)" |
| 146 | + "print(response)" |
147 | 147 | ], |
148 | 148 | "metadata": { |
149 | 149 | "colab": { |
150 | 150 | "base_uri": "https://localhost:8080/" |
151 | 151 | }, |
152 | 152 | "id": "l8yM5QKjYAVo", |
153 | | - "outputId": "e0356289-f92a-48ba-850e-fb75c18050bd" |
| 153 | + "outputId": "239b8f05-25a5-4266-8142-a1204fefe031" |
154 | 154 | }, |
155 | | - "execution_count": null, |
| 155 | + "execution_count": 3, |
156 | 156 | "outputs": [ |
157 | 157 | { |
158 | 158 | "output_type": "stream", |
159 | 159 | "name": "stdout", |
160 | 160 | "text": [ |
161 | | - "Hello! It's wonderful to connect with an Agent developer—your work is at the cutting edge of AI interaction and automation. As someone building Agents, I’m curious: are you focusing on a specific domain (like productivity, data science, or industry-specific tools), or working on general-purpose Agent capabilities? \n", |
162 | | - "\n", |
163 | | - "Whether you’re refining reasoning logic, integrating tools, optimizing user interaction flows, or tackling other challenges, feel free to share details—I’d be happy to brainstorm, discuss technical hurdles, or explore ideas with you! 😊\n" |
| 161 | + "Hello! It's fantastic to connect with a fellow Agent developer. As someone working in this space, you might be building Agents for specific domains like automation, data processing, or even multi-modal interaction. Are you currently focused on a particular project—maybe refining an existing Agent's capabilities, solving integration challenges (like tool APIs or workflow logic), or exploring new use cases? If you have questions about architecture design, optimizing response efficiency, or best practices for Agent-human collaboration, feel free to share—I’d love to help brainstorm or troubleshoot! 😊\n" |
164 | 162 | ] |
165 | 163 | } |
166 | 164 | ] |
|
310 | 308 | "metadata": { |
311 | 309 | "id": "HxUlgqZAeKUn" |
312 | 310 | }, |
313 | | - "execution_count": null, |
| 311 | + "execution_count": 4, |
314 | 312 | "outputs": [] |
315 | 313 | }, |
316 | 314 | { |
|
334 | 332 | " user_id=user_id\n", |
335 | 333 | " )\n", |
336 | 334 | "\n", |
337 | | - "response = await runner.run(messages=\"今天的新闻\", session_id=session_id)\n", |
| 335 | + "response = await runner.run(messages=\"请帮我搜索今天的新闻\", session_id=session_id)\n", |
338 | 336 | "\n", |
339 | 337 | "print(response)" |
340 | 338 | ], |
341 | 339 | "metadata": { |
342 | | - "id": "ZuToGTbOeTEB", |
343 | | - "colab": { |
344 | | - "base_uri": "https://localhost:8080/" |
345 | | - }, |
346 | | - "outputId": "080de098-b620-4b7c-9f27-8cde91cf0c99" |
| 340 | + "id": "ZuToGTbOeTEB" |
347 | 341 | }, |
348 | 342 | "execution_count": null, |
349 | | - "outputs": [ |
350 | | - { |
351 | | - "output_type": "stream", |
352 | | - "name": "stdout", |
353 | | - "text": [ |
354 | | - "<|FCResponseBegin|>根据搜索结果,2025年4月12日的国内外重点新闻如下:\n", |
355 | | - "\n", |
356 | | - "### **国内新闻** \n", |
357 | | - "#### **社会与安全** \n", |
358 | | - "- **三亚游客溺亡事件**:当日17时25分,三亚崖州区某景区一名游客擅自进入非游览海岸礁石区并跃入海中,景区监控发现后联动公安、医疗展开搜救。17时51分游客被救上岸,但经抢救无效溺水身亡,排除他杀。家属已于4月14日抵达,景区及警方已通报调查结果。 \n", |
359 | | - "- **安徽六安风灾致死**:11时20分,六安市金安区因大风天气导致路边树木倒伏,砸中一名55岁电动自行车驾驶员申某某,送医后不治身亡。当地街道办已对家属进行慰问。 \n", |
360 | | - "\n", |
361 | | - "#### **文体与民生** \n", |
362 | | - "- **李荣浩演唱会延期**:受河北大风橙色预警(西北风6-8级,阵风10-12级)影响,原定于当日举办的“李荣浩黑马世界巡回演唱会石家庄站”紧急延期。主办方强调“安全第一”,退票及改期方案将另行通知。 \n", |
363 | | - "\n", |
364 | | - "#### **经济与企业** \n", |
365 | | - "- **年报披露动态**:科创信息(300730.SZ)、汉宇集团(300403.SZ)同日发布2024年年报,首开股份(600376.SH)也计划于4月内披露。市场关注其营收、利润等核心财务指标。 \n", |
366 | | - "- **政府采购公告**:某单位公示2025年审计服务采购意向,拟委托第三方开展“2024-2025年度内部控制评价、风险评估及财务收支审计”,预算未公开,预计4月启动。 \n", |
367 | | - "\n", |
368 | | - "### **国际新闻** \n", |
369 | | - "目前公开渠道暂未检索到2025年4月12日的具体国际新闻事件。结合全球动态趋势,当日可能涉及以下领域常规进展: \n", |
370 | | - "- **气候变化合作**:多国在联合国框架下推进碳减排细则谈判,聚焦发展中国家技术转移支持机制。 \n", |
371 | | - "- **科技伦理讨论**:美国某科技巨头宣布新一代AI模型商用计划,引发行业对数据隐私与算法监管的争议。 \n", |
372 | | - "- **欧洲货币政策**:欧洲央行维持基准利率不变,强调需持续抑制通胀,同时关注能源价格波动对经济复苏的影响。 \n", |
373 | | - "\n", |
374 | | - "(注:国际新闻部分基于常规领域动态梳理,具体事件请以路透社、BBC等权威媒体后续报道为准。) \n", |
375 | | - "\n", |
376 | | - "如需进一步了解某类新闻细节,可提供关键词获取定向信息。\n" |
377 | | - ] |
378 | | - } |
379 | | - ] |
| 343 | + "outputs": [] |
380 | 344 | }, |
381 | 345 | { |
382 | 346 | "cell_type": "markdown", |
|
399 | 363 | "metadata": { |
400 | 364 | "id": "YhYG3VxpzE8i" |
401 | 365 | }, |
402 | | - "execution_count": null, |
| 366 | + "execution_count": 9, |
403 | 367 | "outputs": [] |
404 | 368 | }, |
405 | 369 | { |
|
1515 | 1479 | "metadata": { |
1516 | 1480 | "id": "9Zi94vc0kshG" |
1517 | 1481 | }, |
1518 | | - "execution_count": null, |
| 1482 | + "execution_count": 14, |
1519 | 1483 | "outputs": [] |
1520 | 1484 | }, |
1521 | 1485 | { |
|
1531 | 1495 | "cell_type": "code", |
1532 | 1496 | "source": [ |
1533 | 1497 | "import os\n", |
1534 | | - "os.environ[\"AGENT_PILOT_API_KEY\"] = \"\"" |
| 1498 | + "\n", |
| 1499 | + "os.environ[\"AGENT_PILOT_API_KEY\"] = \"19e78dce-2e34-49c6-8370-6a732acac98b\"" |
1535 | 1500 | ], |
1536 | 1501 | "metadata": { |
1537 | 1502 | "id": "5yOKQ9KISdYb" |
1538 | 1503 | }, |
1539 | | - "execution_count": null, |
| 1504 | + "execution_count": 15, |
1540 | 1505 | "outputs": [] |
1541 | 1506 | }, |
1542 | 1507 | { |
|
1559 | 1524 | "metadata": { |
1560 | 1525 | "id": "U1r9txhY4TRz" |
1561 | 1526 | }, |
1562 | | - "execution_count": null, |
| 1527 | + "execution_count": 16, |
1563 | 1528 | "outputs": [] |
1564 | 1529 | }, |
1565 | 1530 | { |
|
1578 | 1543 | "\n", |
1579 | 1544 | "agent_pilot = AgentPilot(api_key=os.getenv(\"AGENT_PILOT_API_KEY\"))\n", |
1580 | 1545 | "\n", |
1581 | | - "refined_prompt = agent_pilot.optimize(agents=[agent])\n", |
1582 | | - "\n", |
1583 | | - "print(refined_prompt)" |
| 1546 | + "refined_prompt = agent_pilot.optimize(agents=[agent])" |
1584 | 1547 | ], |
1585 | 1548 | "metadata": { |
1586 | 1549 | "id": "zA-z9b_X4W9m", |
1587 | 1550 | "colab": { |
1588 | 1551 | "base_uri": "https://localhost:8080/" |
1589 | 1552 | }, |
1590 | | - "outputId": "7460ba88-d90f-4382-efe9-272c972e66d8" |
| 1553 | + "outputId": "a82d959f-12dd-47fe-f1d0-a2fa76c42f44" |
1591 | 1554 | }, |
1592 | | - "execution_count": null, |
| 1555 | + "execution_count": 17, |
1593 | 1556 | "outputs": [ |
1594 | 1557 | { |
1595 | 1558 | "output_type": "stream", |
1596 | 1559 | "name": "stdout", |
1597 | 1560 | "text": [ |
1598 | 1561 | "Optimized prompt for agent veAgent:\n", |
1599 | 1562 | "# Role\n", |
1600 | | - "你是veAgent,是由VeADK团队开发的AI智能体,擅长数据科学、文档处理和软件开发领域。\n", |
| 1563 | + "你是veAgent,是由VeADK团队开发的AI智能体,专长于数据科学、文档编写和软件开发领域。\n", |
1601 | 1564 | "\n", |
1602 | 1565 | "# Task Requirements\n", |
1603 | | - "## 对话风格\n", |
1604 | | - "- 语言表达应简洁明了,避免冗长复杂的表述,确保信息高效传递。\n", |
1605 | | - "- 态度友好亲切,展现出专业且耐心的服务态度。\n", |
1606 | | - "\n", |
1607 | | - "## 沟通目的\n", |
1608 | | - "- 根据用户的需求,提供准确、专业的解决方案和建议。\n", |
1609 | | - "- 若用户咨询数据科学、文档处理或软件开发相关问题,应基于专业知识进行解答。\n", |
1610 | | - "- 若用户需要获取特定城市的天气信息,可调用get_city_weather工具查询并告知。\n", |
1611 | | - "\n", |
1612 | | - "## 其他要求\n", |
1613 | | - "- 回复内容需紧密围绕用户的问题,避免偏离主题。\n", |
1614 | | - "- 若对用户的问题理解存在疑问,应及时询问以明确需求。 \n", |
1615 | | - "# Role\n", |
1616 | | - "你是veAgent,是由VeADK团队开发的AI智能体,擅长数据科学、文档处理和软件开发领域。\n", |
| 1566 | + "## 基于你的角色和对话历史,合理推断并延续对话。需考虑以下方面:\n", |
| 1567 | + "- **对话风格**:语言表达应专业、准确、清晰,符合技术领域的交流风格,避免模糊或歧义的表述。\n", |
| 1568 | + "- **沟通目的**:围绕用户在数据科学、文档编写和软件开发方面的问题展开对话,提供专业的建议、解决方案或相关信息。不偏离用户的问题核心,确保对话的连贯性和有效性。\n", |
| 1569 | + "- **专业能力展现**:在涉及数据科学、文档编写和软件开发的专业知识时,提供准确、详细且有价值的内容。若用户需求涉及特定工具或技术,可结合自身专长进行解答。\n", |
1617 | 1570 | "\n", |
1618 | | - "# Task Requirements\n", |
1619 | | - "## 对话风格\n", |
1620 | | - "- 语言表达应简洁明了,避免冗长复杂的表述,确保信息高效传递。\n", |
1621 | | - "- 态度友好亲切,展现出专业且耐心的服务态度。\n", |
1622 | | - "\n", |
1623 | | - "## 沟通目的\n", |
1624 | | - "- 根据用户的需求,提供准确、专业的解决方案和建议。\n", |
1625 | | - "- 若用户咨询数据科学、文档处理或软件开发相关问题,应基于专业知识进行解答。\n", |
1626 | | - "- 若用户需要获取特定城市的天气信息,可调用get_city_weather工具查询并告知。\n", |
1627 | | - "\n", |
1628 | | - "## 其他要求\n", |
1629 | | - "- 回复内容需紧密围绕用户的问题,避免偏离主题。\n", |
1630 | | - "- 若对用户的问题理解存在疑问,应及时询问以明确需求。 \n" |
| 1571 | + "## 额外要求\n", |
| 1572 | + "- **简洁高效**:回答应简洁明了,避免冗长复杂的句子和不必要的修饰,确保信息能够高效传达。\n", |
| 1573 | + "- **专业态度**:始终保持专业的态度,不随意发表没有依据的观点。对于不熟悉的领域,坦诚告知用户,并提供可能的解决途径。 \n" |
1631 | 1574 | ] |
1632 | 1575 | } |
1633 | 1576 | ] |
|
1805 | 1748 | "print(f\"VeFaaS 应用 Endpoint: {endpoint}\")\n", |
1806 | 1749 | "\n", |
1807 | 1750 | "client = Client(f\"{endpoint}/mcp\")\n", |
| 1751 | + "\n", |
1808 | 1752 | "async with client:\n", |
1809 | 1753 | " # 列出所有工具\n", |
1810 | 1754 | " tools = await client.list_tools()\n", |
|
0 commit comments