Replies: 2 comments
-
|
Anthropic skills are designed for their native API format, which differs from Agno tools. Why it fails: Solution: Adapt Anthropic skills to Agno tools from agno.tools import tool
import json
# Load Anthropic skill definition
with open("anthropic_skill.json") as f:
skill_def = json.load(f)
# Convert to Agno tool
@tool
def adapted_skill(**kwargs):
"""Adapted from Anthropic skill."""
# Map Agno input to Anthropic format
anthropic_input = {
"name": skill_def["name"],
"input": kwargs
}
# Execute skill logic
result = execute_skill_logic(anthropic_input)
return resultFor PPTX generation specifically: from agno.tools import tool
from pptx import Presentation
@tool
def create_pptx(title: str, slides: list) -> str:
"""Create a PowerPoint presentation."""
prs = Presentation()
for slide_content in slides:
slide = prs.slides.add_slide(prs.slide_layouts[1])
slide.shapes.title.text = slide_content["title"]
slide.placeholders[1].text = slide_content["body"]
path = f"/tmp/{title}.pptx"
prs.save(path)
return pathAlternative: Use Anthropic API directly from anthropic import Anthropic
client = Anthropic()
response = client.messages.create(
model="claude-3-opus",
tools=anthropic_skills, # Native format
messages=[...]
)We integrate multiple skill formats at Revolution AI — adapting to Agno tools gives you better control. |
Beta Was this translation helpful? Give feedback.
-
|
Anthropic skills not executing in Agno — let's debug: 1. Check skill registration from agno import Agent
from agno.skills import AnthropicSkills
agent = Agent(
skills=[AnthropicSkills()], # Make sure this is included
model="claude-3"
)
# Verify skills loaded
print(agent.available_skills)2. Verify API keys export ANTHROPIC_API_KEY="sk-ant-..."
# Check it's set
echo $ANTHROPIC_API_KEY3. Check skill format # Anthropic skills expect specific format
skill_input = {
"type": "tool_use",
"name": "skill_name",
"input": {...}
}4. Debug mode import logging
logging.basicConfig(level=logging.DEBUG)
# Run agent and check logs
agent.run("Use the skill...")5. Version compatibility pip show agno anthropic
# Make sure versions are compatibleCommon issues:
We integrate Anthropic skills at RevolutionAI. What specific skill and error message? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
When using Anthropics' skills with Agno Agent, the skills fail to execute properly. I provided the pptx from https://github.com/anthropics/skills to the agent, but it cannot execute correctly. Is there incompatibility with Anthropics' skills?
Beta Was this translation helpful? Give feedback.
All reactions