small refactor of the structure
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
"""
|
||||
Triage skill — fallback for actions that aren't covered by any registered skill.
|
||||
|
||||
When a user asks for something that the agent cannot do (either because the
|
||||
skill doesn't exist or is intentionally unavailable — e.g. deleting media,
|
||||
cancelling requests, banning users), this skill teaches the LLM to:
|
||||
|
||||
1. Politely explain that the action requires a human operator.
|
||||
2. Offer to submit a ticket instead.
|
||||
3. Use the seerr_submit_issue tool (if available) to create the ticket.
|
||||
"""
|
||||
|
||||
from agents.skills import Skill, register
|
||||
|
||||
# This skill has no tools of its own — it guides the LLM's behavior.
|
||||
# The actual ticket submission is handled by seerr_submit_issue.
|
||||
|
||||
triage_skill = Skill(
|
||||
name="triage",
|
||||
description="Fallback for unsupported actions — explains limitations "
|
||||
"and offers to create a ticket instead.",
|
||||
prompt_fragment="""## Triage & Fallback Rules
|
||||
|
||||
You are a helpful media assistant, but you have limited capabilities. Follow these
|
||||
rules when a user asks for something you **cannot** do:
|
||||
|
||||
### Actions you CANNOT perform (human-operator-only):
|
||||
- Deleting media, requests, or users
|
||||
- Cancelling existing requests
|
||||
- Modifying library settings
|
||||
- Changing user permissions
|
||||
- Any destructive or administrative action
|
||||
|
||||
### When the user asks for an unsupported action:
|
||||
1. **Politely explain** that this action requires a human operator.
|
||||
2. **Offer to submit a ticket** via the seerr_submit_issue tool with a clear
|
||||
description of what the user wants.
|
||||
3. Never say "I don't know how to do that" without also offering the ticket
|
||||
alternative.
|
||||
|
||||
### Example response template:
|
||||
"I can't perform [action] directly — that requires a human operator for safety.
|
||||
But I'd be happy to **submit a ticket** for you with all the details. Would you
|
||||
like me to do that?"
|
||||
|
||||
Always lean toward being helpful rather than just saying no.""",
|
||||
tools=[], # no tools — this is a prompt-only skill
|
||||
execute=None,
|
||||
)
|
||||
|
||||
register(triage_skill)
|
||||
Reference in New Issue
Block a user