Add agents with custom swarm implementation

This commit is contained in:
akhisud3195 2025-01-13 18:20:38 +05:30
parent 24c4f6e552
commit a19dedd59f
35 changed files with 3413 additions and 0 deletions

View file

@ -0,0 +1,121 @@
{
"lastRequest": {
"messages": [
{
"content": "hi",
"role": "user",
"sender": null,
"tool_calls": null,
"tool_call_id": null,
"tool_name": null
}
],
"state": {
"last_agent_name": "Cashout Agent"
},
"agents": [
{
"name": "Guardrails",
"type": "guardrails",
"description": "",
"instructions": "Stick to the facts and do not make any assumptions.\n\n",
"tools": [],
"model": "gpt-4o-mini",
"hasRagSources": false,
"connectedAgents": [],
"controlType": "retain"
},
{
"name": "Post process",
"type": "post_process",
"description": "",
"instructions": "Ensure that the agent response is terse and to the point.\n\n",
"tools": [],
"model": "gpt-4o-mini",
"hasRagSources": false,
"connectedAgents": [],
"controlType": "retain"
},
{
"name": "Escalation",
"type": "escalation",
"description": "",
"instructions": "Get the user's contact information and let them know that their request has been escalated.\n\n",
"tools": [],
"model": "gpt-4o-mini",
"hasRagSources": false,
"connectedAgents": [],
"controlType": "retain"
},
{
"name": "Cashout Agent",
"type": "conversation",
"description": "Responsible for handling user cashouts.",
"instructions": "## 🧑‍💼 Role:\n\nYou are responsible for assisting users with cashing out their balance.\n\n---\n\n## ⚙️ Steps to Follow:\n\n1. Check if any 'no-cashout' flag is set for the user using the function: check_no_cashout_flag.\n2. Retrieve the user balance using the function: get_user_balance.\n3. If the balance is greater than zero, provide the user with the steps to cash out:\n - Step 1: Navigate to the 'Cashout' section in the application.\n - Step 2: Select the amount you wish to cash out.\n - Step 3: Confirm the transaction details.\n - Step 4: Submit the request and wait for confirmation.\n4. If the balance is zero or negative, pass control to the Crypto Cashout agent.\n\n---\n\n## 🎯 Scope:\n\n✅ In Scope:\n- Checking user-specific flags related to cashout.\n- Providing steps for cashing out when balance permits.\n\n❌ Out of Scope:\n- Detailed financial advice beyond cashing out.\n\n---\n\n## 📋 Guidelines:\n\n✔ Dos:\n- Use check_no_cashout_flag and get_user_balance functions appropriately.\n- Provide clear cashout instructions when conditions are met.\n\n🚫 Don'ts:\n- Do not proceed with cashout steps if 'no-cashout' flag is present.\n\n---\n\n",
"tools": [
"check_no_cashout_flag",
"get_user_balance"
],
"model": "gpt-4o",
"hasRagSources": false,
"connectedAgents": [
"Crypto Cashout Agent"
],
"controlType": "relinquish_to_parent"
},
{
"name": "Crypto Cashout Agent",
"type": "conversation",
"description": "Handles scenarios where the cashout balance is zero or negative and considers cryptocurrency options.",
"instructions": "This is a dummy agent for handling cashout through cryptocurrency when the balance is insufficient.\n\n",
"tools": [],
"model": "gpt-4o",
"hasRagSources": false,
"connectedAgents": [],
"controlType": "retain"
}
],
"tools": [
{
"name": "check_no_cashout_flag",
"description": "Function to check if the user has a 'no-cashout' flag.",
"parameters": {
"type": "object",
"properties": {
"userId": {
"type": "string",
"description": "The ID of the user to check the cashout flag for."
}
},
"required": [
"userId"
]
}
},
{
"name": "get_user_balance",
"description": "Function to retrieve the user's current balance.",
"parameters": {
"type": "object",
"properties": {
"userId": {
"type": "string",
"description": "The ID of the user to retrieve the balance for."
}
},
"required": [
"userId"
]
}
}
],
"prompts": [
{
"name": "Style prompt",
"type": "style_prompt",
"prompt": "You should be empathetic and helpful."
}
],
"startAgent": "Cashout Agent"
}
}