Client Reference API
ACP Objects
ApiClientConfiguration
Bases: Configuration
This class contains various settings of the API client.
Parameters:
-
host
(Optional[str]
, default:None
) –Base url.
-
api_key
(Optional[Dict[str, str]]
, default:None
) –Dict to store API key(s). Each entry in the dict specifies an API key. The dict key is the name of the security scheme in the OAS specification. The dict value is the API key secret.
-
api_key_prefix
(Optional[Dict[str, str]]
, default:None
) –Dict to store API prefix (e.g. Bearer). The dict key is the name of the security scheme in the OAS specification. The dict value is an API key prefix when generating the auth data.
-
username
(Optional[str]
, default:None
) –Username for HTTP basic authentication.
-
password
(Optional[str]
, default:None
) –Password for HTTP basic authentication.
-
access_token
(Optional[str]
, default:None
) –Access token.
-
server_variables
(Optional[ServerVariablesT]
, default:None
) –Mapping with string values to replace variables in templated server configuration. The validation of enums is performed for variables with defined enum values before.
-
server_operation_variables
(Optional[Dict[int, ServerVariablesT]]
, default:None
) –Mapping from operation ID to a mapping with string values to replace variables in templated server configuration. The validation of enums is performed for variables with defined enum values before.
-
ssl_ca_cert
(Optional[str]
, default:None
) –str - the path to a file of concatenated CA certificates in PEM format.
-
retries
(Optional[int]
, default:None
) –Number of retries for API requests.
-
ca_cert_data
(Optional[Union[str, bytes]]
, default:None
) –verify the peer using concatenated CA certificate data in PEM (str) or DER (bytes) format.
-
debug
(Optional[bool]
, default:None
) –Debug switch.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/__init__.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 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 |
|
fromEnvPrefix(env_var_prefix, host=None, api_key=None, api_key_prefix=None, username=None, password=None, access_token=None, server_variables=None, server_operation_variables=None, ssl_ca_cert=None, retries=None, ca_cert_data=None, *, debug=None)
classmethod
Construct a configuration object using environment variables as default source of parameter values. For example, with env_var_prefix="MY_", the default host parameter value would be looked up in the "MY_HOST" environment variable if not provided.
Parameters:
-
env_var_prefix
(str
) –String used as prefix for environment variable names.
Returns:
-
ApiClientConfiguration
–Configuration object
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/__init__.py
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 |
|
ACPClient
Bases: AgentsApi
, StatelessRunsApi
, ThreadsApi
, ThreadRunsApi
Client for ACP API.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/__init__.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
|
AsyncACPClient
Bases: AgentsApi
, StatelessRunsApi
, ThreadsApi
, ThreadRunsApi
Async client for ACP API.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/__init__.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
|
ApiClient
Generic API client for OpenAPI client library builds.
OpenAPI generic API client. This client handles the client- server communication, and is invariant across implementations. Specifics of the methods and models for each application are generated from the OpenAPI templates.
Parameters:
-
configuration
–.Configuration object for this client
-
header_name
–a header to pass when making calls to the API.
-
header_value
–a header value to pass when making calls to the API.
-
cookie
–a cookie to include in the header when making calls to the API
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/sync_client/api_client.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 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 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 336 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 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 |
|
user_agent
property
writable
User agent for this API client
__deserialize(data, klass)
Deserializes dict, list, str into an object.
Parameters:
-
data
–dict, list or str.
-
klass
–class literal, or string of class name.
Returns:
-
–
object.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/sync_client/api_client.py
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 |
|
__deserialize_date(string)
Deserializes string to date.
Parameters:
-
string
–str.
Returns:
-
–
date.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/sync_client/api_client.py
736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 |
|
__deserialize_datetime(string)
Deserializes string to datetime.
The string should be in iso8601 datetime format.
Parameters:
-
string
–str.
Returns:
-
–
datetime.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/sync_client/api_client.py
752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 |
|
__deserialize_enum(data, klass)
Deserializes primitive type to enum.
Parameters:
-
data
–primitive type.
-
klass
–class literal.
Returns:
-
–
enum value.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/sync_client/api_client.py
773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 |
|
__deserialize_file(response)
Deserializes body to file
Saves response body into a file in a temporary folder,
using the filename from the Content-Disposition
header if provided.
handle file downloading save response body into a tmp file and return the instance
Parameters:
-
response
–RESTResponse.
Returns:
-
–
file path.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/sync_client/api_client.py
683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 |
|
__deserialize_model(data, klass)
Deserializes list or dict to model.
Parameters:
-
data
–dict, list.
-
klass
–class literal.
Returns:
-
–
model object.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/sync_client/api_client.py
791 792 793 794 795 796 797 798 799 |
|
__deserialize_object(value)
Return an original value.
Returns:
-
–
object.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/sync_client/api_client.py
729 730 731 732 733 734 |
|
__deserialize_primitive(data, klass)
Deserializes string to primitive type.
Parameters:
-
data
–str.
-
klass
–class literal.
Returns:
-
–
int, long, float, str, bool.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/sync_client/api_client.py
714 715 716 717 718 719 720 721 722 723 724 725 726 727 |
|
call_api(method, url, header_params=None, body=None, post_params=None, _request_timeout=None)
Makes the HTTP request (synchronous)
Parameters:
-
method
–Method to call.
-
url
–Path to method endpoint.
-
header_params
–Header parameters to be placed in the request header.
-
body
–Request body.
-
dict
(post_params
) –Request post form parameters, for
application/x-www-form-urlencoded
,multipart/form-data
. -
_request_timeout
–timeout setting for this request.
Returns:
-
RESTResponse
–RESTResponse
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/sync_client/api_client.py
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 |
|
deserialize(response_text, response_type, content_type)
Deserializes response into an object.
Parameters:
-
response
–RESTResponse object to be deserialized.
-
response_type
(str
) –class literal for deserialized object, or string of class name.
-
content_type
(Optional[str]
) –content type of response.
Returns:
-
–
deserialized object.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/sync_client/api_client.py
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 |
|
files_parameters(files)
Builds form parameters.
Parameters:
-
files
(Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]]
) –File parameters.
Returns:
-
–
Form parameters with files.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/sync_client/api_client.py
540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 |
|
get_default()
classmethod
Return new instance of ApiClient.
This method returns newly created, based on default constructor, object of ApiClient class or returns a copy of default ApiClient.
Returns:
-
–
The ApiClient object.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/sync_client/api_client.py
119 120 121 122 123 124 125 126 127 128 129 130 131 |
|
param_serialize(method, resource_path, path_params=None, query_params=None, header_params=None, body=None, post_params=None, files=None, auth_settings=None, collection_formats=None, _host=None, _request_auth=None)
Builds the HTTP request params needed by the request.
Parameters:
-
method
–Method to call.
-
resource_path
–Path to method endpoint.
-
path_params
–Path parameters in the url.
-
query_params
–Query parameters in the url.
-
header_params
–Header parameters to be placed in the request header.
-
body
–Request body.
-
dict
(post_params
) –Request post form parameters, for
application/x-www-form-urlencoded
,multipart/form-data
. -
list
(auth_settings
) –Auth Settings names for the request.
-
collection_formats
–dict of collection formats for path, query, header, and post parameters.
-
_request_auth
–set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
Returns:
-
RequestSerialized
–tuple of form (path, http_method, query_params, header_params, body, post_params, files)
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/sync_client/api_client.py
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 |
|
parameters_to_tuples(params, collection_formats)
Get parameters as list of tuples, formatting collections.
Parameters:
-
params
–Parameters as dict or list of two-tuples
-
collection_formats
(dict
) –Parameter collection formats
Returns:
-
–
Parameters as list of tuples, collections formatted
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/sync_client/api_client.py
471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 |
|
parameters_to_url_query(params, collection_formats)
Get parameters as list of tuples, formatting collections.
Parameters:
-
params
–Parameters as dict or list of two-tuples
-
collection_formats
(dict
) –Parameter collection formats
Returns:
-
–
URL query string (e.g. a=Hello%20World&b=123)
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/sync_client/api_client.py
501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 |
|
response_deserialize(response_data, response_types_map=None)
Deserializes response into an object.
Parameters:
-
response_data
(RESTResponse
) –RESTResponse object to be deserialized.
-
response_types_map
(Optional[Dict[str, T]]
, default:None
) –dict of response types.
Returns:
-
ApiResponse[T]
–ApiResponse
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/sync_client/api_client.py
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 |
|
sanitize_for_serialization(obj)
Builds a JSON POST object.
If obj is None, return None. If obj is SecretStr, return obj.get_secret_value() If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict.
Parameters:
-
obj
–The data to serialize.
Returns:
-
–
The serialized form of data.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/sync_client/api_client.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 |
|
select_header_accept(accepts)
Returns Accept
based on an array of accepts provided.
Parameters:
-
accepts
(List[str]
) –List of headers.
Returns:
-
Optional[str]
–Accept (e.g. application/json).
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/sync_client/api_client.py
575 576 577 578 579 580 581 582 583 584 585 586 587 588 |
|
select_header_content_type(content_types)
Returns Content-Type
based on an array of content_types provided.
Parameters:
-
content_types
–List of content-types.
Returns:
-
–
Content-Type (e.g. application/json).
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/sync_client/api_client.py
590 591 592 593 594 595 596 597 598 599 600 601 602 603 |
|
set_default(default)
classmethod
Set default instance of ApiClient.
It stores default ApiClient.
Parameters:
-
default
–object of ApiClient.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/sync_client/api_client.py
133 134 135 136 137 138 139 140 141 |
|
update_params_for_auth(headers, queries, auth_settings, resource_path, method, body, request_auth=None)
Updates header and query params based on authentication setting.
:resource_path: A string representation of the HTTP request resource path. :method: A string representation of the HTTP request method. :body: A object representing the body of the HTTP request. The object type is the return value of sanitize_for_serialization().
Parameters:
-
headers
–Header parameters dict to be updated.
-
queries
–Query parameters tuple list to be updated.
-
auth_settings
–Authentication setting identifiers list.
-
request_auth
–if set, the provided settings will override the token in the configuration.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/sync_client/api_client.py
605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 |
|
AsyncApiClient
Generic API client for OpenAPI client library builds.
OpenAPI generic API client. This client handles the client- server communication, and is invariant across implementations. Specifics of the methods and models for each application are generated from the OpenAPI templates.
Parameters:
-
configuration
–.Configuration object for this client
-
header_name
–a header to pass when making calls to the API.
-
header_value
–a header value to pass when making calls to the API.
-
cookie
–a cookie to include in the header when making calls to the API
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/async_client/api_client.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 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 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 336 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 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 |
|
user_agent
property
writable
User agent for this API client
__deserialize(data, klass)
Deserializes dict, list, str into an object.
Parameters:
-
data
–dict, list or str.
-
klass
–class literal, or string of class name.
Returns:
-
–
object.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/async_client/api_client.py
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 |
|
__deserialize_date(string)
Deserializes string to date.
Parameters:
-
string
–str.
Returns:
-
–
date.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/async_client/api_client.py
739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 |
|
__deserialize_datetime(string)
Deserializes string to datetime.
The string should be in iso8601 datetime format.
Parameters:
-
string
–str.
Returns:
-
–
datetime.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/async_client/api_client.py
755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 |
|
__deserialize_enum(data, klass)
Deserializes primitive type to enum.
Parameters:
-
data
–primitive type.
-
klass
–class literal.
Returns:
-
–
enum value.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/async_client/api_client.py
776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 |
|
__deserialize_file(response)
Deserializes body to file
Saves response body into a file in a temporary folder,
using the filename from the Content-Disposition
header if provided.
handle file downloading save response body into a tmp file and return the instance
Parameters:
-
response
–RESTResponse.
Returns:
-
–
file path.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/async_client/api_client.py
686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 |
|
__deserialize_model(data, klass)
Deserializes list or dict to model.
Parameters:
-
data
–dict, list.
-
klass
–class literal.
Returns:
-
–
model object.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/async_client/api_client.py
794 795 796 797 798 799 800 801 802 |
|
__deserialize_object(value)
Return an original value.
Returns:
-
–
object.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/async_client/api_client.py
732 733 734 735 736 737 |
|
__deserialize_primitive(data, klass)
Deserializes string to primitive type.
Parameters:
-
data
–str.
-
klass
–class literal.
Returns:
-
–
int, long, float, str, bool.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/async_client/api_client.py
717 718 719 720 721 722 723 724 725 726 727 728 729 730 |
|
call_api(method, url, header_params=None, body=None, post_params=None, _request_timeout=None)
async
Makes the HTTP request (synchronous)
Parameters:
-
method
–Method to call.
-
url
–Path to method endpoint.
-
header_params
–Header parameters to be placed in the request header.
-
body
–Request body.
-
dict
(post_params
) –Request post form parameters, for
application/x-www-form-urlencoded
,multipart/form-data
. -
_request_timeout
–timeout setting for this request.
Returns:
-
RESTResponse
–RESTResponse
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/async_client/api_client.py
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 |
|
deserialize(response_text, response_type, content_type)
Deserializes response into an object.
Parameters:
-
response
–RESTResponse object to be deserialized.
-
response_type
(str
) –class literal for deserialized object, or string of class name.
-
content_type
(Optional[str]
) –content type of response.
Returns:
-
–
deserialized object.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/async_client/api_client.py
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 |
|
files_parameters(files)
Builds form parameters.
Parameters:
-
files
(Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]]
) –File parameters.
Returns:
-
–
Form parameters with files.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/async_client/api_client.py
543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 |
|
get_default()
classmethod
Return new instance of ApiClient.
This method returns newly created, based on default constructor, object of ApiClient class or returns a copy of default ApiClient.
Returns:
-
–
The ApiClient object.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/async_client/api_client.py
122 123 124 125 126 127 128 129 130 131 132 133 134 |
|
param_serialize(method, resource_path, path_params=None, query_params=None, header_params=None, body=None, post_params=None, files=None, auth_settings=None, collection_formats=None, _host=None, _request_auth=None)
Builds the HTTP request params needed by the request.
Parameters:
-
method
–Method to call.
-
resource_path
–Path to method endpoint.
-
path_params
–Path parameters in the url.
-
query_params
–Query parameters in the url.
-
header_params
–Header parameters to be placed in the request header.
-
body
–Request body.
-
dict
(post_params
) –Request post form parameters, for
application/x-www-form-urlencoded
,multipart/form-data
. -
list
(auth_settings
) –Auth Settings names for the request.
-
collection_formats
–dict of collection formats for path, query, header, and post parameters.
-
_request_auth
–set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
Returns:
-
RequestSerialized
–tuple of form (path, http_method, query_params, header_params, body, post_params, files)
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/async_client/api_client.py
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 |
|
parameters_to_tuples(params, collection_formats)
Get parameters as list of tuples, formatting collections.
Parameters:
-
params
–Parameters as dict or list of two-tuples
-
collection_formats
(dict
) –Parameter collection formats
Returns:
-
–
Parameters as list of tuples, collections formatted
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/async_client/api_client.py
474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 |
|
parameters_to_url_query(params, collection_formats)
Get parameters as list of tuples, formatting collections.
Parameters:
-
params
–Parameters as dict or list of two-tuples
-
collection_formats
(dict
) –Parameter collection formats
Returns:
-
–
URL query string (e.g. a=Hello%20World&b=123)
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/async_client/api_client.py
504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 |
|
response_deserialize(response_data, response_types_map=None)
Deserializes response into an object.
Parameters:
-
response_data
(RESTResponse
) –RESTResponse object to be deserialized.
-
response_types_map
(Optional[Dict[str, T]]
, default:None
) –dict of response types.
Returns:
-
ApiResponse[T]
–ApiResponse
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/async_client/api_client.py
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 336 337 338 |
|
sanitize_for_serialization(obj)
Builds a JSON POST object.
If obj is None, return None. If obj is SecretStr, return obj.get_secret_value() If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict.
Parameters:
-
obj
–The data to serialize.
Returns:
-
–
The serialized form of data.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/async_client/api_client.py
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 |
|
select_header_accept(accepts)
Returns Accept
based on an array of accepts provided.
Parameters:
-
accepts
(List[str]
) –List of headers.
Returns:
-
Optional[str]
–Accept (e.g. application/json).
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/async_client/api_client.py
578 579 580 581 582 583 584 585 586 587 588 589 590 591 |
|
select_header_content_type(content_types)
Returns Content-Type
based on an array of content_types provided.
Parameters:
-
content_types
–List of content-types.
Returns:
-
–
Content-Type (e.g. application/json).
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/async_client/api_client.py
593 594 595 596 597 598 599 600 601 602 603 604 605 606 |
|
set_default(default)
classmethod
Set default instance of ApiClient.
It stores default ApiClient.
Parameters:
-
default
–object of ApiClient.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/async_client/api_client.py
136 137 138 139 140 141 142 143 144 |
|
update_params_for_auth(headers, queries, auth_settings, resource_path, method, body, request_auth=None)
Updates header and query params based on authentication setting.
:resource_path: A string representation of the HTTP request resource path. :method: A string representation of the HTTP request method. :body: A object representing the body of the HTTP request. The object type is the return value of sanitize_for_serialization().
Parameters:
-
headers
–Header parameters dict to be updated.
-
queries
–Query parameters tuple list to be updated.
-
auth_settings
–Authentication setting identifiers list.
-
request_auth
–if set, the provided settings will override the token in the configuration.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/async_client/api_client.py
608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 |
|
ApiResponse
Bases: BaseModel
, Generic[T]
API response object
Show JSON schema:
{
"description": "API response object",
"properties": {
"status_code": {
"description": "HTTP status code",
"title": "Status Code",
"type": "integer"
},
"headers": {
"anyOf": [
{
"additionalProperties": {
"type": "string"
},
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "HTTP headers",
"title": "Headers"
},
"data": {
"description": "Deserialized data given the data type",
"title": "Data"
},
"raw_data": {
"description": "Raw data (HTTP response body)",
"format": "binary",
"title": "Raw Data",
"type": "string"
}
},
"required": [
"status_code",
"data",
"raw_data"
],
"title": "ApiResponse",
"type": "object"
}
Config:
default
:{'arbitrary_types_allowed': True}
Fields:
-
status_code
(StrictInt
) -
headers
(Optional[Mapping[str, str]]
) -
data
(T
) -
raw_data
(StrictBytes
)
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/api_response.py
11 12 13 14 15 16 17 18 19 20 21 22 23 |
|
data
pydantic-field
Deserialized data given the data type
headers = None
pydantic-field
HTTP headers
raw_data
pydantic-field
Raw data (HTTP response body)
status_code
pydantic-field
HTTP status code
LangGraph Bindings
ACPNode
This class represents a Langgraph Node that holds a remote connection to an ACP Agent It can be instantiated and added to any langgraph graph.
my_node = ACPNode(...) sg = StateGraph(GraphState) sg.add_node(my_node)
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/langgraph/acp_node.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 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 |
|
__init__(name, agent_id, client_config, input_path, input_type, output_path, output_type, config_path=None, config_type=None, auth_header=None)
Instantiate a Langgraph node encapsulating a remote ACP agent
Parameters:
-
name
(str
) –Name of the langgraph node
-
agent_id
(str
) –Agent ID in the remote server
-
client_config
(ApiClientConfiguration
) –Configuration of the ACP Client
-
input_path
(str
) –Dot-separated path of the ACP Agent input in the graph overall state
-
input_type
–Pydantic class defining the schema of the ACP Agent input
-
output_path
(str
) –Dot-separated path of the ACP Agent output in the graph overall state
-
output_type
–Pydantic class defining the schema of the ACP Agent output
-
config_path
(Optional[str]
, default:None
) –Dot-separated path of the ACP Agent config in the graph configurable
-
config_type
–Pydantic class defining the schema of the ACP Agent config
-
auth_header
(Optional[Dict]
, default:None
) –A dictionary containing auth details necessary to communicate with the node
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/langgraph/acp_node.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
|
APIBridgeAgentNode
Bases: ACPNode
An ACP node that enables using remotely the API bridge agent in a LangGraph multi agent software
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/langgraph/api_bridge.py
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 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|
APIBridgeInput
Bases: BaseModel
Show JSON schema:
{
"properties": {
"query": {
"description": "Query for the API bridge agent in natural language",
"title": "Query",
"type": "string"
}
},
"required": [
"query"
],
"title": "APIBridgeInput",
"type": "object"
}
Fields:
-
query
(str
)
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/langgraph/api_bridge.py
12 13 14 15 |
|
query
pydantic-field
Query for the API bridge agent in natural language
APIBridgeOutput
Bases: BaseModel
Show JSON schema:
{
"properties": {
"result": {
"description": "API response from API bridge agent",
"title": "Result",
"type": "string"
}
},
"required": [
"result"
],
"title": "APIBridgeOutput",
"type": "object"
}
Fields:
-
result
(str
)
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/langgraph/api_bridge.py
18 19 |
|
result
pydantic-field
API response from API bridge agent
add_io_mapped_edge
Adds an I/O-mapped edge to a LangGraph StateGraph.
Parameters: g: The LangGraph StateGraph to which the edge will be added. start: The starting node of the edge, which can be specified either as a string identifier or as an instance of an ACPNode. end: The ending node of the edge, which can be specified either as a string identifier or as an instance of an ACPNode. iomapper_config: A dictionary containing all the metadata necessary for the IO mapper agent to perform data translation. Defaults to an empty dictionary. llm: An instance of llm model
Returns: None: This function modifies the graph in place by adding the specified edge.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/langgraph/io_mapper.py
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 |
|
add_io_mapped_conditional_edge
Adds a conditional I/O-mapped edge to a LangGraph StateGraph.
Parameters: g: The LangGraph StateGraph to which the conditional edge will be added. start: The starting node of the edge, which can be specified either as a string identifier or as an instance of an ACPNode. path: The conditional path that determines the conditions under which the edge will be traversed. The type and structure of 'path' should be specified based on its use case. iomapper_config_map: A dictionary containing metadata that the IO mapper agent requires for data translation. This map is used to configure the agent based on different conditions. llm: An instance of llm model Returns: None: This function modifies the graph in place by adding the specified conditional edge.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/langgraph/io_mapper.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
|
Exceptions
ACPDescriptorValidationException
Bases: Exception
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/exceptions.py
5 6 |
|
ACPRunException
Bases: Exception
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/exceptions.py
8 9 |
|
ApiTypeError
Bases: OpenApiException
, TypeError
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/exceptions.py
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 |
|
__init__(msg, path_to_item=None, valid_classes=None, key_type=None)
Raises an exception for TypeErrors
Args: msg (str): the exception message
Keyword Args: path_to_item (list): a list of keys an indices to get to the current_item None if unset valid_classes (tuple): the primitive classes that current item should be an instance of None if unset key_type (bool): False if our value is a value in a dict True if it is a key in a dict False if our item is an item in a list None if unset
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/exceptions.py
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 |
|
ApiValueError
Bases: OpenApiException
, ValueError
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/exceptions.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
__init__(msg, path_to_item=None)
Args: msg (str): the exception message
Keyword Args: path_to_item (list) the path to the exception in the received_data dict. None if unset
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/exceptions.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
ApiKeyError
Bases: OpenApiException
, KeyError
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/exceptions.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
|
__init__(msg, path_to_item=None)
Args: msg (str): the exception message
Keyword Args: path_to_item (None/list) the path to the exception in the received_data dict
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/exceptions.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
|
ApiAttributeError
Bases: OpenApiException
, AttributeError
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/exceptions.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
|
__init__(msg, path_to_item=None)
Raised when an attribute reference or assignment fails.
Args: msg (str): the exception message
Keyword Args: path_to_item (None/list) the path to the exception in the received_data dict
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/exceptions.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
|
ApiException
Bases: OpenApiException
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/exceptions.py
106 107 108 109 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 |
|
__str__()
Custom error messages for exception
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/exceptions.py
166 167 168 169 170 171 172 173 174 175 176 177 |
|
BadRequestException
Bases: ApiException
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/exceptions.py
180 181 |
|
NotFoundException
Bases: ApiException
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/exceptions.py
184 185 |
|
UnauthorizedException
Bases: ApiException
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/exceptions.py
188 189 |
|
ForbiddenException
Bases: ApiException
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/exceptions.py
192 193 |
|
ServiceException
Bases: ApiException
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/exceptions.py
196 197 |
|
ConflictException
Bases: ApiException
Exception for HTTP 409 Conflict.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/exceptions.py
200 201 202 |
|
UnprocessableEntityException
Bases: ApiException
Exception for HTTP 422 Unprocessable Entity.
Source code in .venv/lib/python3.13/site-packages/agntcy_acp/acp_v0/exceptions.py
205 206 207 |
|