什么是 Skill在 Agno 框架中Skill技能是一种为 AI Agent 提供结构化领域专业知识的机制。通过指令Instructions、脚本Scripts和参考文档ReferencesSkill 将特定领域的知识和能力打包成可重用的模块。Agno Skills 基于Anthropic 的 Agent Skills 规范是一种标准化的技能定义方式使 Agent 能够逐步发现技能在系统提示中看到技能摘要按需加载指令当任务匹配时加载完整的技能指导访问参考文档根据需要查阅详细的技术文档执行脚本运行技能中包含的可执行代码Skill 的核心组成my-skill/ ├── SKILL.md # 必需带有 YAML frontmatter 的指令文件 ├── scripts/ # 可选可执行脚本 │ └── helper.py └── references/ # 可选参考文档 └── guide.mdagno加载使用Skill目录结构SKILL.md内容如下--- name: weather description: Get current weather and forecasts (no API key required). metadata: {clawdbot:{emoji:️,requires:{bins:[curl]}}} --- # Weather Two free services, no API keys needed. ## wttr.in (primary) Quick one-liner: bash curl -s wttr.in/London?format3 # Output: London: ⛅️ 8°C Compact format: bash curl -s wttr.in/London?format%l:%c%t%h%w # Output: London: ⛅️ 8°C 71% ↙5km/h Full forecast: bash curl -s wttr.in/London?T Format codes: %c condition · %t temp · %h humidity · %w wind · %l location · %m moon Tips: - URL-encode spaces: wttr.in/NewYork - Airport codes: wttr.in/JFK - Units: ?m (metric) ?u (USCS) - Today only: ?1 · Current only: ?0 - PNG: curl -s wttr.in/Berlin.png -o /tmp/weather.png ## Open-Meteo (fallback, JSON) Free, no key, good for programmatic use: bash curl -s https://api.open-meteo.com/v1/forecast?latitude51.5longitude-0.12current_weathertrue Find coordinates for a city, then query. Returns JSON with temp, windspeed, weathercode. Docs: https://open-meteo.com/en/docsskill_simple.py内容如下from agno.agent import Agent from agno.skills import LocalSkills, Skills from dotenv import load_dotenv from agno.models.dashscope import DashScope load_dotenv() dash_scope DashScope( idqwen-vl-plus, base_urlhttps://dashscope.aliyuncs.com/compatible-mode/v1 ) agent Agent( name简单AI助手, role简单AI助手, modeldash_scope, description一个简单的AI助手, instructions[ 你是一个简单的AI助手, 你可以回答简单的问题, ], skillsSkills( loaders[ #加载技能 LocalSkills(/Users/apple/workspace-dev/agno-learn/src/skills_demo/skills) ] ) ) if __name__ __main__: resp agent.print_response(北京今天的天气怎么样, markdownTrue) print(resp.content)
agno-7-skills
发布时间:2026/7/8 2:55:36
什么是 Skill在 Agno 框架中Skill技能是一种为 AI Agent 提供结构化领域专业知识的机制。通过指令Instructions、脚本Scripts和参考文档ReferencesSkill 将特定领域的知识和能力打包成可重用的模块。Agno Skills 基于Anthropic 的 Agent Skills 规范是一种标准化的技能定义方式使 Agent 能够逐步发现技能在系统提示中看到技能摘要按需加载指令当任务匹配时加载完整的技能指导访问参考文档根据需要查阅详细的技术文档执行脚本运行技能中包含的可执行代码Skill 的核心组成my-skill/ ├── SKILL.md # 必需带有 YAML frontmatter 的指令文件 ├── scripts/ # 可选可执行脚本 │ └── helper.py └── references/ # 可选参考文档 └── guide.mdagno加载使用Skill目录结构SKILL.md内容如下--- name: weather description: Get current weather and forecasts (no API key required). metadata: {clawdbot:{emoji:️,requires:{bins:[curl]}}} --- # Weather Two free services, no API keys needed. ## wttr.in (primary) Quick one-liner: bash curl -s wttr.in/London?format3 # Output: London: ⛅️ 8°C Compact format: bash curl -s wttr.in/London?format%l:%c%t%h%w # Output: London: ⛅️ 8°C 71% ↙5km/h Full forecast: bash curl -s wttr.in/London?T Format codes: %c condition · %t temp · %h humidity · %w wind · %l location · %m moon Tips: - URL-encode spaces: wttr.in/NewYork - Airport codes: wttr.in/JFK - Units: ?m (metric) ?u (USCS) - Today only: ?1 · Current only: ?0 - PNG: curl -s wttr.in/Berlin.png -o /tmp/weather.png ## Open-Meteo (fallback, JSON) Free, no key, good for programmatic use: bash curl -s https://api.open-meteo.com/v1/forecast?latitude51.5longitude-0.12current_weathertrue Find coordinates for a city, then query. Returns JSON with temp, windspeed, weathercode. Docs: https://open-meteo.com/en/docsskill_simple.py内容如下from agno.agent import Agent from agno.skills import LocalSkills, Skills from dotenv import load_dotenv from agno.models.dashscope import DashScope load_dotenv() dash_scope DashScope( idqwen-vl-plus, base_urlhttps://dashscope.aliyuncs.com/compatible-mode/v1 ) agent Agent( name简单AI助手, role简单AI助手, modeldash_scope, description一个简单的AI助手, instructions[ 你是一个简单的AI助手, 你可以回答简单的问题, ], skillsSkills( loaders[ #加载技能 LocalSkills(/Users/apple/workspace-dev/agno-learn/src/skills_demo/skills) ] ) ) if __name__ __main__: resp agent.print_response(北京今天的天气怎么样, markdownTrue) print(resp.content)