You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"# (REQUIRED) Create a new task. For Agentic agents, you must create a task for messages to be associated with.\n",
33
41
"import uuid\n",
@@ -46,10 +54,47 @@
46
54
},
47
55
{
48
56
"cell_type": "code",
49
-
"execution_count": null,
57
+
"execution_count": 41,
50
58
"id": "b03b0d37",
51
59
"metadata": {},
52
-
"outputs": [],
60
+
"outputs": [
61
+
{
62
+
"name": "stdout",
63
+
"output_type": "stream",
64
+
"text": [
65
+
"Event(id='5f402c77-ed37-4f56-b161-50f3ceb87685', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=247, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 0', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 54, 52, 106969, tzinfo=TzInfo(UTC)))\n",
66
+
"Event(id='f71c4b80-6d93-4167-bdf9-d2f407bde759', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=248, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 1', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 54, 53, 141757, tzinfo=TzInfo(UTC)))\n",
67
+
"Event(id='797aca62-6260-4c4d-a89b-43e33ecfdc30', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=249, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 2', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 54, 54, 200724, tzinfo=TzInfo(UTC)))\n",
68
+
"Event(id='f207d685-789c-4538-b1c2-03c5a93028d8', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=250, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 3', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 54, 55, 264489, tzinfo=TzInfo(UTC)))\n",
69
+
"Event(id='9685fc87-d38b-4d4a-94e2-ac148b3b060f', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=251, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 4', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 54, 56, 352169, tzinfo=TzInfo(UTC)))\n",
70
+
"Event(id='f2a134c7-5dac-4643-acee-259dc076c953', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=252, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 5', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 54, 57, 419635, tzinfo=TzInfo(UTC)))\n",
71
+
"Event(id='68dcfc1f-71b1-4876-907a-4282d12b1c54', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=253, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 6', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 54, 58, 476724, tzinfo=TzInfo(UTC)))\n",
72
+
"Event(id='f8644089-1b20-49ca-b8bd-706feeeed096', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=254, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 7', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 54, 59, 527430, tzinfo=TzInfo(UTC)))\n",
73
+
"Event(id='11300500-4843-4c15-bfa9-7de6e1f29017', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=255, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 8', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 55, 0, 584924, tzinfo=TzInfo(UTC)))\n",
74
+
"Event(id='27d8f4f3-7e25-4d17-aaa8-a4c9d39bfcda', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=256, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 9', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 55, 1, 637711, tzinfo=TzInfo(UTC)))\n",
75
+
"Event(id='7b964f5c-504c-43c5-a1ea-84f96ce1a696', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=257, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 10', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 55, 2, 693531, tzinfo=TzInfo(UTC)))\n",
76
+
"Event(id='dc70e5c3-75d7-4b76-9a1b-171f755440c4', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=258, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 11', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 55, 3, 724789, tzinfo=TzInfo(UTC)))\n",
77
+
"Event(id='adb547d2-5ac8-4c45-86f0-85703434568a', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=259, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 12', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 55, 4, 773604, tzinfo=TzInfo(UTC)))\n",
78
+
"Event(id='575b7dbc-d884-42cf-b67b-47f752862b43', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=260, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 13', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 55, 5, 825423, tzinfo=TzInfo(UTC)))\n",
79
+
"Event(id='de7f328a-03f2-44a3-9ee0-111ba41b48c4', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=261, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 14', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 55, 6, 873700, tzinfo=TzInfo(UTC)))\n",
80
+
"Event(id='639fc12d-867a-4739-a5d6-71e3db5cb3db', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=262, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 15', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 55, 7, 920757, tzinfo=TzInfo(UTC)))\n",
81
+
"Event(id='d7c93e13-8d49-4ba9-88c9-642176bea019', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=263, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 16', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 55, 8, 952535, tzinfo=TzInfo(UTC)))\n",
82
+
"Event(id='177047ce-bd57-47e4-b1ab-ca6a2c8333fe', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=264, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 17', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 55, 9, 986904, tzinfo=TzInfo(UTC)))\n",
83
+
"Event(id='f081c0c8-f9c4-4cb8-90d3-aa1fb662e065', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=265, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 18', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 55, 11, 34936, tzinfo=TzInfo(UTC)))\n",
84
+
"Event(id='45c49d20-de58-4f29-be75-b4169f30ff5c', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=266, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 19', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 55, 12, 64206, tzinfo=TzInfo(UTC)))\n",
85
+
"Event(id='23ef7bb3-f1a7-41cd-ba33-3513724ecb9a', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=267, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 20', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 55, 13, 117837, tzinfo=TzInfo(UTC)))\n",
86
+
"Event(id='f6d5dbda-ca45-42a9-a15e-3726f15a42ce', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=268, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 21', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 55, 14, 172609, tzinfo=TzInfo(UTC)))\n",
87
+
"Event(id='f8c0e226-c950-4173-9b63-00530d5a5a62', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=269, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 22', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 55, 15, 242257, tzinfo=TzInfo(UTC)))\n",
88
+
"Event(id='0cc1591b-0e5f-4044-9b08-8a7f8977f35b', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=270, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 23', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 55, 16, 287209, tzinfo=TzInfo(UTC)))\n",
89
+
"Event(id='562ad0d5-695e-46ca-a3f1-c918f44d8dce', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=271, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 24', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 55, 17, 330180, tzinfo=TzInfo(UTC)))\n",
90
+
"Event(id='c35b5515-a51c-486b-a46a-47cbd31b7b98', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=272, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 25', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 55, 18, 373297, tzinfo=TzInfo(UTC)))\n",
91
+
"Event(id='83b99f74-27d0-443f-8929-ce6f3fea1868', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=273, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 26', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 55, 19, 446678, tzinfo=TzInfo(UTC)))\n",
92
+
"Event(id='291784dd-0722-47d2-913e-27d2c328d972', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=274, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 27', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 55, 20, 508485, tzinfo=TzInfo(UTC)))\n",
93
+
"Event(id='36fff710-3617-4a58-827f-baee95ef0d6d', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=275, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 28', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 55, 21, 603524, tzinfo=TzInfo(UTC)))\n",
94
+
"Event(id='40058df6-7226-47c3-9e11-eb6aeb304ff2', agent_id='c9fc2e91-df7a-42b4-bc79-fe154bd4db5a', sequence_id=276, task_id='0927b469-5aed-4804-aa53-79a6af70f76f', content=TextContent(author='user', content='Hello what can you do? EVENT NUM: 29', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 8, 14, 5, 55, 22, 651817, tzinfo=TzInfo(UTC)))\n"
95
+
]
96
+
}
97
+
],
53
98
"source": [
54
99
"# Send an event to the agent\n",
55
100
"\n",
@@ -60,11 +105,41 @@
60
105
"# - ToolResponseContent: A message with a tool response, which contains response object from a tool call in its content\n",
61
106
"\n",
62
107
"# When processing the message/send response, if you are expecting more than TextContent, such as DataContent, ToolRequestContent, or ToolResponseContent, you can process them as well\n",
108
+
"\n",
109
+
"num_events = 30\n",
110
+
"for i in range(num_events):\n",
111
+
" rpc_response = client.agents.send_event(\n",
112
+
" agent_name=AGENT_NAME,\n",
113
+
" params={\n",
114
+
"\"content\": {\"type\": \"text\", \"author\": \"user\", \"content\": f\"Hello what can you do? EVENT NUM: {i}\"},\n",
"<span style=\"color: #008000; text-decoration-color: #008000\">│</span> I just cleared the queue of events that were received. Total cleared events: <span style=\"color: #008000; text-decoration-color: #008000\">│</span>\n",
0 commit comments