airia 0.1.13__py3-none-any.whl → 0.1.15__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. airia/client/_request_handler/__init__.py +4 -0
  2. airia/client/_request_handler/async_request_handler.py +272 -0
  3. airia/client/_request_handler/base_request_handler.py +108 -0
  4. airia/client/_request_handler/sync_request_handler.py +255 -0
  5. airia/client/async_client.py +27 -678
  6. airia/client/base_client.py +2 -368
  7. airia/client/conversations/__init__.py +4 -0
  8. airia/client/conversations/async_conversations.py +187 -0
  9. airia/client/conversations/base_conversations.py +135 -0
  10. airia/client/conversations/sync_conversations.py +182 -0
  11. airia/client/deployments/__init__.py +11 -0
  12. airia/client/deployments/async_deployments.py +112 -0
  13. airia/client/deployments/base_deployments.py +95 -0
  14. airia/client/deployments/sync_deployments.py +112 -0
  15. airia/client/pipeline_execution/__init__.py +4 -0
  16. airia/client/pipeline_execution/async_pipeline_execution.py +178 -0
  17. airia/client/pipeline_execution/base_pipeline_execution.py +96 -0
  18. airia/client/pipeline_execution/sync_pipeline_execution.py +178 -0
  19. airia/client/pipelines_config/__init__.py +4 -0
  20. airia/client/pipelines_config/async_pipelines_config.py +65 -0
  21. airia/client/pipelines_config/base_pipelines_config.py +44 -0
  22. airia/client/pipelines_config/sync_pipelines_config.py +65 -0
  23. airia/client/project/__init__.py +4 -0
  24. airia/client/project/async_project.py +122 -0
  25. airia/client/project/base_project.py +74 -0
  26. airia/client/project/sync_project.py +120 -0
  27. airia/client/store/__init__.py +4 -0
  28. airia/client/store/async_store.py +377 -0
  29. airia/client/store/base_store.py +243 -0
  30. airia/client/store/sync_store.py +352 -0
  31. airia/client/sync_client.py +27 -656
  32. airia/constants.py +1 -1
  33. airia/exceptions.py +8 -8
  34. airia/logs.py +9 -9
  35. airia/types/_request_data.py +11 -4
  36. airia/types/api/__init__.py +0 -27
  37. airia/types/api/conversations/__init__.py +13 -0
  38. airia/types/api/{conversations.py → conversations/_conversations.py} +49 -12
  39. airia/types/api/deployments/__init__.py +26 -0
  40. airia/types/api/deployments/get_deployment.py +106 -0
  41. airia/types/api/deployments/get_deployments.py +224 -0
  42. airia/types/api/pipeline_execution/__init__.py +13 -0
  43. airia/types/api/{pipeline_execution.py → pipeline_execution/_pipeline_execution.py} +30 -13
  44. airia/types/api/pipelines_config/__init__.py +35 -0
  45. airia/types/api/pipelines_config/get_pipeline_config.py +554 -0
  46. airia/types/api/project/__init__.py +3 -0
  47. airia/types/api/{get_projects.py → project/get_projects.py} +16 -4
  48. airia/types/api/store/__init__.py +19 -0
  49. airia/types/api/store/get_file.py +145 -0
  50. airia/types/api/store/get_files.py +21 -0
  51. airia/types/sse/__init__.py +1 -0
  52. airia/types/sse/sse_messages.py +364 -48
  53. airia/utils/sse_parser.py +5 -4
  54. {airia-0.1.13.dist-info → airia-0.1.15.dist-info}/METADATA +4 -2
  55. airia-0.1.15.dist-info/RECORD +62 -0
  56. airia/types/api/get_pipeline_config.py +0 -214
  57. airia-0.1.13.dist-info/RECORD +0 -24
  58. {airia-0.1.13.dist-info → airia-0.1.15.dist-info}/WHEEL +0 -0
  59. {airia-0.1.13.dist-info → airia-0.1.15.dist-info}/licenses/LICENSE +0 -0
  60. {airia-0.1.13.dist-info → airia-0.1.15.dist-info}/top_level.txt +0 -0
@@ -5,6 +5,7 @@ This module defines all possible SSE message types that can be received during
5
5
  pipeline execution, including agent lifecycle events, processing steps, model
6
6
  streaming, and tool execution messages.
7
7
  """
8
+
8
9
  from datetime import datetime, time
9
10
  from enum import Enum
10
11
  from typing import Optional, Union
@@ -15,45 +16,78 @@ from pydantic import BaseModel, ConfigDict
15
16
  class MessageType(str, Enum):
16
17
  """
17
18
  Enumeration of all possible SSE message types from the Airia API.
18
-
19
+
19
20
  These message types correspond to different events that occur during
20
21
  pipeline execution, agent processing, and streaming responses.
