mirror of
https://github.com/magnus919/agent-skills.git
synced 2026-09-17 06:26:31 +03:00
Greenfield SkillOpt: 3 epochs for CrewAI skill. Role/Goal/Backstory agent model, sequential/hierarchical processes. 11 files: SKILL.md, 6 references, 3 templates, 1 script.
817 B
817 B
CrewAI Callbacks
Step Callback
Called after each agent step:
def on_step(agent, task, step_output):
print(f"[{agent.role}] Step completed: {step_output[:100]}...")
agent = Agent(
role="Researcher",
goal="Find information",
backstory="Expert researcher",
step_callback=on_step,
)
Task Callback
Called after task completion:
def on_task_complete(task, output):
print(f"[{task.agent.role}] Task '{task.description[:50]}...' complete")
task = Task(
description="Research the topic",
expected_output="Research brief",
agent=researcher,
callback=on_task_complete,
)
Use Cases
- Logging agent decisions for debugging
- Monitoring token usage per agent
- Sending progress updates to a dashboard
- Early stopping if output quality drops