Spaces:
Sleeping
Sleeping
File size: 5,466 Bytes
d6a76d5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | #agent.py output
output with prompt - 04032026:
prompt = f"""
You are a customer support agent.
STRICT RULES:
- If any required info is missing β use ask_info
- Only resolve AFTER all required info is collected
Return ONLY JSON.
Actions:
1. ask_info β {{"type": "ask_info", "field": "..."}}
2. resolve β {{"type": "resolve"}}
Allowed fields: account_email, order_id, device_type, browser
Observation:
{observation}
"""
Sending request...
π‘ Calling Groq...
π§ ACTION: {'type': 'ask_info', 'field': 'account_email'}
π₯ OBS: {'ticket_id': 'T11', 'customer_message': "I didn't receive my order but it shows delivered.", 'history': [], 'known_info': {}, 'missing_info': ['order_id'], 'status': 'open', 'step_count': 0, 'remaining_steps': 10}
π‘ Calling Groq...
π§ ACTION: {'type': 'ask_info', 'field': 'order_id'}
π― REWARD: 0.3
β
DONE: False
π₯ OBS: {'ticket_id': 'T11', 'customer_message': "I didn't receive my order but it shows delivered.", 'history': [], 'known_info': {'order_id': 'sample_value'}, 'missing_info': [], 'status': 'open', 'step_count': 1, 'remaining_steps': 9}
π‘ Calling Groq...
π§ ACTION: {'type': 'ask_info', 'field': 'account_email'}
π― REWARD: -0.1
β
DONE: False
π₯ OBS: {'ticket_id': 'T11', 'customer_message': "I didn't receive my order but it shows delivered.", 'history': [], 'known_info': {'order_id': 'sample_value'}, 'missing_info': [], 'status': 'open', 'step_count': 2, 'remaining_steps': 8}
π‘ Calling Groq...
π§ ACTION: {'type': 'ask_info', 'field': 'account_email'}
π― REWARD: -0.1
β
DONE: False
π₯ OBS: {'ticket_id': 'T11', 'customer_message': "I didn't receive my order but it shows delivered.", 'history': [], 'known_info': {'order_id': 'sample_value'}, 'missing_info': [], 'status': 'open', 'step_count': 3, 'remaining_steps': 7}
π‘ Calling Groq...
π§ ACTION: {'type': 'ask_info', 'field': 'account_email'}
π― REWARD: -0.1
β
DONE: False
π₯ OBS: {'ticket_id': 'T11', 'customer_message': "I didn't receive my order but it shows delivered.", 'history': [], 'known_info': {'order_id': 'sample_value'}, 'missing_info': [], 'status': 'open', 'step_count': 4, 'remaining_steps': 6}
π‘ Calling Groq...
π§ ACTION: {'type': 'ask_info', 'field': 'account_email'}
π― REWARD: -0.1
β
DONE: False
π₯ OBS: {'ticket_id': 'T11', 'customer_message': "I didn't receive my order but it shows delivered.", 'history': [], 'known_info': {'order_id': 'sample_value'}, 'missing_info': [], 'status': 'open', 'step_count': 5, 'remaining_steps': 5}
π‘ Calling Groq...
π§ ACTION: {'type': 'ask_info', 'field': 'account_email'}
π― REWARD: -0.1
β
DONE: False
π₯ OBS: {'ticket_id': 'T11', 'customer_message': "I didn't receive my order but it shows delivered.", 'history': [], 'known_info': {'order_id': 'sample_value'}, 'missing_info': [], 'status': 'open', 'step_count': 6, 'remaining_steps': 4}
π‘ Calling Groq...
π§ ACTION: {'type': 'ask_info', 'field': 'account_email'}
π― REWARD: -0.1
β
DONE: False
π₯ OBS: {'ticket_id': 'T11', 'customer_message': "I didn't receive my order but it shows delivered.", 'history': [], 'known_info': {'order_id': 'sample_value'}, 'missing_info': [], 'status': 'open', 'step_count': 7, 'remaining_steps': 3}
π‘ Calling Groq...
π§ ACTION: {'type': 'ask_info', 'field': 'account_email'}
π― REWARD: -0.1
β
DONE: False
π₯ OBS: {'ticket_id': 'T11', 'customer_message': "I didn't receive my order but it shows delivered.", 'history': [], 'known_info': {'order_id': 'sample_value'}, 'missing_info': [], 'status': 'open', 'step_count': 8, 'remaining_steps': 2}
π‘ Calling Groq...
π§ ACTION: {'type': 'ask_info', 'field': 'account_email'}
π― REWARD: -0.1
β
DONE: False
π₯ OBS: {'ticket_id': 'T11', 'customer_message': "I didn't receive my order but it shows delivered.", 'history': [], 'known_info': {'order_id': 'sample_value'}, 'missing_info': [], 'status': 'open', 'step_count': 9, 'remaining_steps': 1}
π‘ Calling Groq...
π§ ACTION: {'type': 'ask_info', 'field': 'account_email'}
π― REWARD: -0.8
β
DONE: True
π FINAL INFO: {'final_score': 0.3}
output with prompt - 04032026:
prompt = f"""
You are a customer support agent.
STRICT RULES:
1. If missing_info list is NOT empty β you MUST ask for ONE of those fields
2. If missing_info list is EMPTY β you MUST resolve
3. NEVER ask for a field that is NOT in missing_info
4. NEVER repeat asking for the same field
Return ONLY JSON.
Actions:
- ask_info β {{"type": "ask_info", "field": "..."}}
- resolve β {{"type": "resolve"}}
Observation:
{observation}
"""
π§ ACTION: {'type': 'ask_info', 'field': 'account_email'}
π₯ OBS: {'ticket_id': 'T10', 'customer_message': 'Something is wrong with my account.', 'history': [], 'known_info': {}, 'missing_info': ['account_email'], 'status': 'open', 'step_count': 0, 'remaining_steps': 10}
π‘ Calling Groq...
π§ ACTION: {'type': 'ask_info', 'field': 'account_email'}
π― REWARD: 0.3
β
DONE: False
π₯ OBS: {'ticket_id': 'T10', 'customer_message': 'Something is wrong with my account.', 'history': [], 'known_info': {'account_email': 'sample_value'}, 'missing_info': [], 'status': 'open', 'step_count': 1, 'remaining_steps': 9}
π‘ Calling Groq...
π§ ACTION: {'type': 'resolve'}
π― REWARD: 1.7
β
DONE: True
π FINAL INFO: {'final_score': 0.7} |