21
- """
22
- AGENT_PING = "AgentPingMessage"
23
- AGENT_START = "AgentStartMessage"
24
- AGENT_INPUT = "AgentInputMessage"
25
- AGENT_END = "AgentEndMessage"
26
- AGENT_STEP_START = "AgentStepStartMessage"
27
- AGENT_STEP_HALT = "AgentStepHaltMessage"
28
- AGENT_STEP_END = "AgentStepEndMessage"
29
- AGENT_OUTPUT = "AgentOutputMessage"
30
- AGENT_AGENT_CARD = "AgentAgentCardMessage"
31
- AGENT_DATASEARCH = "AgentDatasearchMessage"
32
- AGENT_INVOCATION = "AgentInvocationMessage"
33
- AGENT_MODEL = "AgentModelMessage"
34
- AGENT_PYTHON_CODE = "AgentPythonCodeMessage"
35
- AGENT_TOOL_ACTION = "AgentToolActionMessage"
36
- AGENT_MODEL_STREAM_START = "AgentModelStreamStartMessage"
37
- AGENT_MODEL_STREAM_END = "AgentModelStreamEndMessage"
38
- AGENT_MODEL_STREAM_ERROR = "AgentModelStreamErrorMessage"
39
- AGENT_MODEL_STREAM_USAGE = "AgentModelStreamUsageMessage"
40
- AGENT_MODEL_STREAM_FRAGMENT = "AgentModelStreamFragmentMessage"
41
- MODEL_STREAM_FRAGMENT = "ModelStreamFragment"
42
- AGENT_AGENT_CARD_STREAM_START = "AgentAgentCardStreamStartMessage"
43
- AGENT_AGENT_CARD_STREAM_ERROR = "AgentAgentCardStreamErrorMessage"
44
- AGENT_AGENT_CARD_STREAM_FRAGMENT = "AgentAgentCardStreamFragmentMessage"
45
- AGENT_AGENT_CARD_STREAM_END = "AgentAgentCardStreamEndMessage"
46
- AGENT_TOOL_REQUEST = "AgentToolRequestMessage"
47
- AGENT_TOOL_RESPONSE = "AgentToolResponseMessage"
22
+
23
+ Attributes:
24
+ AGENT_PING: Ping message sent periodically to maintain connection health.
25
+ AGENT_START: Message indicating that an agent has started processing.
26
+ AGENT_INPUT: Message indicating that an agent has received input to process.
27
+ AGENT_END: Message indicating that an agent has finished processing.
28
+ AGENT_STEP_START: Message indicating that a processing step has started.
29
+ AGENT_STEP_HALT: Message indicating that a step has been halted pending approval.
30
+ AGENT_STEP_END: Message indicating that a processing step has completed.
31
+ AGENT_OUTPUT: Message containing the output result from a completed step.
32
+ AGENT_AGENT_CARD: Message indicating that an agent card step is being processed.
33
+ AGENT_DATASEARCH: Message indicating that data source search is being performed.
34
+ AGENT_INVOCATION: Message indicating that another agent is being invoked.
35
+ AGENT_MODEL: Message indicating that a language model is being called.
36
+ AGENT_PYTHON_CODE: Message indicating that Python code execution is taking place.
37
+ AGENT_TOOL_ACTION: Message indicating that a tool or external service is being called.
38
+ AGENT_MODEL_STREAM_START: Message indicating that model text streaming has begun.
39
+ AGENT_MODEL_STREAM_END: Message indicating that model text streaming has completed.
40
+ AGENT_MODEL_STREAM_ERROR: Message indicating that an error occurred during model streaming.
41
+ AGENT_MODEL_STREAM_USAGE: Message containing token usage and cost information for model calls.
42
+ AGENT_MODEL_STREAM_FRAGMENT: Fragment of streaming text content from a language model.
43
+ MODEL_STREAM_FRAGMENT: Alternative fragment message type for model streaming.
44
+ AGENT_AGENT_CARD_STREAM_START: Message indicating that agent card streaming has begun.
45
+ AGENT_AGENT_CARD_STREAM_ERROR: Message indicating that an error occurred during agent card streaming.
46
+ AGENT_AGENT_CARD_STREAM_FRAGMENT: Fragment of streaming agent card content.
47
+ AGENT_AGENT_CARD_STREAM_END: Message indicating that agent card streaming has completed.
48
+ AGENT_TOOL_REQUEST: Message indicating that a tool request has been initiated.
49
+ AGENT_TOOL_RESPONSE: Message indicating that a tool request has completed.
50
+ """
51
+
52
+ AGENT_PING: str = "AgentPingMessage"
53
+ AGENT_START: str = "AgentStartMessage"
54
+ AGENT_INPUT: str = "AgentInputMessage"
55
+ AGENT_END: str = "AgentEndMessage"
56
+ AGENT_STEP_START: str = "AgentStepStartMessage"
57
+ AGENT_STEP_HALT: str = "AgentStepHaltMessage"
58
+ AGENT_STEP_END: str = "AgentStepEndMessage"
59
+ AGENT_OUTPUT: str = "AgentOutputMessage"
60
+ AGENT_AGENT_CARD: str = "AgentAgentCardMessage"
61
+ AGENT_DATASEARCH: str = "AgentDatasearchMessage"
62
+ AGENT_INVOCATION: str = "AgentInvocationMessage"
63
+ AGENT_MODEL: str = "AgentModelMessage"
64
+ AGENT_PYTHON_CODE: str = "AgentPythonCodeMessage"
65
+ AGENT_TOOL_ACTION: str = "AgentToolActionMessage"
66
+ AGENT_MODEL_STREAM_START: str = "AgentModelStreamStartMessage"
67
+ AGENT_MODEL_STREAM_END: str = "AgentModelStreamEndMessage"
68
+ AGENT_MODEL_STREAM_ERROR: str = "AgentModelStreamErrorMessage"
69
+ AGENT_MODEL_STREAM_USAGE: str = "AgentModelStreamUsageMessage"
70
+ AGENT_MODEL_STREAM_FRAGMENT: str = "AgentModelStreamFragmentMessage"
71
+ MODEL_STREAM_FRAGMENT: str = "ModelStreamFragment"
72
+ AGENT_AGENT_CARD_STREAM_START: str = "AgentAgentCardStreamStartMessage"
73
+ AGENT_AGENT_CARD_STREAM_ERROR: str = "AgentAgentCardStreamErrorMessage"
74
+ AGENT_AGENT_CARD_STREAM_FRAGMENT: str = "AgentAgentCardStreamFragmentMessage"
75
+ AGENT_AGENT_CARD_STREAM_END: str = "AgentAgentCardStreamEndMessage"
76
+ AGENT_TOOL_REQUEST: str = "AgentToolRequestMessage"
77
+ AGENT_TOOL_RESPONSE: str = "AgentToolResponseMessage"
48
78
 
49
79
 
50
80
  class BaseSSEMessage(BaseModel):
51
81
  """
52
82
  Base class for all Server-Sent Event (SSE) messages from the Airia API.
53
-
83
+
54
84
  All SSE messages include a message_type field that identifies the specific
55
85
  type of event being reported.
86
+
87
+ Attributes:
88
+ message_type: The type of SSE message, identifying the specific event being reported.
56
89
  """
90
+
57
91
  model_config = ConfigDict(use_enum_values=True)
58
92
  message_type: MessageType
59
93
 
@@ -61,10 +95,15 @@ class BaseSSEMessage(BaseModel):
61
95
  class AgentPingMessage(BaseSSEMessage):
62
96
  """
63
97
  Ping message sent periodically to maintain connection health.
64
-
98
+
65
99
  These messages help verify that the connection is still active during
66
100
  long-running pipeline executions.
101
+
102
+ Attributes:
103
+ message_type: Always set to AGENT_PING for ping messages.
104
+ timestamp: The time when the ping message was sent.
67
105
  """
106
+
68
107
  message_type: MessageType = MessageType.AGENT_PING
69
108
  timestamp: datetime
70
109
 
@@ -75,10 +114,15 @@ class AgentPingMessage(BaseSSEMessage):
75
114
  class BaseAgentMessage(BaseSSEMessage):
76
115
  """
77
116
  Base class for messages related to agent execution.
78
-
117
+
79
118
  All agent messages include identifiers for the specific agent
80
119
  and execution session.
120
+
121
+ Attributes:
122
+ agent_id: Unique identifier for the agent generating this message.
123
+ execution_id: Unique identifier for the current execution session.
81
124
  """
125
+
82
126
  agent_id: str
83
127
  execution_id: str
84
128
 
@@ -86,21 +130,39 @@ class BaseAgentMessage(BaseSSEMessage):
86
130
  class AgentStartMessage(BaseAgentMessage):
87
131
  """
88
132
  Message indicating that an agent has started processing.
133
+
134
+ Attributes:
135
+ message_type: Always set to AGENT_START for agent start messages.
136
+ agent_id: Unique identifier for the agent that started.
137
+ execution_id: Unique identifier for the execution session.
89
138
  """
139
+
90
140
  message_type: MessageType = MessageType.AGENT_START
91
141
 
92
142
 
93
143
  class AgentInputMessage(BaseAgentMessage):
94
144
  """
95
145
  Message indicating that an agent has received input to process.
146
+
147
+ Attributes:
148
+ message_type: Always set to AGENT_INPUT for agent input messages.
149
+ agent_id: Unique identifier for the agent receiving input.
150
+ execution_id: Unique identifier for the execution session.
96
151
  """
152
+
97
153
  message_type: MessageType = MessageType.AGENT_INPUT
98
154
 
99
155
 
100
156
  class AgentEndMessage(BaseAgentMessage):
101
157
  """
102
158
  Message indicating that an agent has finished processing.
159
+
160
+ Attributes:
161
+ message_type: Always set to AGENT_END for agent end messages.
162
+ agent_id: Unique identifier for the agent that finished.
163
+ execution_id: Unique identifier for the execution session.
103
164
  """
165
+
104
166
  message_type: MessageType = MessageType.AGENT_END
105
167
 
106
168
 
@@ -110,10 +172,18 @@ class AgentEndMessage(BaseAgentMessage):
110
172
  class BaseStepMessage(BaseAgentMessage):
111
173
  """
112
174
  Base class for messages related to individual processing steps within an agent.
113
-
175
+
114
176
  Steps represent discrete operations or tasks that an agent performs
115
177
  as part of its overall processing workflow.
178
+
179
+ Attributes:
180
+ agent_id: Unique identifier for the agent performing the step.
181
+ execution_id: Unique identifier for the execution session.
182
+ step_id: Unique identifier for the processing step.
183
+ step_type: The type/category of the processing step.
184
+ step_title: Optional human-readable title for the step.
116
185
  """
186
+
117
187
  step_id: str
118
188
  step_type: str
119
189
  step_title: Optional[str] = None
@@ -122,7 +192,17 @@ class BaseStepMessage(BaseAgentMessage):
122
192
  class AgentStepStartMessage(BaseStepMessage):
123
193
  """
124
194
  Message indicating that a processing step has started.
195
+
196
+ Attributes:
197
+ message_type: Always set to AGENT_STEP_START for step start messages.
198
+ agent_id: Unique identifier for the agent performing the step.
199
+ execution_id: Unique identifier for the execution session.
200
+ step_id: Unique identifier for the processing step that started.
201
+ step_type: The type/category of the processing step.
202
+ step_title: Optional human-readable title for the step.
203
+ start_time: The timestamp when the step began execution.
125
204
  """
205
+
126
206
  message_type: MessageType = MessageType.AGENT_STEP_START
127
207
  start_time: datetime
128
208
 
@@ -130,10 +210,20 @@ class AgentStepStartMessage(BaseStepMessage):
130
210
  class AgentStepHaltMessage(BaseStepMessage):
131
211
  """
132
212
  Message indicating that a step has been halted pending approval.
133
-
213
+
134
214
  This occurs when human approval is required before proceeding
135
215
  with potentially sensitive or high-impact operations.
216
+
217
+ Attributes:
218
+ message_type: Always set to AGENT_STEP_HALT for step halt messages.
219
+ agent_id: Unique identifier for the agent performing the step.
220
+ execution_id: Unique identifier for the execution session.
221
+ step_id: Unique identifier for the processing step that was halted.
222
+ step_type: The type/category of the processing step.
223
+ step_title: Optional human-readable title for the step.
224
+ approval_id: Unique identifier for the approval request.
136
225
  """
226
+
137
227
  message_type: MessageType = MessageType.AGENT_STEP_HALT
138
228
  approval_id: str
139
229
 
@@ -141,9 +231,21 @@ class AgentStepHaltMessage(BaseStepMessage):
141
231
  class AgentStepEndMessage(BaseStepMessage):
142
232
  """
143
233
  Message indicating that a processing step has completed.
144
-
234
+
145
235
  Includes timing information and the final status of the step.
236
+
237
+ Attributes:
238
+ message_type: Always set to AGENT_STEP_END for step end messages.
239
+ agent_id: Unique identifier for the agent performing the step.
240
+ execution_id: Unique identifier for the execution session.
241
+ step_id: Unique identifier for the processing step that ended.
242
+ step_type: The type/category of the processing step.
243
+ step_title: Optional human-readable title for the step.
244
+ end_time: The timestamp when the step completed execution.
245
+ duration: The total time the step took to execute.
246
+ status: The final status of the step (e.g., 'success', 'failed').
146
247
  """
248
+
147
249
  message_type: MessageType = MessageType.AGENT_STEP_END
148
250
  end_time: datetime
149
251
  duration: time
@@ -153,7 +255,17 @@ class AgentStepEndMessage(BaseStepMessage):
153
255
  class AgentOutputMessage(BaseStepMessage):
154
256
  """
155
257
  Message containing the output result from a completed step.
258
+
259
+ Attributes:
260
+ message_type: Always set to AGENT_OUTPUT for output messages.
261
+ agent_id: Unique identifier for the agent that produced the output.
262
+ execution_id: Unique identifier for the execution session.
263
+ step_id: Unique identifier for the processing step that generated output.
264
+ step_type: The type/category of the processing step.
265
+ step_title: Optional human-readable title for the step.
266
+ step_result: The output result or content from the completed step.
156
267
  """
268
+
157
269
  message_type: MessageType = MessageType.AGENT_OUTPUT
158
270
  step_result: str
159
271
 
@@ -164,20 +276,38 @@ class AgentOutputMessage(BaseStepMessage):
164
276
  class BaseStatusMessage(BaseStepMessage):
