Client
AsyncLlamaDeployClient #
Source code in llama-agents/llama_deploy/client/async_client.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 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 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
|
create_session
async
#
create_session(poll_interval: float = DEFAULT_POLL_INTERVAL) -> AsyncSessionClient
Create a new session and return a AsyncSessionClient for it.
Returns:
Name | Type | Description |
---|---|---|
AsyncSessionClient |
AsyncSessionClient
|
A client for the newly created session. |
Source code in llama-agents/llama_deploy/client/async_client.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
|
list_sessions
async
#
list_sessions() -> List[SessionDefinition]
List all sessions registered with the control plane.
Returns:
Type | Description |
---|---|
List[SessionDefinition]
|
List[SessionDefinition]: A list of session definitions. |
Source code in llama-agents/llama_deploy/client/async_client.py
139 140 141 142 143 144 145 146 147 |
|
get_session
async
#
get_session(session_id: str, poll_interval: float = DEFAULT_POLL_INTERVAL) -> AsyncSessionClient
Get an existing session by ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session_id |
str
|
The ID of the session to get. |
required |
Returns:
Name | Type | Description |
---|---|---|
AsyncSessionClient |
AsyncSessionClient
|
A client for the specified session. |
Raises:
Type | Description |
---|---|
ValueError
|
If the session does not exist. |
Source code in llama-agents/llama_deploy/client/async_client.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
|
get_or_create_session
async
#
get_or_create_session(session_id: str, poll_interval: float = DEFAULT_POLL_INTERVAL) -> AsyncSessionClient
Get an existing session by ID, or create a new one if it doesn't exist.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session_id |
str
|
The ID of the session to get. |
required |
Returns:
Name | Type | Description |
---|---|---|
AsyncSessionClient |
AsyncSessionClient
|
A client for the specified session. |
Source code in llama-agents/llama_deploy/client/async_client.py
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
|
get_service
async
#
get_service(service_name: str) -> ServiceDefinition
Get the definition of a service by name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
service_name |
str
|
The name of the service to get. |
required |
Returns:
Name | Type | Description |
---|---|---|
ServiceDefinition |
ServiceDefinition
|
The definition of the service. |
Source code in llama-agents/llama_deploy/client/async_client.py
196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
|
delete_session
async
#
delete_session(session_id: str) -> None
Delete a session by ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session_id |
str
|
The ID of the session to delete. |
required |
Source code in llama-agents/llama_deploy/client/async_client.py
211 212 213 214 215 216 217 218 |
|
list_services
async
#
list_services() -> List[ServiceDefinition]
List all services registered with the control plane.
Returns:
Type | Description |
---|---|
List[ServiceDefinition]
|
List[ServiceDefinition]: A list of service definitions. |
Source code in llama-agents/llama_deploy/client/async_client.py
220 221 222 223 224 225 226 227 228 229 230 |
|
register_service
async
#
register_service(service_def: ServiceDefinition) -> None
Register a service with the control plane.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
service_def |
ServiceDefinition
|
The service definition to register. |
required |
Source code in llama-agents/llama_deploy/client/async_client.py
232 233 234 235 236 237 238 239 240 241 242 |
|
deregister_service
async
#
deregister_service(service_name: str) -> None
Deregister a service from the control plane.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
service_name |
str
|
The name of the service to deregister. |
required |
Source code in llama-agents/llama_deploy/client/async_client.py
244 245 246 247 248 249 250 251 252 253 254 |
|
LlamaDeployClient #
Source code in llama-agents/llama_deploy/client/sync_client.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 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 237 238 239 240 241 242 243 244 245 246 247 248 249 250 |
|
create_session #
create_session(poll_interval: float = DEFAULT_POLL_INTERVAL) -> SessionClient
Create a new session and return a SessionClient for it.
Returns:
Name | Type | Description |
---|---|---|
SessionClient |
SessionClient
|
A client for the newly created session. |
Source code in llama-agents/llama_deploy/client/sync_client.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
|
list_sessions #
list_sessions() -> List[SessionDefinition]
List all sessions registered with the control plane.
Returns:
Type | Description |
---|---|
List[SessionDefinition]
|
List[SessionDefinition]: A list of session definitions. |
Source code in llama-agents/llama_deploy/client/sync_client.py
139 140 141 142 143 144 145 146 147 |
|
get_session #
get_session(session_id: str, poll_interval: float = DEFAULT_POLL_INTERVAL) -> SessionClient
Get an existing session by ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session_id |
str
|
The ID of the session to get. |
required |
Returns:
Name | Type | Description |
---|---|---|
SessionClient |
SessionClient
|
A client for the specified session. |
Raises:
Type | Description |
---|---|
ValueError
|
If the session does not exist. |
Source code in llama-agents/llama_deploy/client/sync_client.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
|
get_or_create_session #
get_or_create_session(session_id: str, poll_interval: float = DEFAULT_POLL_INTERVAL) -> SessionClient
Get an existing session by ID, or create a new one if it doesn't exist.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session_id |
str
|
The ID of the session to get. |
required |
Returns:
Name | Type | Description |
---|---|---|
SessionClient |
SessionClient
|
A client for the specified session. |
Source code in llama-agents/llama_deploy/client/sync_client.py
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
|
get_service #
get_service(service_name: str) -> ServiceDefinition
Get the definition of a service by name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
service_name |
str
|
The name of the service to get. |
required |
Returns:
Name | Type | Description |
---|---|---|
ServiceDefinition |
ServiceDefinition
|
The definition of the service. |
Source code in llama-agents/llama_deploy/client/sync_client.py
194 195 196 197 198 199 200 201 202 203 204 205 |
|
delete_session #
delete_session(session_id: str) -> None
Delete a session by ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session_id |
str
|
The ID of the session to delete. |
required |
Source code in llama-agents/llama_deploy/client/sync_client.py
207 208 209 210 211 212 213 214 |
|
list_services #
list_services() -> List[ServiceDefinition]
List all services registered with the control plane.
Returns:
Type | Description |
---|---|
List[ServiceDefinition]
|
List[ServiceDefinition]: A list of service definitions. |
Source code in llama-agents/llama_deploy/client/sync_client.py
216 217 218 219 220 221 222 223 224 225 226 |
|
register_service #
register_service(service_def: ServiceDefinition) -> None
Register a service with the control plane.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
service_def |
ServiceDefinition
|
The service definition to register. |
required |
Source code in llama-agents/llama_deploy/client/sync_client.py
228 229 230 231 232 233 234 235 236 237 238 |
|
deregister_service #
deregister_service(service_name: str) -> None
Deregister a service from the control plane.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
service_name |
str
|
The name of the service to deregister. |
required |
Source code in llama-agents/llama_deploy/client/sync_client.py
240 241 242 243 244 245 246 247 248 249 250 |
|
options: members: - LlamaDeployClient - AsyncLlamaDeployClient