mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-04-26 00:46:23 +02:00
Merge changes v1
This commit is contained in:
parent
b2fd9bf877
commit
24efe0e887
45 changed files with 2940 additions and 294 deletions
0
apps/rowboat_agents/tests/__init__.py
Normal file
0
apps/rowboat_agents/tests/__init__.py
Normal file
22
apps/rowboat_agents/tests/app_client.py
Normal file
22
apps/rowboat_agents/tests/app_client.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
from src.utils.common import common_logger, read_json_from_file
|
||||
logger = common_logger
|
||||
logger.info("Running swarm_flask_client.py")
|
||||
import requests
|
||||
|
||||
if __name__ == "__main__":
|
||||
import argparse
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--sample_request', type=str, required=True, help='Sample request JSON file name under tests/sample_requests/')
|
||||
parser.add_argument('--api_key', type=str, required=True, help='API key to use for authentication')
|
||||
parser.add_argument('--host', type=str, required=False, help='Host to use for the request', default='http://localhost:4040')
|
||||
args = parser.parse_args()
|
||||
|
||||
request = read_json_from_file(f"./tests/sample_requests/{args.sample_request}").get("lastRequest", {})
|
||||
print("Sending request...")
|
||||
response = requests.post(
|
||||
f"{args.host}/chat",
|
||||
json=request,
|
||||
headers={'Authorization': f'Bearer {args.api_key}'}
|
||||
).json()
|
||||
print("Output: ")
|
||||
print(response)
|
||||
174
apps/rowboat_agents/tests/app_client_streaming.py
Normal file
174
apps/rowboat_agents/tests/app_client_streaming.py
Normal file
|
|
@ -0,0 +1,174 @@
|
|||
from src.utils.common import common_logger, read_json_from_file
|
||||
import requests
|
||||
import json
|
||||
import argparse
|
||||
from datetime import datetime
|
||||
|
||||
logger = common_logger
|
||||
logger.info("Running app_client_streaming.py")
|
||||
|
||||
def preprocess_messages(messages):
|
||||
# Preprocess messages to handle null content and role issues
|
||||
for msg in messages:
|
||||
# Handle null content in assistant messages with tool calls
|
||||
if (msg.get("role") == "assistant" and
|
||||
msg.get("content") is None and
|
||||
msg.get("tool_calls") is not None and
|
||||
len(msg.get("tool_calls")) > 0):
|
||||
msg["content"] = "Calling tool"
|
||||
|
||||
# Handle role issues
|
||||
if msg.get("role") == "tool":
|
||||
msg["role"] = "developer"
|
||||
elif not msg.get("role"):
|
||||
msg["role"] = "user"
|
||||
|
||||
return messages
|
||||
|
||||
def stream_chat(host, request_data, api_key):
|
||||
start_time = datetime.now()
|
||||
print("\n" + "="*80)
|
||||
print(f"Starting streaming chat at {start_time}")
|
||||
print(f"Host: {host}")
|
||||
print("="*80 + "\n")
|
||||
|
||||
# First, initialize the stream
|
||||
try:
|
||||
print("\n" + "-"*80)
|
||||
print("Initializing stream...")
|
||||
init_response = requests.post(
|
||||
f"{host}/chat_stream_init",
|
||||
json=request_data,
|
||||
headers={'Authorization': f'Bearer {api_key}'}
|
||||
)
|
||||
print(f"Init Response Status: {init_response.status_code}")
|
||||
print(f"Init Response Text: {init_response.text}")
|
||||
print("-"*80 + "\n")
|
||||
|
||||
if init_response.status_code != 200:
|
||||
logger.error(f"Error initializing stream. Status code: {init_response.status_code}")
|
||||
logger.error(f"Response: {init_response.text}")
|
||||
return
|
||||
|
||||
init_data = init_response.json()
|
||||
|
||||
if 'error' in init_data:
|
||||
logger.error(f"Error initializing stream: {init_data['error']}")
|
||||
return
|
||||
|
||||
stream_id = init_data['stream_id']
|
||||
print(f"Stream initialized successfully with ID: {stream_id}")
|
||||
|
||||
except requests.exceptions.RequestException as e:
|
||||
logger.error(f"Request error during stream initialization: {e}")
|
||||
return
|
||||
except json.JSONDecodeError as e:
|
||||
logger.error(f"Failed to decode JSON response: {e}")
|
||||
logger.error(f"Raw response: {init_response.text}")
|
||||
return
|
||||
|
||||
# Now connect to the stream
|
||||
try:
|
||||
print("\n" + "-"*80)
|
||||
print(f"Connecting to stream {stream_id}...")
|
||||
stream_response = requests.get(
|
||||
f"{host}/chat_stream/{stream_id}",
|
||||
headers={
|
||||
'Authorization': f'Bearer {api_key}',
|
||||
'Accept': 'text/event-stream'
|
||||
},
|
||||
stream=True
|
||||
)
|
||||
|
||||
if stream_response.status_code != 200:
|
||||
logger.error(f"Error connecting to stream. Status code: {stream_response.status_code}")
|
||||
logger.error(f"Response: {stream_response.text}")
|
||||
return
|
||||
|
||||
print(f"Successfully connected to stream")
|
||||
print("-"*80 + "\n")
|
||||
|
||||
event_count = 0
|
||||
current_data = []
|
||||
|
||||
try:
|
||||
print("\n" + "-"*80)
|
||||
print("Starting to process events...")
|
||||
print("-"*80 + "\n")
|
||||
|
||||
for line in stream_response.iter_lines(decode_unicode=True):
|
||||
if line:
|
||||
if line.startswith('data: '):
|
||||
data = line[6:] # Remove 'data: ' prefix
|
||||
try:
|
||||
event_data = json.loads(data)
|
||||
event_count += 1
|
||||
print("\n" + "*"*80)
|
||||
print(f"Event #{event_count}")
|
||||
|
||||
if isinstance(event_data, dict):
|
||||
# Pretty print the event data
|
||||
print("Event Data:")
|
||||
print(json.dumps(event_data, indent=2))
|
||||
|
||||
# Special handling for message events
|
||||
if 'content' in event_data:
|
||||
print("\nMessage Content:", event_data['content'])
|
||||
if event_data.get('tool_calls'):
|
||||
print("Tool Calls:", json.dumps(event_data['tool_calls'], indent=2))
|
||||
else:
|
||||
print("Event Data:", event_data)
|
||||
print("*"*80 + "\n")
|
||||
|
||||
except json.JSONDecodeError as e:
|
||||
print(f"Error decoding event data: {e}")
|
||||
print(f"Raw data: {data}")
|
||||
|
||||
except Exception as e:
|
||||
print(f"Error processing stream: {e}")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
finally:
|
||||
print("\n" + "-"*80)
|
||||
print(f"Closing stream after processing {event_count} events")
|
||||
print("-"*80 + "\n")
|
||||
stream_response.close()
|
||||
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(f"Request error during streaming: {e}")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
end_time = datetime.now()
|
||||
duration = end_time - start_time
|
||||
print("\n" + "="*80)
|
||||
print(f"Streaming session completed at {end_time}")
|
||||
print(f"Total duration: {duration}")
|
||||
print("="*80 + "\n")
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--sample_request', type=str, required=False, default='tmp.json',
|
||||
help='Sample request JSON file name under tests/sample_requests/')
|
||||
parser.add_argument('--api_key', type=str, required=False, default='test',
|
||||
help='API key to use for authentication')
|
||||
parser.add_argument('--host', type=str, default='http://localhost:4040',
|
||||
help='Host to use for the request')
|
||||
args = parser.parse_args()
|
||||
|
||||
try:
|
||||
print("\n" + "="*80)
|
||||
print("Loading request data...")
|
||||
request = read_json_from_file(f"./tests/sample_requests/{args.sample_request}").get("lastRequest", {})
|
||||
print("Request data:")
|
||||
print(json.dumps(request, indent=2))
|
||||
print("Starting streaming request...")
|
||||
print("="*80 + "\n")
|
||||
|
||||
stream_chat(args.host, request, args.api_key)
|
||||
except Exception as e:
|
||||
print("\n" + "!"*80)
|
||||
print(f"Error in main: {e}")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
print("!"*80 + "\n")
|
||||
205
apps/rowboat_agents/tests/interactive.py
Normal file
205
apps/rowboat_agents/tests/interactive.py
Normal file
|
|
@ -0,0 +1,205 @@
|
|||
import copy
|
||||
from datetime import datetime
|
||||
import json
|
||||
import sys
|
||||
import asyncio
|
||||
|
||||
from src.graph.core import order_messages, run_turn_streamed
|
||||
from src.graph.tools import respond_to_tool_raise_error, respond_to_tool_close_chat, RAG_TOOL, CLOSE_CHAT_TOOL
|
||||
from src.utils.common import common_logger, read_json_from_file
|
||||
logger = common_logger
|
||||
|
||||
def preprocess_messages(messages):
|
||||
# Preprocess messages to handle null content and role issues
|
||||
for msg in messages:
|
||||
# Handle null content in assistant messages with tool calls
|
||||
if (msg.get("role") == "assistant" and
|
||||
msg.get("content") is None and
|
||||
msg.get("tool_calls") is not None and
|
||||
len(msg.get("tool_calls")) > 0):
|
||||
msg["content"] = "Calling tool"
|
||||
|
||||
# Handle role issues
|
||||
if msg.get("role") == "tool":
|
||||
msg["role"] = "developer"
|
||||
elif not msg.get("role"):
|
||||
msg["role"] = "user"
|
||||
|
||||
return messages
|
||||
|
||||
async def process_turn(messages, agent_configs, tool_configs, prompt_configs, start_agent_name, state, config, complete_request):
|
||||
"""Processes a single turn using streaming API"""
|
||||
print(f"\n{'*'*50}\nLatest Request:\n{'*'*50}")
|
||||
request_json = {
|
||||
"messages": [{k: v for k, v in msg.items() if k != 'current_turn'} for msg in messages],
|
||||
"state": state,
|
||||
"agents": agent_configs,
|
||||
"tools": tool_configs,
|
||||
"prompts": prompt_configs,
|
||||
"startAgent": start_agent_name
|
||||
}
|
||||
print(json.dumps(request_json, indent=2))
|
||||
|
||||
collected_messages = []
|
||||
|
||||
async for event_type, event_data in run_turn_streamed(
|
||||
messages=messages,
|
||||
start_agent_name=start_agent_name,
|
||||
agent_configs=agent_configs,
|
||||
tool_configs=tool_configs,
|
||||
start_turn_with_start_agent=config.get("start_turn_with_start_agent", False),
|
||||
state=state,
|
||||
additional_tool_configs=[RAG_TOOL, CLOSE_CHAT_TOOL],
|
||||
complete_request=complete_request
|
||||
):
|
||||
if event_type == "message":
|
||||
# Add each message to collected_messages
|
||||
collected_messages.append(event_data)
|
||||
|
||||
elif event_type == "done":
|
||||
print(f"\n\n{'*'*50}\nLatest Response:\n{'*'*50}")
|
||||
response_json = {
|
||||
"messages": collected_messages,
|
||||
"state": event_data.get('state', {}),
|
||||
}
|
||||
print("Turn completed. Here are the streamed messages and final state:")
|
||||
print(json.dumps(response_json, indent=2))
|
||||
print('='*50)
|
||||
|
||||
return collected_messages, event_data.get('state', {})
|
||||
|
||||
elif event_type == "error":
|
||||
print(f"\nError: {event_data.get('error', 'Unknown error')}")
|
||||
return [], state
|
||||
|
||||
if __name__ == "__main__":
|
||||
logger.info(f"{'*'*50}Running interactive mode{'*'*50}")
|
||||
|
||||
def extract_request_fields(complete_request):
|
||||
agent_configs = complete_request.get("agents", [])
|
||||
tool_configs = complete_request.get("tools", [])
|
||||
prompt_configs = complete_request.get("prompts", [])
|
||||
start_agent_name = complete_request.get("startAgent", "")
|
||||
|
||||
return agent_configs, tool_configs, prompt_configs, start_agent_name
|
||||
|
||||
external_tool_mappings = {
|
||||
"raise_error": respond_to_tool_raise_error,
|
||||
"close_chat": respond_to_tool_close_chat
|
||||
}
|
||||
|
||||
config_file = sys.argv[sys.argv.index("--config") + 1] if "--config" in sys.argv else "default_config.json"
|
||||
sample_request_file = sys.argv[sys.argv.index("--sample_request") + 1] if "--sample_request" in sys.argv else "default_example.json"
|
||||
|
||||
print(f"Config file: {config_file}")
|
||||
print(f"Sample request file: {sample_request_file}")
|
||||
|
||||
config = read_json_from_file(f"./configs/{config_file}")
|
||||
example_request = read_json_from_file(f"./tests/sample_requests/{sample_request_file}").get("lastRequest", {})
|
||||
|
||||
if "--load_messages" in sys.argv:
|
||||
messages = example_request.get("messages", [])
|
||||
messages = order_messages(messages)
|
||||
user_input_needed = False
|
||||
else:
|
||||
messages = []
|
||||
user_input_needed = True
|
||||
|
||||
turn_start_time = datetime.now()
|
||||
tool_duration = 0
|
||||
|
||||
state = example_request.get("state", {})
|
||||
start_agent_name = example_request.get("startAgent", "")
|
||||
last_agent_name = state.get("last_agent_name", "")
|
||||
if not last_agent_name:
|
||||
last_agent_name = start_agent_name
|
||||
|
||||
|
||||
logger.info("Starting main conversation loop")
|
||||
while True:
|
||||
logger.info("Loading configuration files")
|
||||
|
||||
# To account for updates to state
|
||||
complete_request = copy.deepcopy(example_request)
|
||||
agent_configs, tool_configs, prompt_configs, start_agent_name = extract_request_fields(complete_request)
|
||||
|
||||
print(f"\nUsing agent: {last_agent_name}")
|
||||
|
||||
if user_input_needed:
|
||||
user_inp = input('\nUSER: ')
|
||||
messages.append({
|
||||
"role": "user",
|
||||
"content": user_inp
|
||||
})
|
||||
turn_start_time = datetime.now()
|
||||
tool_duration = 0
|
||||
if user_inp == 'exit':
|
||||
logger.info("User requested exit")
|
||||
break
|
||||
logger.info("Added user message to conversation")
|
||||
|
||||
# Preprocess messages to replace role tool with role developer and add role user to empty roles
|
||||
print("Preprocessing messages to replace role tool with role developer and add role user to empty roles")
|
||||
messages = preprocess_messages(messages)
|
||||
complete_request["messages"] = preprocess_messages(complete_request["messages"])
|
||||
|
||||
# Run the streaming turn
|
||||
resp_messages, resp_state = asyncio.run(process_turn(
|
||||
messages=messages,
|
||||
agent_configs=agent_configs,
|
||||
tool_configs=tool_configs,
|
||||
prompt_configs=prompt_configs,
|
||||
start_agent_name=start_agent_name,
|
||||
state=state,
|
||||
config=config,
|
||||
complete_request=complete_request
|
||||
))
|
||||
|
||||
state = resp_state
|
||||
last_msg = resp_messages[-1] if resp_messages else {}
|
||||
tool_calls = last_msg.get("tool_calls", [])
|
||||
sender = last_msg.get("sender", "")
|
||||
|
||||
if config.get("return_diff_messages", True):
|
||||
messages.extend(resp_messages)
|
||||
else:
|
||||
messages = resp_messages
|
||||
|
||||
if tool_calls:
|
||||
tool_start_time = datetime.now()
|
||||
user_input_needed = False
|
||||
|
||||
should_break = False
|
||||
for tool_call in tool_calls:
|
||||
tool_name = tool_call["function"]["name"]
|
||||
logger.info(f"Processing tool call: {tool_name}")
|
||||
|
||||
if tool_name not in external_tool_mappings:
|
||||
logger.error(f"Unknown tool call: {tool_name}")
|
||||
raise ValueError(f"Unknown tool call: {tool_name}")
|
||||
|
||||
# Call appropriate handler and process response
|
||||
tool_response = external_tool_mappings[tool_name]([tool_call], mock=True)
|
||||
messages.append(tool_response)
|
||||
logger.info(f"Added {tool_name} response to messages")
|
||||
|
||||
current_tool_duration = round((datetime.now() - tool_start_time).total_seconds() * 10) / 10
|
||||
logger.info(f"Tool response duration: {current_tool_duration:.1f}s")
|
||||
tool_duration += current_tool_duration
|
||||
|
||||
if tool_name == "close_chat":
|
||||
user_input_needed = False
|
||||
logger.info("Closing chat")
|
||||
should_break = True
|
||||
|
||||
if should_break:
|
||||
break
|
||||
|
||||
else:
|
||||
user_input_needed = True
|
||||
print("Quick stats")
|
||||
print(f"Turn Duration: {round((datetime.now() - turn_start_time).total_seconds() * 10) / 10:.1f}s")
|
||||
print(f"Tool Response Duration: {round(tool_duration * 10) / 10:.1f}s")
|
||||
print('='*50)
|
||||
|
||||
print("\n" + "-" * 80)
|
||||
235
apps/rowboat_agents/tests/sample_requests/default_example.json
Normal file
235
apps/rowboat_agents/tests/sample_requests/default_example.json
Normal file
|
|
@ -0,0 +1,235 @@
|
|||
{
|
||||
"lastRequest": {
|
||||
"messages": [
|
||||
{
|
||||
"content": "",
|
||||
"role": "system",
|
||||
"sender": null,
|
||||
"tool_calls": null,
|
||||
"tool_call_id": null,
|
||||
"tool_name": null
|
||||
},
|
||||
{
|
||||
"content": "hi",
|
||||
"role": "user",
|
||||
"sender": null,
|
||||
"tool_calls": null,
|
||||
"tool_call_id": null,
|
||||
"tool_name": null
|
||||
}
|
||||
],
|
||||
"state": {
|
||||
"last_agent_name": "Door Dash Hub"
|
||||
},
|
||||
"agents": [
|
||||
{
|
||||
"name": "Door Dash Hub",
|
||||
"type": "conversation",
|
||||
"description": "Hub agent to manage Door Dash-related queries.",
|
||||
"instructions": "## 🧑💼 Role:\nYou are responsible for directing Door Dash-related queries to appropriate agents.\n\n---\n## ⚙️ Steps to Follow:\n1. Greet the user and ask which Door Dash-related query they need help with (e.g., 'Are you facing issues with your order items or delivery timing?').\n2. If the query matches a specific task, direct the user to the corresponding agent:\n - Order Issue → [@agent:Order Issue]\n - Delayed Delivery → [@agent:Delayed Delivery]\n3. If the query doesn't match any specific task, respond with 'I'm sorry, I didn't understand. Could you clarify your request?' or escalate to human support.\n\n---\n## 🎯 Scope:\n✅ In Scope:\n- Issues with order items\n- Delayed delivery issues\n\n❌ Out of Scope:\n- Issues unrelated to Door Dash\n- General knowledge queries\n\n---\n## 📋 Guidelines:\n✔️ Dos:\n- Direct queries to specific Door Dash agents promptly.\n- Call [@agent:Escalation] agent for unrecognized queries.\n\n🚫 Don'ts:\n- Engage in detailed support.\n- Extend the conversation beyond Door Dash.\n- Provide user-facing text such as 'I will connect you now...' when calling another agent\n\n# Examples\n- **User** : I need help with my order items.\n - **Agent actions**: [@agent:Order Issue](#mention)\n\n- **User** : My delivery is delayed.\n - **Agent actions**: Call [@agent:Delayed Delivery](#mention)\n\n- **User** : I'm not sure where my order is.\n - **Agent actions**: Call [@agent:Delayed Delivery](#mention)\n\n- **User** : Can you reset my order settings?\n - **Agent actions**: [@agent:Escalation](#mention)\n\n- **User** : How are you today?\n - **Agent response**: I'm doing great. What would like help with today?",
|
||||
"model": "gpt-4o-mini",
|
||||
"hasRagSources": false,
|
||||
"controlType": "retain",
|
||||
"tools": [],
|
||||
"prompts": [],
|
||||
"connectedAgents": [
|
||||
"Order Issue",
|
||||
"Delayed Delivery",
|
||||
"Escalation"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Post process",
|
||||
"type": "post_process",
|
||||
"description": "",
|
||||
"instructions": "Ensure that the agent response is terse and to the point.",
|
||||
"model": "gpt-4o-mini",
|
||||
"hasRagSources": false,
|
||||
"controlType": "retain",
|
||||
"tools": [],
|
||||
"prompts": [],
|
||||
"connectedAgents": []
|
||||
},
|
||||
{
|
||||
"name": "Escalation",
|
||||
"type": "escalation",
|
||||
"description": "",
|
||||
"instructions": "Get the user's contact information and let them know that their request has been escalated.",
|
||||
"model": "gpt-4o-mini",
|
||||
"hasRagSources": false,
|
||||
"controlType": "retain",
|
||||
"tools": [],
|
||||
"prompts": [],
|
||||
"connectedAgents": []
|
||||
},
|
||||
{
|
||||
"name": "Order Issue",
|
||||
"type": "conversation",
|
||||
"description": "Agent to assist users with missing or incorrect order items.",
|
||||
"instructions": "## 🧑💼 Role:\nAssist users with issues related to missing or incorrect order items.\n\n---\n## ⚙️ Steps to Follow:\n1. Fetch the order details using the [@tool:get_order_details] tool.\n2. Confirm the issue with the user.\n3. Provide solutions or escalate if unresolved.\n\n---\n## 🎯 Scope:\n✅ In Scope:\n- Handling missing or incorrect order items\n\n❌ Out of Scope:\n- Delayed delivery issues\n- General knowledge queries\n\n---\n## 📋 Guidelines:\n✔️ Dos:\n- Ensure the user is aware of the order details before proceeding.\n\n🚫 Don'ts:\n- Extend the conversation beyond order issues.\n\n# Examples\n- **User** : I received the wrong item in my order.\n - **Agent response**: I can help with that. Let me fetch your order details first.\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : My order is missing an item.\n - **Agent response**: Let's check your order details and resolve this issue.\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : I got someone else's order.\n - **Agent response**: I apologize for the mix-up. I'll fetch your order details to sort this out.\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : Can you help me with a missing item?\n - **Agent response**: Certainly, I'll look into your order details right away.\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : There's an issue with my order items.\n - **Agent response**: Let's verify your order details to address this issue.\n - **Agent actions**: Call [@tool:get_order_details](#mention)",
|
||||
"model": "gpt-4o",
|
||||
"hasRagSources": false,
|
||||
"controlType": "retain",
|
||||
"tools": [
|
||||
"get_order_details"
|
||||
],
|
||||
"prompts": [],
|
||||
"connectedAgents": []
|
||||
},
|
||||
{
|
||||
"name": "Delayed Delivery",
|
||||
"type": "conversation",
|
||||
"description": "Agent to assist users with delayed delivery issues.",
|
||||
"instructions": "## 🧑💼 Role:\nAssist users with issues related to delayed delivery.\n\n---\n## ⚙️ Steps to Follow:\n1. Fetch the delivery status using the [@tool:get_delivery_status] tool.\n2. Confirm the delay with the user.\n3. Provide solutions or escalate if unresolved.\n\n---\n## 🎯 Scope:\n✅ In Scope:\n- Handling delayed delivery issues\n\n❌ Out of Scope:\n- Missing or incorrect order items\n- General knowledge queries\n\n---\n## 📋 Guidelines:\n✔️ Dos:\n- Ensure the user is aware of the delivery status before proceeding.\n\n🚫 Don'ts:\n- Extend the conversation beyond delivery issues.\n\n# Examples\n- **User** : My delivery is late.\n - **Agent response**: I can help with that. Let me fetch your delivery status first.\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : Where is my order? It's delayed.\n - **Agent response**: Let's check your delivery status and resolve this issue.\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : My order hasn't arrived yet.\n - **Agent response**: I apologize for the delay. I'll fetch your delivery status to sort this out.\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : Can you help me with a delayed delivery?\n - **Agent response**: Certainly, I'll look into your delivery status right away.\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : There's an issue with my delivery timing.\n - **Agent response**: Let's verify your delivery status to address this issue.\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)",
|
||||
"model": "gpt-4o",
|
||||
"hasRagSources": false,
|
||||
"controlType": "retain",
|
||||
"tools": [
|
||||
"get_delivery_status"
|
||||
],
|
||||
"prompts": [],
|
||||
"connectedAgents": []
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"name": "get_order_details",
|
||||
"description": "Tool to fetch details about the user's order.",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"order_id": {
|
||||
"type": "string",
|
||||
"description": "The unique identifier for the order."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"order_id"
|
||||
]
|
||||
},
|
||||
"mockTool": true,
|
||||
"mockInstructions": "Return a mock response for Door Dash order details."
|
||||
},
|
||||
{
|
||||
"name": "get_delivery_status",
|
||||
"description": "Tool to fetch the current status of the delivery.",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"order_id": {
|
||||
"type": "string",
|
||||
"description": "The unique identifier for the order."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"order_id"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"prompts": [
|
||||
{
|
||||
"name": "Style prompt",
|
||||
"type": "style_prompt",
|
||||
"prompt": "You should be empathetic and helpful."
|
||||
}
|
||||
],
|
||||
"startAgent": "Door Dash Hub"
|
||||
},
|
||||
"lastResponse": {
|
||||
"messages": [
|
||||
{
|
||||
"annotations": [],
|
||||
"content": "Hello! How can I assist you today? Are you facing issues with your order items or delivery timing?",
|
||||
"created_at": "2025-03-19T12:29:06.547196",
|
||||
"current_turn": true,
|
||||
"response_type": "internal",
|
||||
"role": "assistant",
|
||||
"sender": "Door Dash Hub"
|
||||
},
|
||||
{
|
||||
"annotations": [],
|
||||
"content": "Hi! How can I help you today? Are you having issues with your order items or delivery timing?",
|
||||
"created_at": "2025-03-19T12:29:06.547196",
|
||||
"current_turn": true,
|
||||
"response_type": "external",
|
||||
"role": "assistant",
|
||||
"sender": "Door Dash Hub >> Post process"
|
||||
}
|
||||
],
|
||||
"state": {
|
||||
"agent_data": [
|
||||
{
|
||||
"child_functions": [
|
||||
"transfer_to_escalation",
|
||||
"transfer_to_order_issue",
|
||||
"transfer_to_delayed_delivery"
|
||||
],
|
||||
"external_tools": [],
|
||||
"history": [
|
||||
{
|
||||
"content": "hi",
|
||||
"current_turn": true,
|
||||
"role": "user"
|
||||
},
|
||||
{
|
||||
"annotations": [],
|
||||
"content": "Hello! How can I assist you today? Are you facing issues with your order items or delivery timing?",
|
||||
"created_at": "2025-03-19T12:29:06.547196",
|
||||
"current_turn": true,
|
||||
"response_type": "internal",
|
||||
"role": "assistant",
|
||||
"sender": "Door Dash Hub"
|
||||
}
|
||||
],
|
||||
"instructions": "## 🧑💼 Role:\nYou are responsible for directing Door Dash-related queries to appropriate agents.\n\n---\n## ⚙️ Steps to Follow:\n1. Greet the user and ask which Door Dash-related query they need help with (e.g., 'Are you facing issues with your order items or delivery timing?').\n2. If the query matches a specific task, direct the user to the corresponding agent:\n - Order Issue → [@agent:Order Issue]\n - Delayed Delivery → [@agent:Delayed Delivery]\n3. If the query doesn't match any specific task, respond with 'I'm sorry, I didn't understand. Could you clarify your request?' or escalate to human support.\n\n---\n## 🎯 Scope:\n✅ In Scope:\n- Issues with order items\n- Delayed delivery issues\n\n❌ Out of Scope:\n- Issues unrelated to Door Dash\n- General knowledge queries\n\n---\n## 📋 Guidelines:\n✔️ Dos:\n- Direct queries to specific Door Dash agents promptly.\n- Call [@agent:Escalation] agent for unrecognized queries.\n\n🚫 Don'ts:\n- Engage in detailed support.\n- Extend the conversation beyond Door Dash.\n- Provide user-facing text such as 'I will connect you now...' when calling another agent\n\n# Examples\n- **User** : I need help with my order items.\n - **Agent actions**: [@agent:Order Issue](#mention)\n\n- **User** : My delivery is delayed.\n - **Agent actions**: Call [@agent:Delayed Delivery](#mention)\n\n- **User** : I'm not sure where my order is.\n - **Agent actions**: Call [@agent:Delayed Delivery](#mention)\n\n- **User** : Can you reset my order settings?\n - **Agent actions**: [@agent:Escalation](#mention)\n\n- **User** : How are you today?\n - **Agent response**: I'm doing great. What would like help with today?\n\n----------------------------------------------------------------------------------------------------\n\n\n# Instructions about using other specialized agents\nYou have the following specialized agents that you can transfer the chat to, using the appropriate tool calls for the transfer: \nName: Escalation\nDescription: \nTool for transfer: transfer_to_escalation\n----------------------------------------------------------------------------------------------------\nName: Order Issue\nDescription: Agent to assist users with missing or incorrect order items.\nTool for transfer: transfer_to_order_issue\n----------------------------------------------------------------------------------------------------\nName: Delayed Delivery\nDescription: Agent to assist users with delayed delivery issues.\nTool for transfer: transfer_to_delayed_delivery\n\n## Notes:\n- Transfer the chat to the appropriate agent, based on the chat history and / or the user's request.\n- When you transfer the chat to another agent, you should not provide any response to the user. For example, do not say 'Transferring chat to X agent' or anything like that. Just invoke the tool call to transfer to the other agent.\n- Do NOT ever mention the existence of other agents. For example, do not say 'Please check with X agent for details regarding processing times.' or anything like that.\n- If any other agent transfers the chat to you without responding to the user, it means that they don't know how to help. Do not transfer the chat to back to the same agent in this case. In such cases, you should transfer to the escalation agent using the appropriate tool call. Never ask the user to contact support.\n\n\n----------------------------------------------------------------------------------------------------\n\n\n# Additional System-Wide Context or Instructions:\n\n",
|
||||
"internal_tools": [],
|
||||
"most_recent_parent_name": "",
|
||||
"name": "Door Dash Hub",
|
||||
"parent_function": null
|
||||
},
|
||||
{
|
||||
"child_functions": [],
|
||||
"external_tools": [],
|
||||
"history": [],
|
||||
"instructions": "Get the user's contact information and let them know that their request has been escalated.\n\n----------------------------------------------------------------------------------------------------\n\n\n# Additional System-Wide Context or Instructions:\n\n",
|
||||
"internal_tools": [],
|
||||
"most_recent_parent_name": "",
|
||||
"name": "Escalation",
|
||||
"parent_function": null
|
||||
},
|
||||
{
|
||||
"child_functions": [],
|
||||
"external_tools": [
|
||||
"get_order_details"
|
||||
],
|
||||
"history": [],
|
||||
"instructions": "## 🧑💼 Role:\nAssist users with issues related to missing or incorrect order items.\n\n---\n## ⚙️ Steps to Follow:\n1. Fetch the order details using the [@tool:get_order_details] tool.\n2. Confirm the issue with the user.\n3. Provide solutions or escalate if unresolved.\n\n---\n## 🎯 Scope:\n✅ In Scope:\n- Handling missing or incorrect order items\n\n❌ Out of Scope:\n- Delayed delivery issues\n- General knowledge queries\n\n---\n## 📋 Guidelines:\n✔️ Dos:\n- Ensure the user is aware of the order details before proceeding.\n\n🚫 Don'ts:\n- Extend the conversation beyond order issues.\n\n# Examples\n- **User** : I received the wrong item in my order.\n - **Agent response**: I can help with that. Let me fetch your order details first.\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : My order is missing an item.\n - **Agent response**: Let's check your order details and resolve this issue.\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : I got someone else's order.\n - **Agent response**: I apologize for the mix-up. I'll fetch your order details to sort this out.\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : Can you help me with a missing item?\n - **Agent response**: Certainly, I'll look into your order details right away.\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : There's an issue with my order items.\n - **Agent response**: Let's verify your order details to address this issue.\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n----------------------------------------------------------------------------------------------------\n\n\n# Instructions about giving up chat control\nIf you are unable to handle the chat (e.g. if it is not in your scope of instructions), you should use the tool call provided to give up control of the chat.\nTool for transfer: give_up_chat_control\n\n## Notes:\n- When you give up control of the chat, you should not provide any response to the user. Just invoke the tool call to give up control.\n\n\n----------------------------------------------------------------------------------------------------\n\n\n# Additional System-Wide Context or Instructions:\n\n",
|
||||
"internal_tools": [],
|
||||
"most_recent_parent_name": "",
|
||||
"name": "Order Issue",
|
||||
"parent_function": null
|
||||
},
|
||||
{
|
||||
"child_functions": [],
|
||||
"external_tools": [
|
||||
"get_delivery_status"
|
||||
],
|
||||
"history": [],
|
||||
"instructions": "## 🧑💼 Role:\nAssist users with issues related to delayed delivery.\n\n---\n## ⚙️ Steps to Follow:\n1. Fetch the delivery status using the [@tool:get_delivery_status] tool.\n2. Confirm the delay with the user.\n3. Provide solutions or escalate if unresolved.\n\n---\n## 🎯 Scope:\n✅ In Scope:\n- Handling delayed delivery issues\n\n❌ Out of Scope:\n- Missing or incorrect order items\n- General knowledge queries\n\n---\n## 📋 Guidelines:\n✔️ Dos:\n- Ensure the user is aware of the delivery status before proceeding.\n\n🚫 Don'ts:\n- Extend the conversation beyond delivery issues.\n\n# Examples\n- **User** : My delivery is late.\n - **Agent response**: I can help with that. Let me fetch your delivery status first.\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : Where is my order? It's delayed.\n - **Agent response**: Let's check your delivery status and resolve this issue.\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : My order hasn't arrived yet.\n - **Agent response**: I apologize for the delay. I'll fetch your delivery status to sort this out.\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : Can you help me with a delayed delivery?\n - **Agent response**: Certainly, I'll look into your delivery status right away.\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : There's an issue with my delivery timing.\n - **Agent response**: Let's verify your delivery status to address this issue.\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n----------------------------------------------------------------------------------------------------\n\n\n# Instructions about giving up chat control\nIf you are unable to handle the chat (e.g. if it is not in your scope of instructions), you should use the tool call provided to give up control of the chat.\nTool for transfer: give_up_chat_control\n\n## Notes:\n- When you give up control of the chat, you should not provide any response to the user. Just invoke the tool call to give up control.\n\n\n----------------------------------------------------------------------------------------------------\n\n\n# Additional System-Wide Context or Instructions:\n\n",
|
||||
"internal_tools": [],
|
||||
"most_recent_parent_name": "",
|
||||
"name": "Delayed Delivery",
|
||||
"parent_function": null
|
||||
}
|
||||
],
|
||||
"last_agent_name": "Door Dash Hub"
|
||||
},
|
||||
"tokens_used": {
|
||||
"openai/gpt-4o-mini": {
|
||||
"input_tokens": 1731,
|
||||
"output_tokens": 45
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
424
apps/rowboat_agents/tests/sample_requests/example1.json
Normal file
424
apps/rowboat_agents/tests/sample_requests/example1.json
Normal file
|
|
@ -0,0 +1,424 @@
|
|||
{
|
||||
"lastRequest": {
|
||||
"messages": [
|
||||
{
|
||||
"content": "hi",
|
||||
"role": "user",
|
||||
"sender": null,
|
||||
"tool_calls": null,
|
||||
"tool_call_id": null,
|
||||
"tool_name": null
|
||||
},
|
||||
{
|
||||
"content": "Hello! How can I assist you today with your XYZ Bike?",
|
||||
"role": "assistant",
|
||||
"sender": "Main agent",
|
||||
"tool_calls": null,
|
||||
"tool_call_id": null,
|
||||
"tool_name": null,
|
||||
"response_type": "internal"
|
||||
},
|
||||
{
|
||||
"content": "Hello! How can I assist you today with your XYZ Bike?",
|
||||
"role": "assistant",
|
||||
"sender": "Main agent >> Post process",
|
||||
"tool_calls": null,
|
||||
"tool_call_id": null,
|
||||
"tool_name": null,
|
||||
"response_type": "external"
|
||||
},
|
||||
{
|
||||
"content": "i want to know about the range",
|
||||
"role": "user",
|
||||
"sender": null,
|
||||
"tool_calls": null,
|
||||
"tool_call_id": null,
|
||||
"tool_name": null
|
||||
},
|
||||
{
|
||||
"content": null,
|
||||
"role": "assistant",
|
||||
"sender": "Main agent",
|
||||
"tool_calls": [
|
||||
{
|
||||
"function": {
|
||||
"arguments": "{\"args\":\"\",\"kwargs\":\"\"}",
|
||||
"name": "transfer_to_product_info_agent"
|
||||
},
|
||||
"id": "call_0MJHin0XCMyEJjA7T2FTJLZL",
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"tool_call_id": null,
|
||||
"tool_name": null,
|
||||
"response_type": "internal"
|
||||
},
|
||||
{
|
||||
"content": "{\"assistant\": \"Product info agent\"}",
|
||||
"role": "tool",
|
||||
"sender": null,
|
||||
"tool_calls": null,
|
||||
"tool_call_id": "call_0MJHin0XCMyEJjA7T2FTJLZL",
|
||||
"tool_name": "transfer_to_product_info_agent"
|
||||
},
|
||||
{
|
||||
"content": null,
|
||||
"role": "assistant",
|
||||
"sender": "Product info agent",
|
||||
"tool_calls": [
|
||||
{
|
||||
"function": {
|
||||
"arguments": "{\"question\":\"XYZ Bike travel range\"}",
|
||||
"name": "getArticleInfo"
|
||||
},
|
||||
"id": "call_CcNzb2N3lBt4JOCVrzyHdpdL",
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"tool_call_id": null,
|
||||
"tool_name": null,
|
||||
"response_type": "internal"
|
||||
},
|
||||
{
|
||||
"content": "{\"results\":[{\"title\":\"XYZ Electric Bike\",\"content\":\"# XYZ Electric Bike\\n\\n### Transforming Transportation with the XYZ Electric Bike ### Revolutionizing Urban Mobility XYZ Electric Bike reimagines how we navigate cities, offering a seamless, stress-free alternative to traffic jams, pricey rideshares, rigid schedules, and the hassle of finding parking. --- #### **Instant Foldability** With a single press, XYZ's proprietary hinge mechanism folds the bike smoothly and securely in one swift motion. This innovation makes carrying and storing the bike effortless—outperforming the competition in both speed and ease of use. --- #### **Exceptional Handlebars** The sleek magnesium alloy handlebars are a marvel of design, housing intuitive controls for acceleration, braking, the horn, and LED lights, all within a streamlined, wire-free structure. Magnesium's lightweight properties—33% lighter than aluminum—make XYZ one of the most portable electric bikes available. --- #### **Unmatched Frame Design** Crafted with precision using TORAY carbon fiber, the frame achieves the perfect balance between strength and minimal weight. The material, meticulously layered for durability, is the same advanced composite used in aerospace engineering. --- #### **Impressive Range** Powered by premium electric batteries, XYZ bikes are designed for extended use with fast charging times. Their energy management system ensures long-lasting performance, providing ranges of up to 25 miles per charge, depending on riding conditions. --- #### **Dynamic Power** Equipped with dual motors delivering up to 1,000 watts at peak output, XYZ effortlessly handles steep inclines and challenging terrains. Rare-earth magnets and thermal regulation technology ensure high efficiency and reliability. --- #### **Puncture-Proof Tires** Say goodbye to flat tires. XYZ's solid rubber tires incorporate innovative air pockets for built-in shock absorption, delivering a smooth yet responsive ride across various surfaces. --- #### **Advanced Braking System** XYZ's braking system combines electronic anti-lock functionality with a user-friendly friction brake. Riders can enjoy a customizable braking experience, whether relying on fingertip controls or a traditional foot brake. --- #### **Durable and Comfortable Deck** The single-piece aluminum deck integrates a silicon surface for superior grip, eliminating unnecessary bulk or harsh finishes for a clean, modern look. --- #### **Invisible Kickstand** XYZ's custom-designed kickstand is seamlessly integrated, providing stability without disrupting the bike's sleek aesthetics. --- ### Models Comparison #### **XYZ Classic** - Price: $990 - Range: Up to 12 miles - Charge Time: 3.5 hours (80%) - Weight: 28.5 lbs #### **XYZ Voyager** - Price: $1,490 - Range: Up to 25 miles - Charge Time: 2 hours (80%) - Weight: 29.6 lbs - Features: App integration for enhanced control and ride stats --- XYZ Electric Bike is not just a mode of transport—it's the future of urban mobility, combining cutting-edge technology, top-tier materials, and unparalleled design for a ride that's as stylish as it is functional.\"}]}",
|
||||
"role": "tool",
|
||||
"sender": null,
|
||||
"tool_calls": null,
|
||||
"tool_call_id": "call_CcNzb2N3lBt4JOCVrzyHdpdL",
|
||||
"tool_name": "getArticleInfo"
|
||||
}
|
||||
],
|
||||
"state": {
|
||||
"agent_data": [
|
||||
{
|
||||
"child_functions": [
|
||||
"transfer_to_product_info_agent",
|
||||
"transfer_to_delivery_info_agent",
|
||||
"transfer_to_subscriptions_agent"
|
||||
],
|
||||
"external_tools": [],
|
||||
"history": [
|
||||
{
|
||||
"content": "hi",
|
||||
"current_turn": false,
|
||||
"role": "user"
|
||||
},
|
||||
{
|
||||
"content": "Hello! How can I assist you today with your XYZ Bike?",
|
||||
"created_at": "2024-12-18T07:45:03.670088",
|
||||
"current_turn": false,
|
||||
"response_type": "internal",
|
||||
"role": "assistant",
|
||||
"sender": "Main agent"
|
||||
},
|
||||
{
|
||||
"content": "i want to know about the range",
|
||||
"current_turn": true,
|
||||
"role": "user"
|
||||
},
|
||||
{
|
||||
"created_at": "2024-12-18T07:45:13.240846",
|
||||
"current_turn": true,
|
||||
"response_type": "internal",
|
||||
"role": "assistant",
|
||||
"sender": "Main agent",
|
||||
"tool_calls": [
|
||||
{
|
||||
"function": {
|
||||
"arguments": "{\"args\":\"\",\"kwargs\":\"\"}",
|
||||
"name": "transfer_to_product_info_agent"
|
||||
},
|
||||
"id": "call_0MJHin0XCMyEJjA7T2FTJLZL",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"content": "{\"assistant\": \"Product info agent\"}",
|
||||
"created_at": "2024-12-18T07:45:13.241184",
|
||||
"current_turn": true,
|
||||
"response_type": "internal",
|
||||
"role": "tool",
|
||||
"tool_call_id": "call_0MJHin0XCMyEJjA7T2FTJLZL",
|
||||
"tool_name": "transfer_to_product_info_agent"
|
||||
},
|
||||
{
|
||||
"created_at": "2024-12-18T07:45:13.821351",
|
||||
"current_turn": true,
|
||||
"response_type": "internal",
|
||||
"role": "assistant",
|
||||
"sender": "Product info agent",
|
||||
"tool_calls": [
|
||||
{
|
||||
"function": {
|
||||
"arguments": "{\"question\":\"XYZ Bike travel range\"}",
|
||||
"name": "getArticleInfo"
|
||||
},
|
||||
"id": "call_CcNzb2N3lBt4JOCVrzyHdpdL",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"instructions": "Role:\nYou are a customer support agent for XYZ Bikes. Your primary task is to facilitate conversations by passing control to specialized worker agents when needed.\n\n---\n\nTasks to Follow:\n- Engage in small talk if no specific question is asked.\n- Pass control to the appropriate worker agents for specialized conversations.\n\n---\n\nSmall Talk:\nYou are welcome to engage in basic small talk to build rapport.\n\n---\n\nExamples:\n\n---\nIn Scope Example 1:\nUser: How are you?\nAnswer: \"I'm doing well, thank you! How can I assist you today?\"\n\n---\nIn Scope Example 2:\nUser: What can you do?\nAnswer: \"I can help with customer support-related issues for XYZ Bikes. Let me know if you have any questions.\"\n\n---\nIn Scope Example 3:\nUser: I want a XYZ Bike.\nAnswer: \"What would you like to know about XYZ Bikes?\"\n\n---\nPass Control Example 1:\nUser: Tell me about the product features.\nAction: Pass control to the Product info agent.\n\n---\nPass Control Example 2:\nUser: Where is my scooter?\nAction: Pass control to the Delivery info agent.\n\n---\nPass Control Example 3:\nUser: I need help with my return.\nAction: Pass control to the Returns agent.\n\n---\nPass Control Example 4:\nUser: How does the Unagi subscription work?\nAction: Pass control to the Subscriptions agent.\n\n---\n✅ Dos:\n- Engage in small talk when necessary.\n- Pass control to the appropriate agent based on the user's query.\n\n---\n❌ Don'ts:\n- Do not focus excessively on greetings during ongoing conversations.\n- Do not continue the conversation if you suspect the user is confused or uninterested in Unagi support.\n\nSelf Support Guidance:\n\nThe bot should not suggest phrases like 'let me connect you to support' or 'you can reach out to support'. Instead, the agent is the customer support. It can say 'I apologize, but I don't have the right information'.",
|
||||
"internal_tools": [],
|
||||
"most_recent_parent_name": "",
|
||||
"name": "Main agent",
|
||||
"parent_function": null
|
||||
},
|
||||
{
|
||||
"child_functions": [],
|
||||
"external_tools": [
|
||||
"getArticleInfo"
|
||||
],
|
||||
"history": [
|
||||
{
|
||||
"content": "i want to know about the range",
|
||||
"current_turn": true,
|
||||
"role": "user"
|
||||
},
|
||||
{
|
||||
"created_at": "2024-12-18T07:45:13.821351",
|
||||
"current_turn": true,
|
||||
"response_type": "internal",
|
||||
"role": "assistant",
|
||||
"sender": "Product info agent",
|
||||
"tool_calls": [
|
||||
{
|
||||
"function": {
|
||||
"arguments": "{\"question\":\"XYZ Bike travel range\"}",
|
||||
"name": "getArticleInfo"
|
||||
},
|
||||
"id": "call_CcNzb2N3lBt4JOCVrzyHdpdL",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"instructions": "🧑💼 Role:\nYou are a product information agent for XYZ Bikes. Your job is to answer search for the right article and answer questions strictly based on the article about Unagi products. Feel free to ask the user clarification questions if needed.\n\n---\n\n📜 Instructions:\n\n✅ In Scope:\n- Answer questions strictly about Unagi product information.\n\n❌ Out of Scope:\n- Questions about delivery, returns, subscriptions, and promotions.\n- Any topic unrelated to Unagi products.\n- If a question is out of scope, call give_up_control and do not attempt to answer it.\n\n---\n\n✔️ Dos:\n- Stick to the facts provided in the articles.\n- Provide complete and direct answers to the user's questions.\n- Call the Greeting agent after each interaction.\n\n---\n\n🚫 Don'ts:\n- Do not partially answer questions or direct users to a URL for more information.\n- Do not provide information outside of the given context.\n\n---\n\n📝 Examples:\n\n---\nIn Scope Example 1:\nUser: What is the maximum speed of the Unagi E500?\nAction: Call get_article_info followed by <answer based on the retrieved context about the maximum speed of the Unagi E500>.\n\n---\nIn Scope Example 2:\nUser: How long does it take to charge a XYZ Bike fully?\nAction: Call get_article_info followed by <answer based on the retrieved context about the charging duration>.\n\n---\nIn Scope Example 3:\nUser: Can you tell me about the weight-carrying capacity of XYZ Bikes?\nAction: Call get_article_info followed by <answer based on the retrieved context about weight capacity>.\n\n---\nIn Scope Example 4:\nUser: What are the differences between the E250 and E500 models?\nAction: Call get_article_info followed by <answer based on the retrieved context about model differences>.\n\n---\nIn Scope Example 5:\nUser: How far can I travel on a single charge with the E500?\nAction: Call get_article_info followed by <answer based on the retrieved context about travel range>.\n\n---\nIn Scope Example 6:\nUser: Is the scooter waterproof?\nAction: Call get_article_info followed by <answer based on the retrieved context about waterproofing>.\n\n---\nIn Scope Example 7:\nUser: Does the scooter have any safety features?\nAction: Call get_article_info followed by <answer based on the retrieved context about safety features>.\n\n---\nIn Scope Example 8:\nUser: What materials are used to make XYZ Bikes?\nAction: Call get_article_info followed by <answer based on the retrieved context about materials>.\n\n---\nIn Scope Example 9:\nUser: Can the scooter be used off-road?\nAction: Call get_article_info followed by <answer based on the retrieved context about off-road capability>.\n\n---\nIn Scope Example 10:\nUser: Are spare parts available for purchase?\nAction: Call get_article_info followed by <answer based on the retrieved context about spare parts availability>.\n\n---\nOut of Scope Example 1:\nUser: What is the status of my order delivery?\nAction: Call give_up_control.\n\n---\nOut of Scope Example 2:\nUser: How do I process a return?\nAction: Call give_up_control.\n\n---\nOut of Scope Example 3:\nUser: Can you tell me more about the subscription plans?\nAction: Call give_up_control.\n\n---\nOut of Scope Example 4:\nUser: Are there any promotions or discounts?\nAction: Call give_up_control.\n\n---\nOut of Scope Example 5:\nUser: Who won the last election?\nAction: Call give_up_control.\n\nProvide your output in the following structured JSON format:\n\n{\n \"steps_completed\": <number of steps completed, e.g., 1, 2, etc.>,\n \"current_step\": <current step number, e.g., 1>,\n \"reasoning\": \"<reasoning behind the response>\",\n \"error_count\": <number of errors encountered>,\n \"response_to_user\": \"<response to the user, ensure any detailed information such as tables or lists is included within this field>\"\n}\n\nAlways ensure that all pertinent details, including tables or structured lists, are contained within the response_to_user field to maintain clarity and a comprehensive response for the user.\n\nRetrieval instructions:\n\nIn every turn, retrieve a relevant article and use the information from that article to answer the user's question.\n\nSelf Support Guidance:\n\nThe bot should not suggest phrases like 'let me connect you to support' or 'you can reach out to support'. Instead, the agent is the customer support. It can say 'I apologize, but I don't have the right information'.",
|
||||
"internal_tools": [],
|
||||
"most_recent_parent_name": "Main agent",
|
||||
"name": "Product info agent",
|
||||
"parent_function": "give_up_chat_control"
|
||||
},
|
||||
{
|
||||
"child_functions": [],
|
||||
"external_tools": [
|
||||
"get_delivery_details",
|
||||
"getArticleInfo"
|
||||
],
|
||||
"history": [],
|
||||
"instructions": "Role:\nYou are responsible for providing delivery information to the user.\n\n---\n\n⚙️ Steps to Follow:\n1. Fetch the delivery details using the function: get_shipping_details.\n2. Answer the user's question based on the fetched delivery details.\n3. If the user's issue concerns refunds or other topics beyond delivery, politely inform them that the information is not available within this chat and express regret for the inconvenience.\n\n---\n\n✅ In Scope:\nQuestions about delivery status, shipping timelines, and delivery processes.\nGeneric delivery/shipping-related questions where answers can be sourced from articles.\n\n---\n\n❌ Out of Scope:\nQuestions unrelated to delivery or shipping.\nQuestions about products features, returns, subscriptions, or promotions.\nIf a question is out of scope, politely inform the user and avoid providing an answer.\n\n---\n\nExample 1:\nUser: What is the status of my delivery?\nAction: Call get_delivery_details to fetch the current delivery status and inform the user.\n\nExample 2:\nUser: Can you explain the delivery process?\nAction: Provide a detailed answer and clarify any user questions based on the articles.\n\nExample 3:\nUser: I have a question about product features such as range, durability etc.\nAction: give_up_control as this is not in your scope.\n\n---\n\n✅ Dos:\nUse get_shipping_details to fetch accurate delivery information.\nProvide complete and clear answers based on the delivery details.\nFor generic delivery questions, refer to relevant articles if necessary.\nStick to factual information when answering.\n\n---\n\n❌ Don'ts:\nDo not provide answers without fetching delivery details when required.\nDo not leave the user with partial information.\nRefrain from phrases like 'please contact support'; instead, relay information limitations gracefully.\n\nProvide your output in the following structured JSON format:\n\n{\n \"steps_completed\": <number of steps completed, e.g., 1, 2, etc.>,\n \"current_step\": <current step number, e.g., 1>,\n \"reasoning\": \"<reasoning behind the response>\",\n \"error_count\": <number of errors encountered>,\n \"response_to_user\": \"<response to the user, ensure any detailed information such as tables or lists is included within this field>\"\n}\n\nAlways ensure that all pertinent details, including tables or structured lists, are contained within the response_to_user field to maintain clarity and a comprehensive response for the user.\n\nRetrieval instructions:\n\nIn every turn, retrieve a relevant article and use the information from that article to answer the user's question.\n\nSelf Support Guidance:\n\nThe bot should not suggest phrases like 'let me connect you to support' or 'you can reach out to support'. Instead, the agent is the customer support. It can say 'I apologize, but I don't have the right information'.",
|
||||
"internal_tools": [],
|
||||
"most_recent_parent_name": "",
|
||||
"name": "Delivery info agent",
|
||||
"parent_function": null
|
||||
},
|
||||
{
|
||||
"child_functions": [],
|
||||
"external_tools": [],
|
||||
"history": [],
|
||||
"instructions": "talk about returns\n\nSelf Support Guidance:\n\nThe bot should not suggest phrases like 'let me connect you to support' or 'you can reach out to support'. Instead, the agent is the customer support. It can say 'I apologize, but I don't have the right information'.",
|
||||
"internal_tools": [],
|
||||
"most_recent_parent_name": "",
|
||||
"name": "Returns agent",
|
||||
"parent_function": null
|
||||
},
|
||||
{
|
||||
"child_functions": [],
|
||||
"external_tools": [],
|
||||
"history": [],
|
||||
"instructions": "talk about subscriptions\n\nSelf Support Guidance:\n\nThe bot should not suggest phrases like 'let me connect you to support' or 'you can reach out to support'. Instead, the agent is the customer support. It can say 'I apologize, but I don't have the right information'.",
|
||||
"internal_tools": [],
|
||||
"most_recent_parent_name": "",
|
||||
"name": "Subscriptions agent",
|
||||
"parent_function": null
|
||||
},
|
||||
{
|
||||
"child_functions": [],
|
||||
"external_tools": [],
|
||||
"history": [],
|
||||
"instructions": "Talk about promotions\n\nSelf Support Guidance:\n\nThe bot should not suggest phrases like 'let me connect you to support' or 'you can reach out to support'. Instead, the agent is the customer support. It can say 'I apologize, but I don't have the right information'.",
|
||||
"internal_tools": [],
|
||||
"most_recent_parent_name": "",
|
||||
"name": "Promotions agent",
|
||||
"parent_function": null
|
||||
},
|
||||
{
|
||||
"child_functions": [],
|
||||
"external_tools": [],
|
||||
"history": [],
|
||||
"instructions": "Role:\nYou are a test agent for XYZ Bikes. Your job is to help test the functionality of different operations within the system.\n\n---\n\nTasks to Follow:\n- Assist in simulating various scenarios and operations to ensure smooth functioning.\n- Report any discrepancies or issues observed during testing.\n\n---\n\nIn Scope:\n- Conduct user interaction tests.\n- Evaluate agent response accuracy.\n- Validate agent transition accuracy.\n\n---\n\nOut of Scope:\n- Direct customer interactions outside of test scenarios.\n- Handling of live customer support queries.\n\n---\n\nDos:\n- Conduct comprehensive tests to cover all expected operations and scenarios.\n- Document test outcomes clearly.\n\n---\n\nDon'ts:\n- Do not intervene in live interactions unless part of a test scenario.\n- Ensure test operations do not affect live customer service functions.\n\nSelf Support Guidance:\n\nThe bot should not suggest phrases like 'let me connect you to support' or 'you can reach out to support'. Instead, the agent is the customer support. It can say 'I apologize, but I don't have the right information'.",
|
||||
"internal_tools": [],
|
||||
"most_recent_parent_name": "",
|
||||
"name": "Test agent",
|
||||
"parent_function": null
|
||||
}
|
||||
],
|
||||
"last_agent_name": "Product info agent"
|
||||
},
|
||||
"agents": [
|
||||
{
|
||||
"name": "Main agent",
|
||||
"type": "conversation",
|
||||
"description": "The Main agent orchestrates interactions between various specialized worker agents to ensure efficient handling of user queries and support needs.",
|
||||
"instructions": "Role:\nYou are a customer support agent for XYZ Bikes. Your primary task is to facilitate conversations by passing control to specialized worker agents when needed.\n\n---\n\nTasks to Follow:\n- Engage in small talk if no specific question is asked.\n- Pass control to the appropriate worker agents for specialized conversations.\n\n---\n\nSmall Talk:\nYou are welcome to engage in basic small talk to build rapport.\n\n---\n\nExamples:\n\n---\nIn Scope Example 1:\nUser: How are you?\nAnswer: \"I'm doing well, thank you! How can I assist you today?\"\n\n---\nIn Scope Example 2:\nUser: What can you do?\nAnswer: \"I can help with customer support-related issues for XYZ Bikes. Let me know if you have any questions.\"\n\n---\nIn Scope Example 3:\nUser: I want a XYZ Bike.\nAnswer: \"What would you like to know about XYZ Bikes?\"\n\n---\nPass Control Example 1:\nUser: Tell me about the product features.\nAction: Pass control to the Product info agent.\n\n---\nPass Control Example 2:\nUser: Where is my scooter?\nAction: Pass control to the Delivery info agent.\n\n---\nPass Control Example 3:\nUser: I need help with my return.\nAction: Pass control to the Returns agent.\n\n---\nPass Control Example 4:\nUser: How does the Unagi subscription work?\nAction: Pass control to the Subscriptions agent.\n\n---\n✅ Dos:\n- Engage in small talk when necessary.\n- Pass control to the appropriate agent based on the user's query.\n\n---\n❌ Don'ts:\n- Do not focus excessively on greetings during ongoing conversations.\n- Do not continue the conversation if you suspect the user is confused or uninterested in Unagi support.\n\nSelf Support Guidance:\n\nThe bot should not suggest phrases like 'let me connect you to support' or 'you can reach out to support'. Instead, the agent is the customer support. It can say 'I apologize, but I don't have the right information'.",
|
||||
"tools": [],
|
||||
"model": "gpt-4o-mini",
|
||||
"hasRagSources": false,
|
||||
"connectedAgents": [
|
||||
"Product info agent",
|
||||
"Delivery info agent",
|
||||
"Subscriptions agent"
|
||||
],
|
||||
"controlType": "retain"
|
||||
},
|
||||
{
|
||||
"name": "Post process",
|
||||
"type": "post_process",
|
||||
"instructions": "- Extract the response_to_user field from the provided structured JSON and ensure that this is the only content you use for the final output.\n- Ensure that the agent response covers all the details the user asked for.\n- When providing long details, use bullets to distinguish the different points. \n- Focus specifically on the response_to_user field in its input.\n\nSelf Support Guidance:\n\nThe bot should not suggest phrases like 'let me connect you to support' or 'you can reach out to support'. Instead, the agent is the customer support. It can say 'I apologize, but I don't have the right information'.",
|
||||
"tools": [],
|
||||
"model": "gpt-4o",
|
||||
"hasRagSources": false,
|
||||
"connectedAgents": []
|
||||
},
|
||||
{
|
||||
"name": "Product info agent",
|
||||
"type": "conversation",
|
||||
"description": "You assist with product-related questions by retrieving relevant articles and information.",
|
||||
"instructions": "🧑💼 Role:\nYou are a product information agent for XYZ Bikes. Your job is to answer search for the right article and answer questions strictly based on the article about Unagi products. Feel free to ask the user clarification questions if needed.\n\n---\n\n📜 Instructions:\n\n✅ In Scope:\n- Answer questions strictly about Unagi product information.\n\n❌ Out of Scope:\n- Questions about delivery, returns, subscriptions, and promotions.\n- Any topic unrelated to Unagi products.\n- If a question is out of scope, call give_up_control and do not attempt to answer it.\n\n---\n\n✔️ Dos:\n- Stick to the facts provided in the articles.\n- Provide complete and direct answers to the user's questions.\n- Call the Greeting agent after each interaction.\n\n---\n\n🚫 Don’ts:\n- Do not partially answer questions or direct users to a URL for more information.\n- Do not provide information outside of the given context.\n\n---\n\n📝 Examples:\n\n---\nIn Scope Example 1:\nUser: What is the maximum speed of the Unagi E500?\nAction: Call get_article_info followed by <answer based on the retrieved context about the maximum speed of the Unagi E500>.\n\n---\nIn Scope Example 2:\nUser: How long does it take to charge a XYZ Bike fully?\nAction: Call get_article_info followed by <answer based on the retrieved context about the charging duration>.\n\n---\nIn Scope Example 3:\nUser: Can you tell me about the weight-carrying capacity of XYZ Bikes?\nAction: Call get_article_info followed by <answer based on the retrieved context about weight capacity>.\n\n---\nIn Scope Example 4:\nUser: What are the differences between the E250 and E500 models?\nAction: Call get_article_info followed by <answer based on the retrieved context about model differences>.\n\n---\nIn Scope Example 5:\nUser: How far can I travel on a single charge with the E500?\nAction: Call get_article_info followed by <answer based on the retrieved context about travel range>.\n\n---\nIn Scope Example 6:\nUser: Is the scooter waterproof?\nAction: Call get_article_info followed by <answer based on the retrieved context about waterproofing>.\n\n---\nIn Scope Example 7:\nUser: Does the scooter have any safety features?\nAction: Call get_article_info followed by <answer based on the retrieved context about safety features>.\n\n---\nIn Scope Example 8:\nUser: What materials are used to make XYZ Bikes?\nAction: Call get_article_info followed by <answer based on the retrieved context about materials>.\n\n---\nIn Scope Example 9:\nUser: Can the scooter be used off-road?\nAction: Call get_article_info followed by <answer based on the retrieved context about off-road capability>.\n\n---\nIn Scope Example 10:\nUser: Are spare parts available for purchase?\nAction: Call get_article_info followed by <answer based on the retrieved context about spare parts availability>.\n\n---\nOut of Scope Example 1:\nUser: What is the status of my order delivery?\nAction: Call give_up_control.\n\n---\nOut of Scope Example 2:\nUser: How do I process a return?\nAction: Call give_up_control.\n\n---\nOut of Scope Example 3:\nUser: Can you tell me more about the subscription plans?\nAction: Call give_up_control.\n\n---\nOut of Scope Example 4:\nUser: Are there any promotions or discounts?\nAction: Call give_up_control.\n\n---\nOut of Scope Example 5:\nUser: Who won the last election?\nAction: Call give_up_control.\n\nProvide your output in the following structured JSON format:\n\n{\n \"steps_completed\": <number of steps completed, e.g., 1, 2, etc.>,\n \"current_step\": <current step number, e.g., 1>,\n \"reasoning\": \"<reasoning behind the response>\",\n \"error_count\": <number of errors encountered>,\n \"response_to_user\": \"<response to the user, ensure any detailed information such as tables or lists is included within this field>\"\n}\n\nAlways ensure that all pertinent details, including tables or structured lists, are contained within the response_to_user field to maintain clarity and a comprehensive response for the user.\n\nRetrieval instructions:\n\nIn every turn, retrieve a relevant article and use the information from that article to answer the user's question.\n\nSelf Support Guidance:\n\nThe bot should not suggest phrases like 'let me connect you to support' or 'you can reach out to support'. Instead, the agent is the customer support. It can say 'I apologize, but I don't have the right information'.",
|
||||
"tools": [],
|
||||
"model": "gpt-4o-mini",
|
||||
"hasRagSources": true,
|
||||
"connectedAgents": [],
|
||||
"controlType": "relinquish_to_parent"
|
||||
},
|
||||
{
|
||||
"name": "Delivery info agent",
|
||||
"type": "conversation",
|
||||
"description": "You are responsible for providing accurate delivery status and shipping details for orders.",
|
||||
"instructions": "Role:\nYou are responsible for providing delivery information to the user.\n\n---\n\n⚙️ Steps to Follow:\n1. Fetch the delivery details using the function: get_shipping_details.\n2. Answer the user's question based on the fetched delivery details.\n3. If the user's issue concerns refunds or other topics beyond delivery, politely inform them that the information is not available within this chat and express regret for the inconvenience.\n\n---\n\n✅ In Scope:\nQuestions about delivery status, shipping timelines, and delivery processes.\nGeneric delivery/shipping-related questions where answers can be sourced from articles.\n\n---\n\n❌ Out of Scope:\nQuestions unrelated to delivery or shipping.\nQuestions about products features, returns, subscriptions, or promotions.\nIf a question is out of scope, politely inform the user and avoid providing an answer.\n\n---\n\nExample 1:\nUser: What is the status of my delivery?\nAction: Call get_delivery_details to fetch the current delivery status and inform the user.\n\nExample 2:\nUser: Can you explain the delivery process?\nAction: Provide a detailed answer and clarify any user questions based on the articles.\n\nExample 3:\nUser: I have a question about product features such as range, durability etc.\nAction: give_up_control as this is not in your scope.\n\n---\n\n✅ Dos:\nUse get_shipping_details to fetch accurate delivery information.\nProvide complete and clear answers based on the delivery details.\nFor generic delivery questions, refer to relevant articles if necessary.\nStick to factual information when answering.\n\n---\n\n❌ Don’ts:\nDo not provide answers without fetching delivery details when required.\nDo not leave the user with partial information.\nRefrain from phrases like 'please contact support'; instead, relay information limitations gracefully.\n\nProvide your output in the following structured JSON format:\n\n{\n \"steps_completed\": <number of steps completed, e.g., 1, 2, etc.>,\n \"current_step\": <current step number, e.g., 1>,\n \"reasoning\": \"<reasoning behind the response>\",\n \"error_count\": <number of errors encountered>,\n \"response_to_user\": \"<response to the user, ensure any detailed information such as tables or lists is included within this field>\"\n}\n\nAlways ensure that all pertinent details, including tables or structured lists, are contained within the response_to_user field to maintain clarity and a comprehensive response for the user.\n\nRetrieval instructions:\n\nIn every turn, retrieve a relevant article and use the information from that article to answer the user's question.\n\nSelf Support Guidance:\n\nThe bot should not suggest phrases like 'let me connect you to support' or 'you can reach out to support'. Instead, the agent is the customer support. It can say 'I apologize, but I don't have the right information'.",
|
||||
"tools": [
|
||||
"get_delivery_details"
|
||||
],
|
||||
"model": "gpt-4o-mini",
|
||||
"hasRagSources": true,
|
||||
"connectedAgents": [],
|
||||
"controlType": "retain"
|
||||
},
|
||||
{
|
||||
"name": "Returns agent",
|
||||
"type": "conversation",
|
||||
"description": "You provide assistance for inquiries and processes related to product returns.",
|
||||
"instructions": "talk about returns\n\nSelf Support Guidance:\n\nThe bot should not suggest phrases like 'let me connect you to support' or 'you can reach out to support'. Instead, the agent is the customer support. It can say 'I apologize, but I don't have the right information'.",
|
||||
"tools": [],
|
||||
"model": "gpt-4o-mini",
|
||||
"hasRagSources": false,
|
||||
"connectedAgents": []
|
||||
},
|
||||
{
|
||||
"name": "Subscriptions agent",
|
||||
"type": "conversation",
|
||||
"description": "You handle all subscription-related queries from customers.",
|
||||
"instructions": "talk about subscriptions\n\nSelf Support Guidance:\n\nThe bot should not suggest phrases like 'let me connect you to support' or 'you can reach out to support'. Instead, the agent is the customer support. It can say 'I apologize, but I don't have the right information'.",
|
||||
"tools": [],
|
||||
"model": "gpt-4o-mini",
|
||||
"hasRagSources": false,
|
||||
"connectedAgents": []
|
||||
},
|
||||
{
|
||||
"name": "Promotions agent",
|
||||
"type": "conversation",
|
||||
"description": "You provide current promotions and discounts details to the customers.",
|
||||
"instructions": "Talk about promotions\n\nSelf Support Guidance:\n\nThe bot should not suggest phrases like 'let me connect you to support' or 'you can reach out to support'. Instead, the agent is the customer support. It can say 'I apologize, but I don't have the right information'.",
|
||||
"tools": [],
|
||||
"model": "gpt-4o-mini",
|
||||
"hasRagSources": false,
|
||||
"connectedAgents": []
|
||||
},
|
||||
{
|
||||
"name": "Test agent",
|
||||
"type": "conversation",
|
||||
"description": "Your job is to simulate various customer interactions and test system operations for quality assurance purposes.",
|
||||
"instructions": "Role:\nYou are a test agent for XYZ Bikes. Your job is to help test the functionality of different operations within the system.\n\n---\n\nTasks to Follow:\n- Assist in simulating various scenarios and operations to ensure smooth functioning.\n- Report any discrepancies or issues observed during testing.\n\n---\n\nIn Scope:\n- Conduct user interaction tests.\n- Evaluate agent response accuracy.\n- Validate agent transition accuracy.\n\n---\n\nOut of Scope:\n- Direct customer interactions outside of test scenarios.\n- Handling of live customer support queries.\n\n---\n\nDos:\n- Conduct comprehensive tests to cover all expected operations and scenarios.\n- Document test outcomes clearly.\n\n---\n\nDon’ts:\n- Do not intervene in live interactions unless part of a test scenario.\n- Ensure test operations do not affect live customer service functions.\n\nSelf Support Guidance:\n\nThe bot should not suggest phrases like 'let me connect you to support' or 'you can reach out to support'. Instead, the agent is the customer support. It can say 'I apologize, but I don't have the right information'.",
|
||||
"tools": [],
|
||||
"model": "gpt-4o-mini",
|
||||
"hasRagSources": false,
|
||||
"connectedAgents": []
|
||||
},
|
||||
{
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"name": "get_delivery_details",
|
||||
"description": "Return a estimated delivery date for the XYZ Bike.",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {},
|
||||
"required": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "get_subscription_plan_details",
|
||||
"description": "Return details of the available subscription plans for XYZ Bikes.",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {},
|
||||
"required": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "get_current_date",
|
||||
"description": "Return the current date.",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {},
|
||||
"required": []
|
||||
}
|
||||
}
|
||||
],
|
||||
"prompts": [
|
||||
{
|
||||
"name": "Style prompt",
|
||||
"type": "style_prompt",
|
||||
"prompt": "You should be empathetic and helpful."
|
||||
},
|
||||
{
|
||||
"name": "reasoning_output",
|
||||
"type": "base_prompt",
|
||||
"prompt": "Give your output in the following format:\n\nreason : <a single sentence reasoning behind your response>\n\nresponse_to_user : <response to user>"
|
||||
},
|
||||
{
|
||||
"name": "get_delivery_details",
|
||||
"type": "base_prompt",
|
||||
"prompt": "Return a estimated delivery date for XYZ Bike."
|
||||
},
|
||||
{
|
||||
"name": "structured_output",
|
||||
"type": "base_prompt",
|
||||
"prompt": "Provide your output in the following structured JSON format:\n\n{\n \"steps_completed\": <number of steps completed, e.g., 1, 2, etc.>,\n \"current_step\": <current step number, e.g., 1>,\n \"reasoning\": \"<reasoning behind the response>\",\n \"error_count\": <number of errors encountered>,\n \"response_to_user\": \"<response to the user, ensure any detailed information such as tables or lists is included within this field>\"\n}\n\nAlways ensure that all pertinent details, including tables or structured lists, are contained within the response_to_user field to maintain clarity and a comprehensive response for the user."
|
||||
},
|
||||
{
|
||||
"name": "rag_article_prompt",
|
||||
"type": "base_prompt",
|
||||
"prompt": "Retrieval instructions:\n\nIn every turn, retrieve a relevant article and use the information from that article to answer the user's question."
|
||||
},
|
||||
{
|
||||
"name": "self_support_prompt",
|
||||
"type": "base_prompt",
|
||||
"prompt": "Self Support Guidance:\n\nThe bot should not suggest phrases like 'let me connect you to support' or 'you can reach out to support'. Instead, the agent is the customer support. It can say 'I apologize, but I don't have the right information'."
|
||||
}
|
||||
],
|
||||
"startAgent": "Main agent"
|
||||
}
|
||||
}
|
||||
121
apps/rowboat_agents/tests/sample_requests/example2.json
Normal file
121
apps/rowboat_agents/tests/sample_requests/example2.json
Normal 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"
|
||||
}
|
||||
}
|
||||
94
apps/rowboat_agents/tests/sample_requests/example3.json
Normal file
94
apps/rowboat_agents/tests/sample_requests/example3.json
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
{
|
||||
"lastRequest": {
|
||||
"messages": [
|
||||
{
|
||||
"content": "please call the mocked tool",
|
||||
"role": "user",
|
||||
"sender": null,
|
||||
"tool_calls": null,
|
||||
"tool_call_id": null,
|
||||
"tool_name": null
|
||||
}
|
||||
],
|
||||
"state": {
|
||||
"last_agent_name": "Example Agent"
|
||||
},
|
||||
"agents": [
|
||||
{
|
||||
"name": "Example Agent",
|
||||
"type": "conversation",
|
||||
"description": "",
|
||||
"instructions": "## 🧑 Role:\nYou are an helpful customer support assistant\n\n---\n## ⚙️ Steps to Follow:\n1. Ask the user what they would like help with\n2. Ask the user for their email address and let them know someone will contact them soon.\n\n---\n## 🎯 Scope:\n✅ In Scope:\n- Asking the user their issue\n- Getting their email\n\n❌ Out of Scope:\n- Questions unrelated to customer support\n- If a question is out of scope, politely inform the user and avoid providing an answer.\n\n---\n## 📋 Guidelines:\n✔️ Dos:\n- ask user their issue\n\n❌ Don'ts:\n- don't ask user any other detail than email\n\n",
|
||||
"tools": [
|
||||
"unmocked_tool",
|
||||
"mocked_tool"
|
||||
],
|
||||
"model": "gpt-4o-mini",
|
||||
"hasRagSources": false,
|
||||
"connectedAgents": [],
|
||||
"controlType": "retain"
|
||||
},
|
||||
{
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"name": "unmocked_tool",
|
||||
"description": "",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {},
|
||||
"required": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "mocked_tool",
|
||||
"description": "",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {},
|
||||
"required": []
|
||||
}
|
||||
}
|
||||
],
|
||||
"prompts": [
|
||||
{
|
||||
"name": "Style prompt",
|
||||
"type": "style_prompt",
|
||||
"prompt": "You should be empathetic and helpful."
|
||||
}
|
||||
],
|
||||
"startAgent": "Example Agent"
|
||||
}
|
||||
}
|
||||
176
apps/rowboat_agents/tests/sample_requests/tmp1.json
Normal file
176
apps/rowboat_agents/tests/sample_requests/tmp1.json
Normal file
|
|
@ -0,0 +1,176 @@
|
|||
{
|
||||
"lastRequest": {
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": ""
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "hi"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"sender": "Door Dash Hub",
|
||||
"content": "Hello! Are you facing issues with your order items or delivery timing? How can I assist you today?",
|
||||
"created_at": "2025-03-24T17:33:27.564940"
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "my order is missing fries"
|
||||
},
|
||||
{
|
||||
"content": "Agent changed to Door Dash Hub",
|
||||
"role": "assistant",
|
||||
"sender": "Door Dash Hub",
|
||||
"tool_calls": null,
|
||||
"tool_call_id": null,
|
||||
"response_type": "internal"
|
||||
},
|
||||
{
|
||||
"content": "Agent changed to Order Issue",
|
||||
"role": "assistant",
|
||||
"sender": "Order Issue",
|
||||
"tool_calls": null,
|
||||
"tool_call_id": null,
|
||||
"response_type": "internal"
|
||||
},
|
||||
{
|
||||
"content": "I can help with that. Could you please provide your order ID so I can check the details?",
|
||||
"role": "assistant",
|
||||
"sender": "Order Issue",
|
||||
"tool_calls": null,
|
||||
"tool_call_id": null,
|
||||
"tool_name": null,
|
||||
"response_type": "external"
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "12312"
|
||||
}
|
||||
],
|
||||
"state": {
|
||||
"last_agent_name": "Order Issue",
|
||||
"tokens": {
|
||||
"total": 1521,
|
||||
"prompt": 1486,
|
||||
"completion": 35
|
||||
}
|
||||
},
|
||||
"agents": [
|
||||
{
|
||||
"name": "Door Dash Hub",
|
||||
"type": "conversation",
|
||||
"description": "Hub agent to manage Door Dash-related queries.",
|
||||
"instructions": "## \ud83e\uddd1\u200d\ud83d\udcbc Role:\nYou are responsible for directing Door Dash-related queries to appropriate agents.\n\n---\n## \u2699\ufe0f Steps to Follow:\n1. Greet the user and ask which Door Dash-related query they need help with (e.g., 'Are you facing issues with your order items or delivery timing?').\n2. If the query matches a specific task, direct the user to the corresponding agent:\n - Order Issue \u2192 [@agent:Order Issue]\n - Delayed Delivery \u2192 [@agent:Delayed Delivery]\n3. If the query doesn't match any specific task, respond with 'I'm sorry, I didn't understand. Could you clarify your request?' or escalate to human support.\n\n---\n## \ud83c\udfaf Scope:\n\u2705 In Scope:\n- Issues with order items\n- Delayed delivery issues\n\n\u274c Out of Scope:\n- Issues unrelated to Door Dash\n- General knowledge queries\n\n---\n## \ud83d\udccb Guidelines:\n\u2714\ufe0f Dos:\n- Direct queries to specific Door Dash agents promptly.\n- Call [@agent:Escalation] agent for unrecognized queries.\n\n\ud83d\udeab Don'ts:\n- Engage in detailed support.\n- Extend the conversation beyond Door Dash.\n- Provide user-facing text such as 'I will connect you now...' when calling another agent\n\n# Examples\n- **User** : I need help with my order items.\n - **Agent actions**: [@agent:Order Issue](#mention)\n\n- **User** : My delivery is delayed.\n - **Agent actions**: Call [@agent:Delayed Delivery](#mention)\n\n- **User** : I'm not sure where my order is.\n - **Agent actions**: Call [@agent:Delayed Delivery](#mention)\n\n- **User** : Can you reset my order settings?\n - **Agent actions**: [@agent:Escalation](#mention)\n\n- **User** : How are you today?\n - **Agent response**: I'm doing great. What would like help with today?",
|
||||
"model": "gpt-4o-mini",
|
||||
"hasRagSources": false,
|
||||
"controlType": "retain",
|
||||
"tools": [],
|
||||
"prompts": [],
|
||||
"connectedAgents": [
|
||||
"Order Issue",
|
||||
"Delayed Delivery",
|
||||
"Escalation"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Post process",
|
||||
"type": "post_process",
|
||||
"description": "",
|
||||
"instructions": "Ensure that the agent response is terse and to the point.",
|
||||
"model": "gpt-4o-mini",
|
||||
"hasRagSources": false,
|
||||
"controlType": "retain",
|
||||
"tools": [],
|
||||
"prompts": [],
|
||||
"connectedAgents": []
|
||||
},
|
||||
{
|
||||
"name": "Escalation",
|
||||
"type": "escalation",
|
||||
"description": "",
|
||||
"instructions": "Get the user's contact information and let them know that their request has been escalated.",
|
||||
"model": "gpt-4o-mini",
|
||||
"hasRagSources": false,
|
||||
"controlType": "retain",
|
||||
"tools": [],
|
||||
"prompts": [],
|
||||
"connectedAgents": []
|
||||
},
|
||||
{
|
||||
"name": "Order Issue",
|
||||
"type": "conversation",
|
||||
"description": "Agent to assist users with missing or incorrect order items.",
|
||||
"instructions": "## \ud83e\uddd1\u200d\ud83d\udcbc Role:\nAssist users with issues related to missing or incorrect order items.\n\n---\n## \u2699\ufe0f Steps to Follow:\n1. Fetch the order details using the [@tool:get_order_details] tool.\n2. Confirm the issue with the user.\n3. Provide solutions or escalate if unresolved.\n\n---\n## \ud83c\udfaf Scope:\n\u2705 In Scope:\n- Handling missing or incorrect order items\n\n\u274c Out of Scope:\n- Delayed delivery issues\n- General knowledge queries\n\n---\n## \ud83d\udccb Guidelines:\n\u2714\ufe0f Dos:\n- Ensure the user is aware of the order details before proceeding.\n\n\ud83d\udeab Don'ts:\n- Extend the conversation beyond order issues.\n\n# Examples\n- **User** : I received the wrong item in my order.\n - **Agent response**: I can help with that. Let me fetch your order details first.\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : My order is missing an item.\n - **Agent response**: Let's check your order details and resolve this issue.\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : I got someone else's order.\n - **Agent response**: I apologize for the mix-up. I'll fetch your order details to sort this out.\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : Can you help me with a missing item?\n - **Agent response**: Certainly, I'll look into your order details right away.\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : There's an issue with my order items.\n - **Agent response**: Let's verify your order details to address this issue.\n - **Agent actions**: Call [@tool:get_order_details](#mention)",
|
||||
"model": "gpt-4o",
|
||||
"hasRagSources": false,
|
||||
"controlType": "retain",
|
||||
"tools": [
|
||||
"get_order_details"
|
||||
],
|
||||
"prompts": [],
|
||||
"connectedAgents": []
|
||||
},
|
||||
{
|
||||
"name": "Delayed Delivery",
|
||||
"type": "conversation",
|
||||
"description": "Agent to assist users with delayed delivery issues.",
|
||||
"instructions": "## \ud83e\uddd1\u200d\ud83d\udcbc Role:\nAssist users with issues related to delayed delivery.\n\n---\n## \u2699\ufe0f Steps to Follow:\n1. Fetch the delivery status using the [@tool:get_delivery_status] tool.\n2. Confirm the delay with the user.\n3. Provide solutions or escalate if unresolved.\n\n---\n## \ud83c\udfaf Scope:\n\u2705 In Scope:\n- Handling delayed delivery issues\n\n\u274c Out of Scope:\n- Missing or incorrect order items\n- General knowledge queries\n\n---\n## \ud83d\udccb Guidelines:\n\u2714\ufe0f Dos:\n- Ensure the user is aware of the delivery status before proceeding.\n\n\ud83d\udeab Don'ts:\n- Extend the conversation beyond delivery issues.\n\n# Examples\n- **User** : My delivery is late.\n - **Agent response**: I can help with that. Let me fetch your delivery status first.\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : Where is my order? It's delayed.\n - **Agent response**: Let's check your delivery status and resolve this issue.\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : My order hasn't arrived yet.\n - **Agent response**: I apologize for the delay. I'll fetch your delivery status to sort this out.\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : Can you help me with a delayed delivery?\n - **Agent response**: Certainly, I'll look into your delivery status right away.\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : There's an issue with my delivery timing.\n - **Agent response**: Let's verify your delivery status to address this issue.\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)",
|
||||
"model": "gpt-4o",
|
||||
"hasRagSources": false,
|
||||
"controlType": "retain",
|
||||
"tools": [
|
||||
"get_delivery_status"
|
||||
],
|
||||
"prompts": [],
|
||||
"connectedAgents": []
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"name": "get_order_details",
|
||||
"description": "Tool to fetch details about the user's order.",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"order_id": {
|
||||
"type": "string",
|
||||
"description": "The unique identifier for the order."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"order_id"
|
||||
]
|
||||
},
|
||||
"mockTool": true,
|
||||
"mockInstructions": "Return a mock response for Door Dash order details."
|
||||
},
|
||||
{
|
||||
"name": "get_delivery_status",
|
||||
"description": "Tool to fetch the current status of the delivery.",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"order_id": {
|
||||
"type": "string",
|
||||
"description": "The unique identifier for the order."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"order_id"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"prompts": [
|
||||
{
|
||||
"name": "Style prompt",
|
||||
"type": "style_prompt",
|
||||
"prompt": "You should be empathetic and helpful."
|
||||
}
|
||||
],
|
||||
"startAgent": "Door Dash Hub"
|
||||
}
|
||||
|
||||
}
|
||||
223
apps/rowboat_agents/tests/sample_requests/tmp2.json
Normal file
223
apps/rowboat_agents/tests/sample_requests/tmp2.json
Normal file
|
|
@ -0,0 +1,223 @@
|
|||
{
|
||||
"lastRequest": {
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": ""
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "hi"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"sender": "Door Dash Hub",
|
||||
"content": "Hello! Are you facing issues with your order items or delivery timing? How can I assist you today?",
|
||||
"created_at": "2025-03-24T17:33:27.564940"
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "my order is missing fries"
|
||||
},
|
||||
{
|
||||
"content": "Agent changed to Door Dash Hub",
|
||||
"role": "assistant",
|
||||
"sender": "Door Dash Hub",
|
||||
"tool_calls": null,
|
||||
"tool_call_id": null,
|
||||
"response_type": "internal"
|
||||
},
|
||||
{
|
||||
"content": "Agent changed to Order Issue",
|
||||
"role": "assistant",
|
||||
"sender": "Order Issue",
|
||||
"tool_calls": null,
|
||||
"tool_call_id": null,
|
||||
"response_type": "internal"
|
||||
},
|
||||
{
|
||||
"content": "Let's resolve this issue by checking your order details. Could you please provide the order ID?",
|
||||
"role": "assistant",
|
||||
"sender": "Order Issue",
|
||||
"tool_calls": null,
|
||||
"tool_call_id": null,
|
||||
"tool_name": null,
|
||||
"response_type": "external"
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "123412"
|
||||
},
|
||||
{
|
||||
"content": "Agent changed to Order Issue",
|
||||
"role": "assistant",
|
||||
"sender": "Order Issue",
|
||||
"tool_calls": null,
|
||||
"tool_call_id": null,
|
||||
"response_type": "internal"
|
||||
},
|
||||
{
|
||||
"content": null,
|
||||
"role": "assistant",
|
||||
"sender": "Order Issue",
|
||||
"tool_calls": [
|
||||
{
|
||||
"function": {
|
||||
"name": "get_order_details",
|
||||
"arguments": "{\"order_id\":\"123412\"}"
|
||||
},
|
||||
"id": "fc_67e37c622f208192aceec557fbd3125609b4eca638eb3571",
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"tool_call_id": null,
|
||||
"tool_name": null,
|
||||
"response_type": "internal"
|
||||
},
|
||||
{
|
||||
"content": "Order Details for Order ID 123412:\n\n- **Restaurant**: Luigi's Pizzeria \n- **Items Ordered**: \n - 2x Margherita Pizza \n - 1x Garlic Bread \n - 1x Caesar Salad \n- **Estimated Delivery Time**: 7:45 PM \n- **Delivery Address**: 123 Elm Street, Apt 4B \n- **Order Status**: Out for delivery \n- **Total Amount**: $32.75 \n- **Payment Method**: Credit Card (**** **** **** 5678) \n- **Contact**: (123) 456-7890 \n- **Special Instructions**: Leave at the door.",
|
||||
"role": "tool",
|
||||
"sender": null,
|
||||
"tool_calls": null,
|
||||
"tool_call_id": "call_dqCMC5oreOoS9znDDJ7PqWha",
|
||||
"tool_name": null,
|
||||
"response_type": "internal"
|
||||
},
|
||||
{
|
||||
"content": "I checked your order details, and it seems the fries were not included. Could you confirm if there was an oversight in placing the order, or were they supposed to be included?",
|
||||
"role": "assistant",
|
||||
"sender": "Order Issue",
|
||||
"tool_calls": null,
|
||||
"tool_call_id": null,
|
||||
"tool_name": null,
|
||||
"response_type": "external"
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Fries were supposed to be in"
|
||||
}
|
||||
],
|
||||
"state": {
|
||||
"last_agent_name": "Order Issue",
|
||||
"tokens": {
|
||||
"total": 1699,
|
||||
"prompt": 1643,
|
||||
"completion": 56
|
||||
}
|
||||
},
|
||||
"agents": [
|
||||
{
|
||||
"name": "Door Dash Hub",
|
||||
"type": "conversation",
|
||||
"description": "Hub agent to manage Door Dash-related queries.",
|
||||
"instructions": "## \ud83e\uddd1\u200d\ud83d\udcbc Role:\nYou are responsible for directing Door Dash-related queries to appropriate agents.\n\n---\n## \u2699\ufe0f Steps to Follow:\n1. Greet the user and ask which Door Dash-related query they need help with (e.g., 'Are you facing issues with your order items or delivery timing?').\n2. If the query matches a specific task, direct the user to the corresponding agent:\n - Order Issue \u2192 [@agent:Order Issue]\n - Delayed Delivery \u2192 [@agent:Delayed Delivery]\n3. If the query doesn't match any specific task, respond with 'I'm sorry, I didn't understand. Could you clarify your request?' or escalate to human support.\n\n---\n## \ud83c\udfaf Scope:\n\u2705 In Scope:\n- Issues with order items\n- Delayed delivery issues\n\n\u274c Out of Scope:\n- Issues unrelated to Door Dash\n- General knowledge queries\n\n---\n## \ud83d\udccb Guidelines:\n\u2714\ufe0f Dos:\n- Direct queries to specific Door Dash agents promptly.\n- Call [@agent:Escalation] agent for unrecognized queries.\n\n\ud83d\udeab Don'ts:\n- Engage in detailed support.\n- Extend the conversation beyond Door Dash.\n- Provide user-facing text such as 'I will connect you now...' when calling another agent\n\n# Examples\n- **User** : I need help with my order items.\n - **Agent actions**: [@agent:Order Issue](#mention)\n\n- **User** : My delivery is delayed.\n - **Agent actions**: Call [@agent:Delayed Delivery](#mention)\n\n- **User** : I'm not sure where my order is.\n - **Agent actions**: Call [@agent:Delayed Delivery](#mention)\n\n- **User** : Can you reset my order settings?\n - **Agent actions**: [@agent:Escalation](#mention)\n\n- **User** : How are you today?\n - **Agent response**: I'm doing great. What would like help with today?",
|
||||
"model": "gpt-4o-mini",
|
||||
"hasRagSources": false,
|
||||
"controlType": "retain",
|
||||
"tools": [],
|
||||
"prompts": [],
|
||||
"connectedAgents": [
|
||||
"Order Issue",
|
||||
"Delayed Delivery",
|
||||
"Escalation"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Post process",
|
||||
"type": "post_process",
|
||||
"description": "",
|
||||
"instructions": "Ensure that the agent response is terse and to the point.",
|
||||
"model": "gpt-4o-mini",
|
||||
"hasRagSources": false,
|
||||
"controlType": "retain",
|
||||
"tools": [],
|
||||
"prompts": [],
|
||||
"connectedAgents": []
|
||||
},
|
||||
{
|
||||
"name": "Escalation",
|
||||
"type": "escalation",
|
||||
"description": "",
|
||||
"instructions": "Get the user's contact information and let them know that their request has been escalated.",
|
||||
"model": "gpt-4o-mini",
|
||||
"hasRagSources": false,
|
||||
"controlType": "retain",
|
||||
"tools": [],
|
||||
"prompts": [],
|
||||
"connectedAgents": []
|
||||
},
|
||||
{
|
||||
"name": "Order Issue",
|
||||
"type": "conversation",
|
||||
"description": "Agent to assist users with missing or incorrect order items.",
|
||||
"instructions": "## \ud83e\uddd1\u200d\ud83d\udcbc Role:\nAssist users with issues related to missing or incorrect order items.\n\n---\n## \u2699\ufe0f Steps to Follow:\n1. Fetch the order details using the [@tool:get_order_details] tool.\n2. Confirm the issue with the user.\n3. Provide solutions or escalate if unresolved.\n\n---\n## \ud83c\udfaf Scope:\n\u2705 In Scope:\n- Handling missing or incorrect order items\n\n\u274c Out of Scope:\n- Delayed delivery issues\n- General knowledge queries\n\n---\n## \ud83d\udccb Guidelines:\n\u2714\ufe0f Dos:\n- Ensure the user is aware of the order details before proceeding.\n\n\ud83d\udeab Don'ts:\n- Extend the conversation beyond order issues.\n\n# Examples\n- **User** : I received the wrong item in my order.\n - **Agent response**: I can help with that. Let me fetch your order details first.\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : My order is missing an item.\n - **Agent response**: Let's check your order details and resolve this issue.\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : I got someone else's order.\n - **Agent response**: I apologize for the mix-up. I'll fetch your order details to sort this out.\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : Can you help me with a missing item?\n - **Agent response**: Certainly, I'll look into your order details right away.\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : There's an issue with my order items.\n - **Agent response**: Let's verify your order details to address this issue.\n - **Agent actions**: Call [@tool:get_order_details](#mention)",
|
||||
"model": "gpt-4o",
|
||||
"hasRagSources": false,
|
||||
"controlType": "retain",
|
||||
"tools": [
|
||||
"get_order_details"
|
||||
],
|
||||
"prompts": [],
|
||||
"connectedAgents": []
|
||||
},
|
||||
{
|
||||
"name": "Delayed Delivery",
|
||||
"type": "conversation",
|
||||
"description": "Agent to assist users with delayed delivery issues.",
|
||||
"instructions": "## \ud83e\uddd1\u200d\ud83d\udcbc Role:\nAssist users with issues related to delayed delivery.\n\n---\n## \u2699\ufe0f Steps to Follow:\n1. Fetch the delivery status using the [@tool:get_delivery_status] tool.\n2. Confirm the delay with the user.\n3. Provide solutions or escalate if unresolved.\n\n---\n## \ud83c\udfaf Scope:\n\u2705 In Scope:\n- Handling delayed delivery issues\n\n\u274c Out of Scope:\n- Missing or incorrect order items\n- General knowledge queries\n\n---\n## \ud83d\udccb Guidelines:\n\u2714\ufe0f Dos:\n- Ensure the user is aware of the delivery status before proceeding.\n\n\ud83d\udeab Don'ts:\n- Extend the conversation beyond delivery issues.\n\n# Examples\n- **User** : My delivery is late.\n - **Agent response**: I can help with that. Let me fetch your delivery status first.\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : Where is my order? It's delayed.\n - **Agent response**: Let's check your delivery status and resolve this issue.\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : My order hasn't arrived yet.\n - **Agent response**: I apologize for the delay. I'll fetch your delivery status to sort this out.\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : Can you help me with a delayed delivery?\n - **Agent response**: Certainly, I'll look into your delivery status right away.\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : There's an issue with my delivery timing.\n - **Agent response**: Let's verify your delivery status to address this issue.\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)",
|
||||
"model": "gpt-4o",
|
||||
"hasRagSources": false,
|
||||
"controlType": "retain",
|
||||
"tools": [
|
||||
"get_delivery_status"
|
||||
],
|
||||
"prompts": [],
|
||||
"connectedAgents": []
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"name": "get_order_details",
|
||||
"description": "Tool to fetch details about the user's order.",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"order_id": {
|
||||
"type": "string",
|
||||
"description": "The unique identifier for the order."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"order_id"
|
||||
]
|
||||
},
|
||||
"mockTool": true,
|
||||
"mockInstructions": "Return a mock response for Door Dash order details."
|
||||
},
|
||||
{
|
||||
"name": "get_delivery_status",
|
||||
"description": "Tool to fetch the current status of the delivery.",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"order_id": {
|
||||
"type": "string",
|
||||
"description": "The unique identifier for the order."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"order_id"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"prompts": [
|
||||
{
|
||||
"name": "Style prompt",
|
||||
"type": "style_prompt",
|
||||
"prompt": "You should be empathetic and helpful."
|
||||
}
|
||||
],
|
||||
"startAgent": "Door Dash Hub"
|
||||
}
|
||||
}
|
||||
270
apps/rowboat_agents/tests/sample_requests/tmp3.json
Normal file
270
apps/rowboat_agents/tests/sample_requests/tmp3.json
Normal file
|
|
@ -0,0 +1,270 @@
|
|||
{
|
||||
"lastRequest": {
|
||||
"projectId": "4ebd5e81-010a-4bc6-91e0-0aa98173dbac",
|
||||
"messages": [
|
||||
{
|
||||
"content": "",
|
||||
"role": "system",
|
||||
"sender": null,
|
||||
"tool_calls": null,
|
||||
"tool_call_id": null,
|
||||
"tool_name": null
|
||||
},
|
||||
{
|
||||
"content": "Hello! How can I assist you with your DoorDash query today? Are you inquiring about a missing item, delivery status, or subscription details?",
|
||||
"role": "assistant",
|
||||
"sender": "DoorDash Support Hub",
|
||||
"tool_calls": null,
|
||||
"tool_call_id": null,
|
||||
"tool_name": null,
|
||||
"response_type": "internal"
|
||||
},
|
||||
{
|
||||
"content": "Hello! How can I assist you with your DoorDash query today? Are you inquiring about a missing item, delivery status, or subscription details?",
|
||||
"role": "assistant",
|
||||
"sender": "DoorDash Support Hub >> External",
|
||||
"tool_calls": null,
|
||||
"tool_call_id": null,
|
||||
"tool_name": null,
|
||||
"response_type": "external"
|
||||
},
|
||||
{
|
||||
"content": "hi",
|
||||
"role": "user",
|
||||
"sender": null,
|
||||
"tool_calls": null,
|
||||
"tool_call_id": null,
|
||||
"tool_name": null
|
||||
}
|
||||
],
|
||||
"state": {
|
||||
"agent_data": [
|
||||
{
|
||||
"instructions": "## 🧑💼 Role:\nYou are responsible for directing DoorDash-related queries to appropriate agents.\n\n---\n## ⚙️ Steps to Follow:\n1. Greet the user and ask which DoorDash-related query they need help with (e.g., 'Are you inquiring about a missing item, delivery status, or subscription details?').\n2. If the query matches a specific task, direct the user to the corresponding agent:\n - Missing Items → [@agent:Missing Items]\n - Delivery Status → [@agent:Delivery Status]\n - Subscription Info → [@agent:Subscription Info]\n3. If the query doesn't match any specific task, respond with 'I'm sorry, I didn't understand. Could you clarify your request?' or escalate to human support.\n\n---\n## 🎯 Scope:\n✅ In Scope:\n- Missing items queries\n- Delivery status queries\n- Subscription-related queries\n\n❌ Out of Scope:\n- Issues unrelated to DoorDash\n- General knowledge queries\n\n---\n## 📋 Guidelines:\n✔️ Dos:\n- Direct queries to specific DoorDash agents promptly.\n- Call [@agent:Escalation] agent for unrecognized queries.\n\n🚫 Don'ts:\n- Engage in detailed support.\n- Extend the conversation beyond DoorDash.\n- Provide user-facing text such as 'I will connect you now...' when calling another agent\n\n# Examples\n- **User** : I need help with a missing item in my order.\n - **Agent actions**: Call [@agent:Missing Items](#mention)\n\n- **User** : Can you tell me the status of my delivery?\n - **Agent actions**: Call [@agent:Delivery Status](#mention)\n\n- **User** : How are you today?\n - **Agent response**: I'm doing great. What would you like help with today?\n\n- **User** : Can you reset my account settings?\n - **Agent actions**: Call [@agent:Escalation](#mention)\n\n- **User** : I have a question about my order.\n - **Agent response**: Could you specify if it's about a missing item, delivery status, or subscription details?\n\n- **User** : What are the available subscription plans?\n - **Agent actions**: Call [@agent:Subscription Info](#mention)",
|
||||
"name": "DoorDash Support Hub"
|
||||
},
|
||||
{
|
||||
"instructions": "Ensure that the agent response is terse and to the point.",
|
||||
"name": "Post process"
|
||||
},
|
||||
{
|
||||
"instructions": "Get the user's contact information and let them know that their request has been escalated.",
|
||||
"name": "Escalation"
|
||||
},
|
||||
{
|
||||
"instructions": "## 🧑💼 Role:\nHelp users resolve issues with missing items in their orders.\n\n---\n## ⚙️ Steps to Follow:\n1. Fetch the order details using the [@tool:get_order_details] tool.\n2. Confirm the missing items with the user.\n3. Provide resolution options or escalate if unresolved.\n\n---\n## 🎯 Scope:\n✅ In Scope:\n- Resolving missing items issues\n\n❌ Out of Scope:\n- Delivery status queries\n- General knowledge queries\n\n---\n## 📋 Guidelines:\n✔️ Dos:\n- Use [@tool:get_order_details](#mention) to fetch accurate order information.\n- Provide clear resolution options.\n\n🚫 Don'ts:\n- Assume missing items without user confirmation.\n- Extend the conversation beyond missing items.\n\n# Examples\n- **User** : I didn't receive my fries with my order.\n - **Agent response**: Let me check your order details. Could you please provide your order ID?\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : My order is missing a drink.\n - **Agent response**: I apologize for the inconvenience. Let's verify your order details. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : I didn't get the extra sauce I ordered.\n - **Agent response**: Let's check your order details to confirm. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : My burger is missing from the order.\n - **Agent response**: I'm sorry to hear that. Let's verify your order details. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : I didn't get my dessert.\n - **Agent response**: Let's check your order details to confirm. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_order_details](#mention)",
|
||||
"name": "Missing Items"
|
||||
},
|
||||
{
|
||||
"instructions": "## 🧑💼 Role:\nHelp users with queries related to the delivery status of their orders.\n\n---\n## ⚙️ Steps to Follow:\n1. Fetch the delivery status using the [@tool:get_delivery_status] tool.\n2. Provide the user with the current delivery status.\n3. Offer additional assistance if needed.\n\n---\n## 🎯 Scope:\n✅ In Scope:\n- Providing delivery status updates\n\n❌ Out of Scope:\n- Resolving missing items issues\n- General knowledge queries\n\n---\n## 📋 Guidelines:\n✔️ Dos:\n- Use [@tool:get_delivery_status](#mention) to fetch accurate delivery information.\n- Provide clear and concise status updates.\n\n🚫 Don'ts:\n- Provide status updates without fetching current information.\n- Extend the conversation beyond delivery status.\n\n# Examples\n- **User** : Where is my order?\n - **Agent response**: Let me check the delivery status for you. Could you please provide your order ID?\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : Is my order on the way?\n - **Agent response**: I'll check the delivery status for you. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : When will my order arrive?\n - **Agent response**: Let me find out the delivery status. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : How long until my order gets here?\n - **Agent response**: I'll check the delivery status for you. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : Is my order delayed?\n - **Agent response**: Let me check the delivery status for you. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)",
|
||||
"name": "Delivery Status"
|
||||
},
|
||||
{
|
||||
"instructions": "## 🧑💼 Role:\nProvide information and answer questions related to subscriptions using RAG.\n\n---\n## ⚙️ Steps to Follow:\n1. Use RAG to retrieve relevant information about subscriptions.\n2. Answer the user's questions based on the retrieved information.\n3. If the user's query is outside the scope of subscriptions, inform them politely.\n\n---\n## 🎯 Scope:\n✅ In Scope:\n- Subscription plans and pricing\n- Subscription features and benefits\n\n❌ Out of Scope:\n- Non-subscription-related queries\n- Detailed account management\n\n---\n## 📋 Guidelines:\n✔️ Dos:\n- Use RAG to provide accurate and up-to-date information.\n- Be clear and concise in your responses.\n\n🚫 Don'ts:\n- Provide information without using RAG.\n- Extend the conversation beyond subscription topics.\n\n# Examples\n- **User** : What are the available subscription plans?\n - **Agent response**: Let me check the available subscription plans for you.\n\n- **User** : How much does the premium subscription cost?\n - **Agent response**: I'll find the current pricing for the premium subscription.\n\n- **User** : Can I change my subscription plan?\n - **Agent response**: I'll provide information on how to change your subscription plan.\n\n- **User** : What benefits do I get with a subscription?\n - **Agent response**: Let me retrieve the benefits associated with our subscription plans.\n\n- **User** : Is there a free trial available?\n - **Agent response**: I'll check if there's a free trial available for our subscriptions.",
|
||||
"name": "Subscription Info"
|
||||
}
|
||||
],
|
||||
"last_agent_name": "DoorDash Support Hub"
|
||||
},
|
||||
"agents": [
|
||||
{
|
||||
"name": "DoorDash Support Hub",
|
||||
"type": "conversation",
|
||||
"description": "Hub agent to manage DoorDash-related queries.",
|
||||
"instructions": "## 🧑💼 Role:\nYou are responsible for directing DoorDash-related queries to appropriate agents.\n\n---\n## ⚙️ Steps to Follow:\n1. Greet the user and ask which DoorDash-related query they need help with (e.g., 'Are you inquiring about a missing item, delivery status, or subscription details?').\n2. If the query matches a specific task, direct the user to the corresponding agent:\n - Missing Items → [@agent:Missing Items]\n - Delivery Status → [@agent:Delivery Status]\n - Subscription Info → [@agent:Subscription Info]\n3. If the query doesn't match any specific task, respond with 'I'm sorry, I didn't understand. Could you clarify your request?' or escalate to human support.\n\n---\n## 🎯 Scope:\n✅ In Scope:\n- Missing items queries\n- Delivery status queries\n- Subscription-related queries\n\n❌ Out of Scope:\n- Issues unrelated to DoorDash\n- General knowledge queries\n\n---\n## 📋 Guidelines:\n✔️ Dos:\n- Direct queries to specific DoorDash agents promptly.\n- Call [@agent:Escalation] agent for unrecognized queries.\n\n🚫 Don'ts:\n- Engage in detailed support.\n- Extend the conversation beyond DoorDash.\n- Provide user-facing text such as 'I will connect you now...' when calling another agent\n\n# Examples\n- **User** : I need help with a missing item in my order.\n - **Agent actions**: Call [@agent:Missing Items](#mention)\n\n- **User** : Can you tell me the status of my delivery?\n - **Agent actions**: Call [@agent:Delivery Status](#mention)\n\n- **User** : How are you today?\n - **Agent response**: I'm doing great. What would you like help with today?\n\n- **User** : Can you reset my account settings?\n - **Agent actions**: Call [@agent:Escalation](#mention)\n\n- **User** : I have a question about my order.\n - **Agent response**: Could you specify if it's about a missing item, delivery status, or subscription details?\n\n- **User** : What are the available subscription plans?\n - **Agent actions**: Call [@agent:Subscription Info](#mention)",
|
||||
"model": "gpt-4o",
|
||||
"controlType": "retain",
|
||||
"ragK": 3,
|
||||
"ragReturnType": "chunks",
|
||||
"tools": [],
|
||||
"prompts": [],
|
||||
"connectedAgents": [
|
||||
"Missing Items",
|
||||
"Delivery Status",
|
||||
"Subscription Info",
|
||||
"Escalation"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Post process",
|
||||
"type": "post_process",
|
||||
"description": "",
|
||||
"instructions": "Ensure that the agent response is terse and to the point.",
|
||||
"model": "gpt-4o-mini",
|
||||
"controlType": "retain",
|
||||
"ragK": 3,
|
||||
"ragReturnType": "chunks",
|
||||
"tools": [],
|
||||
"prompts": [],
|
||||
"connectedAgents": []
|
||||
},
|
||||
{
|
||||
"name": "Escalation",
|
||||
"type": "escalation",
|
||||
"description": "",
|
||||
"instructions": "Get the user's contact information and let them know that their request has been escalated.",
|
||||
"model": "gpt-4o-mini",
|
||||
"controlType": "retain",
|
||||
"ragK": 3,
|
||||
"ragReturnType": "chunks",
|
||||
"tools": [],
|
||||
"prompts": [],
|
||||
"connectedAgents": []
|
||||
},
|
||||
{
|
||||
"name": "Missing Items",
|
||||
"type": "conversation",
|
||||
"description": "Agent to assist users with missing items in their orders.",
|
||||
"instructions": "## 🧑💼 Role:\nHelp users resolve issues with missing items in their orders.\n\n---\n## ⚙️ Steps to Follow:\n1. Fetch the order details using the [@tool:get_order_details] tool.\n2. Confirm the missing items with the user.\n3. Provide resolution options or escalate if unresolved.\n\n---\n## 🎯 Scope:\n✅ In Scope:\n- Resolving missing items issues\n\n❌ Out of Scope:\n- Delivery status queries\n- General knowledge queries\n\n---\n## 📋 Guidelines:\n✔️ Dos:\n- Use [@tool:get_order_details](#mention) to fetch accurate order information.\n- Provide clear resolution options.\n\n🚫 Don'ts:\n- Assume missing items without user confirmation.\n- Extend the conversation beyond missing items.\n\n# Examples\n- **User** : I didn't receive my fries with my order.\n - **Agent response**: Let me check your order details. Could you please provide your order ID?\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : My order is missing a drink.\n - **Agent response**: I apologize for the inconvenience. Let's verify your order details. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : I didn't get the extra sauce I ordered.\n - **Agent response**: Let's check your order details to confirm. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : My burger is missing from the order.\n - **Agent response**: I'm sorry to hear that. Let's verify your order details. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : I didn't get my dessert.\n - **Agent response**: Let's check your order details to confirm. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_order_details](#mention)",
|
||||
"model": "gpt-4o",
|
||||
"controlType": "retain",
|
||||
"ragK": 3,
|
||||
"ragReturnType": "chunks",
|
||||
"tools": [
|
||||
"get_order_details"
|
||||
],
|
||||
"prompts": [],
|
||||
"connectedAgents": []
|
||||
},
|
||||
{
|
||||
"name": "Delivery Status",
|
||||
"type": "conversation",
|
||||
"description": "Agent to assist users with delivery status queries.",
|
||||
"instructions": "## 🧑💼 Role:\nHelp users with queries related to the delivery status of their orders.\n\n---\n## ⚙️ Steps to Follow:\n1. Fetch the delivery status using the [@tool:get_delivery_status] tool.\n2. Provide the user with the current delivery status.\n3. Offer additional assistance if needed.\n\n---\n## 🎯 Scope:\n✅ In Scope:\n- Providing delivery status updates\n\n❌ Out of Scope:\n- Resolving missing items issues\n- General knowledge queries\n\n---\n## 📋 Guidelines:\n✔️ Dos:\n- Use [@tool:get_delivery_status](#mention) to fetch accurate delivery information.\n- Provide clear and concise status updates.\n\n🚫 Don'ts:\n- Provide status updates without fetching current information.\n- Extend the conversation beyond delivery status.\n\n# Examples\n- **User** : Where is my order?\n - **Agent response**: Let me check the delivery status for you. Could you please provide your order ID?\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : Is my order on the way?\n - **Agent response**: I'll check the delivery status for you. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : When will my order arrive?\n - **Agent response**: Let me find out the delivery status. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : How long until my order gets here?\n - **Agent response**: I'll check the delivery status for you. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : Is my order delayed?\n - **Agent response**: Let me check the delivery status for you. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)",
|
||||
"model": "gpt-4o",
|
||||
"controlType": "retain",
|
||||
"ragK": 3,
|
||||
"ragReturnType": "chunks",
|
||||
"tools": [
|
||||
"get_delivery_status"
|
||||
],
|
||||
"prompts": [],
|
||||
"connectedAgents": []
|
||||
},
|
||||
{
|
||||
"name": "Subscription Info",
|
||||
"type": "conversation",
|
||||
"description": "Agent to assist users with subscription-related queries.",
|
||||
"instructions": "## 🧑💼 Role:\nProvide information and answer questions related to subscriptions using RAG.\n\n---\n## ⚙️ Steps to Follow:\n1. Use RAG to retrieve relevant information about subscriptions.\n2. Answer the user's questions based on the retrieved information.\n3. If the user's query is outside the scope of subscriptions, inform them politely.\n\n---\n## 🎯 Scope:\n✅ In Scope:\n- Subscription plans and pricing\n- Subscription features and benefits\n\n❌ Out of Scope:\n- Non-subscription-related queries\n- Detailed account management\n\n---\n## 📋 Guidelines:\n✔️ Dos:\n- Use RAG to provide accurate and up-to-date information.\n- Be clear and concise in your responses.\n\n🚫 Don'ts:\n- Provide information without using RAG.\n- Extend the conversation beyond subscription topics.\n\n# Examples\n- **User** : What are the available subscription plans?\n - **Agent response**: Let me check the available subscription plans for you.\n\n- **User** : How much does the premium subscription cost?\n - **Agent response**: I'll find the current pricing for the premium subscription.\n\n- **User** : Can I change my subscription plan?\n - **Agent response**: I'll provide information on how to change your subscription plan.\n\n- **User** : What benefits do I get with a subscription?\n - **Agent response**: Let me retrieve the benefits associated with our subscription plans.\n\n- **User** : Is there a free trial available?\n - **Agent response**: I'll check if there's a free trial available for our subscriptions.",
|
||||
"model": "gpt-4o",
|
||||
"controlType": "relinquish_to_parent",
|
||||
"ragDataSources": [
|
||||
"67e1612510540d9027909e10"
|
||||
],
|
||||
"ragK": 3,
|
||||
"ragReturnType": "content",
|
||||
"tools": [],
|
||||
"prompts": [],
|
||||
"connectedAgents": []
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"name": "get_order_details",
|
||||
"description": "Tool to fetch the user's order details.",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"order_id": {
|
||||
"type": "string",
|
||||
"description": "The unique identifier for the order."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"order_id"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "get_delivery_status",
|
||||
"description": "Tool to fetch the delivery status of an order.",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"order_id": {
|
||||
"type": "string",
|
||||
"description": "The unique identifier for the order."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"order_id"
|
||||
]
|
||||
},
|
||||
"mockTool": true,
|
||||
"mockInstructions": "Give a mock response for a door dash order delivery status."
|
||||
}
|
||||
],
|
||||
"prompts": [
|
||||
{
|
||||
"name": "Style prompt",
|
||||
"type": "style_prompt",
|
||||
"prompt": "You should be empathetic and helpful."
|
||||
},
|
||||
{
|
||||
"name": "Greeting",
|
||||
"type": "greeting",
|
||||
"prompt": "Hello! How can I help you?"
|
||||
}
|
||||
],
|
||||
"startAgent": "DoorDash Support Hub",
|
||||
"mcpServers": [
|
||||
{
|
||||
"name": "delivery",
|
||||
"url": "http://localhost:8000/sse"
|
||||
}
|
||||
],
|
||||
"toolWebhookUrl": "http://127.0.0.1:4020/tool_call"
|
||||
},
|
||||
"lastResponse": {
|
||||
"messages": [
|
||||
{
|
||||
"content": "Hi there! How can I help you with your DoorDash query? Are you inquiring about a missing item, delivery status, or subscription details?",
|
||||
"created_at": null,
|
||||
"response_type": "internal",
|
||||
"role": "assistant",
|
||||
"sender": "DoorDash Support Hub"
|
||||
},
|
||||
{
|
||||
"content": "Hi there! How can I help you with your DoorDash query? Are you inquiring about a missing item, delivery status, or subscription details?",
|
||||
"created_at": null,
|
||||
"response_type": "external",
|
||||
"role": "assistant",
|
||||
"sender": "DoorDash Support Hub >> External"
|
||||
}
|
||||
],
|
||||
"state": {
|
||||
"agent_data": [
|
||||
{
|
||||
"instructions": "## 🧑💼 Role:\nYou are responsible for directing DoorDash-related queries to appropriate agents.\n\n---\n## ⚙️ Steps to Follow:\n1. Greet the user and ask which DoorDash-related query they need help with (e.g., 'Are you inquiring about a missing item, delivery status, or subscription details?').\n2. If the query matches a specific task, direct the user to the corresponding agent:\n - Missing Items → [@agent:Missing Items]\n - Delivery Status → [@agent:Delivery Status]\n - Subscription Info → [@agent:Subscription Info]\n3. If the query doesn't match any specific task, respond with 'I'm sorry, I didn't understand. Could you clarify your request?' or escalate to human support.\n\n---\n## 🎯 Scope:\n✅ In Scope:\n- Missing items queries\n- Delivery status queries\n- Subscription-related queries\n\n❌ Out of Scope:\n- Issues unrelated to DoorDash\n- General knowledge queries\n\n---\n## 📋 Guidelines:\n✔️ Dos:\n- Direct queries to specific DoorDash agents promptly.\n- Call [@agent:Escalation] agent for unrecognized queries.\n\n🚫 Don'ts:\n- Engage in detailed support.\n- Extend the conversation beyond DoorDash.\n- Provide user-facing text such as 'I will connect you now...' when calling another agent\n\n# Examples\n- **User** : I need help with a missing item in my order.\n - **Agent actions**: Call [@agent:Missing Items](#mention)\n\n- **User** : Can you tell me the status of my delivery?\n - **Agent actions**: Call [@agent:Delivery Status](#mention)\n\n- **User** : How are you today?\n - **Agent response**: I'm doing great. What would you like help with today?\n\n- **User** : Can you reset my account settings?\n - **Agent actions**: Call [@agent:Escalation](#mention)\n\n- **User** : I have a question about my order.\n - **Agent response**: Could you specify if it's about a missing item, delivery status, or subscription details?\n\n- **User** : What are the available subscription plans?\n - **Agent actions**: Call [@agent:Subscription Info](#mention)",
|
||||
"name": "DoorDash Support Hub"
|
||||
},
|
||||
{
|
||||
"instructions": "Ensure that the agent response is terse and to the point.",
|
||||
"name": "Post process"
|
||||
},
|
||||
{
|
||||
"instructions": "Get the user's contact information and let them know that their request has been escalated.",
|
||||
"name": "Escalation"
|
||||
},
|
||||
{
|
||||
"instructions": "## 🧑💼 Role:\nHelp users resolve issues with missing items in their orders.\n\n---\n## ⚙️ Steps to Follow:\n1. Fetch the order details using the [@tool:get_order_details] tool.\n2. Confirm the missing items with the user.\n3. Provide resolution options or escalate if unresolved.\n\n---\n## 🎯 Scope:\n✅ In Scope:\n- Resolving missing items issues\n\n❌ Out of Scope:\n- Delivery status queries\n- General knowledge queries\n\n---\n## 📋 Guidelines:\n✔️ Dos:\n- Use [@tool:get_order_details](#mention) to fetch accurate order information.\n- Provide clear resolution options.\n\n🚫 Don'ts:\n- Assume missing items without user confirmation.\n- Extend the conversation beyond missing items.\n\n# Examples\n- **User** : I didn't receive my fries with my order.\n - **Agent response**: Let me check your order details. Could you please provide your order ID?\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : My order is missing a drink.\n - **Agent response**: I apologize for the inconvenience. Let's verify your order details. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : I didn't get the extra sauce I ordered.\n - **Agent response**: Let's check your order details to confirm. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : My burger is missing from the order.\n - **Agent response**: I'm sorry to hear that. Let's verify your order details. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : I didn't get my dessert.\n - **Agent response**: Let's check your order details to confirm. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_order_details](#mention)",
|
||||
"name": "Missing Items"
|
||||
},
|
||||
{
|
||||
"instructions": "## 🧑💼 Role:\nHelp users with queries related to the delivery status of their orders.\n\n---\n## ⚙️ Steps to Follow:\n1. Fetch the delivery status using the [@tool:get_delivery_status] tool.\n2. Provide the user with the current delivery status.\n3. Offer additional assistance if needed.\n\n---\n## 🎯 Scope:\n✅ In Scope:\n- Providing delivery status updates\n\n❌ Out of Scope:\n- Resolving missing items issues\n- General knowledge queries\n\n---\n## 📋 Guidelines:\n✔️ Dos:\n- Use [@tool:get_delivery_status](#mention) to fetch accurate delivery information.\n- Provide clear and concise status updates.\n\n🚫 Don'ts:\n- Provide status updates without fetching current information.\n- Extend the conversation beyond delivery status.\n\n# Examples\n- **User** : Where is my order?\n - **Agent response**: Let me check the delivery status for you. Could you please provide your order ID?\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : Is my order on the way?\n - **Agent response**: I'll check the delivery status for you. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : When will my order arrive?\n - **Agent response**: Let me find out the delivery status. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : How long until my order gets here?\n - **Agent response**: I'll check the delivery status for you. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : Is my order delayed?\n - **Agent response**: Let me check the delivery status for you. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)",
|
||||
"name": "Delivery Status"
|
||||
},
|
||||
{
|
||||
"instructions": "## 🧑💼 Role:\nProvide information and answer questions related to subscriptions using RAG.\n\n---\n## ⚙️ Steps to Follow:\n1. Use RAG to retrieve relevant information about subscriptions.\n2. Answer the user's questions based on the retrieved information.\n3. If the user's query is outside the scope of subscriptions, inform them politely.\n\n---\n## 🎯 Scope:\n✅ In Scope:\n- Subscription plans and pricing\n- Subscription features and benefits\n\n❌ Out of Scope:\n- Non-subscription-related queries\n- Detailed account management\n\n---\n## 📋 Guidelines:\n✔️ Dos:\n- Use RAG to provide accurate and up-to-date information.\n- Be clear and concise in your responses.\n\n🚫 Don'ts:\n- Provide information without using RAG.\n- Extend the conversation beyond subscription topics.\n\n# Examples\n- **User** : What are the available subscription plans?\n - **Agent response**: Let me check the available subscription plans for you.\n\n- **User** : How much does the premium subscription cost?\n - **Agent response**: I'll find the current pricing for the premium subscription.\n\n- **User** : Can I change my subscription plan?\n - **Agent response**: I'll provide information on how to change your subscription plan.\n\n- **User** : What benefits do I get with a subscription?\n - **Agent response**: Let me retrieve the benefits associated with our subscription plans.\n\n- **User** : Is there a free trial available?\n - **Agent response**: I'll check if there's a free trial available for our subscriptions.",
|
||||
"name": "Subscription Info"
|
||||
}
|
||||
],
|
||||
"last_agent_name": "DoorDash Support Hub"
|
||||
},
|
||||
"tokens_used": {
|
||||
"completion": 50,
|
||||
"prompt": 50,
|
||||
"total": 100
|
||||
}
|
||||
}
|
||||
}
|
||||
166
apps/rowboat_agents/tests/sample_requests/tmp4.json
Normal file
166
apps/rowboat_agents/tests/sample_requests/tmp4.json
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
{
|
||||
"lastRequest": {
|
||||
"projectId": "4ebd5e81-010a-4bc6-91e0-0aa98173dbac",
|
||||
"messages": [
|
||||
{
|
||||
"content": "",
|
||||
"role": "system",
|
||||
"sender": null,
|
||||
"tool_calls": null,
|
||||
"tool_call_id": null,
|
||||
"tool_name": null
|
||||
}
|
||||
],
|
||||
"state": {
|
||||
"last_agent_name": "DoorDash Support Hub"
|
||||
},
|
||||
"agents": [
|
||||
{
|
||||
"name": "DoorDash Support Hub",
|
||||
"type": "conversation",
|
||||
"description": "Hub agent to manage DoorDash-related queries.",
|
||||
"instructions": "## 🧑💼 Role:\nYou are responsible for directing DoorDash-related queries to appropriate agents.\n\n---\n## ⚙️ Steps to Follow:\n1. Greet the user and ask which DoorDash-related query they need help with (e.g., 'Are you inquiring about a missing item, delivery status, or subscription details?').\n2. If the query matches a specific task, direct the user to the corresponding agent:\n - Missing Items → [@agent:Missing Items]\n - Delivery Status → [@agent:Delivery Status]\n - Subscription Info → [@agent:Subscription Info]\n3. If the query doesn't match any specific task, respond with 'I'm sorry, I didn't understand. Could you clarify your request?' or escalate to human support.\n\n---\n## 🎯 Scope:\n✅ In Scope:\n- Missing items queries\n- Delivery status queries\n- Subscription-related queries\n\n❌ Out of Scope:\n- Issues unrelated to DoorDash\n- General knowledge queries\n\n---\n## 📋 Guidelines:\n✔️ Dos:\n- Direct queries to specific DoorDash agents promptly.\n- Call [@agent:Escalation] agent for unrecognized queries.\n\n🚫 Don'ts:\n- Engage in detailed support.\n- Extend the conversation beyond DoorDash.\n- Provide user-facing text such as 'I will connect you now...' when calling another agent\n\n# Examples\n- **User** : I need help with a missing item in my order.\n - **Agent actions**: Call [@agent:Missing Items](#mention)\n\n- **User** : Can you tell me the status of my delivery?\n - **Agent actions**: Call [@agent:Delivery Status](#mention)\n\n- **User** : How are you today?\n - **Agent response**: I'm doing great. What would you like help with today?\n\n- **User** : Can you reset my account settings?\n - **Agent actions**: Call [@agent:Escalation](#mention)\n\n- **User** : I have a question about my order.\n - **Agent response**: Could you specify if it's about a missing item, delivery status, or subscription details?\n\n- **User** : What are the available subscription plans?\n - **Agent actions**: Call [@agent:Subscription Info](#mention)",
|
||||
"model": "gpt-4o",
|
||||
"controlType": "retain",
|
||||
"ragK": 3,
|
||||
"ragReturnType": "chunks",
|
||||
"tools": [],
|
||||
"prompts": [],
|
||||
"connectedAgents": [
|
||||
"Missing Items",
|
||||
"Delivery Status",
|
||||
"Subscription Info",
|
||||
"Escalation"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Post process",
|
||||
"type": "post_process",
|
||||
"description": "",
|
||||
"instructions": "Ensure that the agent response is terse and to the point.",
|
||||
"model": "gpt-4o-mini",
|
||||
"controlType": "retain",
|
||||
"ragK": 3,
|
||||
"ragReturnType": "chunks",
|
||||
"tools": [],
|
||||
"prompts": [],
|
||||
"connectedAgents": []
|
||||
},
|
||||
{
|
||||
"name": "Escalation",
|
||||
"type": "escalation",
|
||||
"description": "",
|
||||
"instructions": "Get the user's contact information and let them know that their request has been escalated.",
|
||||
"model": "gpt-4o-mini",
|
||||
"controlType": "retain",
|
||||
"ragK": 3,
|
||||
"ragReturnType": "chunks",
|
||||
"tools": [],
|
||||
"prompts": [],
|
||||
"connectedAgents": []
|
||||
},
|
||||
{
|
||||
"name": "Missing Items",
|
||||
"type": "conversation",
|
||||
"description": "Agent to assist users with missing items in their orders.",
|
||||
"instructions": "## 🧑💼 Role:\nHelp users resolve issues with missing items in their orders.\n\n---\n## ⚙️ Steps to Follow:\n1. Fetch the order details using the [@tool:get_order_details] tool.\n2. Confirm the missing items with the user.\n3. Provide resolution options or escalate if unresolved.\n\n---\n## 🎯 Scope:\n✅ In Scope:\n- Resolving missing items issues\n\n❌ Out of Scope:\n- Delivery status queries\n- General knowledge queries\n\n---\n## 📋 Guidelines:\n✔️ Dos:\n- Use [@tool:get_order_details](#mention) to fetch accurate order information.\n- Provide clear resolution options.\n\n🚫 Don'ts:\n- Assume missing items without user confirmation.\n- Extend the conversation beyond missing items.\n\n# Examples\n- **User** : I didn't receive my fries with my order.\n - **Agent response**: Let me check your order details. Could you please provide your order ID?\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : My order is missing a drink.\n - **Agent response**: I apologize for the inconvenience. Let's verify your order details. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : I didn't get the extra sauce I ordered.\n - **Agent response**: Let's check your order details to confirm. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : My burger is missing from the order.\n - **Agent response**: I'm sorry to hear that. Let's verify your order details. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_order_details](#mention)\n\n- **User** : I didn't get my dessert.\n - **Agent response**: Let's check your order details to confirm. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_order_details](#mention)",
|
||||
"model": "gpt-4o",
|
||||
"controlType": "retain",
|
||||
"ragK": 3,
|
||||
"ragReturnType": "chunks",
|
||||
"tools": [
|
||||
"get_order_details"
|
||||
],
|
||||
"prompts": [],
|
||||
"connectedAgents": []
|
||||
},
|
||||
{
|
||||
"name": "Delivery Status",
|
||||
"type": "conversation",
|
||||
"description": "Agent to assist users with delivery status queries.",
|
||||
"instructions": "## 🧑💼 Role:\nHelp users with queries related to the delivery status of their orders.\n\n---\n## ⚙️ Steps to Follow:\n1. Fetch the delivery status using the [@tool:get_delivery_status] tool.\n2. Provide the user with the current delivery status.\n3. Offer additional assistance if needed.\n\n---\n## 🎯 Scope:\n✅ In Scope:\n- Providing delivery status updates\n\n❌ Out of Scope:\n- Resolving missing items issues\n- General knowledge queries\n\n---\n## 📋 Guidelines:\n✔️ Dos:\n- Use [@tool:get_delivery_status](#mention) to fetch accurate delivery information.\n- Provide clear and concise status updates.\n\n🚫 Don'ts:\n- Provide status updates without fetching current information.\n- Extend the conversation beyond delivery status.\n\n# Examples\n- **User** : Where is my order?\n - **Agent response**: Let me check the delivery status for you. Could you please provide your order ID?\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : Is my order on the way?\n - **Agent response**: I'll check the delivery status for you. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : When will my order arrive?\n - **Agent response**: Let me find out the delivery status. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : How long until my order gets here?\n - **Agent response**: I'll check the delivery status for you. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)\n\n- **User** : Is my order delayed?\n - **Agent response**: Let me check the delivery status for you. Could you provide your order ID?\n - **Agent actions**: Call [@tool:get_delivery_status](#mention)",
|
||||
"model": "gpt-4o",
|
||||
"controlType": "retain",
|
||||
"ragK": 3,
|
||||
"ragReturnType": "chunks",
|
||||
"tools": [
|
||||
"get_delivery_status"
|
||||
],
|
||||
"prompts": [],
|
||||
"connectedAgents": []
|
||||
},
|
||||
{
|
||||
"name": "Subscription Info",
|
||||
"type": "conversation",
|
||||
"description": "Agent to assist users with subscription-related queries.",
|
||||
"instructions": "## 🧑💼 Role:\nProvide information and answer questions related to subscriptions using RAG.\n\n---\n## ⚙️ Steps to Follow:\n1. Use RAG to retrieve relevant information about subscriptions.\n2. Answer the user's questions based on the retrieved information.\n3. If the user's query is outside the scope of subscriptions, inform them politely.\n\n---\n## 🎯 Scope:\n✅ In Scope:\n- Subscription plans and pricing\n- Subscription features and benefits\n\n❌ Out of Scope:\n- Non-subscription-related queries\n- Detailed account management\n\n---\n## 📋 Guidelines:\n✔️ Dos:\n- Use RAG to provide accurate and up-to-date information.\n- Be clear and concise in your responses.\n\n🚫 Don'ts:\n- Provide information without using RAG.\n- Extend the conversation beyond subscription topics.\n\n# Examples\n- **User** : What are the available subscription plans?\n - **Agent response**: Let me check the available subscription plans for you.\n\n- **User** : How much does the premium subscription cost?\n - **Agent response**: I'll find the current pricing for the premium subscription.\n\n- **User** : Can I change my subscription plan?\n - **Agent response**: I'll provide information on how to change your subscription plan.\n\n- **User** : What benefits do I get with a subscription?\n - **Agent response**: Let me retrieve the benefits associated with our subscription plans.\n\n- **User** : Is there a free trial available?\n - **Agent response**: I'll check if there's a free trial available for our subscriptions.",
|
||||
"model": "gpt-4o",
|
||||
"controlType": "relinquish_to_parent",
|
||||
"ragDataSources": [
|
||||
"67e1612510540d9027909e10"
|
||||
],
|
||||
"ragK": 3,
|
||||
"ragReturnType": "content",
|
||||
"tools": [],
|
||||
"prompts": [],
|
||||
"connectedAgents": []
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"name": "get_order_details",
|
||||
"description": "Tool to fetch the user's order details.",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"order_id": {
|
||||
"type": "string",
|
||||
"description": "The unique identifier for the order."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"order_id"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "get_delivery_status",
|
||||
"description": "Tool to fetch the delivery status of an order.",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"order_id": {
|
||||
"type": "string",
|
||||
"description": "The unique identifier for the order."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"order_id"
|
||||
]
|
||||
},
|
||||
"mockTool": true,
|
||||
"mockInstructions": "Give a mock response for a door dash order delivery status."
|
||||
}
|
||||
],
|
||||
"prompts": [
|
||||
{
|
||||
"name": "Style prompt",
|
||||
"type": "style_prompt",
|
||||
"prompt": "You should be empathetic and helpful."
|
||||
},
|
||||
{
|
||||
"name": "Greeting",
|
||||
"type": "greeting",
|
||||
"prompt": "Hello! How can I help you?"
|
||||
}
|
||||
],
|
||||
"startAgent": "DoorDash Support Hub",
|
||||
"mcpServers": [
|
||||
{
|
||||
"name": "delivery",
|
||||
"url": "http://localhost:8000/sse"
|
||||
}
|
||||
],
|
||||
"toolWebhookUrl": "http://127.0.0.1:4020/tool_call"
|
||||
}
|
||||
}
|
||||
110
apps/rowboat_agents/tests/sample_responses/default_example.json
Normal file
110
apps/rowboat_agents/tests/sample_responses/default_example.json
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
{
|
||||
"lastResponse": {
|
||||
"messages": [
|
||||
{
|
||||
"content": "I have retrieved your last booking details for you. \n\n- **Booking ID:** BK123456789\n- **Destination:** Paris, France\n- **Departure Date:** February 15, 2025\n- **Return Date:** February 20, 2025\n- **Passenger Name:** John Doe\n- **Status:** Confirmed\n\nIs there anything specific you would like assistance with regarding this booking?",
|
||||
"created_at": "2025-01-14T13:21:41.011210",
|
||||
"current_turn": true,
|
||||
"response_type": "internal",
|
||||
"role": "assistant",
|
||||
"sender": "Customer Support Hub Agent"
|
||||
},
|
||||
{
|
||||
"content": "Here are your last booking details:\n\n- **Booking ID:** BK123456789\n- **Destination:** Paris, France\n- **Departure Date:** February 15, 2025\n- **Return Date:** February 20, 2025\n- **Passenger Name:** John Doe\n- **Status:** Confirmed\n\nIs there anything specific you need help with regarding this booking?",
|
||||
"created_at": "2025-01-14T13:21:41.011210",
|
||||
"current_turn": true,
|
||||
"response_type": "external",
|
||||
"role": "assistant",
|
||||
"sender": "Customer Support Hub Agent >> Post process"
|
||||
}
|
||||
],
|
||||
"state": {
|
||||
"agent_data": [
|
||||
{
|
||||
"child_functions": [],
|
||||
"external_tools": [
|
||||
"fetch_user_info",
|
||||
"getArticleInfo"
|
||||
],
|
||||
"history": [
|
||||
{
|
||||
"content": "Hello!",
|
||||
"current_turn": false,
|
||||
"role": "user"
|
||||
},
|
||||
{
|
||||
"content": "Hello! How can I assist you today?",
|
||||
"created_at": "2025-01-14T13:21:23.928202",
|
||||
"current_turn": false,
|
||||
"response_type": "internal",
|
||||
"role": "assistant",
|
||||
"sender": "Customer Support Hub Agent"
|
||||
},
|
||||
{
|
||||
"content": "Can you help me with my last booking ID?",
|
||||
"current_turn": true,
|
||||
"role": "user"
|
||||
},
|
||||
{
|
||||
"created_at": "2025-01-14T13:21:33.209215",
|
||||
"current_turn": true,
|
||||
"response_type": "internal",
|
||||
"role": "assistant",
|
||||
"sender": "Customer Support Hub Agent",
|
||||
"tool_calls": [
|
||||
{
|
||||
"function": {
|
||||
"arguments": "{\"user_id\":\"user-provided-or-contextual-id\"}",
|
||||
"name": "fetch_user_info"
|
||||
},
|
||||
"id": "call_ysJNztzRa0kRsy4Z4hljVuQ9",
|
||||
"type": "function"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"content": "\"{\\\"result\\\":{\\\"user_id\\\":\\\"user-provided-or-contextual-id\\\",\\\"last_booking_id\\\":\\\"BK123456789\\\",\\\"booking_date\\\":\\\"2025-01-10T15:30:00Z\\\",\\\"status\\\":\\\"confirmed\\\",\\\"details\\\":{\\\"destination\\\":\\\"Paris, France\\\",\\\"departure_date\\\":\\\"2025-02-15\\\",\\\"return_date\\\":\\\"2025-02-20\\\",\\\"passenger_name\\\":\\\"John Doe\\\"}}}\"",
|
||||
"role": "tool",
|
||||
"tool_call_id": "call_ysJNztzRa0kRsy4Z4hljVuQ9",
|
||||
"tool_name": "fetch_user_info"
|
||||
},
|
||||
{
|
||||
"content": "I have retrieved your last booking details for you. \n\n- **Booking ID:** BK123456789\n- **Destination:** Paris, France\n- **Departure Date:** February 15, 2025\n- **Return Date:** February 20, 2025\n- **Passenger Name:** John Doe\n- **Status:** Confirmed\n\nIs there anything specific you would like assistance with regarding this booking?",
|
||||
"created_at": "2025-01-14T13:21:41.011210",
|
||||
"current_turn": true,
|
||||
"response_type": "internal",
|
||||
"role": "assistant",
|
||||
"sender": "Customer Support Hub Agent"
|
||||
}
|
||||
],
|
||||
"instructions": "## 🧑💼 Role:\nYou are responsible for directing customer support queries to the appropriate agents.\n\n---\n## ⚙️ Steps to Follow:\n1. Greet the user and ask how you can assist them today.\n2. Use the 'fetch_user_info' tool to retrieve user information in real time using the user ID provided or contextually available in the conversation.\n3. Analyze the user's request to determine if it needs escalation or can be handled by a specialized agent.\n4. Direct the query to the relevant agent for issue-specific queries or escalate to a human representative if needed.\n\n---\n## 🎯 Scope:\n✅ In Scope:\n- Directing queries to suitable agents\n- Escalation when necessary\n\n❌ Out of Scope:\n- Handling detailed support or making assumptions about user issues\n\n---\n## 📋 Guidelines:\n✔️ Dos:\n- Maintain a helpful and empathetic tone.\n- Ensure queries are directed promptly.\n🚫 Don'ts:\n- Resolve queries directly that require special handling.\n\nYou should be empathetic and helpful.\n\n----------------------------------------------------------------------------------------------------\n\n\n# Instructions about using the article retrieval tool\n- Where relevant, use the articles tool: getArticleInfo to fetch articles with knowledge relevant to the query and use its contents to respond to the user. \n- Do not send a separate message first asking the user to wait while you look up information. Immediately fetch the articles and respond to the user with the answer to their query. \n- Do not make up information. If the article's contents do not have the answer, give up control of the chat (or transfer to your parent agent, as per your transfer instructions). Do not say anything to the user.\n",
|
||||
"internal_tools": [],
|
||||
"most_recent_parent_name": "",
|
||||
"name": "Customer Support Hub Agent",
|
||||
"parent_function": null
|
||||
},
|
||||
{
|
||||
"child_functions": [],
|
||||
"external_tools": [],
|
||||
"history": [],
|
||||
"instructions": "Get the user's contact information and let them know that their request has been escalated.\n\n",
|
||||
"internal_tools": [],
|
||||
"most_recent_parent_name": "",
|
||||
"name": "Escalation",
|
||||
"parent_function": null
|
||||
}
|
||||
],
|
||||
"last_agent_name": "Customer Support Hub Agent"
|
||||
},
|
||||
"tokens_used": {
|
||||
"openai/gpt-4o": {
|
||||
"input_tokens": 569,
|
||||
"output_tokens": 85
|
||||
},
|
||||
"openai/gpt-4o-mini": {
|
||||
"input_tokens": 871,
|
||||
"output_tokens": 79
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue