Models
EventEnvelopeWithMetadata #
Bases: BaseModel
Client readable representation of an Event. Includes class metadata in order to support matching event types semantically in an extendable manner (e.g. "StartEvent", "StopEvent", etc.).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
dict[str, Any]
|
|
required |
qualified_name
|
str | None
|
|
required |
type
|
str
|
|
required |
types
|
list[str] | None
|
|
required |
Source code in llama_agents/client/protocol/serializable_events.py
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 | |
load_event #
Attempts to load the event data as a python class based on the envelope metadata. Looks up the event from the registry, if provided. Falls back to the qualified_name, attempting to load from the module path.
Source code in llama_agents/client/protocol/serializable_events.py
29 30 31 32 33 34 35 36 37 38 39 40 | |
from_event
classmethod
#
from_event(event: Event, include_qualified_name: bool = True) -> EventEnvelopeWithMetadata
Build a backward-compatible envelope for an Event, preserving existing fields (e.g., qualified_name, value) while adding metadata useful for type-safe clients.
Source code in llama_agents/client/protocol/serializable_events.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
HandlerData #
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
handler_id
|
str
|
|
required |
workflow_name
|
str
|
|
required |
run_id
|
str | None
|
|
required |
error
|
str | None
|
|
required |
result
|
EventEnvelopeWithMetadata | None
|
|
required |
status
|
Literal['running', 'completed', 'failed', 'cancelled']
|
|
required |
started_at
|
str
|
|
required |
updated_at
|
str | None
|
|
required |
completed_at
|
str | None
|
|
required |
Source code in llama_agents/client/protocol/__init__.py
20 21 22 23 24 25 26 27 28 29 | |
HandlersListResponse #
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
handlers
|
list[HandlerData]
|
|
required |
Source code in llama_agents/client/protocol/__init__.py
32 33 | |
SendEventResponse #
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
status
|
Literal['sent']
|
|
required |
Source code in llama_agents/client/protocol/__init__.py
44 45 | |
CancelHandlerResponse #
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
status
|
Literal['deleted', 'cancelled']
|
|
required |
Source code in llama_agents/client/protocol/__init__.py
48 49 | |