mirascope 2.0.0a2__py3-none-any.whl → 2.0.0a4__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.
- mirascope/__init__.py +2 -2
- mirascope/api/__init__.py +6 -0
- mirascope/api/_generated/README.md +207 -0
- mirascope/api/_generated/__init__.py +141 -0
- mirascope/api/_generated/client.py +163 -0
- mirascope/api/_generated/core/__init__.py +52 -0
- mirascope/api/_generated/core/api_error.py +23 -0
- mirascope/api/_generated/core/client_wrapper.py +58 -0
- mirascope/api/_generated/core/datetime_utils.py +30 -0
- mirascope/api/_generated/core/file.py +70 -0
- mirascope/api/_generated/core/force_multipart.py +16 -0
- mirascope/api/_generated/core/http_client.py +619 -0
- mirascope/api/_generated/core/http_response.py +55 -0
- mirascope/api/_generated/core/jsonable_encoder.py +102 -0
- mirascope/api/_generated/core/pydantic_utilities.py +310 -0
- mirascope/api/_generated/core/query_encoder.py +60 -0
- mirascope/api/_generated/core/remove_none_from_dict.py +11 -0
- mirascope/api/_generated/core/request_options.py +35 -0
- mirascope/api/_generated/core/serialization.py +282 -0
- mirascope/api/_generated/docs/__init__.py +4 -0
- mirascope/api/_generated/docs/client.py +95 -0
- mirascope/api/_generated/docs/raw_client.py +132 -0
- mirascope/api/_generated/environment.py +9 -0
- mirascope/api/_generated/errors/__init__.py +17 -0
- mirascope/api/_generated/errors/bad_request_error.py +15 -0
- mirascope/api/_generated/errors/conflict_error.py +15 -0
- mirascope/api/_generated/errors/forbidden_error.py +15 -0
- mirascope/api/_generated/errors/internal_server_error.py +15 -0
- mirascope/api/_generated/errors/not_found_error.py +15 -0
- mirascope/api/_generated/health/__init__.py +7 -0
- mirascope/api/_generated/health/client.py +96 -0
- mirascope/api/_generated/health/raw_client.py +129 -0
- mirascope/api/_generated/health/types/__init__.py +8 -0
- mirascope/api/_generated/health/types/health_check_response.py +24 -0
- mirascope/api/_generated/health/types/health_check_response_status.py +5 -0
- mirascope/api/_generated/organizations/__init__.py +25 -0
- mirascope/api/_generated/organizations/client.py +380 -0
- mirascope/api/_generated/organizations/raw_client.py +876 -0
- mirascope/api/_generated/organizations/types/__init__.py +23 -0
- mirascope/api/_generated/organizations/types/organizations_create_response.py +24 -0
- mirascope/api/_generated/organizations/types/organizations_create_response_role.py +7 -0
- mirascope/api/_generated/organizations/types/organizations_get_response.py +24 -0
- mirascope/api/_generated/organizations/types/organizations_get_response_role.py +7 -0
- mirascope/api/_generated/organizations/types/organizations_list_response_item.py +24 -0
- mirascope/api/_generated/organizations/types/organizations_list_response_item_role.py +7 -0
- mirascope/api/_generated/organizations/types/organizations_update_response.py +24 -0
- mirascope/api/_generated/organizations/types/organizations_update_response_role.py +7 -0
- mirascope/api/_generated/projects/__init__.py +17 -0
- mirascope/api/_generated/projects/client.py +458 -0
- mirascope/api/_generated/projects/raw_client.py +1016 -0
- mirascope/api/_generated/projects/types/__init__.py +15 -0
- mirascope/api/_generated/projects/types/projects_create_response.py +30 -0
- mirascope/api/_generated/projects/types/projects_get_response.py +30 -0
- mirascope/api/_generated/projects/types/projects_list_response_item.py +30 -0
- mirascope/api/_generated/projects/types/projects_update_response.py +30 -0
- mirascope/api/_generated/reference.md +753 -0
- mirascope/api/_generated/traces/__init__.py +55 -0
- mirascope/api/_generated/traces/client.py +162 -0
- mirascope/api/_generated/traces/raw_client.py +168 -0
- mirascope/api/_generated/traces/types/__init__.py +95 -0
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item.py +36 -0
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource.py +31 -0
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item.py +25 -0
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item_value.py +54 -0
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item_value_array_value.py +23 -0
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item_value_kvlist_value.py +28 -0
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item_value_kvlist_value_values_item.py +24 -0
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item.py +35 -0
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope.py +35 -0
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item.py +27 -0
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item_value.py +54 -0
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item_value_array_value.py +23 -0
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item_value_kvlist_value.py +28 -0
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item_value_kvlist_value_values_item.py +24 -0
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item.py +60 -0
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item.py +29 -0
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item_value.py +54 -0
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item_value_array_value.py +23 -0
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item_value_kvlist_value.py +28 -0
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item_value_kvlist_value_values_item.py +24 -0
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_status.py +24 -0
- mirascope/api/_generated/traces/types/traces_create_response.py +27 -0
- mirascope/api/_generated/traces/types/traces_create_response_partial_success.py +28 -0
- mirascope/api/_generated/types/__init__.py +37 -0
- mirascope/api/_generated/types/already_exists_error.py +24 -0
- mirascope/api/_generated/types/already_exists_error_tag.py +5 -0
- mirascope/api/_generated/types/database_error.py +24 -0
- mirascope/api/_generated/types/database_error_tag.py +5 -0
- mirascope/api/_generated/types/http_api_decode_error.py +29 -0
- mirascope/api/_generated/types/http_api_decode_error_tag.py +5 -0
- mirascope/api/_generated/types/issue.py +40 -0
- mirascope/api/_generated/types/issue_tag.py +17 -0
- mirascope/api/_generated/types/not_found_error_body.py +24 -0
- mirascope/api/_generated/types/not_found_error_tag.py +5 -0
- mirascope/api/_generated/types/permission_denied_error.py +24 -0
- mirascope/api/_generated/types/permission_denied_error_tag.py +7 -0
- mirascope/api/_generated/types/property_key.py +7 -0
- mirascope/api/_generated/types/property_key_key.py +27 -0
- mirascope/api/_generated/types/property_key_key_tag.py +5 -0
- mirascope/api/client.py +255 -0
- mirascope/api/settings.py +81 -0
- mirascope/llm/__init__.py +45 -11
- mirascope/llm/calls/calls.py +81 -57
- mirascope/llm/calls/decorator.py +121 -115
- mirascope/llm/content/__init__.py +3 -2
- mirascope/llm/context/_utils.py +19 -6
- mirascope/llm/exceptions.py +30 -16
- mirascope/llm/formatting/_utils.py +9 -5
- mirascope/llm/formatting/format.py +2 -2
- mirascope/llm/formatting/from_call_args.py +2 -2
- mirascope/llm/messages/message.py +13 -5
- mirascope/llm/models/__init__.py +2 -2
- mirascope/llm/models/models.py +189 -81
- mirascope/llm/prompts/__init__.py +13 -12
- mirascope/llm/prompts/_utils.py +27 -24
- mirascope/llm/prompts/decorator.py +133 -204
- mirascope/llm/prompts/prompts.py +424 -0
- mirascope/llm/prompts/protocols.py +25 -59
- mirascope/llm/providers/__init__.py +44 -0
- mirascope/llm/{clients → providers}/_missing_import_stubs.py +8 -6
- mirascope/llm/providers/anthropic/__init__.py +29 -0
- mirascope/llm/providers/anthropic/_utils/__init__.py +23 -0
- mirascope/llm/providers/anthropic/_utils/beta_decode.py +271 -0
- mirascope/llm/providers/anthropic/_utils/beta_encode.py +216 -0
- mirascope/llm/{clients → providers}/anthropic/_utils/decode.py +44 -11
- mirascope/llm/providers/anthropic/_utils/encode.py +356 -0
- mirascope/llm/providers/anthropic/beta_provider.py +322 -0
- mirascope/llm/providers/anthropic/model_id.py +23 -0
- mirascope/llm/providers/anthropic/model_info.py +87 -0
- mirascope/llm/providers/anthropic/provider.py +416 -0
- mirascope/llm/{clients → providers}/base/__init__.py +3 -3
- mirascope/llm/{clients → providers}/base/_utils.py +25 -8
- mirascope/llm/{clients/base/client.py → providers/base/base_provider.py} +255 -126
- mirascope/llm/providers/google/__init__.py +21 -0
- mirascope/llm/{clients → providers}/google/_utils/decode.py +61 -7
- mirascope/llm/{clients → providers}/google/_utils/encode.py +44 -30
- mirascope/llm/providers/google/model_id.py +22 -0
- mirascope/llm/providers/google/model_info.py +62 -0
- mirascope/llm/providers/google/provider.py +442 -0
- mirascope/llm/providers/load_provider.py +54 -0
- mirascope/llm/providers/mlx/__init__.py +24 -0
- mirascope/llm/providers/mlx/_utils.py +129 -0
- mirascope/llm/providers/mlx/encoding/__init__.py +8 -0
- mirascope/llm/providers/mlx/encoding/base.py +69 -0
- mirascope/llm/providers/mlx/encoding/transformers.py +147 -0
- mirascope/llm/providers/mlx/mlx.py +237 -0
- mirascope/llm/providers/mlx/model_id.py +17 -0
- mirascope/llm/providers/mlx/provider.py +415 -0
- mirascope/llm/providers/model_id.py +16 -0
- mirascope/llm/providers/ollama/__init__.py +19 -0
- mirascope/llm/providers/ollama/provider.py +71 -0
- mirascope/llm/providers/openai/__init__.py +6 -0
- mirascope/llm/providers/openai/completions/__init__.py +25 -0
- mirascope/llm/{clients → providers}/openai/completions/_utils/__init__.py +2 -0
- mirascope/llm/{clients → providers}/openai/completions/_utils/decode.py +60 -6
- mirascope/llm/{clients → providers}/openai/completions/_utils/encode.py +37 -26
- mirascope/llm/providers/openai/completions/base_provider.py +513 -0
- mirascope/llm/providers/openai/completions/provider.py +22 -0
- mirascope/llm/providers/openai/model_id.py +31 -0
- mirascope/llm/providers/openai/model_info.py +303 -0
- mirascope/llm/providers/openai/provider.py +398 -0
- mirascope/llm/providers/openai/responses/__init__.py +21 -0
- mirascope/llm/{clients → providers}/openai/responses/_utils/decode.py +59 -6
- mirascope/llm/{clients → providers}/openai/responses/_utils/encode.py +34 -23
- mirascope/llm/providers/openai/responses/provider.py +469 -0
- mirascope/llm/providers/provider_id.py +23 -0
- mirascope/llm/providers/provider_registry.py +169 -0
- mirascope/llm/providers/together/__init__.py +19 -0
- mirascope/llm/providers/together/provider.py +40 -0
- mirascope/llm/responses/__init__.py +3 -0
- mirascope/llm/responses/base_response.py +14 -5
- mirascope/llm/responses/base_stream_response.py +35 -6
- mirascope/llm/responses/finish_reason.py +1 -0
- mirascope/llm/responses/response.py +33 -13
- mirascope/llm/responses/root_response.py +12 -13
- mirascope/llm/responses/stream_response.py +35 -23
- mirascope/llm/responses/usage.py +95 -0
- mirascope/llm/tools/__init__.py +9 -2
- mirascope/llm/tools/_utils.py +12 -3
- mirascope/llm/tools/protocols.py +4 -4
- mirascope/llm/tools/tool_schema.py +44 -9
- mirascope/llm/tools/tools.py +10 -9
- mirascope/ops/__init__.py +156 -0
- mirascope/ops/_internal/__init__.py +5 -0
- mirascope/ops/_internal/closure.py +1118 -0
- mirascope/ops/_internal/configuration.py +126 -0
- mirascope/ops/_internal/context.py +76 -0
- mirascope/ops/_internal/exporters/__init__.py +26 -0
- mirascope/ops/_internal/exporters/exporters.py +342 -0
- mirascope/ops/_internal/exporters/processors.py +104 -0
- mirascope/ops/_internal/exporters/types.py +165 -0
- mirascope/ops/_internal/exporters/utils.py +29 -0
- mirascope/ops/_internal/instrumentation/__init__.py +8 -0
- mirascope/ops/_internal/instrumentation/llm/__init__.py +8 -0
- mirascope/ops/_internal/instrumentation/llm/encode.py +238 -0
- mirascope/ops/_internal/instrumentation/llm/gen_ai_types/__init__.py +38 -0
- mirascope/ops/_internal/instrumentation/llm/gen_ai_types/gen_ai_input_messages.py +31 -0
- mirascope/ops/_internal/instrumentation/llm/gen_ai_types/gen_ai_output_messages.py +38 -0
- mirascope/ops/_internal/instrumentation/llm/gen_ai_types/gen_ai_system_instructions.py +18 -0
- mirascope/ops/_internal/instrumentation/llm/gen_ai_types/shared.py +100 -0
- mirascope/ops/_internal/instrumentation/llm/llm.py +1288 -0
- mirascope/ops/_internal/propagation.py +198 -0
- mirascope/ops/_internal/protocols.py +51 -0
- mirascope/ops/_internal/session.py +139 -0
- mirascope/ops/_internal/spans.py +232 -0
- mirascope/ops/_internal/traced_calls.py +371 -0
- mirascope/ops/_internal/traced_functions.py +394 -0
- mirascope/ops/_internal/tracing.py +276 -0
- mirascope/ops/_internal/types.py +13 -0
- mirascope/ops/_internal/utils.py +75 -0
- mirascope/ops/_internal/versioned_calls.py +512 -0
- mirascope/ops/_internal/versioned_functions.py +346 -0
- mirascope/ops/_internal/versioning.py +303 -0
- mirascope/ops/exceptions.py +21 -0
- {mirascope-2.0.0a2.dist-info → mirascope-2.0.0a4.dist-info}/METADATA +78 -3
- mirascope-2.0.0a4.dist-info/RECORD +247 -0
- {mirascope-2.0.0a2.dist-info → mirascope-2.0.0a4.dist-info}/WHEEL +1 -1
- mirascope/graphs/__init__.py +0 -22
- mirascope/graphs/finite_state_machine.py +0 -625
- mirascope/llm/agents/__init__.py +0 -15
- mirascope/llm/agents/agent.py +0 -97
- mirascope/llm/agents/agent_template.py +0 -45
- mirascope/llm/agents/decorator.py +0 -176
- mirascope/llm/calls/base_call.py +0 -33
- mirascope/llm/clients/__init__.py +0 -34
- mirascope/llm/clients/anthropic/__init__.py +0 -25
- mirascope/llm/clients/anthropic/_utils/encode.py +0 -243
- mirascope/llm/clients/anthropic/clients.py +0 -819
- mirascope/llm/clients/anthropic/model_ids.py +0 -8
- mirascope/llm/clients/google/__init__.py +0 -20
- mirascope/llm/clients/google/clients.py +0 -853
- mirascope/llm/clients/google/model_ids.py +0 -15
- mirascope/llm/clients/openai/__init__.py +0 -25
- mirascope/llm/clients/openai/completions/__init__.py +0 -28
- mirascope/llm/clients/openai/completions/_utils/model_features.py +0 -81
- mirascope/llm/clients/openai/completions/clients.py +0 -833
- mirascope/llm/clients/openai/completions/model_ids.py +0 -8
- mirascope/llm/clients/openai/responses/__init__.py +0 -26
- mirascope/llm/clients/openai/responses/_utils/__init__.py +0 -13
- mirascope/llm/clients/openai/responses/_utils/model_features.py +0 -87
- mirascope/llm/clients/openai/responses/clients.py +0 -832
- mirascope/llm/clients/openai/responses/model_ids.py +0 -8
- mirascope/llm/clients/openai/shared/__init__.py +0 -7
- mirascope/llm/clients/openai/shared/_utils.py +0 -55
- mirascope/llm/clients/providers.py +0 -175
- mirascope-2.0.0a2.dist-info/RECORD +0 -102
- /mirascope/llm/{clients → providers}/base/kwargs.py +0 -0
- /mirascope/llm/{clients → providers}/base/params.py +0 -0
- /mirascope/llm/{clients/anthropic → providers/google}/_utils/__init__.py +0 -0
- /mirascope/llm/{clients → providers}/google/message.py +0 -0
- /mirascope/llm/{clients/google → providers/openai/responses}/_utils/__init__.py +0 -0
- {mirascope-2.0.0a2.dist-info → mirascope-2.0.0a4.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""OpenAI Completions API provider implementation."""
|
|
2
|
+
|
|
3
|
+
from ..model_id import model_name
|
|
4
|
+
from .base_provider import BaseOpenAICompletionsProvider
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class OpenAICompletionsProvider(BaseOpenAICompletionsProvider):
|
|
8
|
+
"""Provider for OpenAI's ChatCompletions API."""
|
|
9
|
+
|
|
10
|
+
id = "openai:completions"
|
|
11
|
+
default_scope = "openai/"
|
|
12
|
+
default_base_url = None
|
|
13
|
+
api_key_env_var = "OPENAI_API_KEY"
|
|
14
|
+
api_key_required = False
|
|
15
|
+
provider_name = "OpenAI"
|
|
16
|
+
|
|
17
|
+
def _provider_model_name(self, model_id: str) -> str:
|
|
18
|
+
"""Get the model name for tracking in Response.
|
|
19
|
+
|
|
20
|
+
Returns the model name with :completions suffix for tracking which API was used.
|
|
21
|
+
"""
|
|
22
|
+
return model_name(model_id, "completions")
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"""OpenAI model ids, and related utilities."""
|
|
2
|
+
|
|
3
|
+
from typing import Literal, TypeAlias, get_args
|
|
4
|
+
|
|
5
|
+
from .model_info import OpenAIKnownModels
|
|
6
|
+
|
|
7
|
+
OpenAIModelId = OpenAIKnownModels | str
|
|
8
|
+
"""Valid OpenAI model IDs including API-specific variants."""
|
|
9
|
+
|
|
10
|
+
OPENAI_KNOWN_MODELS: set[str] = set(get_args(OpenAIKnownModels))
|
|
11
|
+
|
|
12
|
+
ApiMode: TypeAlias = Literal["responses", "completions"]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def model_name(model_id: OpenAIModelId, api_mode: ApiMode | None) -> str:
|
|
16
|
+
"""Extract the openai model name from the ModelId
|
|
17
|
+
|
|
18
|
+
Args:
|
|
19
|
+
model_id: Full model ID (e.g. "openai/gpt-4o")
|
|
20
|
+
api_mode: API mode to append as suffix ("responses" or "completions").
|
|
21
|
+
If None, no suffix will be added (just the base model name).
|
|
22
|
+
|
|
23
|
+
Returns:
|
|
24
|
+
Provider-specific model ID with API suffix (e.g. "gpt-4o:responses")
|
|
25
|
+
"""
|
|
26
|
+
base_name = (
|
|
27
|
+
model_id.split("/")[1].removesuffix(":responses").removesuffix(":completions")
|
|
28
|
+
)
|
|
29
|
+
if api_mode is None:
|
|
30
|
+
return base_name
|
|
31
|
+
return f"{base_name}:{api_mode}"
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
"""OpenAI model information.
|
|
2
|
+
|
|
3
|
+
This file is auto-generated by scripts/model_features/codegen_openai.py
|
|
4
|
+
Do not edit manually - run the codegen script to update."""
|
|
5
|
+
|
|
6
|
+
from typing import Literal
|
|
7
|
+
|
|
8
|
+
OpenAIKnownModels = Literal[
|
|
9
|
+
"openai/chatgpt-4o-latest",
|
|
10
|
+
"openai/chatgpt-4o-latest:completions",
|
|
11
|
+
"openai/chatgpt-4o-latest:responses",
|
|
12
|
+
"openai/codex-mini-latest",
|
|
13
|
+
"openai/codex-mini-latest:responses",
|
|
14
|
+
"openai/gpt-3.5-turbo",
|
|
15
|
+
"openai/gpt-3.5-turbo:completions",
|
|
16
|
+
"openai/gpt-3.5-turbo:responses",
|
|
17
|
+
"openai/gpt-3.5-turbo-0125",
|
|
18
|
+
"openai/gpt-3.5-turbo-0125:completions",
|
|
19
|
+
"openai/gpt-3.5-turbo-0125:responses",
|
|
20
|
+
"openai/gpt-3.5-turbo-1106",
|
|
21
|
+
"openai/gpt-3.5-turbo-1106:completions",
|
|
22
|
+
"openai/gpt-3.5-turbo-1106:responses",
|
|
23
|
+
"openai/gpt-3.5-turbo-16k",
|
|
24
|
+
"openai/gpt-3.5-turbo-16k:completions",
|
|
25
|
+
"openai/gpt-4",
|
|
26
|
+
"openai/gpt-4:completions",
|
|
27
|
+
"openai/gpt-4:responses",
|
|
28
|
+
"openai/gpt-4-0125-preview",
|
|
29
|
+
"openai/gpt-4-0125-preview:completions",
|
|
30
|
+
"openai/gpt-4-0125-preview:responses",
|
|
31
|
+
"openai/gpt-4-0613",
|
|
32
|
+
"openai/gpt-4-0613:completions",
|
|
33
|
+
"openai/gpt-4-0613:responses",
|
|
34
|
+
"openai/gpt-4-1106-preview",
|
|
35
|
+
"openai/gpt-4-1106-preview:completions",
|
|
36
|
+
"openai/gpt-4-1106-preview:responses",
|
|
37
|
+
"openai/gpt-4-turbo",
|
|
38
|
+
"openai/gpt-4-turbo:completions",
|
|
39
|
+
"openai/gpt-4-turbo:responses",
|
|
40
|
+
"openai/gpt-4-turbo-2024-04-09",
|
|
41
|
+
"openai/gpt-4-turbo-2024-04-09:completions",
|
|
42
|
+
"openai/gpt-4-turbo-2024-04-09:responses",
|
|
43
|
+
"openai/gpt-4-turbo-preview",
|
|
44
|
+
"openai/gpt-4-turbo-preview:completions",
|
|
45
|
+
"openai/gpt-4-turbo-preview:responses",
|
|
46
|
+
"openai/gpt-4.1",
|
|
47
|
+
"openai/gpt-4.1:completions",
|
|
48
|
+
"openai/gpt-4.1:responses",
|
|
49
|
+
"openai/gpt-4.1-2025-04-14",
|
|
50
|
+
"openai/gpt-4.1-2025-04-14:completions",
|
|
51
|
+
"openai/gpt-4.1-2025-04-14:responses",
|
|
52
|
+
"openai/gpt-4.1-mini",
|
|
53
|
+
"openai/gpt-4.1-mini:completions",
|
|
54
|
+
"openai/gpt-4.1-mini:responses",
|
|
55
|
+
"openai/gpt-4.1-mini-2025-04-14",
|
|
56
|
+
"openai/gpt-4.1-mini-2025-04-14:completions",
|
|
57
|
+
"openai/gpt-4.1-mini-2025-04-14:responses",
|
|
58
|
+
"openai/gpt-4.1-nano",
|
|
59
|
+
"openai/gpt-4.1-nano:completions",
|
|
60
|
+
"openai/gpt-4.1-nano:responses",
|
|
61
|
+
"openai/gpt-4.1-nano-2025-04-14",
|
|
62
|
+
"openai/gpt-4.1-nano-2025-04-14:completions",
|
|
63
|
+
"openai/gpt-4.1-nano-2025-04-14:responses",
|
|
64
|
+
"openai/gpt-4o",
|
|
65
|
+
"openai/gpt-4o:completions",
|
|
66
|
+
"openai/gpt-4o:responses",
|
|
67
|
+
"openai/gpt-4o-2024-05-13",
|
|
68
|
+
"openai/gpt-4o-2024-05-13:completions",
|
|
69
|
+
"openai/gpt-4o-2024-05-13:responses",
|
|
70
|
+
"openai/gpt-4o-2024-08-06",
|
|
71
|
+
"openai/gpt-4o-2024-08-06:completions",
|
|
72
|
+
"openai/gpt-4o-2024-08-06:responses",
|
|
73
|
+
"openai/gpt-4o-2024-11-20",
|
|
74
|
+
"openai/gpt-4o-2024-11-20:completions",
|
|
75
|
+
"openai/gpt-4o-2024-11-20:responses",
|
|
76
|
+
"openai/gpt-4o-mini",
|
|
77
|
+
"openai/gpt-4o-mini:completions",
|
|
78
|
+
"openai/gpt-4o-mini:responses",
|
|
79
|
+
"openai/gpt-4o-mini-2024-07-18",
|
|
80
|
+
"openai/gpt-4o-mini-2024-07-18:completions",
|
|
81
|
+
"openai/gpt-4o-mini-2024-07-18:responses",
|
|
82
|
+
"openai/gpt-4o-mini-search-preview",
|
|
83
|
+
"openai/gpt-4o-mini-search-preview:completions",
|
|
84
|
+
"openai/gpt-4o-mini-search-preview-2025-03-11",
|
|
85
|
+
"openai/gpt-4o-mini-search-preview-2025-03-11:completions",
|
|
86
|
+
"openai/gpt-4o-search-preview",
|
|
87
|
+
"openai/gpt-4o-search-preview:completions",
|
|
88
|
+
"openai/gpt-4o-search-preview-2025-03-11",
|
|
89
|
+
"openai/gpt-4o-search-preview-2025-03-11:completions",
|
|
90
|
+
"openai/gpt-5",
|
|
91
|
+
"openai/gpt-5:completions",
|
|
92
|
+
"openai/gpt-5:responses",
|
|
93
|
+
"openai/gpt-5-2025-08-07",
|
|
94
|
+
"openai/gpt-5-2025-08-07:completions",
|
|
95
|
+
"openai/gpt-5-2025-08-07:responses",
|
|
96
|
+
"openai/gpt-5-chat-latest",
|
|
97
|
+
"openai/gpt-5-chat-latest:completions",
|
|
98
|
+
"openai/gpt-5-chat-latest:responses",
|
|
99
|
+
"openai/gpt-5-codex",
|
|
100
|
+
"openai/gpt-5-codex:responses",
|
|
101
|
+
"openai/gpt-5-mini",
|
|
102
|
+
"openai/gpt-5-mini:completions",
|
|
103
|
+
"openai/gpt-5-mini:responses",
|
|
104
|
+
"openai/gpt-5-mini-2025-08-07",
|
|
105
|
+
"openai/gpt-5-mini-2025-08-07:completions",
|
|
106
|
+
"openai/gpt-5-mini-2025-08-07:responses",
|
|
107
|
+
"openai/gpt-5-nano",
|
|
108
|
+
"openai/gpt-5-nano:completions",
|
|
109
|
+
"openai/gpt-5-nano:responses",
|
|
110
|
+
"openai/gpt-5-nano-2025-08-07",
|
|
111
|
+
"openai/gpt-5-nano-2025-08-07:completions",
|
|
112
|
+
"openai/gpt-5-nano-2025-08-07:responses",
|
|
113
|
+
"openai/gpt-5-pro",
|
|
114
|
+
"openai/gpt-5-pro:responses",
|
|
115
|
+
"openai/gpt-5-pro-2025-10-06",
|
|
116
|
+
"openai/gpt-5-pro-2025-10-06:responses",
|
|
117
|
+
"openai/gpt-5-search-api",
|
|
118
|
+
"openai/gpt-5-search-api:completions",
|
|
119
|
+
"openai/gpt-5-search-api-2025-10-14",
|
|
120
|
+
"openai/gpt-5-search-api-2025-10-14:completions",
|
|
121
|
+
"openai/gpt-5.1",
|
|
122
|
+
"openai/gpt-5.1:responses",
|
|
123
|
+
"openai/gpt-5.1-2025-11-13",
|
|
124
|
+
"openai/gpt-5.1-2025-11-13:responses",
|
|
125
|
+
"openai/gpt-5.1-chat-latest",
|
|
126
|
+
"openai/gpt-5.1-chat-latest:completions",
|
|
127
|
+
"openai/gpt-5.1-chat-latest:responses",
|
|
128
|
+
"openai/gpt-5.1-codex",
|
|
129
|
+
"openai/gpt-5.1-codex:responses",
|
|
130
|
+
"openai/gpt-5.1-codex-max",
|
|
131
|
+
"openai/gpt-5.1-codex-max:responses",
|
|
132
|
+
"openai/gpt-5.1-codex-mini",
|
|
133
|
+
"openai/gpt-5.1-codex-mini:responses",
|
|
134
|
+
"openai/gpt-5.2",
|
|
135
|
+
"openai/gpt-5.2:completions",
|
|
136
|
+
"openai/gpt-5.2:responses",
|
|
137
|
+
"openai/gpt-5.2-2025-12-11",
|
|
138
|
+
"openai/gpt-5.2-2025-12-11:completions",
|
|
139
|
+
"openai/gpt-5.2-2025-12-11:responses",
|
|
140
|
+
"openai/gpt-5.2-chat-latest",
|
|
141
|
+
"openai/gpt-5.2-chat-latest:completions",
|
|
142
|
+
"openai/gpt-5.2-chat-latest:responses",
|
|
143
|
+
"openai/gpt-5.2-pro",
|
|
144
|
+
"openai/gpt-5.2-pro:responses",
|
|
145
|
+
"openai/gpt-5.2-pro-2025-12-11",
|
|
146
|
+
"openai/gpt-5.2-pro-2025-12-11:responses",
|
|
147
|
+
"openai/o1",
|
|
148
|
+
"openai/o1:completions",
|
|
149
|
+
"openai/o1:responses",
|
|
150
|
+
"openai/o1-2024-12-17",
|
|
151
|
+
"openai/o1-2024-12-17:completions",
|
|
152
|
+
"openai/o1-2024-12-17:responses",
|
|
153
|
+
"openai/o1-pro",
|
|
154
|
+
"openai/o1-pro:responses",
|
|
155
|
+
"openai/o1-pro-2025-03-19",
|
|
156
|
+
"openai/o1-pro-2025-03-19:responses",
|
|
157
|
+
"openai/o3",
|
|
158
|
+
"openai/o3:completions",
|
|
159
|
+
"openai/o3:responses",
|
|
160
|
+
"openai/o3-2025-04-16",
|
|
161
|
+
"openai/o3-2025-04-16:completions",
|
|
162
|
+
"openai/o3-2025-04-16:responses",
|
|
163
|
+
"openai/o3-mini",
|
|
164
|
+
"openai/o3-mini:completions",
|
|
165
|
+
"openai/o3-mini:responses",
|
|
166
|
+
"openai/o3-mini-2025-01-31",
|
|
167
|
+
"openai/o3-mini-2025-01-31:completions",
|
|
168
|
+
"openai/o3-mini-2025-01-31:responses",
|
|
169
|
+
"openai/o3-pro",
|
|
170
|
+
"openai/o3-pro:responses",
|
|
171
|
+
"openai/o3-pro-2025-06-10",
|
|
172
|
+
"openai/o3-pro-2025-06-10:responses",
|
|
173
|
+
"openai/o4-mini",
|
|
174
|
+
"openai/o4-mini:completions",
|
|
175
|
+
"openai/o4-mini:responses",
|
|
176
|
+
"openai/o4-mini-2025-04-16",
|
|
177
|
+
"openai/o4-mini-2025-04-16:completions",
|
|
178
|
+
"openai/o4-mini-2025-04-16:responses",
|
|
179
|
+
]
|
|
180
|
+
"""Valid OpenAI model IDs including API-specific variants."""
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
MODELS_WITHOUT_AUDIO_SUPPORT: set[str] = {
|
|
184
|
+
"chatgpt-4o-latest",
|
|
185
|
+
"gpt-3.5-turbo",
|
|
186
|
+
"gpt-3.5-turbo-0125",
|
|
187
|
+
"gpt-3.5-turbo-1106",
|
|
188
|
+
"gpt-3.5-turbo-16k",
|
|
189
|
+
"gpt-4",
|
|
190
|
+
"gpt-4-0125-preview",
|
|
191
|
+
"gpt-4-0613",
|
|
192
|
+
"gpt-4-1106-preview",
|
|
193
|
+
"gpt-4-turbo",
|
|
194
|
+
"gpt-4-turbo-2024-04-09",
|
|
195
|
+
"gpt-4-turbo-preview",
|
|
196
|
+
"gpt-4.1",
|
|
197
|
+
"gpt-4.1-2025-04-14",
|
|
198
|
+
"gpt-4.1-mini",
|
|
199
|
+
"gpt-4.1-mini-2025-04-14",
|
|
200
|
+
"gpt-4.1-nano",
|
|
201
|
+
"gpt-4.1-nano-2025-04-14",
|
|
202
|
+
"gpt-4o",
|
|
203
|
+
"gpt-4o-2024-05-13",
|
|
204
|
+
"gpt-4o-2024-08-06",
|
|
205
|
+
"gpt-4o-2024-11-20",
|
|
206
|
+
"gpt-4o-mini",
|
|
207
|
+
"gpt-4o-mini-2024-07-18",
|
|
208
|
+
"gpt-4o-mini-search-preview",
|
|
209
|
+
"gpt-4o-mini-search-preview-2025-03-11",
|
|
210
|
+
"gpt-4o-search-preview",
|
|
211
|
+
"gpt-4o-search-preview-2025-03-11",
|
|
212
|
+
"gpt-5",
|
|
213
|
+
"gpt-5-2025-08-07",
|
|
214
|
+
"gpt-5-chat-latest",
|
|
215
|
+
"gpt-5-mini",
|
|
216
|
+
"gpt-5-mini-2025-08-07",
|
|
217
|
+
"gpt-5-nano",
|
|
218
|
+
"gpt-5-nano-2025-08-07",
|
|
219
|
+
"gpt-5-search-api",
|
|
220
|
+
"gpt-5-search-api-2025-10-14",
|
|
221
|
+
"gpt-5.1-chat-latest",
|
|
222
|
+
"gpt-5.2",
|
|
223
|
+
"gpt-5.2-2025-12-11",
|
|
224
|
+
"gpt-5.2-chat-latest",
|
|
225
|
+
"o1",
|
|
226
|
+
"o1-2024-12-17",
|
|
227
|
+
"o3",
|
|
228
|
+
"o3-2025-04-16",
|
|
229
|
+
"o3-mini",
|
|
230
|
+
"o3-mini-2025-01-31",
|
|
231
|
+
"o4-mini",
|
|
232
|
+
"o4-mini-2025-04-16",
|
|
233
|
+
}
|
|
234
|
+
"""Models that do not support audio inputs.
|
|
235
|
+
|
|
236
|
+
Models not in this set are assumed to support audio (optimistic default).
|
|
237
|
+
"""
|
|
238
|
+
|
|
239
|
+
NON_REASONING_MODELS: set[str] = {
|
|
240
|
+
"chatgpt-4o-latest",
|
|
241
|
+
"gpt-3.5-turbo",
|
|
242
|
+
"gpt-3.5-turbo-0125",
|
|
243
|
+
"gpt-3.5-turbo-1106",
|
|
244
|
+
"gpt-4",
|
|
245
|
+
"gpt-4-0125-preview",
|
|
246
|
+
"gpt-4-0613",
|
|
247
|
+
"gpt-4-1106-preview",
|
|
248
|
+
"gpt-4-turbo",
|
|
249
|
+
"gpt-4-turbo-2024-04-09",
|
|
250
|
+
"gpt-4-turbo-preview",
|
|
251
|
+
"gpt-4.1",
|
|
252
|
+
"gpt-4.1-2025-04-14",
|
|
253
|
+
"gpt-4.1-mini",
|
|
254
|
+
"gpt-4.1-mini-2025-04-14",
|
|
255
|
+
"gpt-4.1-nano",
|
|
256
|
+
"gpt-4.1-nano-2025-04-14",
|
|
257
|
+
"gpt-4o",
|
|
258
|
+
"gpt-4o-2024-05-13",
|
|
259
|
+
"gpt-4o-2024-08-06",
|
|
260
|
+
"gpt-4o-2024-11-20",
|
|
261
|
+
"gpt-4o-mini",
|
|
262
|
+
"gpt-4o-mini-2024-07-18",
|
|
263
|
+
"gpt-5-chat-latest",
|
|
264
|
+
}
|
|
265
|
+
"""Models that do not support the reasoning parameter.
|
|
266
|
+
|
|
267
|
+
Models not in this set are assumed to support reasoning (optimistic default).
|
|
268
|
+
"""
|
|
269
|
+
|
|
270
|
+
MODELS_WITHOUT_JSON_SCHEMA_SUPPORT: set[str] = {
|
|
271
|
+
"chatgpt-4o-latest",
|
|
272
|
+
"gpt-3.5-turbo",
|
|
273
|
+
"gpt-3.5-turbo-0125",
|
|
274
|
+
"gpt-3.5-turbo-1106",
|
|
275
|
+
"gpt-3.5-turbo-16k",
|
|
276
|
+
"gpt-4",
|
|
277
|
+
"gpt-4-0125-preview",
|
|
278
|
+
"gpt-4-0613",
|
|
279
|
+
"gpt-4-1106-preview",
|
|
280
|
+
"gpt-4-turbo",
|
|
281
|
+
"gpt-4-turbo-2024-04-09",
|
|
282
|
+
"gpt-4-turbo-preview",
|
|
283
|
+
"gpt-4o-2024-05-13",
|
|
284
|
+
}
|
|
285
|
+
"""Models that do not support JSON schema (structured outputs).
|
|
286
|
+
|
|
287
|
+
Models not in this set are assumed to support JSON schema (optimistic default).
|
|
288
|
+
"""
|
|
289
|
+
|
|
290
|
+
MODELS_WITHOUT_JSON_OBJECT_SUPPORT: set[str] = {
|
|
291
|
+
"gpt-4",
|
|
292
|
+
"gpt-4-0613",
|
|
293
|
+
"gpt-4o-mini-search-preview",
|
|
294
|
+
"gpt-4o-mini-search-preview-2025-03-11",
|
|
295
|
+
"gpt-4o-search-preview",
|
|
296
|
+
"gpt-4o-search-preview-2025-03-11",
|
|
297
|
+
"gpt-5-search-api",
|
|
298
|
+
"gpt-5-search-api-2025-10-14",
|
|
299
|
+
}
|
|
300
|
+
"""Models that do not support JSON object mode.
|
|
301
|
+
|
|
302
|
+
Models not in this set are assumed to support JSON object mode (optimistic default).
|
|
303
|
+
"""
|