165
277
  """
166
278
  Base class for status update messages within processing steps.
167
-
279
+
168
280
  Status messages provide real-time updates about what operations
169
281
  are being performed during step execution.
282
+
283
+ Attributes:
284
+ agent_id: Unique identifier for the agent performing the step.
285
+ execution_id: Unique identifier for the execution session.
286
+ step_id: Unique identifier for the processing step.
287
+ step_type: The type/category of the processing step.
288
+ step_title: Optional human-readable title for the step.
170
289
  """
290
+
171
291
  pass
172
292
 
173
293
 
174
294
  class AgentAgentCardMessage(BaseStatusMessage):
175
295
  """
176
296
  Message indicating that an agent card step is being processed.
177
-
297
+
178
298
  Agent cards represent interactive UI components or displays
179
299
  that provide rich information to users during pipeline execution.
300
+
301
+ Attributes:
302
+ message_type: Always set to AGENT_AGENT_CARD for agent card messages.
303
+ agent_id: Unique identifier for the agent processing the card.
304
+ execution_id: Unique identifier for the execution session.
305
+ step_id: Unique identifier for the processing step.
306
+ step_type: The type/category of the processing step.
307
+ step_title: Optional human-readable title for the step.
308
+ step_name: The name of the agent card step being processed.
180
309
  """
310
+
181
311
  message_type: MessageType = MessageType.AGENT_AGENT_CARD
182
312
  step_name: str
183
313
 
@@ -185,10 +315,22 @@ class AgentAgentCardMessage(BaseStatusMessage):
185
315
  class AgentDatasearchMessage(BaseStatusMessage):
186
316
  """
187
317
  Message indicating that data source search is being performed.
188
-
318
+
189
319
  This message is sent when an agent is querying or searching
190
320
  through configured data sources to retrieve relevant information.
321
+
322
+ Attributes:
323
+ message_type: Always set to AGENT_DATASEARCH for data search messages.
324
+ agent_id: Unique identifier for the agent performing the search.
325
+ execution_id: Unique identifier for the execution session.
326
+ step_id: Unique identifier for the processing step.
327
+ step_type: The type/category of the processing step.
328
+ step_title: Optional human-readable title for the step.
329
+ datastore_id: Unique identifier for the data source being searched.
330
+ datastore_type: The type of data source (e.g., 'database', 'file', 'api').
331
+ datastore_name: Human-readable name of the data source.
191
332
  """
333
+
192
334
  message_type: MessageType = MessageType.AGENT_DATASEARCH
193
335
  datastore_id: str
194
336
  datastore_type: str
@@ -198,10 +340,20 @@ class AgentDatasearchMessage(BaseStatusMessage):
198
340
  class AgentInvocationMessage(BaseStatusMessage):
199
341
  """
200
342
  Message indicating that another agent is being invoked.
201
-
343
+
202
344
  This occurs when the current agent calls or delegates work
203
345
  to another specialized agent in the pipeline.
346
+
347
+ Attributes:
348
+ message_type: Always set to AGENT_INVOCATION for agent invocation messages.
349
+ agent_id: Unique identifier for the agent making the invocation.
350
+ execution_id: Unique identifier for the execution session.
351
+ step_id: Unique identifier for the processing step.
352
+ step_type: The type/category of the processing step.
353
+ step_title: Optional human-readable title for the step.
354
+ agent_name: The name of the agent being invoked.
204
355
  """
356
+
205
357
  message_type: MessageType = MessageType.AGENT_INVOCATION
206
358
  agent_name: str
207
359
 
@@ -209,10 +361,20 @@ class AgentInvocationMessage(BaseStatusMessage):
209
361
  class AgentModelMessage(BaseStatusMessage):
210
362
  """
211
363
  Message indicating that a language model is being called.
212
-
364
+
213
365
  This message is sent when an agent begins interacting with
214
366
  a language model for text generation or processing.
367
+
368
+ Attributes:
369
+ message_type: Always set to AGENT_MODEL for model messages.
370
+ agent_id: Unique identifier for the agent calling the model.
371
+ execution_id: Unique identifier for the execution session.
372
+ step_id: Unique identifier for the processing step.
373
+ step_type: The type/category of the processing step.
374
+ step_title: Optional human-readable title for the step.
375
+ model_name: The name of the language model being called.
215
376
  """
377
+
216
378
  message_type: MessageType = MessageType.AGENT_MODEL
217
379
  model_name: str
218
380
 
@@ -220,10 +382,20 @@ class AgentModelMessage(BaseStatusMessage):
220
382
  class AgentPythonCodeMessage(BaseStatusMessage):
