c63a5cfe-b235-4fbe-8bbb-82a9e02a482a-python 0.1.0a5__py3-none-any.whl → 0.1.0a7__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.0a5.dist-info → c63a5cfe_b235_4fbe_8bbb_82a9e02a482a_python-0.1.0a7.dist-info}/METADATA +27 -27
- c63a5cfe_b235_4fbe_8bbb_82a9e02a482a_python-0.1.0a7.dist-info/RECORD +237 -0
- {do_gradientai → gradientai}/__init__.py +2 -2
- {do_gradientai → gradientai}/_base_client.py +1 -1
- {do_gradientai → gradientai}/_client.py +12 -0
- {do_gradientai → gradientai}/_response.py +4 -4
- {do_gradientai → gradientai}/_types.py +1 -1
- {do_gradientai → gradientai}/_utils/_logs.py +2 -2
- {do_gradientai → gradientai}/_utils/_resources_proxy.py +4 -4
- {do_gradientai → gradientai}/_version.py +2 -2
- {do_gradientai → gradientai}/resources/agents/__init__.py +14 -0
- {do_gradientai → gradientai}/resources/agents/agents.py +32 -0
- gradientai/resources/agents/chat/chat.py +102 -0
- gradientai/resources/agents/chat/completions.py +385 -0
- gradientai/resources/chat/__init__.py +33 -0
- {do_gradientai → gradientai}/resources/models.py +105 -77
- {do_gradientai → gradientai}/types/__init__.py +3 -2
- {do_gradientai/types → gradientai/types/agents}/chat/__init__.py +0 -1
- gradientai/types/agents/chat/completion_create_response.py +81 -0
- gradientai/types/api_model.py +32 -0
- gradientai/types/chat/__init__.py +6 -0
- gradientai/types/chat/completion_create_params.py +185 -0
- {do_gradientai → gradientai}/types/chat/completion_create_response.py +1 -1
- gradientai/types/model_list_params.py +42 -0
- gradientai/types/model_list_response.py +18 -0
- {do_gradientai → gradientai}/types/shared/__init__.py +1 -0
- c63a5cfe_b235_4fbe_8bbb_82a9e02a482a_python-0.1.0a5.dist-info/RECORD +0 -230
- do_gradientai/types/model.py +0 -21
- do_gradientai/types/model_list_response.py +0 -15
- {c63a5cfe_b235_4fbe_8bbb_82a9e02a482a_python-0.1.0a5.dist-info → c63a5cfe_b235_4fbe_8bbb_82a9e02a482a_python-0.1.0a7.dist-info}/WHEEL +0 -0
- {c63a5cfe_b235_4fbe_8bbb_82a9e02a482a_python-0.1.0a5.dist-info → c63a5cfe_b235_4fbe_8bbb_82a9e02a482a_python-0.1.0a7.dist-info}/licenses/LICENSE +0 -0
- {do_gradientai → gradientai}/_compat.py +0 -0
- {do_gradientai → gradientai}/_constants.py +0 -0
- {do_gradientai → gradientai}/_exceptions.py +0 -0
- {do_gradientai → gradientai}/_files.py +0 -0
- {do_gradientai → gradientai}/_models.py +0 -0
- {do_gradientai → gradientai}/_qs.py +0 -0
- {do_gradientai → gradientai}/_resource.py +0 -0
- {do_gradientai → gradientai}/_streaming.py +0 -0
- {do_gradientai → gradientai}/_utils/__init__.py +0 -0
- {do_gradientai → gradientai}/_utils/_proxy.py +0 -0
- {do_gradientai → gradientai}/_utils/_reflection.py +0 -0
- {do_gradientai → gradientai}/_utils/_streams.py +0 -0
- {do_gradientai → gradientai}/_utils/_sync.py +0 -0
- {do_gradientai → gradientai}/_utils/_transform.py +0 -0
- {do_gradientai → gradientai}/_utils/_typing.py +0 -0
- {do_gradientai → gradientai}/_utils/_utils.py +0 -0
- {do_gradientai → gradientai}/lib/.keep +0 -0
- {do_gradientai → gradientai}/py.typed +0 -0
- {do_gradientai → gradientai}/resources/__init__.py +0 -0
- {do_gradientai → gradientai}/resources/agents/api_keys.py +0 -0
- {do_gradientai/resources → gradientai/resources/agents}/chat/__init__.py +0 -0
- {do_gradientai → gradientai}/resources/agents/evaluation_datasets.py +0 -0
- {do_gradientai → gradientai}/resources/agents/evaluation_metrics/__init__.py +0 -0
- {do_gradientai → gradientai}/resources/agents/evaluation_metrics/evaluation_metrics.py +0 -0
- {do_gradientai → gradientai}/resources/agents/evaluation_metrics/workspaces/__init__.py +0 -0
- {do_gradientai → gradientai}/resources/agents/evaluation_metrics/workspaces/agents.py +0 -0
- {do_gradientai → gradientai}/resources/agents/evaluation_metrics/workspaces/workspaces.py +0 -0
- {do_gradientai → gradientai}/resources/agents/evaluation_runs.py +0 -0
- {do_gradientai → gradientai}/resources/agents/evaluation_test_cases.py +0 -0
- {do_gradientai → gradientai}/resources/agents/functions.py +0 -0
- {do_gradientai → gradientai}/resources/agents/knowledge_bases.py +0 -0
- {do_gradientai → gradientai}/resources/agents/routes.py +0 -0
- {do_gradientai → gradientai}/resources/agents/versions.py +0 -0
- {do_gradientai → gradientai}/resources/chat/chat.py +0 -0
- {do_gradientai → gradientai}/resources/chat/completions.py +0 -0
- {do_gradientai → gradientai}/resources/inference/__init__.py +0 -0
- {do_gradientai → gradientai}/resources/inference/api_keys.py +0 -0
- {do_gradientai → gradientai}/resources/inference/inference.py +0 -0
- {do_gradientai → gradientai}/resources/knowledge_bases/__init__.py +0 -0
- {do_gradientai → gradientai}/resources/knowledge_bases/data_sources.py +0 -0
- {do_gradientai → gradientai}/resources/knowledge_bases/indexing_jobs.py +0 -0
- {do_gradientai → gradientai}/resources/knowledge_bases/knowledge_bases.py +0 -0
- {do_gradientai → gradientai}/resources/model_providers/__init__.py +0 -0
- {do_gradientai → gradientai}/resources/model_providers/anthropic/__init__.py +0 -0
- {do_gradientai → gradientai}/resources/model_providers/anthropic/anthropic.py +0 -0
- {do_gradientai → gradientai}/resources/model_providers/anthropic/keys.py +0 -0
- {do_gradientai → gradientai}/resources/model_providers/model_providers.py +0 -0
- {do_gradientai → gradientai}/resources/model_providers/openai/__init__.py +0 -0
- {do_gradientai → gradientai}/resources/model_providers/openai/keys.py +0 -0
- {do_gradientai → gradientai}/resources/model_providers/openai/openai.py +0 -0
- {do_gradientai → gradientai}/resources/regions.py +0 -0
- {do_gradientai → gradientai}/types/agent_create_params.py +0 -0
- {do_gradientai → gradientai}/types/agent_create_response.py +0 -0
- {do_gradientai → gradientai}/types/agent_delete_response.py +0 -0
- {do_gradientai → gradientai}/types/agent_list_params.py +0 -0
- {do_gradientai → gradientai}/types/agent_list_response.py +0 -0
- {do_gradientai → gradientai}/types/agent_retrieve_response.py +0 -0
- {do_gradientai → gradientai}/types/agent_update_params.py +0 -0
- {do_gradientai → gradientai}/types/agent_update_response.py +0 -0
- {do_gradientai → gradientai}/types/agent_update_status_params.py +0 -0
- {do_gradientai → gradientai}/types/agent_update_status_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/__init__.py +0 -0
- {do_gradientai → gradientai}/types/agents/api_evaluation_metric.py +0 -0
- {do_gradientai → gradientai}/types/agents/api_evaluation_metric_result.py +0 -0
- {do_gradientai → gradientai}/types/agents/api_evaluation_prompt.py +0 -0
- {do_gradientai → gradientai}/types/agents/api_evaluation_run.py +0 -0
- {do_gradientai → gradientai}/types/agents/api_evaluation_test_case.py +0 -0
- {do_gradientai → gradientai}/types/agents/api_key_create_params.py +0 -0
- {do_gradientai → gradientai}/types/agents/api_key_create_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/api_key_delete_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/api_key_list_params.py +0 -0
- {do_gradientai → gradientai}/types/agents/api_key_list_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/api_key_regenerate_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/api_key_update_params.py +0 -0
- {do_gradientai → gradientai}/types/agents/api_key_update_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/api_link_knowledge_base_output.py +0 -0
- {do_gradientai → gradientai}/types/agents/api_star_metric.py +0 -0
- {do_gradientai → gradientai}/types/agents/api_star_metric_param.py +0 -0
- {do_gradientai/types → gradientai/types/agents}/chat/completion_create_params.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_dataset_create_file_upload_presigned_urls_params.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_dataset_create_file_upload_presigned_urls_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_dataset_create_params.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_dataset_create_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_metric_list_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_metrics/__init__.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_metrics/workspace_create_params.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_metrics/workspace_create_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_metrics/workspace_delete_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_metrics/workspace_list_evaluation_test_cases_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_metrics/workspace_list_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_metrics/workspace_retrieve_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_metrics/workspace_update_params.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_metrics/workspace_update_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_metrics/workspaces/__init__.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_metrics/workspaces/agent_list_params.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_metrics/workspaces/agent_list_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_metrics/workspaces/agent_move_params.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_metrics/workspaces/agent_move_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_run_create_params.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_run_create_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_run_list_results_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_run_retrieve_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_run_retrieve_results_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_test_case_create_params.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_test_case_create_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_test_case_list_evaluation_runs_params.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_test_case_list_evaluation_runs_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_test_case_list_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_test_case_retrieve_params.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_test_case_retrieve_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_test_case_update_params.py +0 -0
- {do_gradientai → gradientai}/types/agents/evaluation_test_case_update_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/function_create_params.py +0 -0
- {do_gradientai → gradientai}/types/agents/function_create_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/function_delete_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/function_update_params.py +0 -0
- {do_gradientai → gradientai}/types/agents/function_update_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/knowledge_base_detach_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/route_add_params.py +0 -0
- {do_gradientai → gradientai}/types/agents/route_add_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/route_delete_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/route_update_params.py +0 -0
- {do_gradientai → gradientai}/types/agents/route_update_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/route_view_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/version_list_params.py +0 -0
- {do_gradientai → gradientai}/types/agents/version_list_response.py +0 -0
- {do_gradientai → gradientai}/types/agents/version_update_params.py +0 -0
- {do_gradientai → gradientai}/types/agents/version_update_response.py +0 -0
- {do_gradientai → gradientai}/types/api_agent.py +0 -0
- {do_gradientai → gradientai}/types/api_agent_api_key_info.py +0 -0
- {do_gradientai → gradientai}/types/api_agent_model.py +0 -0
- {do_gradientai → gradientai}/types/api_agreement.py +0 -0
- {do_gradientai → gradientai}/types/api_anthropic_api_key_info.py +0 -0
- {do_gradientai → gradientai}/types/api_deployment_visibility.py +0 -0
- {do_gradientai → gradientai}/types/api_knowledge_base.py +0 -0
- {do_gradientai → gradientai}/types/api_model_version.py +0 -0
- {do_gradientai → gradientai}/types/api_openai_api_key_info.py +0 -0
- {do_gradientai → gradientai}/types/api_retrieval_method.py +0 -0
- {do_gradientai → gradientai}/types/api_workspace.py +0 -0
- {do_gradientai → gradientai}/types/inference/__init__.py +0 -0
- {do_gradientai → gradientai}/types/inference/api_key_create_params.py +0 -0
- {do_gradientai → gradientai}/types/inference/api_key_create_response.py +0 -0
- {do_gradientai → gradientai}/types/inference/api_key_delete_response.py +0 -0
- {do_gradientai → gradientai}/types/inference/api_key_list_params.py +0 -0
- {do_gradientai → gradientai}/types/inference/api_key_list_response.py +0 -0
- {do_gradientai → gradientai}/types/inference/api_key_update_params.py +0 -0
- {do_gradientai → gradientai}/types/inference/api_key_update_regenerate_response.py +0 -0
- {do_gradientai → gradientai}/types/inference/api_key_update_response.py +0 -0
- {do_gradientai → gradientai}/types/inference/api_model_api_key_info.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_base_create_params.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_base_create_response.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_base_delete_response.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_base_list_params.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_base_list_response.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_base_retrieve_response.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_base_update_params.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_base_update_response.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_bases/__init__.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_bases/api_file_upload_data_source.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_bases/api_file_upload_data_source_param.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_bases/api_indexed_data_source.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_bases/api_indexing_job.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_bases/api_knowledge_base_data_source.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_bases/api_spaces_data_source.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_bases/api_spaces_data_source_param.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_bases/api_web_crawler_data_source.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_bases/api_web_crawler_data_source_param.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_bases/aws_data_source_param.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_bases/data_source_create_params.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_bases/data_source_create_response.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_bases/data_source_delete_response.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_bases/data_source_list_params.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_bases/data_source_list_response.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_bases/indexing_job_create_params.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_bases/indexing_job_create_response.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_bases/indexing_job_list_params.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_bases/indexing_job_list_response.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_bases/indexing_job_retrieve_data_sources_response.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_bases/indexing_job_retrieve_response.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_bases/indexing_job_update_cancel_params.py +0 -0
- {do_gradientai → gradientai}/types/knowledge_bases/indexing_job_update_cancel_response.py +0 -0
- {do_gradientai → gradientai}/types/model_providers/__init__.py +0 -0
- {do_gradientai → gradientai}/types/model_providers/anthropic/__init__.py +0 -0
- {do_gradientai → gradientai}/types/model_providers/anthropic/key_create_params.py +0 -0
- {do_gradientai → gradientai}/types/model_providers/anthropic/key_create_response.py +0 -0
- {do_gradientai → gradientai}/types/model_providers/anthropic/key_delete_response.py +0 -0
- {do_gradientai → gradientai}/types/model_providers/anthropic/key_list_agents_params.py +0 -0
- {do_gradientai → gradientai}/types/model_providers/anthropic/key_list_agents_response.py +0 -0
- {do_gradientai → gradientai}/types/model_providers/anthropic/key_list_params.py +0 -0
- {do_gradientai → gradientai}/types/model_providers/anthropic/key_list_response.py +0 -0
- {do_gradientai → gradientai}/types/model_providers/anthropic/key_retrieve_response.py +0 -0
- {do_gradientai → gradientai}/types/model_providers/anthropic/key_update_params.py +0 -0
- {do_gradientai → gradientai}/types/model_providers/anthropic/key_update_response.py +0 -0
- {do_gradientai → gradientai}/types/model_providers/openai/__init__.py +0 -0
- {do_gradientai → gradientai}/types/model_providers/openai/key_create_params.py +0 -0
- {do_gradientai → gradientai}/types/model_providers/openai/key_create_response.py +0 -0
- {do_gradientai → gradientai}/types/model_providers/openai/key_delete_response.py +0 -0
- {do_gradientai → gradientai}/types/model_providers/openai/key_list_params.py +0 -0
- {do_gradientai → gradientai}/types/model_providers/openai/key_list_response.py +0 -0
- {do_gradientai → gradientai}/types/model_providers/openai/key_retrieve_agents_params.py +0 -0
- {do_gradientai → gradientai}/types/model_providers/openai/key_retrieve_agents_response.py +0 -0
- {do_gradientai → gradientai}/types/model_providers/openai/key_retrieve_response.py +0 -0
- {do_gradientai → gradientai}/types/model_providers/openai/key_update_params.py +0 -0
- {do_gradientai → gradientai}/types/model_providers/openai/key_update_response.py +0 -0
- {do_gradientai → gradientai}/types/region_list_params.py +0 -0
- {do_gradientai → gradientai}/types/region_list_response.py +0 -0
- {do_gradientai → gradientai}/types/shared/api_links.py +0 -0
- {do_gradientai → gradientai}/types/shared/api_meta.py +0 -0
- {do_gradientai/types/chat → gradientai/types/shared}/chat_completion_token_logprob.py +0 -0
@@ -2,9 +2,14 @@
|
|
2
2
|
|
3
3
|
from __future__ import annotations
|
4
4
|
|
5
|
+
from typing import List
|
6
|
+
from typing_extensions import Literal
|
7
|
+
|
5
8
|
import httpx
|
6
9
|
|
10
|
+
from ..types import model_list_params
|
7
11
|
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
12
|
+
from .._utils import maybe_transform, async_maybe_transform
|
8
13
|
from .._compat import cached_property
|
9
14
|
from .._resource import SyncAPIResource, AsyncAPIResource
|
10
15
|
from .._response import (
|
@@ -13,7 +18,6 @@ from .._response import (
|
|
13
18
|
async_to_raw_response_wrapper,
|
14
19
|
async_to_streamed_response_wrapper,
|
15
20
|
)
|
16
|
-
from ..types.model import Model
|
17
21
|
from .._base_client import make_request_options
|
18
22
|
from ..types.model_list_response import ModelListResponse
|
19
23
|
|
@@ -40,22 +44,52 @@ class ModelsResource(SyncAPIResource):
|
|
40
44
|
"""
|
41
45
|
return ModelsResourceWithStreamingResponse(self)
|
42
46
|
|
43
|
-
def
|
47
|
+
def list(
|
44
48
|
self,
|
45
|
-
model: str,
|
46
49
|
*,
|
50
|
+
page: int | NotGiven = NOT_GIVEN,
|
51
|
+
per_page: int | NotGiven = NOT_GIVEN,
|
52
|
+
public_only: bool | NotGiven = NOT_GIVEN,
|
53
|
+
usecases: List[
|
54
|
+
Literal[
|
55
|
+
"MODEL_USECASE_UNKNOWN",
|
56
|
+
"MODEL_USECASE_AGENT",
|
57
|
+
"MODEL_USECASE_FINETUNED",
|
58
|
+
"MODEL_USECASE_KNOWLEDGEBASE",
|
59
|
+
"MODEL_USECASE_GUARDRAIL",
|
60
|
+
"MODEL_USECASE_REASONING",
|
61
|
+
"MODEL_USECASE_SERVERLESS",
|
62
|
+
]
|
63
|
+
]
|
64
|
+
| NotGiven = NOT_GIVEN,
|
47
65
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
48
66
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
49
67
|
extra_headers: Headers | None = None,
|
50
68
|
extra_query: Query | None = None,
|
51
69
|
extra_body: Body | None = None,
|
52
70
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
53
|
-
) ->
|
71
|
+
) -> ModelListResponse:
|
54
72
|
"""
|
55
|
-
|
56
|
-
the owner and permissioning.
|
73
|
+
To list all models, send a GET request to `/v2/gen-ai/models`.
|
57
74
|
|
58
75
|
Args:
|
76
|
+
page: page number.
|
77
|
+
|
78
|
+
per_page: items per page.
|
79
|
+
|
80
|
+
public_only: only include models that are publicly available.
|
81
|
+
|
82
|
+
usecases: include only models defined for the listed usecases.
|
83
|
+
|
84
|
+
- MODEL_USECASE_UNKNOWN: The use case of the model is unknown
|
85
|
+
- MODEL_USECASE_AGENT: The model maybe used in an agent
|
86
|
+
- MODEL_USECASE_FINETUNED: The model maybe used for fine tuning
|
87
|
+
- MODEL_USECASE_KNOWLEDGEBASE: The model maybe used for knowledge bases
|
88
|
+
(embedding models)
|
89
|
+
- MODEL_USECASE_GUARDRAIL: The model maybe used for guardrails
|
90
|
+
- MODEL_USECASE_REASONING: The model usecase for reasoning
|
91
|
+
- MODEL_USECASE_SERVERLESS: The model usecase for serverless inference
|
92
|
+
|
59
93
|
extra_headers: Send extra headers
|
60
94
|
|
61
95
|
extra_query: Add additional query parameters to the request
|
@@ -64,36 +98,24 @@ class ModelsResource(SyncAPIResource):
|
|
64
98
|
|
65
99
|
timeout: Override the client-level default timeout for this request, in seconds
|
66
100
|
"""
|
67
|
-
if not model:
|
68
|
-
raise ValueError(f"Expected a non-empty value for `model` but received {model!r}")
|
69
101
|
return self._get(
|
70
|
-
|
102
|
+
"/v2/gen-ai/models"
|
71
103
|
if self._client._base_url_overridden
|
72
|
-
else
|
104
|
+
else "https://api.digitalocean.com/v2/gen-ai/models",
|
73
105
|
options=make_request_options(
|
74
|
-
extra_headers=extra_headers,
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
88
|
-
) -> ModelListResponse:
|
89
|
-
"""
|
90
|
-
Lists the currently available models, and provides basic information about each
|
91
|
-
one such as the owner and availability.
|
92
|
-
"""
|
93
|
-
return self._get(
|
94
|
-
"/models" if self._client._base_url_overridden else "https://inference.do-ai.run/v1/models",
|
95
|
-
options=make_request_options(
|
96
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
106
|
+
extra_headers=extra_headers,
|
107
|
+
extra_query=extra_query,
|
108
|
+
extra_body=extra_body,
|
109
|
+
timeout=timeout,
|
110
|
+
query=maybe_transform(
|
111
|
+
{
|
112
|
+
"page": page,
|
113
|
+
"per_page": per_page,
|
114
|
+
"public_only": public_only,
|
115
|
+
"usecases": usecases,
|
116
|
+
},
|
117
|
+
model_list_params.ModelListParams,
|
118
|
+
),
|
97
119
|
),
|
98
120
|
cast_to=ModelListResponse,
|
99
121
|
)
|
@@ -119,22 +141,52 @@ class AsyncModelsResource(AsyncAPIResource):
|
|
119
141
|
"""
|
120
142
|
return AsyncModelsResourceWithStreamingResponse(self)
|
121
143
|
|
122
|
-
async def
|
144
|
+
async def list(
|
123
145
|
self,
|
124
|
-
model: str,
|
125
146
|
*,
|
147
|
+
page: int | NotGiven = NOT_GIVEN,
|
148
|
+
per_page: int | NotGiven = NOT_GIVEN,
|
149
|
+
public_only: bool | NotGiven = NOT_GIVEN,
|
150
|
+
usecases: List[
|
151
|
+
Literal[
|
152
|
+
"MODEL_USECASE_UNKNOWN",
|
153
|
+
"MODEL_USECASE_AGENT",
|
154
|
+
"MODEL_USECASE_FINETUNED",
|
155
|
+
"MODEL_USECASE_KNOWLEDGEBASE",
|
156
|
+
"MODEL_USECASE_GUARDRAIL",
|
157
|
+
"MODEL_USECASE_REASONING",
|
158
|
+
"MODEL_USECASE_SERVERLESS",
|
159
|
+
]
|
160
|
+
]
|
161
|
+
| NotGiven = NOT_GIVEN,
|
126
162
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
127
163
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
128
164
|
extra_headers: Headers | None = None,
|
129
165
|
extra_query: Query | None = None,
|
130
166
|
extra_body: Body | None = None,
|
131
167
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
132
|
-
) ->
|
168
|
+
) -> ModelListResponse:
|
133
169
|
"""
|
134
|
-
|
135
|
-
the owner and permissioning.
|
170
|
+
To list all models, send a GET request to `/v2/gen-ai/models`.
|
136
171
|
|
137
172
|
Args:
|
173
|
+
page: page number.
|
174
|
+
|
175
|
+
per_page: items per page.
|
176
|
+
|
177
|
+
public_only: only include models that are publicly available.
|
178
|
+
|
179
|
+
usecases: include only models defined for the listed usecases.
|
180
|
+
|
181
|
+
- MODEL_USECASE_UNKNOWN: The use case of the model is unknown
|
182
|
+
- MODEL_USECASE_AGENT: The model maybe used in an agent
|
183
|
+
- MODEL_USECASE_FINETUNED: The model maybe used for fine tuning
|
184
|
+
- MODEL_USECASE_KNOWLEDGEBASE: The model maybe used for knowledge bases
|
185
|
+
(embedding models)
|
186
|
+
- MODEL_USECASE_GUARDRAIL: The model maybe used for guardrails
|
187
|
+
- MODEL_USECASE_REASONING: The model usecase for reasoning
|
188
|
+
- MODEL_USECASE_SERVERLESS: The model usecase for serverless inference
|
189
|
+
|
138
190
|
extra_headers: Send extra headers
|
139
191
|
|
140
192
|
extra_query: Add additional query parameters to the request
|
@@ -143,36 +195,24 @@ class AsyncModelsResource(AsyncAPIResource):
|
|
143
195
|
|
144
196
|
timeout: Override the client-level default timeout for this request, in seconds
|
145
197
|
"""
|
146
|
-
if not model:
|
147
|
-
raise ValueError(f"Expected a non-empty value for `model` but received {model!r}")
|
148
198
|
return await self._get(
|
149
|
-
|
199
|
+
"/v2/gen-ai/models"
|
150
200
|
if self._client._base_url_overridden
|
151
|
-
else
|
152
|
-
options=make_request_options(
|
153
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
154
|
-
),
|
155
|
-
cast_to=Model,
|
156
|
-
)
|
157
|
-
|
158
|
-
async def list(
|
159
|
-
self,
|
160
|
-
*,
|
161
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
162
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
163
|
-
extra_headers: Headers | None = None,
|
164
|
-
extra_query: Query | None = None,
|
165
|
-
extra_body: Body | None = None,
|
166
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
167
|
-
) -> ModelListResponse:
|
168
|
-
"""
|
169
|
-
Lists the currently available models, and provides basic information about each
|
170
|
-
one such as the owner and availability.
|
171
|
-
"""
|
172
|
-
return await self._get(
|
173
|
-
"/models" if self._client._base_url_overridden else "https://inference.do-ai.run/v1/models",
|
201
|
+
else "https://api.digitalocean.com/v2/gen-ai/models",
|
174
202
|
options=make_request_options(
|
175
|
-
extra_headers=extra_headers,
|
203
|
+
extra_headers=extra_headers,
|
204
|
+
extra_query=extra_query,
|
205
|
+
extra_body=extra_body,
|
206
|
+
timeout=timeout,
|
207
|
+
query=await async_maybe_transform(
|
208
|
+
{
|
209
|
+
"page": page,
|
210
|
+
"per_page": per_page,
|
211
|
+
"public_only": public_only,
|
212
|
+
"usecases": usecases,
|
213
|
+
},
|
214
|
+
model_list_params.ModelListParams,
|
215
|
+
),
|
176
216
|
),
|
177
217
|
cast_to=ModelListResponse,
|
178
218
|
)
|
@@ -182,9 +222,6 @@ class ModelsResourceWithRawResponse:
|
|
182
222
|
def __init__(self, models: ModelsResource) -> None:
|
183
223
|
self._models = models
|
184
224
|
|
185
|
-
self.retrieve = to_raw_response_wrapper(
|
186
|
-
models.retrieve,
|
187
|
-
)
|
188
225
|
self.list = to_raw_response_wrapper(
|
189
226
|
models.list,
|
190
227
|
)
|
@@ -194,9 +231,6 @@ class AsyncModelsResourceWithRawResponse:
|
|
194
231
|
def __init__(self, models: AsyncModelsResource) -> None:
|
195
232
|
self._models = models
|
196
233
|
|
197
|
-
self.retrieve = async_to_raw_response_wrapper(
|
198
|
-
models.retrieve,
|
199
|
-
)
|
200
234
|
self.list = async_to_raw_response_wrapper(
|
201
235
|
models.list,
|
202
236
|
)
|
@@ -206,9 +240,6 @@ class ModelsResourceWithStreamingResponse:
|
|
206
240
|
def __init__(self, models: ModelsResource) -> None:
|
207
241
|
self._models = models
|
208
242
|
|
209
|
-
self.retrieve = to_streamed_response_wrapper(
|
210
|
-
models.retrieve,
|
211
|
-
)
|
212
243
|
self.list = to_streamed_response_wrapper(
|
213
244
|
models.list,
|
214
245
|
)
|
@@ -218,9 +249,6 @@ class AsyncModelsResourceWithStreamingResponse:
|
|
218
249
|
def __init__(self, models: AsyncModelsResource) -> None:
|
219
250
|
self._models = models
|
220
251
|
|
221
|
-
self.retrieve = async_to_streamed_response_wrapper(
|
222
|
-
models.retrieve,
|
223
|
-
)
|
224
252
|
self.list = async_to_streamed_response_wrapper(
|
225
253
|
models.list,
|
226
254
|
)
|
@@ -2,14 +2,15 @@
|
|
2
2
|
|
3
3
|
from __future__ import annotations
|
4
4
|
|
5
|
-
from .
|
6
|
-
from .shared import APIMeta as APIMeta, APILinks as APILinks
|
5
|
+
from .shared import APIMeta as APIMeta, APILinks as APILinks, ChatCompletionTokenLogprob as ChatCompletionTokenLogprob
|
7
6
|
from .api_agent import APIAgent as APIAgent
|
7
|
+
from .api_model import APIModel as APIModel
|
8
8
|
from .api_agreement import APIAgreement as APIAgreement
|
9
9
|
from .api_workspace import APIWorkspace as APIWorkspace
|
10
10
|
from .api_agent_model import APIAgentModel as APIAgentModel
|
11
11
|
from .agent_list_params import AgentListParams as AgentListParams
|
12
12
|
from .api_model_version import APIModelVersion as APIModelVersion
|
13
|
+
from .model_list_params import ModelListParams as ModelListParams
|
13
14
|
from .api_knowledge_base import APIKnowledgeBase as APIKnowledgeBase
|
14
15
|
from .region_list_params import RegionListParams as RegionListParams
|
15
16
|
from .agent_create_params import AgentCreateParams as AgentCreateParams
|
@@ -4,4 +4,3 @@ from __future__ import annotations
|
|
4
4
|
|
5
5
|
from .completion_create_params import CompletionCreateParams as CompletionCreateParams
|
6
6
|
from .completion_create_response import CompletionCreateResponse as CompletionCreateResponse
|
7
|
-
from .chat_completion_token_logprob import ChatCompletionTokenLogprob as ChatCompletionTokenLogprob
|
@@ -0,0 +1,81 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import List, Optional
|
4
|
+
from typing_extensions import Literal
|
5
|
+
|
6
|
+
from ...._models import BaseModel
|
7
|
+
from ...shared.chat_completion_token_logprob import ChatCompletionTokenLogprob
|
8
|
+
|
9
|
+
__all__ = ["CompletionCreateResponse", "Choice", "ChoiceLogprobs", "ChoiceMessage", "Usage"]
|
10
|
+
|
11
|
+
|
12
|
+
class ChoiceLogprobs(BaseModel):
|
13
|
+
content: Optional[List[ChatCompletionTokenLogprob]] = None
|
14
|
+
"""A list of message content tokens with log probability information."""
|
15
|
+
|
16
|
+
refusal: Optional[List[ChatCompletionTokenLogprob]] = None
|
17
|
+
"""A list of message refusal tokens with log probability information."""
|
18
|
+
|
19
|
+
|
20
|
+
class ChoiceMessage(BaseModel):
|
21
|
+
content: Optional[str] = None
|
22
|
+
"""The contents of the message."""
|
23
|
+
|
24
|
+
refusal: Optional[str] = None
|
25
|
+
"""The refusal message generated by the model."""
|
26
|
+
|
27
|
+
role: Literal["assistant"]
|
28
|
+
"""The role of the author of this message."""
|
29
|
+
|
30
|
+
|
31
|
+
class Choice(BaseModel):
|
32
|
+
finish_reason: Literal["stop", "length"]
|
33
|
+
"""The reason the model stopped generating tokens.
|
34
|
+
|
35
|
+
This will be `stop` if the model hit a natural stop point or a provided stop
|
36
|
+
sequence, or `length` if the maximum number of tokens specified in the request
|
37
|
+
was reached.
|
38
|
+
"""
|
39
|
+
|
40
|
+
index: int
|
41
|
+
"""The index of the choice in the list of choices."""
|
42
|
+
|
43
|
+
logprobs: Optional[ChoiceLogprobs] = None
|
44
|
+
"""Log probability information for the choice."""
|
45
|
+
|
46
|
+
message: ChoiceMessage
|
47
|
+
"""A chat completion message generated by the model."""
|
48
|
+
|
49
|
+
|
50
|
+
class Usage(BaseModel):
|
51
|
+
completion_tokens: int
|
52
|
+
"""Number of tokens in the generated completion."""
|
53
|
+
|
54
|
+
prompt_tokens: int
|
55
|
+
"""Number of tokens in the prompt."""
|
56
|
+
|
57
|
+
total_tokens: int
|
58
|
+
"""Total number of tokens used in the request (prompt + completion)."""
|
59
|
+
|
60
|
+
|
61
|
+
class CompletionCreateResponse(BaseModel):
|
62
|
+
id: str
|
63
|
+
"""A unique identifier for the chat completion."""
|
64
|
+
|
65
|
+
choices: List[Choice]
|
66
|
+
"""A list of chat completion choices.
|
67
|
+
|
68
|
+
Can be more than one if `n` is greater than 1.
|
69
|
+
"""
|
70
|
+
|
71
|
+
created: int
|
72
|
+
"""The Unix timestamp (in seconds) of when the chat completion was created."""
|
73
|
+
|
74
|
+
model: str
|
75
|
+
"""The model used for the chat completion."""
|
76
|
+
|
77
|
+
object: Literal["chat.completion"]
|
78
|
+
"""The object type, which is always `chat.completion`."""
|
79
|
+
|
80
|
+
usage: Optional[Usage] = None
|
81
|
+
"""Usage statistics for the completion request."""
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import Optional
|
4
|
+
from datetime import datetime
|
5
|
+
|
6
|
+
from .._models import BaseModel
|
7
|
+
from .api_agreement import APIAgreement
|
8
|
+
from .api_model_version import APIModelVersion
|
9
|
+
|
10
|
+
__all__ = ["APIModel"]
|
11
|
+
|
12
|
+
|
13
|
+
class APIModel(BaseModel):
|
14
|
+
agreement: Optional[APIAgreement] = None
|
15
|
+
|
16
|
+
created_at: Optional[datetime] = None
|
17
|
+
|
18
|
+
is_foundational: Optional[bool] = None
|
19
|
+
|
20
|
+
name: Optional[str] = None
|
21
|
+
|
22
|
+
parent_uuid: Optional[str] = None
|
23
|
+
|
24
|
+
updated_at: Optional[datetime] = None
|
25
|
+
|
26
|
+
upload_complete: Optional[bool] = None
|
27
|
+
|
28
|
+
url: Optional[str] = None
|
29
|
+
|
30
|
+
uuid: Optional[str] = None
|
31
|
+
|
32
|
+
version: Optional[APIModelVersion] = None
|
@@ -0,0 +1,6 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from .completion_create_params import CompletionCreateParams as CompletionCreateParams
|
6
|
+
from .completion_create_response import CompletionCreateResponse as CompletionCreateResponse
|
@@ -0,0 +1,185 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from typing import Dict, List, Union, Iterable, Optional
|
6
|
+
from typing_extensions import Literal, Required, TypeAlias, TypedDict
|
7
|
+
|
8
|
+
__all__ = [
|
9
|
+
"CompletionCreateParams",
|
10
|
+
"Message",
|
11
|
+
"MessageChatCompletionRequestSystemMessage",
|
12
|
+
"MessageChatCompletionRequestDeveloperMessage",
|
13
|
+
"MessageChatCompletionRequestUserMessage",
|
14
|
+
"MessageChatCompletionRequestAssistantMessage",
|
15
|
+
"StreamOptions",
|
16
|
+
]
|
17
|
+
|
18
|
+
|
19
|
+
class CompletionCreateParams(TypedDict, total=False):
|
20
|
+
messages: Required[Iterable[Message]]
|
21
|
+
"""A list of messages comprising the conversation so far."""
|
22
|
+
|
23
|
+
model: Required[str]
|
24
|
+
"""Model ID used to generate the response."""
|
25
|
+
|
26
|
+
frequency_penalty: Optional[float]
|
27
|
+
"""Number between -2.0 and 2.0.
|
28
|
+
|
29
|
+
Positive values penalize new tokens based on their existing frequency in the
|
30
|
+
text so far, decreasing the model's likelihood to repeat the same line verbatim.
|
31
|
+
"""
|
32
|
+
|
33
|
+
logit_bias: Optional[Dict[str, int]]
|
34
|
+
"""Modify the likelihood of specified tokens appearing in the completion.
|
35
|
+
|
36
|
+
Accepts a JSON object that maps tokens (specified by their token ID in the
|
37
|
+
tokenizer) to an associated bias value from -100 to 100. Mathematically, the
|
38
|
+
bias is added to the logits generated by the model prior to sampling. The exact
|
39
|
+
effect will vary per model, but values between -1 and 1 should decrease or
|
40
|
+
increase likelihood of selection; values like -100 or 100 should result in a ban
|
41
|
+
or exclusive selection of the relevant token.
|
42
|
+
"""
|
43
|
+
|
44
|
+
logprobs: Optional[bool]
|
45
|
+
"""Whether to return log probabilities of the output tokens or not.
|
46
|
+
|
47
|
+
If true, returns the log probabilities of each output token returned in the
|
48
|
+
`content` of `message`.
|
49
|
+
"""
|
50
|
+
|
51
|
+
max_completion_tokens: Optional[int]
|
52
|
+
"""
|
53
|
+
The maximum number of completion tokens that may be used over the course of the
|
54
|
+
run. The run will make a best effort to use only the number of completion tokens
|
55
|
+
specified, across multiple turns of the run.
|
56
|
+
"""
|
57
|
+
|
58
|
+
max_tokens: Optional[int]
|
59
|
+
"""The maximum number of tokens that can be generated in the completion.
|
60
|
+
|
61
|
+
The token count of your prompt plus `max_tokens` cannot exceed the model's
|
62
|
+
context length.
|
63
|
+
"""
|
64
|
+
|
65
|
+
metadata: Optional[Dict[str, str]]
|
66
|
+
"""Set of 16 key-value pairs that can be attached to an object.
|
67
|
+
|
68
|
+
This can be useful for storing additional information about the object in a
|
69
|
+
structured format, and querying for objects via API or the dashboard.
|
70
|
+
|
71
|
+
Keys are strings with a maximum length of 64 characters. Values are strings with
|
72
|
+
a maximum length of 512 characters.
|
73
|
+
"""
|
74
|
+
|
75
|
+
n: Optional[int]
|
76
|
+
"""How many chat completion choices to generate for each input message.
|
77
|
+
|
78
|
+
Note that you will be charged based on the number of generated tokens across all
|
79
|
+
of the choices. Keep `n` as `1` to minimize costs.
|
80
|
+
"""
|
81
|
+
|
82
|
+
presence_penalty: Optional[float]
|
83
|
+
"""Number between -2.0 and 2.0.
|
84
|
+
|
85
|
+
Positive values penalize new tokens based on whether they appear in the text so
|
86
|
+
far, increasing the model's likelihood to talk about new topics.
|
87
|
+
"""
|
88
|
+
|
89
|
+
stop: Union[Optional[str], List[str], None]
|
90
|
+
"""Up to 4 sequences where the API will stop generating further tokens.
|
91
|
+
|
92
|
+
The returned text will not contain the stop sequence.
|
93
|
+
"""
|
94
|
+
|
95
|
+
stream: Optional[bool]
|
96
|
+
"""
|
97
|
+
If set to true, the model response data will be streamed to the client as it is
|
98
|
+
generated using server-sent events.
|
99
|
+
"""
|
100
|
+
|
101
|
+
stream_options: Optional[StreamOptions]
|
102
|
+
"""Options for streaming response. Only set this when you set `stream: true`."""
|
103
|
+
|
104
|
+
temperature: Optional[float]
|
105
|
+
"""What sampling temperature to use, between 0 and 2.
|
106
|
+
|
107
|
+
Higher values like 0.8 will make the output more random, while lower values like
|
108
|
+
0.2 will make it more focused and deterministic. We generally recommend altering
|
109
|
+
this or `top_p` but not both.
|
110
|
+
"""
|
111
|
+
|
112
|
+
top_logprobs: Optional[int]
|
113
|
+
"""
|
114
|
+
An integer between 0 and 20 specifying the number of most likely tokens to
|
115
|
+
return at each token position, each with an associated log probability.
|
116
|
+
`logprobs` must be set to `true` if this parameter is used.
|
117
|
+
"""
|
118
|
+
|
119
|
+
top_p: Optional[float]
|
120
|
+
"""
|
121
|
+
An alternative to sampling with temperature, called nucleus sampling, where the
|
122
|
+
model considers the results of the tokens with top_p probability mass. So 0.1
|
123
|
+
means only the tokens comprising the top 10% probability mass are considered.
|
124
|
+
|
125
|
+
We generally recommend altering this or `temperature` but not both.
|
126
|
+
"""
|
127
|
+
|
128
|
+
user: str
|
129
|
+
"""
|
130
|
+
A unique identifier representing your end-user, which can help DigitalOcean to
|
131
|
+
monitor and detect abuse.
|
132
|
+
"""
|
133
|
+
|
134
|
+
|
135
|
+
class MessageChatCompletionRequestSystemMessage(TypedDict, total=False):
|
136
|
+
content: Required[Union[str, List[str]]]
|
137
|
+
"""The contents of the system message."""
|
138
|
+
|
139
|
+
role: Required[Literal["system"]]
|
140
|
+
"""The role of the messages author, in this case `system`."""
|
141
|
+
|
142
|
+
|
143
|
+
class MessageChatCompletionRequestDeveloperMessage(TypedDict, total=False):
|
144
|
+
content: Required[Union[str, List[str]]]
|
145
|
+
"""The contents of the developer message."""
|
146
|
+
|
147
|
+
role: Required[Literal["developer"]]
|
148
|
+
"""The role of the messages author, in this case `developer`."""
|
149
|
+
|
150
|
+
|
151
|
+
class MessageChatCompletionRequestUserMessage(TypedDict, total=False):
|
152
|
+
content: Required[Union[str, List[str]]]
|
153
|
+
"""The contents of the user message."""
|
154
|
+
|
155
|
+
role: Required[Literal["user"]]
|
156
|
+
"""The role of the messages author, in this case `user`."""
|
157
|
+
|
158
|
+
|
159
|
+
class MessageChatCompletionRequestAssistantMessage(TypedDict, total=False):
|
160
|
+
role: Required[Literal["assistant"]]
|
161
|
+
"""The role of the messages author, in this case `assistant`."""
|
162
|
+
|
163
|
+
content: Union[str, List[str], None]
|
164
|
+
"""The contents of the assistant message."""
|
165
|
+
|
166
|
+
|
167
|
+
Message: TypeAlias = Union[
|
168
|
+
MessageChatCompletionRequestSystemMessage,
|
169
|
+
MessageChatCompletionRequestDeveloperMessage,
|
170
|
+
MessageChatCompletionRequestUserMessage,
|
171
|
+
MessageChatCompletionRequestAssistantMessage,
|
172
|
+
]
|
173
|
+
|
174
|
+
|
175
|
+
class StreamOptions(TypedDict, total=False):
|
176
|
+
include_usage: bool
|
177
|
+
"""If set, an additional chunk will be streamed before the `data: [DONE]` message.
|
178
|
+
|
179
|
+
The `usage` field on this chunk shows the token usage statistics for the entire
|
180
|
+
request, and the `choices` field will always be an empty array.
|
181
|
+
|
182
|
+
All other chunks will also include a `usage` field, but with a null value.
|
183
|
+
**NOTE:** If the stream is interrupted, you may not receive the final usage
|
184
|
+
chunk which contains the total token usage for the request.
|
185
|
+
"""
|
@@ -4,7 +4,7 @@ from typing import List, Optional
|
|
4
4
|
from typing_extensions import Literal
|
5
5
|
|
6
6
|
from ..._models import BaseModel
|
7
|
-
from .chat_completion_token_logprob import ChatCompletionTokenLogprob
|
7
|
+
from ..shared.chat_completion_token_logprob import ChatCompletionTokenLogprob
|
8
8
|
|
9
9
|
__all__ = ["CompletionCreateResponse", "Choice", "ChoiceLogprobs", "ChoiceMessage", "Usage"]
|
10
10
|
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from typing import List
|
6
|
+
from typing_extensions import Literal, TypedDict
|
7
|
+
|
8
|
+
__all__ = ["ModelListParams"]
|
9
|
+
|
10
|
+
|
11
|
+
class ModelListParams(TypedDict, total=False):
|
12
|
+
page: int
|
13
|
+
"""page number."""
|
14
|
+
|
15
|
+
per_page: int
|
16
|
+
"""items per page."""
|
17
|
+
|
18
|
+
public_only: bool
|
19
|
+
"""only include models that are publicly available."""
|
20
|
+
|
21
|
+
usecases: List[
|
22
|
+
Literal[
|
23
|
+
"MODEL_USECASE_UNKNOWN",
|
24
|
+
"MODEL_USECASE_AGENT",
|
25
|
+
"MODEL_USECASE_FINETUNED",
|
26
|
+
"MODEL_USECASE_KNOWLEDGEBASE",
|
27
|
+
"MODEL_USECASE_GUARDRAIL",
|
28
|
+
"MODEL_USECASE_REASONING",
|
29
|
+
"MODEL_USECASE_SERVERLESS",
|
30
|
+
]
|
31
|
+
]
|
32
|
+
"""include only models defined for the listed usecases.
|
33
|
+
|
34
|
+
- MODEL_USECASE_UNKNOWN: The use case of the model is unknown
|
35
|
+
- MODEL_USECASE_AGENT: The model maybe used in an agent
|
36
|
+
- MODEL_USECASE_FINETUNED: The model maybe used for fine tuning
|
37
|
+
- MODEL_USECASE_KNOWLEDGEBASE: The model maybe used for knowledge bases
|
38
|
+
(embedding models)
|
39
|
+
- MODEL_USECASE_GUARDRAIL: The model maybe used for guardrails
|
40
|
+
- MODEL_USECASE_REASONING: The model usecase for reasoning
|
41
|
+
- MODEL_USECASE_SERVERLESS: The model usecase for serverless inference
|
42
|
+
"""
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import List, Optional
|
4
|
+
|
5
|
+
from .._models import BaseModel
|
6
|
+
from .api_model import APIModel
|
7
|
+
from .shared.api_meta import APIMeta
|
8
|
+
from .shared.api_links import APILinks
|
9
|
+
|
10
|
+
__all__ = ["ModelListResponse"]
|
11
|
+
|
12
|
+
|
13
|
+
class ModelListResponse(BaseModel):
|
14
|
+
links: Optional[APILinks] = None
|
15
|
+
|
16
|
+
meta: Optional[APIMeta] = None
|
17
|
+
|
18
|
+
models: Optional[List[APIModel]] = None
|