c63a5cfe-b235-4fbe-8bbb-82a9e02a482a-python 0.1.0a4__py3-none-any.whl → 0.1.0a6__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.0a4.dist-info → c63a5cfe_b235_4fbe_8bbb_82a9e02a482a_python-0.1.0a6.dist-info}/METADATA +41 -16
- c63a5cfe_b235_4fbe_8bbb_82a9e02a482a_python-0.1.0a6.dist-info/RECORD +230 -0
- gradientai/_client.py +73 -71
- gradientai/_version.py +1 -1
- gradientai/resources/__init__.py +14 -28
- gradientai/resources/agents/__init__.py +69 -13
- gradientai/resources/agents/agents.py +148 -20
- gradientai/resources/{regions → agents}/evaluation_datasets.py +3 -3
- gradientai/resources/agents/evaluation_metrics/__init__.py +33 -0
- gradientai/resources/agents/evaluation_metrics/evaluation_metrics.py +177 -0
- gradientai/resources/agents/evaluation_metrics/workspaces/__init__.py +33 -0
- gradientai/resources/agents/evaluation_metrics/workspaces/agents.py +324 -0
- gradientai/resources/agents/evaluation_metrics/workspaces/workspaces.py +654 -0
- gradientai/resources/{regions/evaluation_runs → agents}/evaluation_runs.py +197 -47
- gradientai/resources/{regions → agents}/evaluation_test_cases.py +30 -9
- gradientai/resources/agents/{child_agents.py → routes.py} +64 -64
- gradientai/resources/chat/completions.py +20 -2
- gradientai/resources/inference/__init__.py +0 -14
- gradientai/resources/inference/inference.py +0 -32
- gradientai/resources/knowledge_bases/__init__.py +14 -0
- gradientai/resources/{indexing_jobs.py → knowledge_bases/indexing_jobs.py} +16 -12
- gradientai/resources/knowledge_bases/knowledge_bases.py +32 -0
- gradientai/resources/{providers → model_providers}/__init__.py +13 -13
- gradientai/resources/{providers → model_providers}/anthropic/keys.py +12 -7
- gradientai/resources/{providers/providers.py → model_providers/model_providers.py} +31 -31
- gradientai/resources/{providers → model_providers}/openai/keys.py +12 -7
- gradientai/resources/models.py +77 -105
- gradientai/resources/regions.py +195 -0
- gradientai/types/__init__.py +2 -17
- gradientai/types/agent_list_response.py +2 -2
- gradientai/types/agents/__init__.py +44 -8
- gradientai/types/{api_evaluation_metric.py → agents/api_evaluation_metric.py} +1 -1
- gradientai/types/{regions/evaluation_runs → agents}/api_evaluation_metric_result.py +1 -1
- gradientai/types/{regions/evaluation_runs/api_prompt.py → agents/api_evaluation_prompt.py} +3 -3
- gradientai/types/{regions/evaluation_runs → agents}/api_evaluation_run.py +13 -1
- gradientai/types/{regions → agents}/api_evaluation_test_case.py +1 -1
- gradientai/types/agents/api_key_list_response.py +2 -2
- gradientai/types/{region_list_evaluation_metrics_response.py → agents/evaluation_metric_list_response.py} +3 -3
- gradientai/types/agents/evaluation_metrics/__init__.py +14 -0
- gradientai/types/agents/evaluation_metrics/workspace_create_params.py +16 -0
- gradientai/types/agents/evaluation_metrics/workspace_create_response.py +16 -0
- gradientai/types/agents/evaluation_metrics/workspace_delete_response.py +11 -0
- gradientai/types/agents/evaluation_metrics/workspace_list_evaluation_test_cases_response.py +12 -0
- gradientai/types/agents/evaluation_metrics/workspace_list_response.py +16 -0
- gradientai/types/agents/evaluation_metrics/workspace_retrieve_response.py +16 -0
- gradientai/types/agents/evaluation_metrics/workspace_update_params.py +18 -0
- gradientai/types/agents/evaluation_metrics/workspace_update_response.py +16 -0
- gradientai/types/agents/evaluation_metrics/workspaces/__init__.py +8 -0
- gradientai/types/agents/evaluation_metrics/workspaces/agent_list_params.py +26 -0
- gradientai/types/agents/evaluation_metrics/workspaces/agent_list_response.py +22 -0
- gradientai/types/agents/evaluation_metrics/workspaces/agent_move_params.py +16 -0
- gradientai/types/agents/evaluation_metrics/workspaces/agent_move_response.py +16 -0
- gradientai/types/{regions → agents}/evaluation_run_create_params.py +3 -2
- gradientai/types/{regions → agents}/evaluation_run_create_response.py +2 -2
- gradientai/types/{regions/evaluation_runs/result_retrieve_response.py → agents/evaluation_run_list_results_response.py} +5 -5
- gradientai/types/{regions → agents}/evaluation_run_retrieve_response.py +1 -1
- gradientai/types/agents/evaluation_run_retrieve_results_response.py +12 -0
- gradientai/types/{regions → agents}/evaluation_test_case_list_evaluation_runs_response.py +1 -1
- gradientai/types/agents/evaluation_test_case_retrieve_params.py +12 -0
- gradientai/types/agents/{child_agent_add_params.py → route_add_params.py} +2 -2
- gradientai/types/agents/{child_agent_add_response.py → route_add_response.py} +2 -2
- gradientai/types/agents/{child_agent_delete_response.py → route_delete_response.py} +2 -2
- gradientai/types/agents/{child_agent_update_params.py → route_update_params.py} +2 -2
- gradientai/types/agents/{child_agent_update_response.py → route_update_response.py} +2 -2
- gradientai/types/agents/{child_agent_view_response.py → route_view_response.py} +2 -2
- gradientai/types/agents/version_list_response.py +2 -2
- gradientai/types/api_knowledge_base.py +1 -1
- gradientai/types/api_workspace.py +1 -1
- gradientai/types/inference/__init__.py +0 -2
- gradientai/types/inference/api_key_list_response.py +2 -2
- gradientai/types/knowledge_base_list_response.py +2 -2
- gradientai/types/knowledge_bases/__init__.py +12 -0
- gradientai/types/{indexing_job_retrieve_data_sources_response.py → knowledge_bases/api_indexed_data_source.py} +4 -8
- gradientai/types/{api_indexing_job.py → knowledge_bases/api_indexing_job.py} +13 -1
- gradientai/types/knowledge_bases/api_knowledge_base_data_source.py +4 -1
- gradientai/types/knowledge_bases/data_source_list_response.py +2 -2
- gradientai/types/{indexing_job_create_response.py → knowledge_bases/indexing_job_create_response.py} +1 -1
- gradientai/types/{indexing_job_list_response.py → knowledge_bases/indexing_job_list_response.py} +3 -3
- gradientai/types/knowledge_bases/indexing_job_retrieve_data_sources_response.py +12 -0
- gradientai/types/{indexing_job_retrieve_response.py → knowledge_bases/indexing_job_retrieve_response.py} +1 -1
- gradientai/types/{indexing_job_update_cancel_params.py → knowledge_bases/indexing_job_update_cancel_params.py} +1 -1
- gradientai/types/{indexing_job_update_cancel_response.py → knowledge_bases/indexing_job_update_cancel_response.py} +1 -1
- gradientai/types/{inference/model.py → model.py} +1 -1
- gradientai/types/model_list_response.py +5 -8
- gradientai/types/{providers → model_providers}/anthropic/key_list_agents_response.py +2 -2
- gradientai/types/{providers → model_providers}/anthropic/key_list_response.py +2 -2
- gradientai/types/{providers → model_providers}/openai/key_list_response.py +2 -2
- gradientai/types/{providers → model_providers}/openai/key_retrieve_agents_response.py +2 -2
- gradientai/types/shared/__init__.py +4 -0
- c63a5cfe_b235_4fbe_8bbb_82a9e02a482a_python-0.1.0a4.dist-info/RECORD +0 -217
- gradientai/resources/inference/models.py +0 -226
- gradientai/resources/regions/__init__.py +0 -61
- gradientai/resources/regions/evaluation_runs/__init__.py +0 -33
- gradientai/resources/regions/evaluation_runs/results.py +0 -264
- gradientai/resources/regions/regions.py +0 -352
- gradientai/types/api_model.py +0 -32
- gradientai/types/inference/model_list_response.py +0 -15
- gradientai/types/model_list_params.py +0 -42
- gradientai/types/regions/__init__.py +0 -32
- gradientai/types/regions/evaluation_runs/__init__.py +0 -9
- gradientai/types/regions/evaluation_runs/result_retrieve_prompt_response.py +0 -12
- {c63a5cfe_b235_4fbe_8bbb_82a9e02a482a_python-0.1.0a4.dist-info → c63a5cfe_b235_4fbe_8bbb_82a9e02a482a_python-0.1.0a6.dist-info}/WHEEL +0 -0
- {c63a5cfe_b235_4fbe_8bbb_82a9e02a482a_python-0.1.0a4.dist-info → c63a5cfe_b235_4fbe_8bbb_82a9e02a482a_python-0.1.0a6.dist-info}/licenses/LICENSE +0 -0
- /gradientai/resources/{providers → model_providers}/anthropic/__init__.py +0 -0
- /gradientai/resources/{providers → model_providers}/anthropic/anthropic.py +0 -0
- /gradientai/resources/{providers → model_providers}/openai/__init__.py +0 -0
- /gradientai/resources/{providers → model_providers}/openai/openai.py +0 -0
- /gradientai/types/{regions → agents}/api_star_metric.py +0 -0
- /gradientai/types/{regions → agents}/api_star_metric_param.py +0 -0
- /gradientai/types/{regions → agents}/evaluation_dataset_create_file_upload_presigned_urls_params.py +0 -0
- /gradientai/types/{regions → agents}/evaluation_dataset_create_file_upload_presigned_urls_response.py +0 -0
- /gradientai/types/{regions → agents}/evaluation_dataset_create_params.py +0 -0
- /gradientai/types/{regions → agents}/evaluation_dataset_create_response.py +0 -0
- /gradientai/types/{regions → agents}/evaluation_test_case_create_params.py +0 -0
- /gradientai/types/{regions → agents}/evaluation_test_case_create_response.py +0 -0
- /gradientai/types/{regions → agents}/evaluation_test_case_list_evaluation_runs_params.py +0 -0
- /gradientai/types/{regions → agents}/evaluation_test_case_list_response.py +0 -0
- /gradientai/types/{regions → agents}/evaluation_test_case_retrieve_response.py +0 -0
- /gradientai/types/{regions → agents}/evaluation_test_case_update_params.py +0 -0
- /gradientai/types/{regions → agents}/evaluation_test_case_update_response.py +0 -0
- /gradientai/types/{indexing_job_create_params.py → knowledge_bases/indexing_job_create_params.py} +0 -0
- /gradientai/types/{indexing_job_list_params.py → knowledge_bases/indexing_job_list_params.py} +0 -0
- /gradientai/types/{providers → model_providers}/__init__.py +0 -0
- /gradientai/types/{providers → model_providers}/anthropic/__init__.py +0 -0
- /gradientai/types/{providers → model_providers}/anthropic/key_create_params.py +0 -0
- /gradientai/types/{providers → model_providers}/anthropic/key_create_response.py +0 -0
- /gradientai/types/{providers → model_providers}/anthropic/key_delete_response.py +0 -0
- /gradientai/types/{providers → model_providers}/anthropic/key_list_agents_params.py +0 -0
- /gradientai/types/{providers → model_providers}/anthropic/key_list_params.py +0 -0
- /gradientai/types/{providers → model_providers}/anthropic/key_retrieve_response.py +0 -0
- /gradientai/types/{providers → model_providers}/anthropic/key_update_params.py +0 -0
- /gradientai/types/{providers → model_providers}/anthropic/key_update_response.py +0 -0
- /gradientai/types/{providers → model_providers}/openai/__init__.py +0 -0
- /gradientai/types/{providers → model_providers}/openai/key_create_params.py +0 -0
- /gradientai/types/{providers → model_providers}/openai/key_create_response.py +0 -0
- /gradientai/types/{providers → model_providers}/openai/key_delete_response.py +0 -0
- /gradientai/types/{providers → model_providers}/openai/key_list_params.py +0 -0
- /gradientai/types/{providers → model_providers}/openai/key_retrieve_agents_params.py +0 -0
- /gradientai/types/{providers → model_providers}/openai/key_retrieve_response.py +0 -0
- /gradientai/types/{providers → model_providers}/openai/key_update_params.py +0 -0
- /gradientai/types/{providers → model_providers}/openai/key_update_response.py +0 -0
- /gradientai/types/{agents → shared}/api_links.py +0 -0
- /gradientai/types/{agents → shared}/api_meta.py +0 -0
@@ -15,34 +15,34 @@ from ..._response import (
|
|
15
15
|
async_to_streamed_response_wrapper,
|
16
16
|
)
|
17
17
|
from ..._base_client import make_request_options
|
18
|
-
from ...types.agents import
|
19
|
-
from ...types.agents.
|
20
|
-
from ...types.agents.
|
21
|
-
from ...types.agents.
|
22
|
-
from ...types.agents.
|
18
|
+
from ...types.agents import route_add_params, route_update_params
|
19
|
+
from ...types.agents.route_add_response import RouteAddResponse
|
20
|
+
from ...types.agents.route_view_response import RouteViewResponse
|
21
|
+
from ...types.agents.route_delete_response import RouteDeleteResponse
|
22
|
+
from ...types.agents.route_update_response import RouteUpdateResponse
|
23
23
|
|
24
|
-
__all__ = ["
|
24
|
+
__all__ = ["RoutesResource", "AsyncRoutesResource"]
|
25
25
|
|
26
26
|
|
27
|
-
class
|
27
|
+
class RoutesResource(SyncAPIResource):
|
28
28
|
@cached_property
|
29
|
-
def with_raw_response(self) ->
|
29
|
+
def with_raw_response(self) -> RoutesResourceWithRawResponse:
|
30
30
|
"""
|
31
31
|
This property can be used as a prefix for any HTTP method call to return
|
32
32
|
the raw response object instead of the parsed content.
|
33
33
|
|
34
34
|
For more information, see https://www.github.com/digitalocean/gradientai-python#accessing-raw-response-data-eg-headers
|
35
35
|
"""
|
36
|
-
return
|
36
|
+
return RoutesResourceWithRawResponse(self)
|
37
37
|
|
38
38
|
@cached_property
|
39
|
-
def with_streaming_response(self) ->
|
39
|
+
def with_streaming_response(self) -> RoutesResourceWithStreamingResponse:
|
40
40
|
"""
|
41
41
|
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
42
42
|
|
43
43
|
For more information, see https://www.github.com/digitalocean/gradientai-python#with_streaming_response
|
44
44
|
"""
|
45
|
-
return
|
45
|
+
return RoutesResourceWithStreamingResponse(self)
|
46
46
|
|
47
47
|
def update(
|
48
48
|
self,
|
@@ -60,7 +60,7 @@ class ChildAgentsResource(SyncAPIResource):
|
|
60
60
|
extra_query: Query | None = None,
|
61
61
|
extra_body: Body | None = None,
|
62
62
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
63
|
-
) ->
|
63
|
+
) -> RouteUpdateResponse:
|
64
64
|
"""
|
65
65
|
To update an agent route for an agent, send a PUT request to
|
66
66
|
`/v2/gen-ai/agents/{parent_agent_uuid}/child_agents/{child_agent_uuid}`.
|
@@ -96,12 +96,12 @@ class ChildAgentsResource(SyncAPIResource):
|
|
96
96
|
"route_name": route_name,
|
97
97
|
"uuid": uuid,
|
98
98
|
},
|
99
|
-
|
99
|
+
route_update_params.RouteUpdateParams,
|
100
100
|
),
|
101
101
|
options=make_request_options(
|
102
102
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
103
103
|
),
|
104
|
-
cast_to=
|
104
|
+
cast_to=RouteUpdateResponse,
|
105
105
|
)
|
106
106
|
|
107
107
|
def delete(
|
@@ -115,7 +115,7 @@ class ChildAgentsResource(SyncAPIResource):
|
|
115
115
|
extra_query: Query | None = None,
|
116
116
|
extra_body: Body | None = None,
|
117
117
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
118
|
-
) ->
|
118
|
+
) -> RouteDeleteResponse:
|
119
119
|
"""
|
120
120
|
To delete an agent route from a parent agent, send a DELETE request to
|
121
121
|
`/v2/gen-ai/agents/{parent_agent_uuid}/child_agents/{child_agent_uuid}`.
|
@@ -140,7 +140,7 @@ class ChildAgentsResource(SyncAPIResource):
|
|
140
140
|
options=make_request_options(
|
141
141
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
142
142
|
),
|
143
|
-
cast_to=
|
143
|
+
cast_to=RouteDeleteResponse,
|
144
144
|
)
|
145
145
|
|
146
146
|
def add(
|
@@ -158,7 +158,7 @@ class ChildAgentsResource(SyncAPIResource):
|
|
158
158
|
extra_query: Query | None = None,
|
159
159
|
extra_body: Body | None = None,
|
160
160
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
161
|
-
) ->
|
161
|
+
) -> RouteAddResponse:
|
162
162
|
"""
|
163
163
|
To add an agent route to an agent, send a POST request to
|
164
164
|
`/v2/gen-ai/agents/{parent_agent_uuid}/child_agents/{child_agent_uuid}`.
|
@@ -193,12 +193,12 @@ class ChildAgentsResource(SyncAPIResource):
|
|
193
193
|
"body_parent_agent_uuid": body_parent_agent_uuid,
|
194
194
|
"route_name": route_name,
|
195
195
|
},
|
196
|
-
|
196
|
+
route_add_params.RouteAddParams,
|
197
197
|
),
|
198
198
|
options=make_request_options(
|
199
199
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
200
200
|
),
|
201
|
-
cast_to=
|
201
|
+
cast_to=RouteAddResponse,
|
202
202
|
)
|
203
203
|
|
204
204
|
def view(
|
@@ -211,7 +211,7 @@ class ChildAgentsResource(SyncAPIResource):
|
|
211
211
|
extra_query: Query | None = None,
|
212
212
|
extra_body: Body | None = None,
|
213
213
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
214
|
-
) ->
|
214
|
+
) -> RouteViewResponse:
|
215
215
|
"""
|
216
216
|
To view agent routes for an agent, send a GET requtest to
|
217
217
|
`/v2/gen-ai/agents/{uuid}/child_agents`.
|
@@ -234,29 +234,29 @@ class ChildAgentsResource(SyncAPIResource):
|
|
234
234
|
options=make_request_options(
|
235
235
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
236
236
|
),
|
237
|
-
cast_to=
|
237
|
+
cast_to=RouteViewResponse,
|
238
238
|
)
|
239
239
|
|
240
240
|
|
241
|
-
class
|
241
|
+
class AsyncRoutesResource(AsyncAPIResource):
|
242
242
|
@cached_property
|
243
|
-
def with_raw_response(self) ->
|
243
|
+
def with_raw_response(self) -> AsyncRoutesResourceWithRawResponse:
|
244
244
|
"""
|
245
245
|
This property can be used as a prefix for any HTTP method call to return
|
246
246
|
the raw response object instead of the parsed content.
|
247
247
|
|
248
248
|
For more information, see https://www.github.com/digitalocean/gradientai-python#accessing-raw-response-data-eg-headers
|
249
249
|
"""
|
250
|
-
return
|
250
|
+
return AsyncRoutesResourceWithRawResponse(self)
|
251
251
|
|
252
252
|
@cached_property
|
253
|
-
def with_streaming_response(self) ->
|
253
|
+
def with_streaming_response(self) -> AsyncRoutesResourceWithStreamingResponse:
|
254
254
|
"""
|
255
255
|
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
256
256
|
|
257
257
|
For more information, see https://www.github.com/digitalocean/gradientai-python#with_streaming_response
|
258
258
|
"""
|
259
|
-
return
|
259
|
+
return AsyncRoutesResourceWithStreamingResponse(self)
|
260
260
|
|
261
261
|
async def update(
|
262
262
|
self,
|
@@ -274,7 +274,7 @@ class AsyncChildAgentsResource(AsyncAPIResource):
|
|
274
274
|
extra_query: Query | None = None,
|
275
275
|
extra_body: Body | None = None,
|
276
276
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
277
|
-
) ->
|
277
|
+
) -> RouteUpdateResponse:
|
278
278
|
"""
|
279
279
|
To update an agent route for an agent, send a PUT request to
|
280
280
|
`/v2/gen-ai/agents/{parent_agent_uuid}/child_agents/{child_agent_uuid}`.
|
@@ -310,12 +310,12 @@ class AsyncChildAgentsResource(AsyncAPIResource):
|
|
310
310
|
"route_name": route_name,
|
311
311
|
"uuid": uuid,
|
312
312
|
},
|
313
|
-
|
313
|
+
route_update_params.RouteUpdateParams,
|
314
314
|
),
|
315
315
|
options=make_request_options(
|
316
316
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
317
317
|
),
|
318
|
-
cast_to=
|
318
|
+
cast_to=RouteUpdateResponse,
|
319
319
|
)
|
320
320
|
|
321
321
|
async def delete(
|
@@ -329,7 +329,7 @@ class AsyncChildAgentsResource(AsyncAPIResource):
|
|
329
329
|
extra_query: Query | None = None,
|
330
330
|
extra_body: Body | None = None,
|
331
331
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
332
|
-
) ->
|
332
|
+
) -> RouteDeleteResponse:
|
333
333
|
"""
|
334
334
|
To delete an agent route from a parent agent, send a DELETE request to
|
335
335
|
`/v2/gen-ai/agents/{parent_agent_uuid}/child_agents/{child_agent_uuid}`.
|
@@ -354,7 +354,7 @@ class AsyncChildAgentsResource(AsyncAPIResource):
|
|
354
354
|
options=make_request_options(
|
355
355
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
356
356
|
),
|
357
|
-
cast_to=
|
357
|
+
cast_to=RouteDeleteResponse,
|
358
358
|
)
|
359
359
|
|
360
360
|
async def add(
|
@@ -372,7 +372,7 @@ class AsyncChildAgentsResource(AsyncAPIResource):
|
|
372
372
|
extra_query: Query | None = None,
|
373
373
|
extra_body: Body | None = None,
|
374
374
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
375
|
-
) ->
|
375
|
+
) -> RouteAddResponse:
|
376
376
|
"""
|
377
377
|
To add an agent route to an agent, send a POST request to
|
378
378
|
`/v2/gen-ai/agents/{parent_agent_uuid}/child_agents/{child_agent_uuid}`.
|
@@ -407,12 +407,12 @@ class AsyncChildAgentsResource(AsyncAPIResource):
|
|
407
407
|
"body_parent_agent_uuid": body_parent_agent_uuid,
|
408
408
|
"route_name": route_name,
|
409
409
|
},
|
410
|
-
|
410
|
+
route_add_params.RouteAddParams,
|
411
411
|
),
|
412
412
|
options=make_request_options(
|
413
413
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
414
414
|
),
|
415
|
-
cast_to=
|
415
|
+
cast_to=RouteAddResponse,
|
416
416
|
)
|
417
417
|
|
418
418
|
async def view(
|
@@ -425,7 +425,7 @@ class AsyncChildAgentsResource(AsyncAPIResource):
|
|
425
425
|
extra_query: Query | None = None,
|
426
426
|
extra_body: Body | None = None,
|
427
427
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
428
|
-
) ->
|
428
|
+
) -> RouteViewResponse:
|
429
429
|
"""
|
430
430
|
To view agent routes for an agent, send a GET requtest to
|
431
431
|
`/v2/gen-ai/agents/{uuid}/child_agents`.
|
@@ -448,77 +448,77 @@ class AsyncChildAgentsResource(AsyncAPIResource):
|
|
448
448
|
options=make_request_options(
|
449
449
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
450
450
|
),
|
451
|
-
cast_to=
|
451
|
+
cast_to=RouteViewResponse,
|
452
452
|
)
|
453
453
|
|
454
454
|
|
455
|
-
class
|
456
|
-
def __init__(self,
|
457
|
-
self.
|
455
|
+
class RoutesResourceWithRawResponse:
|
456
|
+
def __init__(self, routes: RoutesResource) -> None:
|
457
|
+
self._routes = routes
|
458
458
|
|
459
459
|
self.update = to_raw_response_wrapper(
|
460
|
-
|
460
|
+
routes.update,
|
461
461
|
)
|
462
462
|
self.delete = to_raw_response_wrapper(
|
463
|
-
|
463
|
+
routes.delete,
|
464
464
|
)
|
465
465
|
self.add = to_raw_response_wrapper(
|
466
|
-
|
466
|
+
routes.add,
|
467
467
|
)
|
468
468
|
self.view = to_raw_response_wrapper(
|
469
|
-
|
469
|
+
routes.view,
|
470
470
|
)
|
471
471
|
|
472
472
|
|
473
|
-
class
|
474
|
-
def __init__(self,
|
475
|
-
self.
|
473
|
+
class AsyncRoutesResourceWithRawResponse:
|
474
|
+
def __init__(self, routes: AsyncRoutesResource) -> None:
|
475
|
+
self._routes = routes
|
476
476
|
|
477
477
|
self.update = async_to_raw_response_wrapper(
|
478
|
-
|
478
|
+
routes.update,
|
479
479
|
)
|
480
480
|
self.delete = async_to_raw_response_wrapper(
|
481
|
-
|
481
|
+
routes.delete,
|
482
482
|
)
|
483
483
|
self.add = async_to_raw_response_wrapper(
|
484
|
-
|
484
|
+
routes.add,
|
485
485
|
)
|
486
486
|
self.view = async_to_raw_response_wrapper(
|
487
|
-
|
487
|
+
routes.view,
|
488
488
|
)
|
489
489
|
|
490
490
|
|
491
|
-
class
|
492
|
-
def __init__(self,
|
493
|
-
self.
|
491
|
+
class RoutesResourceWithStreamingResponse:
|
492
|
+
def __init__(self, routes: RoutesResource) -> None:
|
493
|
+
self._routes = routes
|
494
494
|
|
495
495
|
self.update = to_streamed_response_wrapper(
|
496
|
-
|
496
|
+
routes.update,
|
497
497
|
)
|
498
498
|
self.delete = to_streamed_response_wrapper(
|
499
|
-
|
499
|
+
routes.delete,
|
500
500
|
)
|
501
501
|
self.add = to_streamed_response_wrapper(
|
502
|
-
|
502
|
+
routes.add,
|
503
503
|
)
|
504
504
|
self.view = to_streamed_response_wrapper(
|
505
|
-
|
505
|
+
routes.view,
|
506
506
|
)
|
507
507
|
|
508
508
|
|
509
|
-
class
|
510
|
-
def __init__(self,
|
511
|
-
self.
|
509
|
+
class AsyncRoutesResourceWithStreamingResponse:
|
510
|
+
def __init__(self, routes: AsyncRoutesResource) -> None:
|
511
|
+
self._routes = routes
|
512
512
|
|
513
513
|
self.update = async_to_streamed_response_wrapper(
|
514
|
-
|
514
|
+
routes.update,
|
515
515
|
)
|
516
516
|
self.delete = async_to_streamed_response_wrapper(
|
517
|
-
|
517
|
+
routes.delete,
|
518
518
|
)
|
519
519
|
self.add = async_to_streamed_response_wrapper(
|
520
|
-
|
520
|
+
routes.add,
|
521
521
|
)
|
522
522
|
self.view = async_to_streamed_response_wrapper(
|
523
|
-
|
523
|
+
routes.view,
|
524
524
|
)
|
@@ -153,6 +153,15 @@ class CompletionsResource(SyncAPIResource):
|
|
153
153
|
|
154
154
|
timeout: Override the client-level default timeout for this request, in seconds
|
155
155
|
"""
|
156
|
+
|
157
|
+
# This method requires an inference_key to be set via client argument or environment variable
|
158
|
+
if not self._client.inference_key:
|
159
|
+
raise TypeError(
|
160
|
+
"Could not resolve authentication method. Expected the inference_key to be set for chat completions."
|
161
|
+
)
|
162
|
+
headers = extra_headers or {}
|
163
|
+
headers = {"Authorization": f"Bearer {self._client.inference_key}", **headers}
|
164
|
+
|
156
165
|
return self._post(
|
157
166
|
"/chat/completions"
|
158
167
|
if self._client._base_url_overridden
|
@@ -180,7 +189,7 @@ class CompletionsResource(SyncAPIResource):
|
|
180
189
|
completion_create_params.CompletionCreateParams,
|
181
190
|
),
|
182
191
|
options=make_request_options(
|
183
|
-
extra_headers=
|
192
|
+
extra_headers=headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
184
193
|
),
|
185
194
|
cast_to=CompletionCreateResponse,
|
186
195
|
)
|
@@ -316,6 +325,15 @@ class AsyncCompletionsResource(AsyncAPIResource):
|
|
316
325
|
|
317
326
|
timeout: Override the client-level default timeout for this request, in seconds
|
318
327
|
"""
|
328
|
+
|
329
|
+
# This method requires an inference_key to be set via client argument or environment variable
|
330
|
+
if not hasattr(self._client, "inference_key") or not self._client.inference_key:
|
331
|
+
raise TypeError(
|
332
|
+
"Could not resolve authentication method. Expected the inference_key to be set for chat completions."
|
333
|
+
)
|
334
|
+
headers = extra_headers or {}
|
335
|
+
headers = {"Authorization": f"Bearer {self._client.inference_key}", **headers}
|
336
|
+
|
319
337
|
return await self._post(
|
320
338
|
"/chat/completions"
|
321
339
|
if self._client._base_url_overridden
|
@@ -343,7 +361,7 @@ class AsyncCompletionsResource(AsyncAPIResource):
|
|
343
361
|
completion_create_params.CompletionCreateParams,
|
344
362
|
),
|
345
363
|
options=make_request_options(
|
346
|
-
extra_headers=
|
364
|
+
extra_headers=headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
347
365
|
),
|
348
366
|
cast_to=CompletionCreateResponse,
|
349
367
|
)
|
@@ -1,13 +1,5 @@
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
2
|
|
3
|
-
from .models import (
|
4
|
-
ModelsResource,
|
5
|
-
AsyncModelsResource,
|
6
|
-
ModelsResourceWithRawResponse,
|
7
|
-
AsyncModelsResourceWithRawResponse,
|
8
|
-
ModelsResourceWithStreamingResponse,
|
9
|
-
AsyncModelsResourceWithStreamingResponse,
|
10
|
-
)
|
11
3
|
from .api_keys import (
|
12
4
|
APIKeysResource,
|
13
5
|
AsyncAPIKeysResource,
|
@@ -32,12 +24,6 @@ __all__ = [
|
|
32
24
|
"AsyncAPIKeysResourceWithRawResponse",
|
33
25
|
"APIKeysResourceWithStreamingResponse",
|
34
26
|
"AsyncAPIKeysResourceWithStreamingResponse",
|
35
|
-
"ModelsResource",
|
36
|
-
"AsyncModelsResource",
|
37
|
-
"ModelsResourceWithRawResponse",
|
38
|
-
"AsyncModelsResourceWithRawResponse",
|
39
|
-
"ModelsResourceWithStreamingResponse",
|
40
|
-
"AsyncModelsResourceWithStreamingResponse",
|
41
27
|
"InferenceResource",
|
42
28
|
"AsyncInferenceResource",
|
43
29
|
"InferenceResourceWithRawResponse",
|
@@ -2,14 +2,6 @@
|
|
2
2
|
|
3
3
|
from __future__ import annotations
|
4
4
|
|
5
|
-
from .models import (
|
6
|
-
ModelsResource,
|
7
|
-
AsyncModelsResource,
|
8
|
-
ModelsResourceWithRawResponse,
|
9
|
-
AsyncModelsResourceWithRawResponse,
|
10
|
-
ModelsResourceWithStreamingResponse,
|
11
|
-
AsyncModelsResourceWithStreamingResponse,
|
12
|
-
)
|
13
5
|
from .api_keys import (
|
14
6
|
APIKeysResource,
|
15
7
|
AsyncAPIKeysResource,
|
@@ -29,10 +21,6 @@ class InferenceResource(SyncAPIResource):
|
|
29
21
|
def api_keys(self) -> APIKeysResource:
|
30
22
|
return APIKeysResource(self._client)
|
31
23
|
|
32
|
-
@cached_property
|
33
|
-
def models(self) -> ModelsResource:
|
34
|
-
return ModelsResource(self._client)
|
35
|
-
|
36
24
|
@cached_property
|
37
25
|
def with_raw_response(self) -> InferenceResourceWithRawResponse:
|
38
26
|
"""
|
@@ -58,10 +46,6 @@ class AsyncInferenceResource(AsyncAPIResource):
|
|
58
46
|
def api_keys(self) -> AsyncAPIKeysResource:
|
59
47
|
return AsyncAPIKeysResource(self._client)
|
60
48
|
|
61
|
-
@cached_property
|
62
|
-
def models(self) -> AsyncModelsResource:
|
63
|
-
return AsyncModelsResource(self._client)
|
64
|
-
|
65
49
|
@cached_property
|
66
50
|
def with_raw_response(self) -> AsyncInferenceResourceWithRawResponse:
|
67
51
|
"""
|
@@ -90,10 +74,6 @@ class InferenceResourceWithRawResponse:
|
|
90
74
|
def api_keys(self) -> APIKeysResourceWithRawResponse:
|
91
75
|
return APIKeysResourceWithRawResponse(self._inference.api_keys)
|
92
76
|
|
93
|
-
@cached_property
|
94
|
-
def models(self) -> ModelsResourceWithRawResponse:
|
95
|
-
return ModelsResourceWithRawResponse(self._inference.models)
|
96
|
-
|
97
77
|
|
98
78
|
class AsyncInferenceResourceWithRawResponse:
|
99
79
|
def __init__(self, inference: AsyncInferenceResource) -> None:
|
@@ -103,10 +83,6 @@ class AsyncInferenceResourceWithRawResponse:
|
|
103
83
|
def api_keys(self) -> AsyncAPIKeysResourceWithRawResponse:
|
104
84
|
return AsyncAPIKeysResourceWithRawResponse(self._inference.api_keys)
|
105
85
|
|
106
|
-
@cached_property
|
107
|
-
def models(self) -> AsyncModelsResourceWithRawResponse:
|
108
|
-
return AsyncModelsResourceWithRawResponse(self._inference.models)
|
109
|
-
|
110
86
|
|
111
87
|
class InferenceResourceWithStreamingResponse:
|
112
88
|
def __init__(self, inference: InferenceResource) -> None:
|
@@ -116,10 +92,6 @@ class InferenceResourceWithStreamingResponse:
|
|
116
92
|
def api_keys(self) -> APIKeysResourceWithStreamingResponse:
|
117
93
|
return APIKeysResourceWithStreamingResponse(self._inference.api_keys)
|
118
94
|
|
119
|
-
@cached_property
|
120
|
-
def models(self) -> ModelsResourceWithStreamingResponse:
|
121
|
-
return ModelsResourceWithStreamingResponse(self._inference.models)
|
122
|
-
|
123
95
|
|
124
96
|
class AsyncInferenceResourceWithStreamingResponse:
|
125
97
|
def __init__(self, inference: AsyncInferenceResource) -> None:
|
@@ -128,7 +100,3 @@ class AsyncInferenceResourceWithStreamingResponse:
|
|
128
100
|
@cached_property
|
129
101
|
def api_keys(self) -> AsyncAPIKeysResourceWithStreamingResponse:
|
130
102
|
return AsyncAPIKeysResourceWithStreamingResponse(self._inference.api_keys)
|
131
|
-
|
132
|
-
@cached_property
|
133
|
-
def models(self) -> AsyncModelsResourceWithStreamingResponse:
|
134
|
-
return AsyncModelsResourceWithStreamingResponse(self._inference.models)
|
@@ -8,6 +8,14 @@ from .data_sources import (
|
|
8
8
|
DataSourcesResourceWithStreamingResponse,
|
9
9
|
AsyncDataSourcesResourceWithStreamingResponse,
|
10
10
|
)
|
11
|
+
from .indexing_jobs import (
|
12
|
+
IndexingJobsResource,
|
13
|
+
AsyncIndexingJobsResource,
|
14
|
+
IndexingJobsResourceWithRawResponse,
|
15
|
+
AsyncIndexingJobsResourceWithRawResponse,
|
16
|
+
IndexingJobsResourceWithStreamingResponse,
|
17
|
+
AsyncIndexingJobsResourceWithStreamingResponse,
|
18
|
+
)
|
11
19
|
from .knowledge_bases import (
|
12
20
|
KnowledgeBasesResource,
|
13
21
|
AsyncKnowledgeBasesResource,
|
@@ -24,6 +32,12 @@ __all__ = [
|
|
24
32
|
"AsyncDataSourcesResourceWithRawResponse",
|
25
33
|
"DataSourcesResourceWithStreamingResponse",
|
26
34
|
"AsyncDataSourcesResourceWithStreamingResponse",
|
35
|
+
"IndexingJobsResource",
|
36
|
+
"AsyncIndexingJobsResource",
|
37
|
+
"IndexingJobsResourceWithRawResponse",
|
38
|
+
"AsyncIndexingJobsResourceWithRawResponse",
|
39
|
+
"IndexingJobsResourceWithStreamingResponse",
|
40
|
+
"AsyncIndexingJobsResourceWithStreamingResponse",
|
27
41
|
"KnowledgeBasesResource",
|
28
42
|
"AsyncKnowledgeBasesResource",
|
29
43
|
"KnowledgeBasesResourceWithRawResponse",
|
@@ -6,23 +6,27 @@ from typing import List
|
|
6
6
|
|
7
7
|
import httpx
|
8
8
|
|
9
|
-
from
|
10
|
-
from
|
11
|
-
from
|
12
|
-
from
|
13
|
-
from
|
14
|
-
from .._response import (
|
9
|
+
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
10
|
+
from ..._utils import maybe_transform, async_maybe_transform
|
11
|
+
from ..._compat import cached_property
|
12
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
13
|
+
from ..._response import (
|
15
14
|
to_raw_response_wrapper,
|
16
15
|
to_streamed_response_wrapper,
|
17
16
|
async_to_raw_response_wrapper,
|
18
17
|
async_to_streamed_response_wrapper,
|
19
18
|
)
|
20
|
-
from
|
21
|
-
from
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
19
|
+
from ..._base_client import make_request_options
|
20
|
+
from ...types.knowledge_bases import (
|
21
|
+
indexing_job_list_params,
|
22
|
+
indexing_job_create_params,
|
23
|
+
indexing_job_update_cancel_params,
|
24
|
+
)
|
25
|
+
from ...types.knowledge_bases.indexing_job_list_response import IndexingJobListResponse
|
26
|
+
from ...types.knowledge_bases.indexing_job_create_response import IndexingJobCreateResponse
|
27
|
+
from ...types.knowledge_bases.indexing_job_retrieve_response import IndexingJobRetrieveResponse
|
28
|
+
from ...types.knowledge_bases.indexing_job_update_cancel_response import IndexingJobUpdateCancelResponse
|
29
|
+
from ...types.knowledge_bases.indexing_job_retrieve_data_sources_response import IndexingJobRetrieveDataSourcesResponse
|
26
30
|
|
27
31
|
__all__ = ["IndexingJobsResource", "AsyncIndexingJobsResource"]
|
28
32
|
|
@@ -25,6 +25,14 @@ from .data_sources import (
|
|
25
25
|
DataSourcesResourceWithStreamingResponse,
|
26
26
|
AsyncDataSourcesResourceWithStreamingResponse,
|
27
27
|
)
|
28
|
+
from .indexing_jobs import (
|
29
|
+
IndexingJobsResource,
|
30
|
+
AsyncIndexingJobsResource,
|
31
|
+
IndexingJobsResourceWithRawResponse,
|
32
|
+
AsyncIndexingJobsResourceWithRawResponse,
|
33
|
+
IndexingJobsResourceWithStreamingResponse,
|
34
|
+
AsyncIndexingJobsResourceWithStreamingResponse,
|
35
|
+
)
|
28
36
|
from ..._base_client import make_request_options
|
29
37
|
from ...types.knowledge_base_list_response import KnowledgeBaseListResponse
|
30
38
|
from ...types.knowledge_base_create_response import KnowledgeBaseCreateResponse
|
@@ -40,6 +48,10 @@ class KnowledgeBasesResource(SyncAPIResource):
|
|
40
48
|
def data_sources(self) -> DataSourcesResource:
|
41
49
|
return DataSourcesResource(self._client)
|
42
50
|
|
51
|
+
@cached_property
|
52
|
+
def indexing_jobs(self) -> IndexingJobsResource:
|
53
|
+
return IndexingJobsResource(self._client)
|
54
|
+
|
43
55
|
@cached_property
|
44
56
|
def with_raw_response(self) -> KnowledgeBasesResourceWithRawResponse:
|
45
57
|
"""
|
@@ -316,6 +328,10 @@ class AsyncKnowledgeBasesResource(AsyncAPIResource):
|
|
316
328
|
def data_sources(self) -> AsyncDataSourcesResource:
|
317
329
|
return AsyncDataSourcesResource(self._client)
|
318
330
|
|
331
|
+
@cached_property
|
332
|
+
def indexing_jobs(self) -> AsyncIndexingJobsResource:
|
333
|
+
return AsyncIndexingJobsResource(self._client)
|
334
|
+
|
319
335
|
@cached_property
|
320
336
|
def with_raw_response(self) -> AsyncKnowledgeBasesResourceWithRawResponse:
|
321
337
|
"""
|
@@ -611,6 +627,10 @@ class KnowledgeBasesResourceWithRawResponse:
|
|
611
627
|
def data_sources(self) -> DataSourcesResourceWithRawResponse:
|
612
628
|
return DataSourcesResourceWithRawResponse(self._knowledge_bases.data_sources)
|
613
629
|
|
630
|
+
@cached_property
|
631
|
+
def indexing_jobs(self) -> IndexingJobsResourceWithRawResponse:
|
632
|
+
return IndexingJobsResourceWithRawResponse(self._knowledge_bases.indexing_jobs)
|
633
|
+
|
614
634
|
|
615
635
|
class AsyncKnowledgeBasesResourceWithRawResponse:
|
616
636
|
def __init__(self, knowledge_bases: AsyncKnowledgeBasesResource) -> None:
|
@@ -636,6 +656,10 @@ class AsyncKnowledgeBasesResourceWithRawResponse:
|
|
636
656
|
def data_sources(self) -> AsyncDataSourcesResourceWithRawResponse:
|
637
657
|
return AsyncDataSourcesResourceWithRawResponse(self._knowledge_bases.data_sources)
|
638
658
|
|
659
|
+
@cached_property
|
660
|
+
def indexing_jobs(self) -> AsyncIndexingJobsResourceWithRawResponse:
|
661
|
+
return AsyncIndexingJobsResourceWithRawResponse(self._knowledge_bases.indexing_jobs)
|
662
|
+
|
639
663
|
|
640
664
|
class KnowledgeBasesResourceWithStreamingResponse:
|
641
665
|
def __init__(self, knowledge_bases: KnowledgeBasesResource) -> None:
|
@@ -661,6 +685,10 @@ class KnowledgeBasesResourceWithStreamingResponse:
|
|
661
685
|
def data_sources(self) -> DataSourcesResourceWithStreamingResponse:
|
662
686
|
return DataSourcesResourceWithStreamingResponse(self._knowledge_bases.data_sources)
|
663
687
|
|
688
|
+
@cached_property
|
689
|
+
def indexing_jobs(self) -> IndexingJobsResourceWithStreamingResponse:
|
690
|
+
return IndexingJobsResourceWithStreamingResponse(self._knowledge_bases.indexing_jobs)
|
691
|
+
|
664
692
|
|
665
693
|
class AsyncKnowledgeBasesResourceWithStreamingResponse:
|
666
694
|
def __init__(self, knowledge_bases: AsyncKnowledgeBasesResource) -> None:
|
@@ -685,3 +713,7 @@ class AsyncKnowledgeBasesResourceWithStreamingResponse:
|
|
685
713
|
@cached_property
|
686
714
|
def data_sources(self) -> AsyncDataSourcesResourceWithStreamingResponse:
|
687
715
|
return AsyncDataSourcesResourceWithStreamingResponse(self._knowledge_bases.data_sources)
|
716
|
+
|
717
|
+
@cached_property
|
718
|
+
def indexing_jobs(self) -> AsyncIndexingJobsResourceWithStreamingResponse:
|
719
|
+
return AsyncIndexingJobsResourceWithStreamingResponse(self._knowledge_bases.indexing_jobs)
|
@@ -16,13 +16,13 @@ from .anthropic import (
|
|
16
16
|
AnthropicResourceWithStreamingResponse,
|
17
17
|
AsyncAnthropicResourceWithStreamingResponse,
|
18
18
|
)
|
19
|
-
from .
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
19
|
+
from .model_providers import (
|
20
|
+
ModelProvidersResource,
|
21
|
+
AsyncModelProvidersResource,
|
22
|
+
ModelProvidersResourceWithRawResponse,
|
23
|
+
AsyncModelProvidersResourceWithRawResponse,
|
24
|
+
ModelProvidersResourceWithStreamingResponse,
|
25
|
+
AsyncModelProvidersResourceWithStreamingResponse,
|
26
26
|
)
|
27
27
|
|
28
28
|
__all__ = [
|
@@ -38,10 +38,10 @@ __all__ = [
|
|
38
38
|
"AsyncOpenAIResourceWithRawResponse",
|
39
39
|
"OpenAIResourceWithStreamingResponse",
|
40
40
|
"AsyncOpenAIResourceWithStreamingResponse",
|
41
|
-
"
|
42
|
-
"
|
43
|
-
"
|
44
|
-
"
|
45
|
-
"
|
46
|
-
"
|
41
|
+
"ModelProvidersResource",
|
42
|
+
"AsyncModelProvidersResource",
|
43
|
+
"ModelProvidersResourceWithRawResponse",
|
44
|
+
"AsyncModelProvidersResourceWithRawResponse",
|
45
|
+
"ModelProvidersResourceWithStreamingResponse",
|
46
|
+
"AsyncModelProvidersResourceWithStreamingResponse",
|
47
47
|
]
|