221
383
  """
222
384
  Message indicating that Python code execution is taking place.
223
-
385
+
224
386
  This message is sent when an agent executes custom Python code
225
387
  blocks as part of its processing workflow.
388
+
389
+ Attributes:
390
+ message_type: Always set to AGENT_PYTHON_CODE for Python code messages.
391
+ agent_id: Unique identifier for the agent executing the code.
392
+ execution_id: Unique identifier for the execution session.
393
+ step_id: Unique identifier for the processing step.
394
+ step_type: The type/category of the processing step.
395
+ step_title: Optional human-readable title for the step.
396
+ step_name: The name of the Python code step being executed.
226
397
  """
398
+
227
399
  message_type: MessageType = MessageType.AGENT_PYTHON_CODE
228
400
  step_name: str
229
401
 
@@ -231,10 +403,21 @@ class AgentPythonCodeMessage(BaseStatusMessage):
231
403
  class AgentToolActionMessage(BaseStatusMessage):
232
404
  """
233
405
  Message indicating that a tool or external service is being called.
234
-
406
+
235
407
  This message is sent when an agent invokes an external tool,
236
408
  API, or service to perform a specific action or retrieve data.
409
+
410
+ Attributes:
411
+ message_type: Always set to AGENT_TOOL_ACTION for tool action messages.
412
+ agent_id: Unique identifier for the agent calling the tool.
413
+ execution_id: Unique identifier for the execution session.
414
+ step_id: Unique identifier for the processing step.
415
+ step_type: The type/category of the processing step.
416
+ step_title: Optional human-readable title for the step.
417
+ step_name: The name of the tool action step being performed.
418
+ tool_name: The name of the external tool being called.
237
419
  """
420
+
238
421
  message_type: MessageType = MessageType.AGENT_TOOL_ACTION
239
422
  step_name: str
240
423
  tool_name: str
@@ -246,10 +429,17 @@ class AgentToolActionMessage(BaseStatusMessage):
246
429
  class BaseModelStreamMessage(BaseAgentMessage):
247
430
  """
248
431
  Base class for language model streaming messages.
249
-
432
+
250
433
  Model streaming allows real-time display of text generation
251
434
  as it occurs, providing better user experience for long responses.
435
+
436
+ Attributes:
437
+ agent_id: Unique identifier for the agent performing the streaming.
438
+ execution_id: Unique identifier for the execution session.
439
+ step_id: Unique identifier for the processing step.
440
+ stream_id: Unique identifier for the streaming session.
252
441
  """
442
+
253
443
  step_id: str
254
444
  stream_id: str
255
445
 
@@ -257,7 +447,16 @@ class BaseModelStreamMessage(BaseAgentMessage):
257
447
  class AgentModelStreamStartMessage(BaseModelStreamMessage):
258
448
  """
259
449
  Message indicating that model text streaming has begun.
450
+
451
+ Attributes:
452
+ message_type: Always set to AGENT_MODEL_STREAM_START for stream start messages.
453
+ agent_id: Unique identifier for the agent performing the streaming.
454
+ execution_id: Unique identifier for the execution session.
455
+ step_id: Unique identifier for the processing step.
456
+ stream_id: Unique identifier for the streaming session.
457
+ model_name: The name of the language model being streamed.
260
458
  """
459
+
261
460
  message_type: MessageType = MessageType.AGENT_MODEL_STREAM_START
262
461
  model_name: str
263
462
 
@@ -265,7 +464,16 @@ class AgentModelStreamStartMessage(BaseModelStreamMessage):
265
464
  class AgentModelStreamErrorMessage(BaseModelStreamMessage):
266
465
  """
267
466
  Message indicating that an error occurred during model streaming.
467
+
468
+ Attributes:
469
+ message_type: Always set to AGENT_MODEL_STREAM_ERROR for stream error messages.
470
+ agent_id: Unique identifier for the agent performing the streaming.
471
+ execution_id: Unique identifier for the execution session.
472
+ step_id: Unique identifier for the processing step.
473
+ stream_id: Unique identifier for the streaming session.
474
+ error_message: Description of the error that occurred during streaming.
268
475
  """
476
+
269
477
  message_type: MessageType = MessageType.AGENT_MODEL_STREAM_ERROR
270
478
  error_message: str
271
479
 
@@ -273,10 +481,20 @@ class AgentModelStreamErrorMessage(BaseModelStreamMessage):
273
481
  class AgentModelStreamFragmentMessage(BaseModelStreamMessage):
274
482
  """
275
483
  Fragment of streaming text content from a language model.
276
-
484
+
277
485
  These messages contain individual chunks of text as they are generated
278
486
  by the model, allowing for real-time display of results.
487
+
488
+ Attributes:
489
+ message_type: Always set to AGENT_MODEL_STREAM_FRAGMENT for fragment messages.
490
+ agent_id: Unique identifier for the agent performing the streaming.
491
+ execution_id: Unique identifier for the execution session.
492
+ step_id: Unique identifier for the processing step.
493
+ stream_id: Unique identifier for the streaming session.
494
+ index: The sequential index of this fragment within the stream.
495
+ content: The text content of this fragment, or None if no content.
279
496
  """
