File size: 1,453 Bytes
2f85c93 6643e6e fcb1a95 6643e6e fcb1a95 98d31e7 fcb1a95 bf722a2 fcb1a95 6643e6e fcb1a95 6643e6e fcb1a95 bf722a2 fcb1a95 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
from src.manager.agent_manager import AgentManager
__all__ = ['FireAgent']
class FireAgent():
dependencies = ["ollama==0.4.7",
"pydantic==2.11.1",
"pydantic_core==2.33.0"]
inputSchema = {
"name": "FireAgent",
"description": "Fires an AI agent for you.",
"parameters": {
"type": "object",
"properties":{
"agent_name": {
"type": "string",
"description": "Name of the AI agent that is to be fired. This name cannot have spaces or special characters. It should be a single word.",
},
},
"required": ["agent_name"],
}
}
def run(self, **kwargs):
print("Running Fire Agent")
agent_name= kwargs.get("agent_name")
agent_manager = AgentManager()
try:
remaining_resource_budget, remaining_expense_budget = agent_manager.delete_agent(agent_name=agent_name)
except ValueError as e:
return {
"status": "error",
"message": f"Error occurred: {str(e)}",
"output": None
}
return {
"status": "success",
"message": "Agent successfully fired.",
"remaining_resource_budget": remaining_resource_budget,
"remaining_expense_budget": remaining_expense_budget
} |