Deployments¶
Deployments helps you manage the deployment configurations of a CXAS app. A deployment in CX Agent Studio represents an environment configuration (such as a telephony integration or a channel-specific setup) that determines how your app is published and reachable.
Use this class when you want to list deployments, inspect their configuration, or script deployment updates as part of a release pipeline.
Quick Example¶
from cxas_scrapi import Deployments
app_name = "projects/my-project/locations/us/apps/my-app-id"
deployments = Deployments(app_name=app_name)
# List all deployments
all_deployments = deployments.list_deployments()
for d in all_deployments:
print(d.display_name, d.name)
# Create a Sessions client pinned to a specific deployment
from cxas_scrapi import Sessions
sessions = Sessions(
app_name=app_name,
deployment_id="my-deployment-id",
)
response = sessions.run(session_id="test-1", text="Hello")
Reference¶
Deployments ¶
Bases: Apps
Core Class for managing Deployment Resources.
Initializes the Deployments client.
Source code in src/cxas_scrapi/core/deployments.py
list_deployments ¶
Lists deployments within a specific app.
Source code in src/cxas_scrapi/core/deployments.py
get_deployments_map ¶
Creates a map of Deployment full names to display names.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reverse | bool | If True, map display_name -> name. | False |
Source code in src/cxas_scrapi/core/deployments.py
get_deployment ¶
Gets a specific deployment.
Source code in src/cxas_scrapi/core/deployments.py
create_deployment ¶
create_deployment(deployment_id, display_name, app_version, channel_type=API, modality=None, theme=None, web_widget_title=None, disable_dtmf=False, disable_barge_in_control=False, persona_property=None, noise_suppression_level=None, traffic_split=None)
Creates a new deployment with specified configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
deployment_id | str | The ID to use for the deployment. | required |
display_name | str | The display name of the deployment. | required |
app_version | str | App version name or ID to deploy. | required |
channel_type | ChannelType | str | The channel type (e.g. ChannelType.API). | API |
modality | Modality | str | None | Web widget modality (WEB_UI only). | None |
theme | Theme | str | None | Web widget theme (WEB_UI only). | None |
web_widget_title | str | None | Web widget title (WEB_UI only). | None |
disable_dtmf | bool | Whether DTMF is disabled. | False |
disable_barge_in_control | bool | Whether barge-in control is disabled. | False |
persona_property | Persona | PersonaProperty | str | None | Persona property (CONCISE, CHATTY). Accepts Deployments.Persona, string, or types.ChannelProfile.PersonaProperty. | None |
noise_suppression_level | str | None | Noise suppression level (low, moderate, high, very_high). | None |
traffic_split | dict[str, int] | None | Traffic split configuration between versions. | None |
Note: modality, theme, and web_widget_title are only applicable when channel_type is ChannelType.WEB_UI.
Source code in src/cxas_scrapi/core/deployments.py
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 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 | |
update_deployment ¶
Updates specific fields of an existing Deployment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
deployment_id | str | The ID of the deployment to update. | required |
**kwargs | Any | Fields to update. Supported fields include: - display_name: New display name. - app_version: New app version name or ID. - channel_type: New ChannelType or string. - modality: Web widget modality (WEB_UI only). - theme: Web widget theme (WEB_UI only). - web_widget_title: Web widget title (WEB_UI only). - disable_dtmf: Whether DTMF is disabled. - disable_barge_in_control: Whether barge-in control is disabled. - persona_property: Persona property (CONCISE, CHATTY). Accepts Deployments.Persona, string, or types.ChannelProfile.PersonaProperty. - noise_suppression_level: Noise suppression level (low, moderate, high, very_high). - traffic_split: Traffic split configuration between versions. | {} |
Source code in src/cxas_scrapi/core/deployments.py
337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 | |
delete_deployment ¶
Deletes a specific deployment.