497
+
280
498
  message_type: MessageType = MessageType.AGENT_MODEL_STREAM_FRAGMENT
281
499
  index: int
282
500
  content: Optional[str] = None
@@ -285,7 +503,17 @@ class AgentModelStreamFragmentMessage(BaseModelStreamMessage):
285
503
  class AgentModelStreamEndMessage(BaseModelStreamMessage):
286
504
  """
287
505
  Message indicating that model text streaming has completed.
506
+
507
+ Attributes:
508
+ message_type: Always set to AGENT_MODEL_STREAM_END for stream end messages.
509
+ agent_id: Unique identifier for the agent performing the streaming.
510
+ execution_id: Unique identifier for the execution session.
511
+ step_id: Unique identifier for the processing step.
512
+ stream_id: Unique identifier for the streaming session.
513
+ content_id: Unique identifier for the generated content.
514
+ duration: Optional duration of the streaming session in seconds.
288
515
  """
516
+
289
517
  message_type: MessageType = MessageType.AGENT_MODEL_STREAM_END
290
518
  content_id: str
291
519
  duration: Optional[float] = None
@@ -294,7 +522,17 @@ class AgentModelStreamEndMessage(BaseModelStreamMessage):
294
522
  class AgentModelStreamUsageMessage(BaseModelStreamMessage):
295
523
  """
296
524
  Message containing token usage and cost information for model calls.
525
+
526
+ Attributes:
527
+ message_type: Always set to AGENT_MODEL_STREAM_USAGE for usage messages.
528
+ agent_id: Unique identifier for the agent performing the streaming.
529
+ execution_id: Unique identifier for the execution session.
530
+ step_id: Unique identifier for the processing step.
531
+ stream_id: Unique identifier for the streaming session.
532
+ token: Optional number of tokens used during the model call.
533
+ tokens_cost: Optional cost in dollars for the tokens used.
297
534
  """
535
+
298
536
  message_type: MessageType = MessageType.AGENT_MODEL_STREAM_USAGE
299
537
  token: Optional[int] = None
300
538
  tokens_cost: Optional[float] = None
@@ -306,10 +544,17 @@ class AgentModelStreamUsageMessage(BaseModelStreamMessage):
306
544
  class BaseAgentAgentCardStreamMessage(BaseAgentMessage):
307
545
  """
308
546
  Base class for agent card streaming messages.
309
-
547
+
310
548
  Agent card streaming allows real-time updates to interactive
311
549
  UI components during their generation or processing.
550
+
551
+ Attributes:
552
+ agent_id: Unique identifier for the agent performing the streaming.
553
+ execution_id: Unique identifier for the execution session.
554
+ step_id: Unique identifier for the processing step.
555
+ stream_id: Unique identifier for the streaming session.
312
556
  """
557
+
313
558
  step_id: str
314
559
  stream_id: str
315
560
 
@@ -317,7 +562,16 @@ class BaseAgentAgentCardStreamMessage(BaseAgentMessage):
317
562
  class AgentAgentCardStreamStartMessage(BaseAgentAgentCardStreamMessage):
318
563
  """
319
564
  Message indicating that agent card streaming has begun.
565
+
566
+ Attributes:
567
+ message_type: Always set to AGENT_AGENT_CARD_STREAM_START for card stream start messages.
568
+ agent_id: Unique identifier for the agent performing the streaming.
569
+ execution_id: Unique identifier for the execution session.
570
+ step_id: Unique identifier for the processing step.
571
+ stream_id: Unique identifier for the streaming session.
572
+ content: Optional initial content for the agent card.
320
573
  """
574
+
321
575
  message_type: MessageType = MessageType.AGENT_AGENT_CARD_STREAM_START
322
576
  content: Optional[str] = None
323
577
 
@@ -325,7 +579,16 @@ class AgentAgentCardStreamStartMessage(BaseAgentAgentCardStreamMessage):
325
579
  class AgentAgentCardStreamErrorMessage(BaseAgentAgentCardStreamMessage):
326
580
  """
327
581
  Message indicating that an error occurred during agent card streaming.
582
+
583
+ Attributes:
584
+ message_type: Always set to AGENT_AGENT_CARD_STREAM_ERROR for card stream error messages.
585
+ agent_id: Unique identifier for the agent performing the streaming.
586
+ execution_id: Unique identifier for the execution session.
587
+ step_id: Unique identifier for the processing step.
588
+ stream_id: Unique identifier for the streaming session.
589
+ error_message: Description of the error that occurred during card streaming.
328
590
  """
591
+
329
592
  message_type: MessageType = MessageType.AGENT_AGENT_CARD_STREAM_ERROR
330
593
  error_message: str
331
594
 
