c63a5cfe-b235-4fbe-8bbb-82a9e02a482a-python 0.1.0a3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- c63a5cfe_b235_4fbe_8bbb_82a9e02a482a_python-0.1.0a3.dist-info/METADATA +396 -0
- c63a5cfe_b235_4fbe_8bbb_82a9e02a482a_python-0.1.0a3.dist-info/RECORD +190 -0
- c63a5cfe_b235_4fbe_8bbb_82a9e02a482a_python-0.1.0a3.dist-info/WHEEL +4 -0
- c63a5cfe_b235_4fbe_8bbb_82a9e02a482a_python-0.1.0a3.dist-info/licenses/LICENSE +201 -0
- digitalocean_genai_sdk/__init__.py +99 -0
- digitalocean_genai_sdk/_base_client.py +1949 -0
- digitalocean_genai_sdk/_client.py +795 -0
- digitalocean_genai_sdk/_compat.py +219 -0
- digitalocean_genai_sdk/_constants.py +14 -0
- digitalocean_genai_sdk/_exceptions.py +108 -0
- digitalocean_genai_sdk/_files.py +123 -0
- digitalocean_genai_sdk/_models.py +805 -0
- digitalocean_genai_sdk/_qs.py +150 -0
- digitalocean_genai_sdk/_resource.py +43 -0
- digitalocean_genai_sdk/_response.py +832 -0
- digitalocean_genai_sdk/_streaming.py +333 -0
- digitalocean_genai_sdk/_types.py +219 -0
- digitalocean_genai_sdk/_utils/__init__.py +57 -0
- digitalocean_genai_sdk/_utils/_logs.py +25 -0
- digitalocean_genai_sdk/_utils/_proxy.py +65 -0
- digitalocean_genai_sdk/_utils/_reflection.py +42 -0
- digitalocean_genai_sdk/_utils/_resources_proxy.py +24 -0
- digitalocean_genai_sdk/_utils/_streams.py +12 -0
- digitalocean_genai_sdk/_utils/_sync.py +86 -0
- digitalocean_genai_sdk/_utils/_transform.py +447 -0
- digitalocean_genai_sdk/_utils/_typing.py +151 -0
- digitalocean_genai_sdk/_utils/_utils.py +422 -0
- digitalocean_genai_sdk/_version.py +4 -0
- digitalocean_genai_sdk/lib/.keep +4 -0
- digitalocean_genai_sdk/py.typed +0 -0
- digitalocean_genai_sdk/resources/__init__.py +145 -0
- digitalocean_genai_sdk/resources/agents/__init__.py +89 -0
- digitalocean_genai_sdk/resources/agents/agents.py +965 -0
- digitalocean_genai_sdk/resources/agents/api_keys.py +581 -0
- digitalocean_genai_sdk/resources/agents/child_agents.py +508 -0
- digitalocean_genai_sdk/resources/agents/functions.py +421 -0
- digitalocean_genai_sdk/resources/agents/knowledge_bases.py +346 -0
- digitalocean_genai_sdk/resources/agents/versions.py +298 -0
- digitalocean_genai_sdk/resources/api_keys/__init__.py +19 -0
- digitalocean_genai_sdk/resources/api_keys/api_keys.py +275 -0
- digitalocean_genai_sdk/resources/api_keys/api_keys_.py +529 -0
- digitalocean_genai_sdk/resources/auth/__init__.py +33 -0
- digitalocean_genai_sdk/resources/auth/agents/__init__.py +33 -0
- digitalocean_genai_sdk/resources/auth/agents/agents.py +102 -0
- digitalocean_genai_sdk/resources/auth/agents/token.py +173 -0
- digitalocean_genai_sdk/resources/auth/auth.py +102 -0
- digitalocean_genai_sdk/resources/chat.py +381 -0
- digitalocean_genai_sdk/resources/embeddings.py +201 -0
- digitalocean_genai_sdk/resources/indexing_jobs.py +543 -0
- digitalocean_genai_sdk/resources/knowledge_bases/__init__.py +33 -0
- digitalocean_genai_sdk/resources/knowledge_bases/data_sources.py +410 -0
- digitalocean_genai_sdk/resources/knowledge_bases/knowledge_bases.py +667 -0
- digitalocean_genai_sdk/resources/models.py +222 -0
- digitalocean_genai_sdk/resources/providers/__init__.py +47 -0
- digitalocean_genai_sdk/resources/providers/anthropic/__init__.py +33 -0
- digitalocean_genai_sdk/resources/providers/anthropic/anthropic.py +102 -0
- digitalocean_genai_sdk/resources/providers/anthropic/keys.py +662 -0
- digitalocean_genai_sdk/resources/providers/openai/__init__.py +33 -0
- digitalocean_genai_sdk/resources/providers/openai/keys.py +658 -0
- digitalocean_genai_sdk/resources/providers/openai/openai.py +102 -0
- digitalocean_genai_sdk/resources/providers/providers.py +134 -0
- digitalocean_genai_sdk/resources/regions.py +191 -0
- digitalocean_genai_sdk/types/__init__.py +57 -0
- digitalocean_genai_sdk/types/agent_create_params.py +39 -0
- digitalocean_genai_sdk/types/agent_create_response.py +16 -0
- digitalocean_genai_sdk/types/agent_delete_response.py +16 -0
- digitalocean_genai_sdk/types/agent_list_params.py +18 -0
- digitalocean_genai_sdk/types/agent_list_response.py +198 -0
- digitalocean_genai_sdk/types/agent_retrieve_response.py +16 -0
- digitalocean_genai_sdk/types/agent_update_params.py +65 -0
- digitalocean_genai_sdk/types/agent_update_response.py +16 -0
- digitalocean_genai_sdk/types/agent_update_status_params.py +16 -0
- digitalocean_genai_sdk/types/agent_update_status_response.py +16 -0
- digitalocean_genai_sdk/types/agents/__init__.py +31 -0
- digitalocean_genai_sdk/types/agents/api_key_create_params.py +15 -0
- digitalocean_genai_sdk/types/agents/api_key_create_response.py +12 -0
- digitalocean_genai_sdk/types/agents/api_key_delete_response.py +12 -0
- digitalocean_genai_sdk/types/agents/api_key_list_params.py +15 -0
- digitalocean_genai_sdk/types/agents/api_key_list_response.py +18 -0
- digitalocean_genai_sdk/types/agents/api_key_regenerate_response.py +12 -0
- digitalocean_genai_sdk/types/agents/api_key_update_params.py +19 -0
- digitalocean_genai_sdk/types/agents/api_key_update_response.py +12 -0
- digitalocean_genai_sdk/types/agents/api_link_knowledge_base_output.py +16 -0
- digitalocean_genai_sdk/types/agents/api_links.py +21 -0
- digitalocean_genai_sdk/types/agents/api_meta.py +15 -0
- digitalocean_genai_sdk/types/agents/child_agent_add_params.py +22 -0
- digitalocean_genai_sdk/types/agents/child_agent_add_response.py +14 -0
- digitalocean_genai_sdk/types/agents/child_agent_delete_response.py +13 -0
- digitalocean_genai_sdk/types/agents/child_agent_update_params.py +24 -0
- digitalocean_genai_sdk/types/agents/child_agent_update_response.py +18 -0
- digitalocean_genai_sdk/types/agents/child_agent_view_response.py +16 -0
- digitalocean_genai_sdk/types/agents/function_create_params.py +25 -0
- digitalocean_genai_sdk/types/agents/function_create_response.py +16 -0
- digitalocean_genai_sdk/types/agents/function_delete_response.py +16 -0
- digitalocean_genai_sdk/types/agents/function_update_params.py +29 -0
- digitalocean_genai_sdk/types/agents/function_update_response.py +16 -0
- digitalocean_genai_sdk/types/agents/knowledge_base_detach_response.py +16 -0
- digitalocean_genai_sdk/types/agents/version_list_params.py +15 -0
- digitalocean_genai_sdk/types/agents/version_list_response.py +118 -0
- digitalocean_genai_sdk/types/agents/version_update_params.py +15 -0
- digitalocean_genai_sdk/types/agents/version_update_response.py +30 -0
- digitalocean_genai_sdk/types/api_agent.py +263 -0
- digitalocean_genai_sdk/types/api_agent_api_key_info.py +22 -0
- digitalocean_genai_sdk/types/api_agreement.py +17 -0
- digitalocean_genai_sdk/types/api_anthropic_api_key_info.py +22 -0
- digitalocean_genai_sdk/types/api_deployment_visibility.py +9 -0
- digitalocean_genai_sdk/types/api_indexing_job.py +43 -0
- digitalocean_genai_sdk/types/api_key_list_params.py +42 -0
- digitalocean_genai_sdk/types/api_key_list_response.py +42 -0
- digitalocean_genai_sdk/types/api_keys/__init__.py +13 -0
- digitalocean_genai_sdk/types/api_keys/api_key_create_params.py +11 -0
- digitalocean_genai_sdk/types/api_keys/api_key_create_response.py +12 -0
- digitalocean_genai_sdk/types/api_keys/api_key_delete_response.py +12 -0
- digitalocean_genai_sdk/types/api_keys/api_key_list_params.py +15 -0
- digitalocean_genai_sdk/types/api_keys/api_key_list_response.py +18 -0
- digitalocean_genai_sdk/types/api_keys/api_key_update_params.py +15 -0
- digitalocean_genai_sdk/types/api_keys/api_key_update_regenerate_response.py +12 -0
- digitalocean_genai_sdk/types/api_keys/api_key_update_response.py +12 -0
- digitalocean_genai_sdk/types/api_keys/api_model_api_key_info.py +22 -0
- digitalocean_genai_sdk/types/api_knowledge_base.py +37 -0
- digitalocean_genai_sdk/types/api_model.py +57 -0
- digitalocean_genai_sdk/types/api_model_version.py +15 -0
- digitalocean_genai_sdk/types/api_openai_api_key_info.py +25 -0
- digitalocean_genai_sdk/types/api_retrieval_method.py +13 -0
- digitalocean_genai_sdk/types/auth/__init__.py +3 -0
- digitalocean_genai_sdk/types/auth/agents/__init__.py +6 -0
- digitalocean_genai_sdk/types/auth/agents/token_create_params.py +13 -0
- digitalocean_genai_sdk/types/auth/agents/token_create_response.py +13 -0
- digitalocean_genai_sdk/types/chat_completion_request_message_content_part_text_param.py +15 -0
- digitalocean_genai_sdk/types/chat_completion_token_logprob.py +57 -0
- digitalocean_genai_sdk/types/chat_create_completion_params.py +208 -0
- digitalocean_genai_sdk/types/chat_create_completion_response.py +81 -0
- digitalocean_genai_sdk/types/embedding_create_params.py +28 -0
- digitalocean_genai_sdk/types/embedding_create_response.py +41 -0
- digitalocean_genai_sdk/types/indexing_job_create_params.py +14 -0
- digitalocean_genai_sdk/types/indexing_job_create_response.py +12 -0
- digitalocean_genai_sdk/types/indexing_job_list_params.py +15 -0
- digitalocean_genai_sdk/types/indexing_job_list_response.py +18 -0
- digitalocean_genai_sdk/types/indexing_job_retrieve_data_sources_response.py +52 -0
- digitalocean_genai_sdk/types/indexing_job_retrieve_response.py +12 -0
- digitalocean_genai_sdk/types/indexing_job_update_cancel_params.py +14 -0
- digitalocean_genai_sdk/types/indexing_job_update_cancel_response.py +12 -0
- digitalocean_genai_sdk/types/knowledge_base_create_params.py +64 -0
- digitalocean_genai_sdk/types/knowledge_base_create_response.py +12 -0
- digitalocean_genai_sdk/types/knowledge_base_delete_response.py +11 -0
- digitalocean_genai_sdk/types/knowledge_base_list_params.py +15 -0
- digitalocean_genai_sdk/types/knowledge_base_list_response.py +18 -0
- digitalocean_genai_sdk/types/knowledge_base_retrieve_response.py +30 -0
- digitalocean_genai_sdk/types/knowledge_base_update_params.py +27 -0
- digitalocean_genai_sdk/types/knowledge_base_update_response.py +12 -0
- digitalocean_genai_sdk/types/knowledge_bases/__init__.py +16 -0
- digitalocean_genai_sdk/types/knowledge_bases/api_file_upload_data_source.py +15 -0
- digitalocean_genai_sdk/types/knowledge_bases/api_file_upload_data_source_param.py +15 -0
- digitalocean_genai_sdk/types/knowledge_bases/api_knowledge_base_data_source.py +35 -0
- digitalocean_genai_sdk/types/knowledge_bases/api_spaces_data_source.py +15 -0
- digitalocean_genai_sdk/types/knowledge_bases/api_spaces_data_source_param.py +15 -0
- digitalocean_genai_sdk/types/knowledge_bases/api_web_crawler_data_source.py +26 -0
- digitalocean_genai_sdk/types/knowledge_bases/api_web_crawler_data_source_param.py +25 -0
- digitalocean_genai_sdk/types/knowledge_bases/data_source_create_params.py +33 -0
- digitalocean_genai_sdk/types/knowledge_bases/data_source_create_response.py +12 -0
- digitalocean_genai_sdk/types/knowledge_bases/data_source_delete_response.py +13 -0
- digitalocean_genai_sdk/types/knowledge_bases/data_source_list_params.py +15 -0
- digitalocean_genai_sdk/types/knowledge_bases/data_source_list_response.py +18 -0
- digitalocean_genai_sdk/types/model.py +21 -0
- digitalocean_genai_sdk/types/model_list_response.py +15 -0
- digitalocean_genai_sdk/types/providers/__init__.py +3 -0
- digitalocean_genai_sdk/types/providers/anthropic/__init__.py +14 -0
- digitalocean_genai_sdk/types/providers/anthropic/key_create_params.py +13 -0
- digitalocean_genai_sdk/types/providers/anthropic/key_create_response.py +12 -0
- digitalocean_genai_sdk/types/providers/anthropic/key_delete_response.py +12 -0
- digitalocean_genai_sdk/types/providers/anthropic/key_list_agents_params.py +15 -0
- digitalocean_genai_sdk/types/providers/anthropic/key_list_agents_response.py +22 -0
- digitalocean_genai_sdk/types/providers/anthropic/key_list_params.py +15 -0
- digitalocean_genai_sdk/types/providers/anthropic/key_list_response.py +18 -0
- digitalocean_genai_sdk/types/providers/anthropic/key_retrieve_response.py +12 -0
- digitalocean_genai_sdk/types/providers/anthropic/key_update_params.py +17 -0
- digitalocean_genai_sdk/types/providers/anthropic/key_update_response.py +12 -0
- digitalocean_genai_sdk/types/providers/openai/__init__.py +14 -0
- digitalocean_genai_sdk/types/providers/openai/key_create_params.py +13 -0
- digitalocean_genai_sdk/types/providers/openai/key_create_response.py +12 -0
- digitalocean_genai_sdk/types/providers/openai/key_delete_response.py +12 -0
- digitalocean_genai_sdk/types/providers/openai/key_list_params.py +15 -0
- digitalocean_genai_sdk/types/providers/openai/key_list_response.py +18 -0
- digitalocean_genai_sdk/types/providers/openai/key_retrieve_agents_params.py +15 -0
- digitalocean_genai_sdk/types/providers/openai/key_retrieve_agents_response.py +22 -0
- digitalocean_genai_sdk/types/providers/openai/key_retrieve_response.py +12 -0
- digitalocean_genai_sdk/types/providers/openai/key_update_params.py +17 -0
- digitalocean_genai_sdk/types/providers/openai/key_update_response.py +12 -0
- digitalocean_genai_sdk/types/region_list_params.py +15 -0
- digitalocean_genai_sdk/types/region_list_response.py +23 -0
@@ -0,0 +1,508 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
import httpx
|
6
|
+
|
7
|
+
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
8
|
+
from ..._utils import maybe_transform, async_maybe_transform
|
9
|
+
from ..._compat import cached_property
|
10
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
11
|
+
from ..._response import (
|
12
|
+
to_raw_response_wrapper,
|
13
|
+
to_streamed_response_wrapper,
|
14
|
+
async_to_raw_response_wrapper,
|
15
|
+
async_to_streamed_response_wrapper,
|
16
|
+
)
|
17
|
+
from ..._base_client import make_request_options
|
18
|
+
from ...types.agents import child_agent_add_params, child_agent_update_params
|
19
|
+
from ...types.agents.child_agent_add_response import ChildAgentAddResponse
|
20
|
+
from ...types.agents.child_agent_view_response import ChildAgentViewResponse
|
21
|
+
from ...types.agents.child_agent_delete_response import ChildAgentDeleteResponse
|
22
|
+
from ...types.agents.child_agent_update_response import ChildAgentUpdateResponse
|
23
|
+
|
24
|
+
__all__ = ["ChildAgentsResource", "AsyncChildAgentsResource"]
|
25
|
+
|
26
|
+
|
27
|
+
class ChildAgentsResource(SyncAPIResource):
|
28
|
+
@cached_property
|
29
|
+
def with_raw_response(self) -> ChildAgentsResourceWithRawResponse:
|
30
|
+
"""
|
31
|
+
This property can be used as a prefix for any HTTP method call to return
|
32
|
+
the raw response object instead of the parsed content.
|
33
|
+
|
34
|
+
For more information, see https://www.github.com/digitalocean/genai-python#accessing-raw-response-data-eg-headers
|
35
|
+
"""
|
36
|
+
return ChildAgentsResourceWithRawResponse(self)
|
37
|
+
|
38
|
+
@cached_property
|
39
|
+
def with_streaming_response(self) -> ChildAgentsResourceWithStreamingResponse:
|
40
|
+
"""
|
41
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
42
|
+
|
43
|
+
For more information, see https://www.github.com/digitalocean/genai-python#with_streaming_response
|
44
|
+
"""
|
45
|
+
return ChildAgentsResourceWithStreamingResponse(self)
|
46
|
+
|
47
|
+
def update(
|
48
|
+
self,
|
49
|
+
path_child_agent_uuid: str,
|
50
|
+
*,
|
51
|
+
path_parent_agent_uuid: str,
|
52
|
+
body_child_agent_uuid: str | NotGiven = NOT_GIVEN,
|
53
|
+
if_case: str | NotGiven = NOT_GIVEN,
|
54
|
+
body_parent_agent_uuid: str | NotGiven = NOT_GIVEN,
|
55
|
+
route_name: str | NotGiven = NOT_GIVEN,
|
56
|
+
uuid: str | NotGiven = NOT_GIVEN,
|
57
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
58
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
59
|
+
extra_headers: Headers | None = None,
|
60
|
+
extra_query: Query | None = None,
|
61
|
+
extra_body: Body | None = None,
|
62
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
63
|
+
) -> ChildAgentUpdateResponse:
|
64
|
+
"""
|
65
|
+
To update an agent route for an agent, send a PUT request to
|
66
|
+
`/v2/gen-ai/agents/{parent_agent_uuid}/child_agents/{child_agent_uuid}`.
|
67
|
+
|
68
|
+
Args:
|
69
|
+
body_parent_agent_uuid: A unique identifier for the parent agent.
|
70
|
+
|
71
|
+
extra_headers: Send extra headers
|
72
|
+
|
73
|
+
extra_query: Add additional query parameters to the request
|
74
|
+
|
75
|
+
extra_body: Add additional JSON properties to the request
|
76
|
+
|
77
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
78
|
+
"""
|
79
|
+
if not path_parent_agent_uuid:
|
80
|
+
raise ValueError(
|
81
|
+
f"Expected a non-empty value for `path_parent_agent_uuid` but received {path_parent_agent_uuid!r}"
|
82
|
+
)
|
83
|
+
if not path_child_agent_uuid:
|
84
|
+
raise ValueError(
|
85
|
+
f"Expected a non-empty value for `path_child_agent_uuid` but received {path_child_agent_uuid!r}"
|
86
|
+
)
|
87
|
+
return self._put(
|
88
|
+
f"/v2/genai/agents/{path_parent_agent_uuid}/child_agents/{path_child_agent_uuid}",
|
89
|
+
body=maybe_transform(
|
90
|
+
{
|
91
|
+
"body_child_agent_uuid": body_child_agent_uuid,
|
92
|
+
"if_case": if_case,
|
93
|
+
"body_parent_agent_uuid": body_parent_agent_uuid,
|
94
|
+
"route_name": route_name,
|
95
|
+
"uuid": uuid,
|
96
|
+
},
|
97
|
+
child_agent_update_params.ChildAgentUpdateParams,
|
98
|
+
),
|
99
|
+
options=make_request_options(
|
100
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
101
|
+
),
|
102
|
+
cast_to=ChildAgentUpdateResponse,
|
103
|
+
)
|
104
|
+
|
105
|
+
def delete(
|
106
|
+
self,
|
107
|
+
child_agent_uuid: str,
|
108
|
+
*,
|
109
|
+
parent_agent_uuid: str,
|
110
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
111
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
112
|
+
extra_headers: Headers | None = None,
|
113
|
+
extra_query: Query | None = None,
|
114
|
+
extra_body: Body | None = None,
|
115
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
116
|
+
) -> ChildAgentDeleteResponse:
|
117
|
+
"""
|
118
|
+
To delete an agent route from a parent agent, send a DELETE request to
|
119
|
+
`/v2/gen-ai/agents/{parent_agent_uuid}/child_agents/{child_agent_uuid}`.
|
120
|
+
|
121
|
+
Args:
|
122
|
+
extra_headers: Send extra headers
|
123
|
+
|
124
|
+
extra_query: Add additional query parameters to the request
|
125
|
+
|
126
|
+
extra_body: Add additional JSON properties to the request
|
127
|
+
|
128
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
129
|
+
"""
|
130
|
+
if not parent_agent_uuid:
|
131
|
+
raise ValueError(f"Expected a non-empty value for `parent_agent_uuid` but received {parent_agent_uuid!r}")
|
132
|
+
if not child_agent_uuid:
|
133
|
+
raise ValueError(f"Expected a non-empty value for `child_agent_uuid` but received {child_agent_uuid!r}")
|
134
|
+
return self._delete(
|
135
|
+
f"/v2/genai/agents/{parent_agent_uuid}/child_agents/{child_agent_uuid}",
|
136
|
+
options=make_request_options(
|
137
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
138
|
+
),
|
139
|
+
cast_to=ChildAgentDeleteResponse,
|
140
|
+
)
|
141
|
+
|
142
|
+
def add(
|
143
|
+
self,
|
144
|
+
path_child_agent_uuid: str,
|
145
|
+
*,
|
146
|
+
path_parent_agent_uuid: str,
|
147
|
+
body_child_agent_uuid: str | NotGiven = NOT_GIVEN,
|
148
|
+
if_case: str | NotGiven = NOT_GIVEN,
|
149
|
+
body_parent_agent_uuid: str | NotGiven = NOT_GIVEN,
|
150
|
+
route_name: str | NotGiven = NOT_GIVEN,
|
151
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
152
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
153
|
+
extra_headers: Headers | None = None,
|
154
|
+
extra_query: Query | None = None,
|
155
|
+
extra_body: Body | None = None,
|
156
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
157
|
+
) -> ChildAgentAddResponse:
|
158
|
+
"""
|
159
|
+
To add an agent route to an agent, send a POST request to
|
160
|
+
`/v2/gen-ai/agents/{parent_agent_uuid}/child_agents/{child_agent_uuid}`.
|
161
|
+
|
162
|
+
Args:
|
163
|
+
body_parent_agent_uuid: A unique identifier for the parent agent.
|
164
|
+
|
165
|
+
extra_headers: Send extra headers
|
166
|
+
|
167
|
+
extra_query: Add additional query parameters to the request
|
168
|
+
|
169
|
+
extra_body: Add additional JSON properties to the request
|
170
|
+
|
171
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
172
|
+
"""
|
173
|
+
if not path_parent_agent_uuid:
|
174
|
+
raise ValueError(
|
175
|
+
f"Expected a non-empty value for `path_parent_agent_uuid` but received {path_parent_agent_uuid!r}"
|
176
|
+
)
|
177
|
+
if not path_child_agent_uuid:
|
178
|
+
raise ValueError(
|
179
|
+
f"Expected a non-empty value for `path_child_agent_uuid` but received {path_child_agent_uuid!r}"
|
180
|
+
)
|
181
|
+
return self._post(
|
182
|
+
f"/v2/genai/agents/{path_parent_agent_uuid}/child_agents/{path_child_agent_uuid}",
|
183
|
+
body=maybe_transform(
|
184
|
+
{
|
185
|
+
"body_child_agent_uuid": body_child_agent_uuid,
|
186
|
+
"if_case": if_case,
|
187
|
+
"body_parent_agent_uuid": body_parent_agent_uuid,
|
188
|
+
"route_name": route_name,
|
189
|
+
},
|
190
|
+
child_agent_add_params.ChildAgentAddParams,
|
191
|
+
),
|
192
|
+
options=make_request_options(
|
193
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
194
|
+
),
|
195
|
+
cast_to=ChildAgentAddResponse,
|
196
|
+
)
|
197
|
+
|
198
|
+
def view(
|
199
|
+
self,
|
200
|
+
uuid: str,
|
201
|
+
*,
|
202
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
203
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
204
|
+
extra_headers: Headers | None = None,
|
205
|
+
extra_query: Query | None = None,
|
206
|
+
extra_body: Body | None = None,
|
207
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
208
|
+
) -> ChildAgentViewResponse:
|
209
|
+
"""
|
210
|
+
To view agent routes for an agent, send a GET requtest to
|
211
|
+
`/v2/gen-ai/agents/{uuid}/child_agents`.
|
212
|
+
|
213
|
+
Args:
|
214
|
+
extra_headers: Send extra headers
|
215
|
+
|
216
|
+
extra_query: Add additional query parameters to the request
|
217
|
+
|
218
|
+
extra_body: Add additional JSON properties to the request
|
219
|
+
|
220
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
221
|
+
"""
|
222
|
+
if not uuid:
|
223
|
+
raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
|
224
|
+
return self._get(
|
225
|
+
f"/v2/genai/agents/{uuid}/child_agents",
|
226
|
+
options=make_request_options(
|
227
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
228
|
+
),
|
229
|
+
cast_to=ChildAgentViewResponse,
|
230
|
+
)
|
231
|
+
|
232
|
+
|
233
|
+
class AsyncChildAgentsResource(AsyncAPIResource):
|
234
|
+
@cached_property
|
235
|
+
def with_raw_response(self) -> AsyncChildAgentsResourceWithRawResponse:
|
236
|
+
"""
|
237
|
+
This property can be used as a prefix for any HTTP method call to return
|
238
|
+
the raw response object instead of the parsed content.
|
239
|
+
|
240
|
+
For more information, see https://www.github.com/digitalocean/genai-python#accessing-raw-response-data-eg-headers
|
241
|
+
"""
|
242
|
+
return AsyncChildAgentsResourceWithRawResponse(self)
|
243
|
+
|
244
|
+
@cached_property
|
245
|
+
def with_streaming_response(self) -> AsyncChildAgentsResourceWithStreamingResponse:
|
246
|
+
"""
|
247
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
248
|
+
|
249
|
+
For more information, see https://www.github.com/digitalocean/genai-python#with_streaming_response
|
250
|
+
"""
|
251
|
+
return AsyncChildAgentsResourceWithStreamingResponse(self)
|
252
|
+
|
253
|
+
async def update(
|
254
|
+
self,
|
255
|
+
path_child_agent_uuid: str,
|
256
|
+
*,
|
257
|
+
path_parent_agent_uuid: str,
|
258
|
+
body_child_agent_uuid: str | NotGiven = NOT_GIVEN,
|
259
|
+
if_case: str | NotGiven = NOT_GIVEN,
|
260
|
+
body_parent_agent_uuid: str | NotGiven = NOT_GIVEN,
|
261
|
+
route_name: str | NotGiven = NOT_GIVEN,
|
262
|
+
uuid: str | NotGiven = NOT_GIVEN,
|
263
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
264
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
265
|
+
extra_headers: Headers | None = None,
|
266
|
+
extra_query: Query | None = None,
|
267
|
+
extra_body: Body | None = None,
|
268
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
269
|
+
) -> ChildAgentUpdateResponse:
|
270
|
+
"""
|
271
|
+
To update an agent route for an agent, send a PUT request to
|
272
|
+
`/v2/gen-ai/agents/{parent_agent_uuid}/child_agents/{child_agent_uuid}`.
|
273
|
+
|
274
|
+
Args:
|
275
|
+
body_parent_agent_uuid: A unique identifier for the parent agent.
|
276
|
+
|
277
|
+
extra_headers: Send extra headers
|
278
|
+
|
279
|
+
extra_query: Add additional query parameters to the request
|
280
|
+
|
281
|
+
extra_body: Add additional JSON properties to the request
|
282
|
+
|
283
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
284
|
+
"""
|
285
|
+
if not path_parent_agent_uuid:
|
286
|
+
raise ValueError(
|
287
|
+
f"Expected a non-empty value for `path_parent_agent_uuid` but received {path_parent_agent_uuid!r}"
|
288
|
+
)
|
289
|
+
if not path_child_agent_uuid:
|
290
|
+
raise ValueError(
|
291
|
+
f"Expected a non-empty value for `path_child_agent_uuid` but received {path_child_agent_uuid!r}"
|
292
|
+
)
|
293
|
+
return await self._put(
|
294
|
+
f"/v2/genai/agents/{path_parent_agent_uuid}/child_agents/{path_child_agent_uuid}",
|
295
|
+
body=await async_maybe_transform(
|
296
|
+
{
|
297
|
+
"body_child_agent_uuid": body_child_agent_uuid,
|
298
|
+
"if_case": if_case,
|
299
|
+
"body_parent_agent_uuid": body_parent_agent_uuid,
|
300
|
+
"route_name": route_name,
|
301
|
+
"uuid": uuid,
|
302
|
+
},
|
303
|
+
child_agent_update_params.ChildAgentUpdateParams,
|
304
|
+
),
|
305
|
+
options=make_request_options(
|
306
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
307
|
+
),
|
308
|
+
cast_to=ChildAgentUpdateResponse,
|
309
|
+
)
|
310
|
+
|
311
|
+
async def delete(
|
312
|
+
self,
|
313
|
+
child_agent_uuid: str,
|
314
|
+
*,
|
315
|
+
parent_agent_uuid: str,
|
316
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
317
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
318
|
+
extra_headers: Headers | None = None,
|
319
|
+
extra_query: Query | None = None,
|
320
|
+
extra_body: Body | None = None,
|
321
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
322
|
+
) -> ChildAgentDeleteResponse:
|
323
|
+
"""
|
324
|
+
To delete an agent route from a parent agent, send a DELETE request to
|
325
|
+
`/v2/gen-ai/agents/{parent_agent_uuid}/child_agents/{child_agent_uuid}`.
|
326
|
+
|
327
|
+
Args:
|
328
|
+
extra_headers: Send extra headers
|
329
|
+
|
330
|
+
extra_query: Add additional query parameters to the request
|
331
|
+
|
332
|
+
extra_body: Add additional JSON properties to the request
|
333
|
+
|
334
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
335
|
+
"""
|
336
|
+
if not parent_agent_uuid:
|
337
|
+
raise ValueError(f"Expected a non-empty value for `parent_agent_uuid` but received {parent_agent_uuid!r}")
|
338
|
+
if not child_agent_uuid:
|
339
|
+
raise ValueError(f"Expected a non-empty value for `child_agent_uuid` but received {child_agent_uuid!r}")
|
340
|
+
return await self._delete(
|
341
|
+
f"/v2/genai/agents/{parent_agent_uuid}/child_agents/{child_agent_uuid}",
|
342
|
+
options=make_request_options(
|
343
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
344
|
+
),
|
345
|
+
cast_to=ChildAgentDeleteResponse,
|
346
|
+
)
|
347
|
+
|
348
|
+
async def add(
|
349
|
+
self,
|
350
|
+
path_child_agent_uuid: str,
|
351
|
+
*,
|
352
|
+
path_parent_agent_uuid: str,
|
353
|
+
body_child_agent_uuid: str | NotGiven = NOT_GIVEN,
|
354
|
+
if_case: str | NotGiven = NOT_GIVEN,
|
355
|
+
body_parent_agent_uuid: str | NotGiven = NOT_GIVEN,
|
356
|
+
route_name: str | NotGiven = NOT_GIVEN,
|
357
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
358
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
359
|
+
extra_headers: Headers | None = None,
|
360
|
+
extra_query: Query | None = None,
|
361
|
+
extra_body: Body | None = None,
|
362
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
363
|
+
) -> ChildAgentAddResponse:
|
364
|
+
"""
|
365
|
+
To add an agent route to an agent, send a POST request to
|
366
|
+
`/v2/gen-ai/agents/{parent_agent_uuid}/child_agents/{child_agent_uuid}`.
|
367
|
+
|
368
|
+
Args:
|
369
|
+
body_parent_agent_uuid: A unique identifier for the parent agent.
|
370
|
+
|
371
|
+
extra_headers: Send extra headers
|
372
|
+
|
373
|
+
extra_query: Add additional query parameters to the request
|
374
|
+
|
375
|
+
extra_body: Add additional JSON properties to the request
|
376
|
+
|
377
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
378
|
+
"""
|
379
|
+
if not path_parent_agent_uuid:
|
380
|
+
raise ValueError(
|
381
|
+
f"Expected a non-empty value for `path_parent_agent_uuid` but received {path_parent_agent_uuid!r}"
|
382
|
+
)
|
383
|
+
if not path_child_agent_uuid:
|
384
|
+
raise ValueError(
|
385
|
+
f"Expected a non-empty value for `path_child_agent_uuid` but received {path_child_agent_uuid!r}"
|
386
|
+
)
|
387
|
+
return await self._post(
|
388
|
+
f"/v2/genai/agents/{path_parent_agent_uuid}/child_agents/{path_child_agent_uuid}",
|
389
|
+
body=await async_maybe_transform(
|
390
|
+
{
|
391
|
+
"body_child_agent_uuid": body_child_agent_uuid,
|
392
|
+
"if_case": if_case,
|
393
|
+
"body_parent_agent_uuid": body_parent_agent_uuid,
|
394
|
+
"route_name": route_name,
|
395
|
+
},
|
396
|
+
child_agent_add_params.ChildAgentAddParams,
|
397
|
+
),
|
398
|
+
options=make_request_options(
|
399
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
400
|
+
),
|
401
|
+
cast_to=ChildAgentAddResponse,
|
402
|
+
)
|
403
|
+
|
404
|
+
async def view(
|
405
|
+
self,
|
406
|
+
uuid: str,
|
407
|
+
*,
|
408
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
409
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
410
|
+
extra_headers: Headers | None = None,
|
411
|
+
extra_query: Query | None = None,
|
412
|
+
extra_body: Body | None = None,
|
413
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
414
|
+
) -> ChildAgentViewResponse:
|
415
|
+
"""
|
416
|
+
To view agent routes for an agent, send a GET requtest to
|
417
|
+
`/v2/gen-ai/agents/{uuid}/child_agents`.
|
418
|
+
|
419
|
+
Args:
|
420
|
+
extra_headers: Send extra headers
|
421
|
+
|
422
|
+
extra_query: Add additional query parameters to the request
|
423
|
+
|
424
|
+
extra_body: Add additional JSON properties to the request
|
425
|
+
|
426
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
427
|
+
"""
|
428
|
+
if not uuid:
|
429
|
+
raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
|
430
|
+
return await self._get(
|
431
|
+
f"/v2/genai/agents/{uuid}/child_agents",
|
432
|
+
options=make_request_options(
|
433
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
434
|
+
),
|
435
|
+
cast_to=ChildAgentViewResponse,
|
436
|
+
)
|
437
|
+
|
438
|
+
|
439
|
+
class ChildAgentsResourceWithRawResponse:
|
440
|
+
def __init__(self, child_agents: ChildAgentsResource) -> None:
|
441
|
+
self._child_agents = child_agents
|
442
|
+
|
443
|
+
self.update = to_raw_response_wrapper(
|
444
|
+
child_agents.update,
|
445
|
+
)
|
446
|
+
self.delete = to_raw_response_wrapper(
|
447
|
+
child_agents.delete,
|
448
|
+
)
|
449
|
+
self.add = to_raw_response_wrapper(
|
450
|
+
child_agents.add,
|
451
|
+
)
|
452
|
+
self.view = to_raw_response_wrapper(
|
453
|
+
child_agents.view,
|
454
|
+
)
|
455
|
+
|
456
|
+
|
457
|
+
class AsyncChildAgentsResourceWithRawResponse:
|
458
|
+
def __init__(self, child_agents: AsyncChildAgentsResource) -> None:
|
459
|
+
self._child_agents = child_agents
|
460
|
+
|
461
|
+
self.update = async_to_raw_response_wrapper(
|
462
|
+
child_agents.update,
|
463
|
+
)
|
464
|
+
self.delete = async_to_raw_response_wrapper(
|
465
|
+
child_agents.delete,
|
466
|
+
)
|
467
|
+
self.add = async_to_raw_response_wrapper(
|
468
|
+
child_agents.add,
|
469
|
+
)
|
470
|
+
self.view = async_to_raw_response_wrapper(
|
471
|
+
child_agents.view,
|
472
|
+
)
|
473
|
+
|
474
|
+
|
475
|
+
class ChildAgentsResourceWithStreamingResponse:
|
476
|
+
def __init__(self, child_agents: ChildAgentsResource) -> None:
|
477
|
+
self._child_agents = child_agents
|
478
|
+
|
479
|
+
self.update = to_streamed_response_wrapper(
|
480
|
+
child_agents.update,
|
481
|
+
)
|
482
|
+
self.delete = to_streamed_response_wrapper(
|
483
|
+
child_agents.delete,
|
484
|
+
)
|
485
|
+
self.add = to_streamed_response_wrapper(
|
486
|
+
child_agents.add,
|
487
|
+
)
|
488
|
+
self.view = to_streamed_response_wrapper(
|
489
|
+
child_agents.view,
|
490
|
+
)
|
491
|
+
|
492
|
+
|
493
|
+
class AsyncChildAgentsResourceWithStreamingResponse:
|
494
|
+
def __init__(self, child_agents: AsyncChildAgentsResource) -> None:
|
495
|
+
self._child_agents = child_agents
|
496
|
+
|
497
|
+
self.update = async_to_streamed_response_wrapper(
|
498
|
+
child_agents.update,
|
499
|
+
)
|
500
|
+
self.delete = async_to_streamed_response_wrapper(
|
501
|
+
child_agents.delete,
|
502
|
+
)
|
503
|
+
self.add = async_to_streamed_response_wrapper(
|
504
|
+
child_agents.add,
|
505
|
+
)
|
506
|
+
self.view = async_to_streamed_response_wrapper(
|
507
|
+
child_agents.view,
|
508
|
+
)
|