|
2 | 2 | "cells": [ |
3 | 3 | { |
4 | 4 | "cell_type": "code", |
5 | | - "execution_count": 6, |
| 5 | + "execution_count": null, |
6 | 6 | "id": "36834357", |
7 | 7 | "metadata": {}, |
8 | 8 | "outputs": [], |
|
14 | 14 | }, |
15 | 15 | { |
16 | 16 | "cell_type": "code", |
17 | | - "execution_count": 7, |
| 17 | + "execution_count": null, |
18 | 18 | "id": "d1c309d6", |
19 | 19 | "metadata": {}, |
20 | 20 | "outputs": [], |
|
24 | 24 | }, |
25 | 25 | { |
26 | 26 | "cell_type": "code", |
27 | | - "execution_count": 8, |
| 27 | + "execution_count": null, |
28 | 28 | "id": "9f6e6ef0", |
29 | 29 | "metadata": {}, |
30 | | - "outputs": [ |
31 | | - { |
32 | | - "name": "stdout", |
33 | | - "output_type": "stream", |
34 | | - "text": [ |
35 | | - "Task(id='fab911e3-47c5-43f2-9942-382a98d45975', created_at=datetime.datetime(2025, 7, 27, 0, 52, 55, 493055, tzinfo=TzInfo(UTC)), name='69297be2-task', status='RUNNING', status_reason='Task created, forwarding to ACP server', updated_at=datetime.datetime(2025, 7, 27, 0, 52, 55, 493055, tzinfo=TzInfo(UTC)))\n" |
36 | | - ] |
37 | | - } |
38 | | - ], |
| 30 | + "outputs": [], |
39 | 31 | "source": [ |
40 | 32 | "# (REQUIRED) Create a new task. For Agentic agents, you must create a task for messages to be associated with.\n", |
41 | 33 | "\n", |
|
64 | 56 | "execution_count": null, |
65 | 57 | "id": "b03b0d37", |
66 | 58 | "metadata": {}, |
67 | | - "outputs": [ |
68 | | - { |
69 | | - "name": "stdout", |
70 | | - "output_type": "stream", |
71 | | - "text": [ |
72 | | - "Event(id='6f1c066c-f400-49a5-a8bd-afe0f2367b4c', agent_id='ef21f2e7-5bbe-440a-824b-7e89f462a781', sequence_id=203, task_id='fab911e3-47c5-43f2-9942-382a98d45975', content=TextContent(author='user', content='Hello what can you do?', attachments=None, format='plain', style='static', type='text'), created_at=datetime.datetime(2025, 7, 27, 0, 52, 56, 693376, tzinfo=TzInfo(UTC)))\n" |
73 | | - ] |
74 | | - } |
75 | | - ], |
| 59 | + "outputs": [], |
76 | 60 | "source": [ |
77 | 61 | "# Test non streaming response\n", |
78 | 62 | "from typing import cast\n", |
|
101 | 85 | }, |
102 | 86 | { |
103 | 87 | "cell_type": "code", |
104 | | - "execution_count": 10, |
| 88 | + "execution_count": null, |
105 | 89 | "id": "a6927cc0", |
106 | 90 | "metadata": {}, |
107 | | - "outputs": [ |
108 | | - { |
109 | | - "data": { |
110 | | - "text/html": [ |
111 | | - "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #00ffff; text-decoration-color: #00ffff\">╭───────────────────────── </span><span style=\"color: #00ffff; text-decoration-color: #00ffff; font-weight: bold\">USER</span><span style=\"color: #00ffff; text-decoration-color: #00ffff\"> [07/27/2025 00:52:56] ─────────────────────────╮</span>\n", |
112 | | - "<span style=\"color: #00ffff; text-decoration-color: #00ffff\">│</span> Hello what can you do? <span style=\"color: #00ffff; text-decoration-color: #00ffff\">│</span>\n", |
113 | | - "<span style=\"color: #00ffff; text-decoration-color: #00ffff\">╰──────────────────────────────────────────────────────────────────────────────╯</span>\n", |
114 | | - "</pre>\n" |
115 | | - ], |
116 | | - "text/plain": [ |
117 | | - "\u001b[96m╭─\u001b[0m\u001b[96m────────────────────────\u001b[0m\u001b[96m \u001b[0m\u001b[1;96mUSER\u001b[0m\u001b[96m [07/27/2025 00:52:56] \u001b[0m\u001b[96m────────────────────────\u001b[0m\u001b[96m─╮\u001b[0m\n", |
118 | | - "\u001b[96m│\u001b[0m Hello what can you do? \u001b[96m│\u001b[0m\n", |
119 | | - "\u001b[96m╰──────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n" |
120 | | - ] |
121 | | - }, |
122 | | - "metadata": {}, |
123 | | - "output_type": "display_data" |
124 | | - }, |
125 | | - { |
126 | | - "name": "stdout", |
127 | | - "output_type": "stream", |
128 | | - "text": [ |
129 | | - " \r" |
130 | | - ] |
131 | | - }, |
132 | | - { |
133 | | - "data": { |
134 | | - "text/html": [ |
135 | | - "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #00ff00; text-decoration-color: #00ff00\">╭──────────────────────── </span><span style=\"color: #00ff00; text-decoration-color: #00ff00; font-weight: bold\">AGENT</span><span style=\"color: #00ff00; text-decoration-color: #00ff00\"> [07/27/2025 00:52:56] ─────────────────────────╮</span>\n", |
136 | | - "<span style=\"color: #00ff00; text-decoration-color: #00ff00\">│</span> Hello! I can assist you with a variety of tasks, such as: <span style=\"color: #00ff00; text-decoration-color: #00ff00\">│</span>\n", |
137 | | - "<span style=\"color: #00ff00; text-decoration-color: #00ff00\">│</span> <span style=\"color: #00ff00; text-decoration-color: #00ff00\">│</span>\n", |
138 | | - "<span style=\"color: #00ff00; text-decoration-color: #00ff00\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> 1 </span>Answering questions on a wide range of topics, including science, <span style=\"color: #00ff00; text-decoration-color: #00ff00\">│</span>\n", |
139 | | - "<span style=\"color: #00ff00; text-decoration-color: #00ff00\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> </span>history, technology, and more. <span style=\"color: #00ff00; text-decoration-color: #00ff00\">│</span>\n", |
140 | | - "<span style=\"color: #00ff00; text-decoration-color: #00ff00\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> 2 </span>Providing explanations and summaries of complex concepts. <span style=\"color: #00ff00; text-decoration-color: #00ff00\">│</span>\n", |
141 | | - "<span style=\"color: #00ff00; text-decoration-color: #00ff00\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> 3 </span>Assisting with language translations and grammar checks. <span style=\"color: #00ff00; text-decoration-color: #00ff00\">│</span>\n", |
142 | | - "<span style=\"color: #00ff00; text-decoration-color: #00ff00\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> 4 </span>Offering writing tips, editing assistance, and brainstorming ideas for <span style=\"color: #00ff00; text-decoration-color: #00ff00\">│</span>\n", |
143 | | - "<span style=\"color: #00ff00; text-decoration-color: #00ff00\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> </span>creative projects. <span style=\"color: #00ff00; text-decoration-color: #00ff00\">│</span>\n", |
144 | | - "<span style=\"color: #00ff00; text-decoration-color: #00ff00\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> 5 </span>Giving advice on studying, time management, and organization. <span style=\"color: #00ff00; text-decoration-color: #00ff00\">│</span>\n", |
145 | | - "<span style=\"color: #00ff00; text-decoration-color: #00ff00\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> 6 </span>Sharing information about books, movies, and other media. <span style=\"color: #00ff00; text-decoration-color: #00ff00\">│</span>\n", |
146 | | - "<span style=\"color: #00ff00; text-decoration-color: #00ff00\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> 7 </span>Engaging in general conversation or providing entertainment. <span style=\"color: #00ff00; text-decoration-color: #00ff00\">│</span>\n", |
147 | | - "<span style=\"color: #00ff00; text-decoration-color: #00ff00\">│</span> <span style=\"color: #00ff00; text-decoration-color: #00ff00\">│</span>\n", |
148 | | - "<span style=\"color: #00ff00; text-decoration-color: #00ff00\">│</span> If you have a specific question or need help with something, feel free to <span style=\"color: #00ff00; text-decoration-color: #00ff00\">│</span>\n", |
149 | | - "<span style=\"color: #00ff00; text-decoration-color: #00ff00\">│</span> ask! <span style=\"color: #00ff00; text-decoration-color: #00ff00\">│</span>\n", |
150 | | - "<span style=\"color: #00ff00; text-decoration-color: #00ff00\">╰──────────────────────────────────────────────────────────────────────────────╯</span>\n", |
151 | | - "</pre>\n" |
152 | | - ], |
153 | | - "text/plain": [ |
154 | | - "\u001b[92m╭─\u001b[0m\u001b[92m───────────────────────\u001b[0m\u001b[92m \u001b[0m\u001b[1;92mAGENT\u001b[0m\u001b[92m [07/27/2025 00:52:56] \u001b[0m\u001b[92m────────────────────────\u001b[0m\u001b[92m─╮\u001b[0m\n", |
155 | | - "\u001b[92m│\u001b[0m Hello! I can assist you with a variety of tasks, such as: \u001b[92m│\u001b[0m\n", |
156 | | - "\u001b[92m│\u001b[0m \u001b[92m│\u001b[0m\n", |
157 | | - "\u001b[92m│\u001b[0m \u001b[1;33m 1 \u001b[0mAnswering questions on a wide range of topics, including science, \u001b[92m│\u001b[0m\n", |
158 | | - "\u001b[92m│\u001b[0m \u001b[1;33m \u001b[0mhistory, technology, and more. \u001b[92m│\u001b[0m\n", |
159 | | - "\u001b[92m│\u001b[0m \u001b[1;33m 2 \u001b[0mProviding explanations and summaries of complex concepts. \u001b[92m│\u001b[0m\n", |
160 | | - "\u001b[92m│\u001b[0m \u001b[1;33m 3 \u001b[0mAssisting with language translations and grammar checks. \u001b[92m│\u001b[0m\n", |
161 | | - "\u001b[92m│\u001b[0m \u001b[1;33m 4 \u001b[0mOffering writing tips, editing assistance, and brainstorming ideas for \u001b[92m│\u001b[0m\n", |
162 | | - "\u001b[92m│\u001b[0m \u001b[1;33m \u001b[0mcreative projects. \u001b[92m│\u001b[0m\n", |
163 | | - "\u001b[92m│\u001b[0m \u001b[1;33m 5 \u001b[0mGiving advice on studying, time management, and organization. \u001b[92m│\u001b[0m\n", |
164 | | - "\u001b[92m│\u001b[0m \u001b[1;33m 6 \u001b[0mSharing information about books, movies, and other media. \u001b[92m│\u001b[0m\n", |
165 | | - "\u001b[92m│\u001b[0m \u001b[1;33m 7 \u001b[0mEngaging in general conversation or providing entertainment. \u001b[92m│\u001b[0m\n", |
166 | | - "\u001b[92m│\u001b[0m \u001b[92m│\u001b[0m\n", |
167 | | - "\u001b[92m│\u001b[0m If you have a specific question or need help with something, feel free to \u001b[92m│\u001b[0m\n", |
168 | | - "\u001b[92m│\u001b[0m ask! \u001b[92m│\u001b[0m\n", |
169 | | - "\u001b[92m╰──────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n" |
170 | | - ] |
171 | | - }, |
172 | | - "metadata": {}, |
173 | | - "output_type": "display_data" |
174 | | - }, |
175 | | - { |
176 | | - "name": "stdout", |
177 | | - "output_type": "stream", |
178 | | - "text": [ |
179 | | - "Streaming timed out after 5 seconds - returning collected messages\n" |
180 | | - ] |
181 | | - } |
182 | | - ], |
| 91 | + "outputs": [], |
183 | 92 | "source": [ |
184 | 93 | "from agentex.lib.utils.dev_tools import subscribe_to_async_task_messages\n", |
185 | 94 | "\n", |
|
192 | 101 | " timeout=5,\n", |
193 | 102 | ")" |
194 | 103 | ] |
195 | | - }, |
196 | | - { |
197 | | - "cell_type": "code", |
198 | | - "execution_count": null, |
199 | | - "id": "6470ae58", |
200 | | - "metadata": {}, |
201 | | - "outputs": [], |
202 | | - "source": [] |
203 | 104 | } |
204 | 105 | ], |
205 | 106 | "metadata": { |
|
0 commit comments