@@ -333,10 +596,20 @@ class AgentAgentCardStreamErrorMessage(BaseAgentAgentCardStreamMessage):
333
596
  class AgentAgentCardStreamFragmentMessage(BaseAgentAgentCardStreamMessage):
334
597
  """
335
598
  Fragment of streaming agent card content.
336
-
599
+
337
600
  These messages contain individual chunks of agent card data
338
601
  as they are generated, allowing for real-time UI updates.
602
+
603
+ Attributes:
604
+ message_type: Always set to AGENT_AGENT_CARD_STREAM_FRAGMENT for card fragment messages.
605
+ agent_id: Unique identifier for the agent performing the streaming.
606
+ execution_id: Unique identifier for the execution session.
607
+ step_id: Unique identifier for the processing step.
608
+ stream_id: Unique identifier for the streaming session.
609
+ index: The sequential index of this fragment within the stream.
610
+ content: The card content of this fragment, or None if no content.
339
611
  """
612
+
340
613
  message_type: MessageType = MessageType.AGENT_AGENT_CARD_STREAM_FRAGMENT
341
614
  index: int
342
615
  content: Optional[str]
@@ -345,7 +618,16 @@ class AgentAgentCardStreamFragmentMessage(BaseAgentAgentCardStreamMessage):
345
618
  class AgentAgentCardStreamEndMessage(BaseAgentAgentCardStreamMessage):
346
619
  """
347
620
  Message indicating that agent card streaming has completed.
621
+
622
+ Attributes:
623
+ message_type: Always set to AGENT_AGENT_CARD_STREAM_END for card stream end messages.
624
+ agent_id: Unique identifier for the agent performing the streaming.
625
+ execution_id: Unique identifier for the execution session.
626
+ step_id: Unique identifier for the processing step.
627
+ stream_id: Unique identifier for the streaming session.
628
+ content: Optional final content for the agent card.
348
629
  """
630
+
349
631
  message_type: MessageType = MessageType.AGENT_AGENT_CARD_STREAM_END
350
632
  content: Optional[str] = None
351
633
 
@@ -356,10 +638,20 @@ class AgentAgentCardStreamEndMessage(BaseAgentAgentCardStreamMessage):
356
638
  class BaseAgentToolMessage(BaseStepMessage):
357
639
  """
358
640
  Base class for tool execution messages.
359
-
641
+
360
642
  Tool messages track the lifecycle of external tool or service
361
643
  calls made by agents during pipeline execution.
644
+
645
+ Attributes:
646
+ agent_id: Unique identifier for the agent performing the step.
647
+ execution_id: Unique identifier for the execution session.
648
+ step_id: Unique identifier for the processing step.
649
+ step_type: The type/category of the processing step.
650
+ step_title: Optional human-readable title for the step.
651
+ id: Unique identifier for the tool execution.
652
+ name: The name of the tool being executed.
362
653
  """
654
+
363
655
  id: str
364
656
  name: str
365
657
 
@@ -367,20 +659,44 @@ class BaseAgentToolMessage(BaseStepMessage):
367
659
  class AgentToolRequestMessage(BaseAgentToolMessage):
368
660
  """
369
661
  Message indicating that a tool request has been initiated.
370
-
662
+
371
663
  This message is sent when an agent begins calling an external
372
664
  tool or service to perform a specific operation.
665
+
666
+ Attributes:
667
+ message_type: Always set to AGENT_TOOL_REQUEST for tool request messages.
668
+ agent_id: Unique identifier for the agent making the tool request.
669
+ execution_id: Unique identifier for the execution session.
670
+ step_id: Unique identifier for the processing step.
671
+ step_type: The type/category of the processing step.
672
+ step_title: Optional human-readable title for the step.
673
+ id: Unique identifier for the tool execution.
674
+ name: The name of the tool being requested.
373
675
  """
676
+
374
677
  message_type: MessageType = MessageType.AGENT_TOOL_REQUEST
375
678
 
376
679
 
377
680
  class AgentToolResponseMessage(BaseAgentToolMessage):
378
681
  """
379
682
  Message indicating that a tool request has completed.
380
-
683
+
381
684
  This message contains the results and timing information
382
685
  from a completed tool or service call.
686
+
687
+ Attributes:
688
+ message_type: Always set to AGENT_TOOL_RESPONSE for tool response messages.
689
+ agent_id: Unique identifier for the agent that made the tool request.
690
+ execution_id: Unique identifier for the execution session.
691
+ step_id: Unique identifier for the processing step.
692
+ step_type: The type/category of the processing step.
693
+ step_title: Optional human-readable title for the step.
694
+ id: Unique identifier for the tool execution.
695
+ name: The name of the tool that was executed.
696
+ duration: The time it took for the tool to complete execution.
697
+ success: Whether the tool execution was successful.
383
698
  """
699
+
384
700
  message_type: MessageType = MessageType.AGENT_TOOL_RESPONSE
385
701
  duration: time
386
702
  success: bool