Types
ChatMessage #
Bases: BaseModel
Chat message.
TODO: Temp copy of class from llama-index, to avoid pydantic v1/v2 issues.
Source code in llama_deploy/llama_deploy/types.py
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 |
|
ActionTypes #
Bases: str
, Enum
Action types for messages. Different consumers will handle (or ignore) different action types.
Source code in llama_deploy/llama_deploy/types.py
69 70 71 72 73 74 75 76 77 78 79 |
|
TaskDefinition #
Bases: BaseModel
The definition and state of a task.
Attributes:
Name | Type | Description |
---|---|---|
input |
str
|
The task input. |
session_id |
str
|
The session ID that the task belongs to. |
task_id |
str
|
The task ID. Defaults to a random UUID. |
agent_id |
str
|
The agent ID that the task should be sent to. If blank, the orchestrator decides. |
Source code in llama_deploy/llama_deploy/types.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
|
SessionDefinition #
Bases: BaseModel
The definition of a session.
Attributes:
Name | Type | Description |
---|---|---|
session_id |
str
|
The session ID. Defaults to a random UUID. |
task_definitions |
List[str]
|
The task ids in order, representing the session. |
state |
dict
|
The current session state. |
Source code in llama_deploy/llama_deploy/types.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
|
NewTask #
Bases: BaseModel
The payload for a new task message.
Source code in llama_deploy/llama_deploy/types.py
129 130 131 132 133 |
|
TaskResult #
Bases: BaseModel
The result of a task.
Attributes:
Name | Type | Description |
---|---|---|
task_id |
str
|
The task ID. |
history |
List[ChatMessage]
|
The task history. |
result |
str
|
The task result. |
data |
dict
|
Additional data about the task or result. |
Source code in llama_deploy/llama_deploy/types.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
|
ToolCallBundle #
Bases: BaseModel
A bundle of information for a tool call.
Attributes:
Name | Type | Description |
---|---|---|
tool_name |
str
|
The name of the tool. |
tool_args |
List[Any]
|
The tool arguments. |
tool_kwargs |
Dict[str, Any]
|
The tool keyword arguments |
Source code in llama_deploy/llama_deploy/types.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
|
ToolCall #
Bases: BaseModel
A tool call.
Attributes:
Name | Type | Description |
---|---|---|
id_ |
str
|
The tool call ID. Defaults to a random UUID. |
tool_call_bundle |
ToolCallBundle
|
The tool call bundle. |
source_id |
str
|
The source ID. |
Source code in llama_deploy/llama_deploy/types.py
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
|
ToolCallResult #
Bases: BaseModel
A tool call result.
Attributes:
Name | Type | Description |
---|---|---|
id_ |
str
|
The tool call ID. Should match the ID of the tool call. |
tool_message |
ChatMessage
|
The tool message. |
result |
str
|
The tool result. |
Source code in llama_deploy/llama_deploy/types.py
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 |
|
ServiceDefinition #
Bases: BaseModel
The definition of a service, bundles useful information describing the service.
Attributes:
Name | Type | Description |
---|---|---|
service_name |
str
|
The name of the service. |
description |
str
|
A description of the service and it's purpose. |
prompt |
List[ChatMessage]
|
Specific instructions for the service. |
host |
Optional[str]
|
The host of the service, if its a network service. |
port |
Optional[int]
|
The port of the service, if its a network service. |
Source code in llama_deploy/llama_deploy/types.py
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
|
HumanResponse #
Bases: BaseModel
A simple human response.
Attributes:
Name | Type | Description |
---|---|---|
response |
str
|
The human response. |
Source code in llama_deploy/llama_deploy/types.py
239 240 241 242 243 244 245 246 247 248 |
|
options: members: - ActionTypes - NewTask - ServiceDefinition - SessionDefinition - TaskDefinition - TaskResult