mirascope 2.0.0a6__py3-none-any.whl → 2.0.1__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/api/_generated/__init__.py +186 -5
- mirascope/api/_generated/annotations/client.py +38 -6
- mirascope/api/_generated/annotations/raw_client.py +366 -47
- mirascope/api/_generated/annotations/types/annotations_create_response.py +19 -6
- mirascope/api/_generated/annotations/types/annotations_get_response.py +19 -6
- mirascope/api/_generated/annotations/types/annotations_list_response_annotations_item.py +22 -7
- mirascope/api/_generated/annotations/types/annotations_update_response.py +19 -6
- mirascope/api/_generated/api_keys/__init__.py +12 -2
- mirascope/api/_generated/api_keys/client.py +107 -6
- mirascope/api/_generated/api_keys/raw_client.py +486 -38
- mirascope/api/_generated/api_keys/types/__init__.py +7 -1
- mirascope/api/_generated/api_keys/types/api_keys_list_all_for_org_response_item.py +40 -0
- mirascope/api/_generated/client.py +36 -0
- mirascope/api/_generated/docs/raw_client.py +71 -9
- mirascope/api/_generated/environment.py +3 -3
- mirascope/api/_generated/environments/__init__.py +6 -0
- mirascope/api/_generated/environments/client.py +158 -9
- mirascope/api/_generated/environments/raw_client.py +620 -52
- mirascope/api/_generated/environments/types/__init__.py +10 -0
- mirascope/api/_generated/environments/types/environments_get_analytics_response.py +60 -0
- mirascope/api/_generated/environments/types/environments_get_analytics_response_top_functions_item.py +24 -0
- mirascope/api/_generated/{organizations/types/organizations_credits_response.py → environments/types/environments_get_analytics_response_top_models_item.py} +6 -3
- mirascope/api/_generated/errors/__init__.py +6 -0
- mirascope/api/_generated/errors/bad_request_error.py +5 -2
- mirascope/api/_generated/errors/conflict_error.py +5 -2
- mirascope/api/_generated/errors/payment_required_error.py +15 -0
- mirascope/api/_generated/errors/service_unavailable_error.py +14 -0
- mirascope/api/_generated/errors/too_many_requests_error.py +15 -0
- mirascope/api/_generated/functions/__init__.py +10 -0
- mirascope/api/_generated/functions/client.py +222 -8
- mirascope/api/_generated/functions/raw_client.py +975 -134
- mirascope/api/_generated/functions/types/__init__.py +28 -4
- mirascope/api/_generated/functions/types/functions_get_by_env_response.py +53 -0
- mirascope/api/_generated/functions/types/functions_get_by_env_response_dependencies_value.py +22 -0
- mirascope/api/_generated/functions/types/functions_list_by_env_response.py +25 -0
- mirascope/api/_generated/functions/types/functions_list_by_env_response_functions_item.py +56 -0
- mirascope/api/_generated/functions/types/functions_list_by_env_response_functions_item_dependencies_value.py +22 -0
- mirascope/api/_generated/health/raw_client.py +74 -10
- mirascope/api/_generated/organization_invitations/__init__.py +33 -0
- mirascope/api/_generated/organization_invitations/client.py +546 -0
- mirascope/api/_generated/organization_invitations/raw_client.py +1519 -0
- mirascope/api/_generated/organization_invitations/types/__init__.py +53 -0
- mirascope/api/_generated/organization_invitations/types/organization_invitations_accept_response.py +34 -0
- mirascope/api/_generated/organization_invitations/types/organization_invitations_accept_response_role.py +7 -0
- mirascope/api/_generated/organization_invitations/types/organization_invitations_create_request_role.py +7 -0
- mirascope/api/_generated/organization_invitations/types/organization_invitations_create_response.py +48 -0
- mirascope/api/_generated/organization_invitations/types/organization_invitations_create_response_role.py +7 -0
- mirascope/api/_generated/organization_invitations/types/organization_invitations_create_response_status.py +7 -0
- mirascope/api/_generated/organization_invitations/types/organization_invitations_get_response.py +48 -0
- mirascope/api/_generated/organization_invitations/types/organization_invitations_get_response_role.py +7 -0
- mirascope/api/_generated/organization_invitations/types/organization_invitations_get_response_status.py +7 -0
- mirascope/api/_generated/organization_invitations/types/organization_invitations_list_response_item.py +48 -0
- mirascope/api/_generated/organization_invitations/types/organization_invitations_list_response_item_role.py +7 -0
- mirascope/api/_generated/organization_invitations/types/organization_invitations_list_response_item_status.py +7 -0
- mirascope/api/_generated/organization_memberships/__init__.py +19 -0
- mirascope/api/_generated/organization_memberships/client.py +302 -0
- mirascope/api/_generated/organization_memberships/raw_client.py +736 -0
- mirascope/api/_generated/organization_memberships/types/__init__.py +27 -0
- mirascope/api/_generated/organization_memberships/types/organization_memberships_list_response_item.py +33 -0
- mirascope/api/_generated/organization_memberships/types/organization_memberships_list_response_item_role.py +7 -0
- mirascope/api/_generated/organization_memberships/types/organization_memberships_update_request_role.py +7 -0
- mirascope/api/_generated/organization_memberships/types/organization_memberships_update_response.py +31 -0
- mirascope/api/_generated/organization_memberships/types/organization_memberships_update_response_role.py +7 -0
- mirascope/api/_generated/organizations/__init__.py +26 -2
- mirascope/api/_generated/organizations/client.py +442 -20
- mirascope/api/_generated/organizations/raw_client.py +1763 -164
- mirascope/api/_generated/organizations/types/__init__.py +48 -2
- mirascope/api/_generated/organizations/types/organizations_create_payment_intent_response.py +24 -0
- mirascope/api/_generated/organizations/types/organizations_preview_subscription_change_request_target_plan.py +7 -0
- mirascope/api/_generated/organizations/types/organizations_preview_subscription_change_response.py +47 -0
- mirascope/api/_generated/organizations/types/organizations_preview_subscription_change_response_validation_errors_item.py +33 -0
- mirascope/api/_generated/organizations/types/organizations_preview_subscription_change_response_validation_errors_item_resource.py +7 -0
- mirascope/api/_generated/organizations/types/organizations_router_balance_response.py +24 -0
- mirascope/api/_generated/organizations/types/organizations_subscription_response.py +53 -0
- mirascope/api/_generated/organizations/types/organizations_subscription_response_current_plan.py +7 -0
- mirascope/api/_generated/organizations/types/organizations_subscription_response_payment_method.py +26 -0
- mirascope/api/_generated/organizations/types/organizations_subscription_response_scheduled_change.py +34 -0
- mirascope/api/_generated/organizations/types/organizations_subscription_response_scheduled_change_target_plan.py +7 -0
- mirascope/api/_generated/organizations/types/organizations_update_subscription_request_target_plan.py +7 -0
- mirascope/api/_generated/organizations/types/organizations_update_subscription_response.py +35 -0
- mirascope/api/_generated/project_memberships/__init__.py +25 -0
- mirascope/api/_generated/project_memberships/client.py +437 -0
- mirascope/api/_generated/project_memberships/raw_client.py +1039 -0
- mirascope/api/_generated/project_memberships/types/__init__.py +29 -0
- mirascope/api/_generated/project_memberships/types/project_memberships_create_request_role.py +7 -0
- mirascope/api/_generated/project_memberships/types/project_memberships_create_response.py +35 -0
- mirascope/api/_generated/project_memberships/types/project_memberships_create_response_role.py +7 -0
- mirascope/api/_generated/project_memberships/types/project_memberships_list_response_item.py +33 -0
- mirascope/api/_generated/project_memberships/types/project_memberships_list_response_item_role.py +7 -0
- mirascope/api/_generated/project_memberships/types/project_memberships_update_request_role.py +7 -0
- mirascope/api/_generated/project_memberships/types/project_memberships_update_response.py +35 -0
- mirascope/api/_generated/project_memberships/types/project_memberships_update_response_role.py +7 -0
- mirascope/api/_generated/projects/raw_client.py +415 -58
- mirascope/api/_generated/reference.md +2767 -397
- mirascope/api/_generated/tags/__init__.py +19 -0
- mirascope/api/_generated/tags/client.py +504 -0
- mirascope/api/_generated/tags/raw_client.py +1288 -0
- mirascope/api/_generated/tags/types/__init__.py +17 -0
- mirascope/api/_generated/tags/types/tags_create_response.py +41 -0
- mirascope/api/_generated/tags/types/tags_get_response.py +41 -0
- mirascope/api/_generated/tags/types/tags_list_response.py +23 -0
- mirascope/api/_generated/tags/types/tags_list_response_tags_item.py +41 -0
- mirascope/api/_generated/tags/types/tags_update_response.py +41 -0
- mirascope/api/_generated/token_cost/__init__.py +7 -0
- mirascope/api/_generated/token_cost/client.py +160 -0
- mirascope/api/_generated/token_cost/raw_client.py +264 -0
- mirascope/api/_generated/token_cost/types/__init__.py +8 -0
- mirascope/api/_generated/token_cost/types/token_cost_calculate_request_usage.py +54 -0
- mirascope/api/_generated/token_cost/types/token_cost_calculate_response.py +52 -0
- mirascope/api/_generated/traces/__init__.py +20 -0
- mirascope/api/_generated/traces/client.py +543 -0
- mirascope/api/_generated/traces/raw_client.py +1366 -96
- mirascope/api/_generated/traces/types/__init__.py +28 -0
- mirascope/api/_generated/traces/types/traces_get_analytics_summary_response.py +6 -0
- mirascope/api/_generated/traces/types/traces_get_trace_detail_by_env_response.py +33 -0
- mirascope/api/_generated/traces/types/traces_get_trace_detail_by_env_response_spans_item.py +88 -0
- mirascope/api/_generated/traces/types/traces_get_trace_detail_response_spans_item.py +0 -2
- mirascope/api/_generated/traces/types/traces_list_by_function_hash_response.py +25 -0
- mirascope/api/_generated/traces/types/traces_list_by_function_hash_response_traces_item.py +44 -0
- mirascope/api/_generated/traces/types/traces_search_by_env_request_attribute_filters_item.py +26 -0
- mirascope/api/_generated/traces/types/traces_search_by_env_request_attribute_filters_item_operator.py +7 -0
- mirascope/api/_generated/traces/types/traces_search_by_env_request_sort_by.py +7 -0
- mirascope/api/_generated/traces/types/traces_search_by_env_request_sort_order.py +7 -0
- mirascope/api/_generated/traces/types/traces_search_by_env_response.py +26 -0
- mirascope/api/_generated/traces/types/traces_search_by_env_response_spans_item.py +50 -0
- mirascope/api/_generated/traces/types/traces_search_response_spans_item.py +10 -1
- mirascope/api/_generated/types/__init__.py +32 -2
- mirascope/api/_generated/types/bad_request_error_body.py +50 -0
- mirascope/api/_generated/types/date.py +3 -0
- mirascope/api/_generated/types/immutable_resource_error.py +22 -0
- mirascope/api/_generated/types/internal_server_error_body.py +3 -3
- mirascope/api/_generated/types/plan_limit_exceeded_error.py +32 -0
- mirascope/api/_generated/types/plan_limit_exceeded_error_tag.py +7 -0
- mirascope/api/_generated/types/pricing_unavailable_error.py +23 -0
- mirascope/api/_generated/types/rate_limit_error.py +31 -0
- mirascope/api/_generated/types/rate_limit_error_tag.py +5 -0
- mirascope/api/_generated/types/service_unavailable_error_body.py +24 -0
- mirascope/api/_generated/types/service_unavailable_error_tag.py +7 -0
- mirascope/api/_generated/types/subscription_past_due_error.py +31 -0
- mirascope/api/_generated/types/subscription_past_due_error_tag.py +7 -0
- mirascope/api/settings.py +19 -1
- mirascope/llm/__init__.py +53 -10
- mirascope/llm/calls/__init__.py +2 -1
- mirascope/llm/calls/calls.py +3 -1
- mirascope/llm/calls/decorator.py +21 -7
- mirascope/llm/content/tool_output.py +22 -5
- mirascope/llm/exceptions.py +284 -71
- mirascope/llm/formatting/__init__.py +17 -0
- mirascope/llm/formatting/format.py +112 -35
- mirascope/llm/formatting/output_parser.py +178 -0
- mirascope/llm/formatting/partial.py +80 -7
- mirascope/llm/formatting/primitives.py +192 -0
- mirascope/llm/formatting/types.py +20 -8
- mirascope/llm/messages/__init__.py +3 -0
- mirascope/llm/messages/_utils.py +34 -0
- mirascope/llm/models/__init__.py +5 -0
- mirascope/llm/models/models.py +137 -69
- mirascope/llm/{providers/base → models}/params.py +7 -57
- mirascope/llm/models/thinking_config.py +61 -0
- mirascope/llm/prompts/_utils.py +0 -32
- mirascope/llm/prompts/decorator.py +16 -5
- mirascope/llm/prompts/prompts.py +131 -68
- mirascope/llm/providers/__init__.py +1 -4
- mirascope/llm/providers/anthropic/_utils/__init__.py +2 -0
- mirascope/llm/providers/anthropic/_utils/beta_decode.py +18 -9
- mirascope/llm/providers/anthropic/_utils/beta_encode.py +62 -13
- mirascope/llm/providers/anthropic/_utils/decode.py +18 -9
- mirascope/llm/providers/anthropic/_utils/encode.py +26 -7
- mirascope/llm/providers/anthropic/_utils/errors.py +2 -2
- mirascope/llm/providers/anthropic/beta_provider.py +64 -18
- mirascope/llm/providers/anthropic/provider.py +91 -33
- mirascope/llm/providers/base/__init__.py +0 -4
- mirascope/llm/providers/base/_utils.py +55 -6
- mirascope/llm/providers/base/base_provider.py +116 -37
- mirascope/llm/providers/google/_utils/__init__.py +2 -0
- mirascope/llm/providers/google/_utils/decode.py +20 -7
- mirascope/llm/providers/google/_utils/encode.py +26 -7
- mirascope/llm/providers/google/_utils/errors.py +3 -2
- mirascope/llm/providers/google/provider.py +64 -18
- mirascope/llm/providers/mirascope/_utils.py +13 -17
- mirascope/llm/providers/mirascope/provider.py +49 -18
- mirascope/llm/providers/mlx/_utils.py +7 -2
- mirascope/llm/providers/mlx/encoding/base.py +5 -2
- mirascope/llm/providers/mlx/encoding/transformers.py +5 -2
- mirascope/llm/providers/mlx/mlx.py +23 -6
- mirascope/llm/providers/mlx/provider.py +42 -13
- mirascope/llm/providers/openai/_utils/errors.py +2 -2
- mirascope/llm/providers/openai/completions/_utils/encode.py +20 -16
- mirascope/llm/providers/openai/completions/base_provider.py +40 -11
- mirascope/llm/providers/openai/provider.py +40 -10
- mirascope/llm/providers/openai/responses/_utils/__init__.py +2 -0
- mirascope/llm/providers/openai/responses/_utils/decode.py +19 -6
- mirascope/llm/providers/openai/responses/_utils/encode.py +22 -10
- mirascope/llm/providers/openai/responses/provider.py +56 -18
- mirascope/llm/providers/provider_registry.py +93 -19
- mirascope/llm/responses/__init__.py +6 -1
- mirascope/llm/responses/_utils.py +102 -12
- mirascope/llm/responses/base_response.py +5 -2
- mirascope/llm/responses/base_stream_response.py +115 -25
- mirascope/llm/responses/response.py +2 -1
- mirascope/llm/responses/root_response.py +89 -17
- mirascope/llm/responses/stream_response.py +6 -9
- mirascope/llm/tools/decorator.py +9 -4
- mirascope/llm/tools/tool_schema.py +12 -6
- mirascope/llm/tools/toolkit.py +35 -27
- mirascope/llm/tools/tools.py +45 -20
- mirascope/ops/__init__.py +4 -0
- mirascope/ops/_internal/configuration.py +82 -31
- mirascope/ops/_internal/exporters/exporters.py +64 -11
- mirascope/ops/_internal/instrumentation/llm/common.py +530 -0
- mirascope/ops/_internal/instrumentation/llm/cost.py +190 -0
- mirascope/ops/_internal/instrumentation/llm/encode.py +1 -1
- mirascope/ops/_internal/instrumentation/llm/llm.py +116 -1242
- mirascope/ops/_internal/instrumentation/llm/model.py +1798 -0
- mirascope/ops/_internal/instrumentation/llm/response.py +521 -0
- mirascope/ops/_internal/instrumentation/llm/serialize.py +300 -0
- mirascope/ops/_internal/protocols.py +83 -1
- mirascope/ops/_internal/traced_calls.py +4 -0
- mirascope/ops/_internal/traced_functions.py +118 -8
- mirascope/ops/_internal/tracing.py +78 -1
- mirascope/ops/_internal/utils.py +52 -4
- {mirascope-2.0.0a6.dist-info → mirascope-2.0.1.dist-info}/METADATA +12 -11
- mirascope-2.0.1.dist-info/RECORD +423 -0
- {mirascope-2.0.0a6.dist-info → mirascope-2.0.1.dist-info}/licenses/LICENSE +1 -1
- mirascope-2.0.0a6.dist-info/RECORD +0 -316
- {mirascope-2.0.0a6.dist-info → mirascope-2.0.1.dist-info}/WHEEL +0 -0
|
@@ -3,12 +3,22 @@
|
|
|
3
3
|
# isort: skip_file
|
|
4
4
|
|
|
5
5
|
from .environments_create_response import EnvironmentsCreateResponse
|
|
6
|
+
from .environments_get_analytics_response import EnvironmentsGetAnalyticsResponse
|
|
7
|
+
from .environments_get_analytics_response_top_functions_item import (
|
|
8
|
+
EnvironmentsGetAnalyticsResponseTopFunctionsItem,
|
|
9
|
+
)
|
|
10
|
+
from .environments_get_analytics_response_top_models_item import (
|
|
11
|
+
EnvironmentsGetAnalyticsResponseTopModelsItem,
|
|
12
|
+
)
|
|
6
13
|
from .environments_get_response import EnvironmentsGetResponse
|
|
7
14
|
from .environments_list_response_item import EnvironmentsListResponseItem
|
|
8
15
|
from .environments_update_response import EnvironmentsUpdateResponse
|
|
9
16
|
|
|
10
17
|
__all__ = [
|
|
11
18
|
"EnvironmentsCreateResponse",
|
|
19
|
+
"EnvironmentsGetAnalyticsResponse",
|
|
20
|
+
"EnvironmentsGetAnalyticsResponseTopFunctionsItem",
|
|
21
|
+
"EnvironmentsGetAnalyticsResponseTopModelsItem",
|
|
12
22
|
"EnvironmentsGetResponse",
|
|
13
23
|
"EnvironmentsListResponseItem",
|
|
14
24
|
"EnvironmentsUpdateResponse",
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
import typing_extensions
|
|
7
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
|
+
from ...core.serialization import FieldMetadata
|
|
9
|
+
from .environments_get_analytics_response_top_functions_item import (
|
|
10
|
+
EnvironmentsGetAnalyticsResponseTopFunctionsItem,
|
|
11
|
+
)
|
|
12
|
+
from .environments_get_analytics_response_top_models_item import (
|
|
13
|
+
EnvironmentsGetAnalyticsResponseTopModelsItem,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class EnvironmentsGetAnalyticsResponse(UniversalBaseModel):
|
|
18
|
+
total_spans: typing_extensions.Annotated[float, FieldMetadata(alias="totalSpans")]
|
|
19
|
+
avg_duration_ms: typing_extensions.Annotated[
|
|
20
|
+
typing.Optional[float], FieldMetadata(alias="avgDurationMs")
|
|
21
|
+
] = None
|
|
22
|
+
p50duration_ms: typing_extensions.Annotated[
|
|
23
|
+
typing.Optional[float], FieldMetadata(alias="p50DurationMs")
|
|
24
|
+
] = None
|
|
25
|
+
p95duration_ms: typing_extensions.Annotated[
|
|
26
|
+
typing.Optional[float], FieldMetadata(alias="p95DurationMs")
|
|
27
|
+
] = None
|
|
28
|
+
p99duration_ms: typing_extensions.Annotated[
|
|
29
|
+
typing.Optional[float], FieldMetadata(alias="p99DurationMs")
|
|
30
|
+
] = None
|
|
31
|
+
error_rate: typing_extensions.Annotated[float, FieldMetadata(alias="errorRate")]
|
|
32
|
+
total_tokens: typing_extensions.Annotated[float, FieldMetadata(alias="totalTokens")]
|
|
33
|
+
total_input_tokens: typing_extensions.Annotated[
|
|
34
|
+
float, FieldMetadata(alias="totalInputTokens")
|
|
35
|
+
]
|
|
36
|
+
total_output_tokens: typing_extensions.Annotated[
|
|
37
|
+
float, FieldMetadata(alias="totalOutputTokens")
|
|
38
|
+
]
|
|
39
|
+
total_cost_usd: typing_extensions.Annotated[
|
|
40
|
+
float, FieldMetadata(alias="totalCostUsd")
|
|
41
|
+
]
|
|
42
|
+
top_models: typing_extensions.Annotated[
|
|
43
|
+
typing.List[EnvironmentsGetAnalyticsResponseTopModelsItem],
|
|
44
|
+
FieldMetadata(alias="topModels"),
|
|
45
|
+
]
|
|
46
|
+
top_functions: typing_extensions.Annotated[
|
|
47
|
+
typing.List[EnvironmentsGetAnalyticsResponseTopFunctionsItem],
|
|
48
|
+
FieldMetadata(alias="topFunctions"),
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
if IS_PYDANTIC_V2:
|
|
52
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
53
|
+
extra="allow", frozen=True
|
|
54
|
+
) # type: ignore # Pydantic v2
|
|
55
|
+
else:
|
|
56
|
+
|
|
57
|
+
class Config:
|
|
58
|
+
frozen = True
|
|
59
|
+
smart_union = True
|
|
60
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
import typing_extensions
|
|
7
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
|
+
from ...core.serialization import FieldMetadata
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class EnvironmentsGetAnalyticsResponseTopFunctionsItem(UniversalBaseModel):
|
|
12
|
+
function_name: typing_extensions.Annotated[str, FieldMetadata(alias="functionName")]
|
|
13
|
+
count: float
|
|
14
|
+
|
|
15
|
+
if IS_PYDANTIC_V2:
|
|
16
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
17
|
+
extra="allow", frozen=True
|
|
18
|
+
) # type: ignore # Pydantic v2
|
|
19
|
+
else:
|
|
20
|
+
|
|
21
|
+
class Config:
|
|
22
|
+
frozen = True
|
|
23
|
+
smart_union = True
|
|
24
|
+
extra = pydantic.Extra.allow
|
|
@@ -6,11 +6,14 @@ import pydantic
|
|
|
6
6
|
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
class
|
|
10
|
-
|
|
9
|
+
class EnvironmentsGetAnalyticsResponseTopModelsItem(UniversalBaseModel):
|
|
10
|
+
model: str
|
|
11
|
+
count: float
|
|
11
12
|
|
|
12
13
|
if IS_PYDANTIC_V2:
|
|
13
|
-
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
14
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
15
|
+
extra="allow", frozen=True
|
|
16
|
+
) # type: ignore # Pydantic v2
|
|
14
17
|
else:
|
|
15
18
|
|
|
16
19
|
class Config:
|
|
@@ -7,6 +7,9 @@ from .conflict_error import ConflictError
|
|
|
7
7
|
from .forbidden_error import ForbiddenError
|
|
8
8
|
from .internal_server_error import InternalServerError
|
|
9
9
|
from .not_found_error import NotFoundError
|
|
10
|
+
from .payment_required_error import PaymentRequiredError
|
|
11
|
+
from .service_unavailable_error import ServiceUnavailableError
|
|
12
|
+
from .too_many_requests_error import TooManyRequestsError
|
|
10
13
|
from .unauthorized_error import UnauthorizedError
|
|
11
14
|
|
|
12
15
|
__all__ = [
|
|
@@ -15,5 +18,8 @@ __all__ = [
|
|
|
15
18
|
"ForbiddenError",
|
|
16
19
|
"InternalServerError",
|
|
17
20
|
"NotFoundError",
|
|
21
|
+
"PaymentRequiredError",
|
|
22
|
+
"ServiceUnavailableError",
|
|
23
|
+
"TooManyRequestsError",
|
|
18
24
|
"UnauthorizedError",
|
|
19
25
|
]
|
|
@@ -3,9 +3,12 @@
|
|
|
3
3
|
import typing
|
|
4
4
|
|
|
5
5
|
from ..core.api_error import ApiError
|
|
6
|
-
from ..types.http_api_decode_error import HttpApiDecodeError
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
class BadRequestError(ApiError):
|
|
10
|
-
def __init__(
|
|
9
|
+
def __init__(
|
|
10
|
+
self,
|
|
11
|
+
body: typing.Optional[typing.Any],
|
|
12
|
+
headers: typing.Optional[typing.Dict[str, str]] = None,
|
|
13
|
+
):
|
|
11
14
|
super().__init__(status_code=400, headers=headers, body=body)
|
|
@@ -3,9 +3,12 @@
|
|
|
3
3
|
import typing
|
|
4
4
|
|
|
5
5
|
from ..core.api_error import ApiError
|
|
6
|
-
from ..types.already_exists_error import AlreadyExistsError
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
class ConflictError(ApiError):
|
|
10
|
-
def __init__(
|
|
9
|
+
def __init__(
|
|
10
|
+
self,
|
|
11
|
+
body: typing.Optional[typing.Any],
|
|
12
|
+
headers: typing.Optional[typing.Dict[str, str]] = None,
|
|
13
|
+
):
|
|
11
14
|
super().__init__(status_code=409, headers=headers, body=body)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ..core.api_error import ApiError
|
|
6
|
+
from ..types.plan_limit_exceeded_error import PlanLimitExceededError
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class PaymentRequiredError(ApiError):
|
|
10
|
+
def __init__(
|
|
11
|
+
self,
|
|
12
|
+
body: PlanLimitExceededError,
|
|
13
|
+
headers: typing.Optional[typing.Dict[str, str]] = None,
|
|
14
|
+
):
|
|
15
|
+
super().__init__(status_code=402, headers=headers, body=body)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ..core.api_error import ApiError
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ServiceUnavailableError(ApiError):
|
|
9
|
+
def __init__(
|
|
10
|
+
self,
|
|
11
|
+
body: typing.Optional[typing.Any],
|
|
12
|
+
headers: typing.Optional[typing.Dict[str, str]] = None,
|
|
13
|
+
):
|
|
14
|
+
super().__init__(status_code=503, headers=headers, body=body)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ..core.api_error import ApiError
|
|
6
|
+
from ..types.rate_limit_error import RateLimitError
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class TooManyRequestsError(ApiError):
|
|
10
|
+
def __init__(
|
|
11
|
+
self,
|
|
12
|
+
body: RateLimitError,
|
|
13
|
+
headers: typing.Optional[typing.Dict[str, str]] = None,
|
|
14
|
+
):
|
|
15
|
+
super().__init__(status_code=429, headers=headers, body=body)
|
|
@@ -8,8 +8,13 @@ from .types import (
|
|
|
8
8
|
FunctionsCreateResponseDependenciesValue,
|
|
9
9
|
FunctionsFindByHashResponse,
|
|
10
10
|
FunctionsFindByHashResponseDependenciesValue,
|
|
11
|
+
FunctionsGetByEnvResponse,
|
|
12
|
+
FunctionsGetByEnvResponseDependenciesValue,
|
|
11
13
|
FunctionsGetResponse,
|
|
12
14
|
FunctionsGetResponseDependenciesValue,
|
|
15
|
+
FunctionsListByEnvResponse,
|
|
16
|
+
FunctionsListByEnvResponseFunctionsItem,
|
|
17
|
+
FunctionsListByEnvResponseFunctionsItemDependenciesValue,
|
|
13
18
|
FunctionsListResponse,
|
|
14
19
|
FunctionsListResponseFunctionsItem,
|
|
15
20
|
FunctionsListResponseFunctionsItemDependenciesValue,
|
|
@@ -21,8 +26,13 @@ __all__ = [
|
|
|
21
26
|
"FunctionsCreateResponseDependenciesValue",
|
|
22
27
|
"FunctionsFindByHashResponse",
|
|
23
28
|
"FunctionsFindByHashResponseDependenciesValue",
|
|
29
|
+
"FunctionsGetByEnvResponse",
|
|
30
|
+
"FunctionsGetByEnvResponseDependenciesValue",
|
|
24
31
|
"FunctionsGetResponse",
|
|
25
32
|
"FunctionsGetResponseDependenciesValue",
|
|
33
|
+
"FunctionsListByEnvResponse",
|
|
34
|
+
"FunctionsListByEnvResponseFunctionsItem",
|
|
35
|
+
"FunctionsListByEnvResponseFunctionsItemDependenciesValue",
|
|
26
36
|
"FunctionsListResponse",
|
|
27
37
|
"FunctionsListResponseFunctionsItem",
|
|
28
38
|
"FunctionsListResponseFunctionsItemDependenciesValue",
|
|
@@ -5,10 +5,14 @@ import typing
|
|
|
5
5
|
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
6
|
from ..core.request_options import RequestOptions
|
|
7
7
|
from .raw_client import AsyncRawFunctionsClient, RawFunctionsClient
|
|
8
|
-
from .types.functions_create_request_dependencies_value import
|
|
8
|
+
from .types.functions_create_request_dependencies_value import (
|
|
9
|
+
FunctionsCreateRequestDependenciesValue,
|
|
10
|
+
)
|
|
9
11
|
from .types.functions_create_response import FunctionsCreateResponse
|
|
10
12
|
from .types.functions_find_by_hash_response import FunctionsFindByHashResponse
|
|
13
|
+
from .types.functions_get_by_env_response import FunctionsGetByEnvResponse
|
|
11
14
|
from .types.functions_get_response import FunctionsGetResponse
|
|
15
|
+
from .types.functions_list_by_env_response import FunctionsListByEnvResponse
|
|
12
16
|
from .types.functions_list_response import FunctionsListResponse
|
|
13
17
|
|
|
14
18
|
# this is used as the default value for optional parameters
|
|
@@ -30,7 +34,9 @@ class FunctionsClient:
|
|
|
30
34
|
"""
|
|
31
35
|
return self._raw_client
|
|
32
36
|
|
|
33
|
-
def list(
|
|
37
|
+
def list(
|
|
38
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
39
|
+
) -> FunctionsListResponse:
|
|
34
40
|
"""
|
|
35
41
|
Parameters
|
|
36
42
|
----------
|
|
@@ -124,7 +130,9 @@ class FunctionsClient:
|
|
|
124
130
|
)
|
|
125
131
|
return _response.data
|
|
126
132
|
|
|
127
|
-
def get(
|
|
133
|
+
def get(
|
|
134
|
+
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
135
|
+
) -> FunctionsGetResponse:
|
|
128
136
|
"""
|
|
129
137
|
Parameters
|
|
130
138
|
----------
|
|
@@ -150,7 +158,9 @@ class FunctionsClient:
|
|
|
150
158
|
_response = self._raw_client.get(id, request_options=request_options)
|
|
151
159
|
return _response.data
|
|
152
160
|
|
|
153
|
-
def delete(
|
|
161
|
+
def delete(
|
|
162
|
+
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
163
|
+
) -> None:
|
|
154
164
|
"""
|
|
155
165
|
Parameters
|
|
156
166
|
----------
|
|
@@ -203,6 +213,96 @@ class FunctionsClient:
|
|
|
203
213
|
_response = self._raw_client.findbyhash(hash, request_options=request_options)
|
|
204
214
|
return _response.data
|
|
205
215
|
|
|
216
|
+
def getbyenv(
|
|
217
|
+
self,
|
|
218
|
+
organization_id: str,
|
|
219
|
+
project_id: str,
|
|
220
|
+
environment_id: str,
|
|
221
|
+
function_id: str,
|
|
222
|
+
*,
|
|
223
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
224
|
+
) -> FunctionsGetByEnvResponse:
|
|
225
|
+
"""
|
|
226
|
+
Parameters
|
|
227
|
+
----------
|
|
228
|
+
organization_id : str
|
|
229
|
+
|
|
230
|
+
project_id : str
|
|
231
|
+
|
|
232
|
+
environment_id : str
|
|
233
|
+
|
|
234
|
+
function_id : str
|
|
235
|
+
|
|
236
|
+
request_options : typing.Optional[RequestOptions]
|
|
237
|
+
Request-specific configuration.
|
|
238
|
+
|
|
239
|
+
Returns
|
|
240
|
+
-------
|
|
241
|
+
FunctionsGetByEnvResponse
|
|
242
|
+
Success
|
|
243
|
+
|
|
244
|
+
Examples
|
|
245
|
+
--------
|
|
246
|
+
from mirascope.api._generated import Mirascope
|
|
247
|
+
|
|
248
|
+
client = Mirascope()
|
|
249
|
+
client.functions.getbyenv(
|
|
250
|
+
organization_id="organizationId",
|
|
251
|
+
project_id="projectId",
|
|
252
|
+
environment_id="environmentId",
|
|
253
|
+
function_id="functionId",
|
|
254
|
+
)
|
|
255
|
+
"""
|
|
256
|
+
_response = self._raw_client.getbyenv(
|
|
257
|
+
organization_id,
|
|
258
|
+
project_id,
|
|
259
|
+
environment_id,
|
|
260
|
+
function_id,
|
|
261
|
+
request_options=request_options,
|
|
262
|
+
)
|
|
263
|
+
return _response.data
|
|
264
|
+
|
|
265
|
+
def listbyenv(
|
|
266
|
+
self,
|
|
267
|
+
organization_id: str,
|
|
268
|
+
project_id: str,
|
|
269
|
+
environment_id: str,
|
|
270
|
+
*,
|
|
271
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
272
|
+
) -> FunctionsListByEnvResponse:
|
|
273
|
+
"""
|
|
274
|
+
Parameters
|
|
275
|
+
----------
|
|
276
|
+
organization_id : str
|
|
277
|
+
|
|
278
|
+
project_id : str
|
|
279
|
+
|
|
280
|
+
environment_id : str
|
|
281
|
+
|
|
282
|
+
request_options : typing.Optional[RequestOptions]
|
|
283
|
+
Request-specific configuration.
|
|
284
|
+
|
|
285
|
+
Returns
|
|
286
|
+
-------
|
|
287
|
+
FunctionsListByEnvResponse
|
|
288
|
+
Success
|
|
289
|
+
|
|
290
|
+
Examples
|
|
291
|
+
--------
|
|
292
|
+
from mirascope.api._generated import Mirascope
|
|
293
|
+
|
|
294
|
+
client = Mirascope()
|
|
295
|
+
client.functions.listbyenv(
|
|
296
|
+
organization_id="organizationId",
|
|
297
|
+
project_id="projectId",
|
|
298
|
+
environment_id="environmentId",
|
|
299
|
+
)
|
|
300
|
+
"""
|
|
301
|
+
_response = self._raw_client.listbyenv(
|
|
302
|
+
organization_id, project_id, environment_id, request_options=request_options
|
|
303
|
+
)
|
|
304
|
+
return _response.data
|
|
305
|
+
|
|
206
306
|
|
|
207
307
|
class AsyncFunctionsClient:
|
|
208
308
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
@@ -219,7 +319,9 @@ class AsyncFunctionsClient:
|
|
|
219
319
|
"""
|
|
220
320
|
return self._raw_client
|
|
221
321
|
|
|
222
|
-
async def list(
|
|
322
|
+
async def list(
|
|
323
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
324
|
+
) -> FunctionsListResponse:
|
|
223
325
|
"""
|
|
224
326
|
Parameters
|
|
225
327
|
----------
|
|
@@ -329,7 +431,9 @@ class AsyncFunctionsClient:
|
|
|
329
431
|
)
|
|
330
432
|
return _response.data
|
|
331
433
|
|
|
332
|
-
async def get(
|
|
434
|
+
async def get(
|
|
435
|
+
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
436
|
+
) -> FunctionsGetResponse:
|
|
333
437
|
"""
|
|
334
438
|
Parameters
|
|
335
439
|
----------
|
|
@@ -363,7 +467,9 @@ class AsyncFunctionsClient:
|
|
|
363
467
|
_response = await self._raw_client.get(id, request_options=request_options)
|
|
364
468
|
return _response.data
|
|
365
469
|
|
|
366
|
-
async def delete(
|
|
470
|
+
async def delete(
|
|
471
|
+
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
472
|
+
) -> None:
|
|
367
473
|
"""
|
|
368
474
|
Parameters
|
|
369
475
|
----------
|
|
@@ -429,5 +535,113 @@ class AsyncFunctionsClient:
|
|
|
429
535
|
|
|
430
536
|
asyncio.run(main())
|
|
431
537
|
"""
|
|
432
|
-
_response = await self._raw_client.findbyhash(
|
|
538
|
+
_response = await self._raw_client.findbyhash(
|
|
539
|
+
hash, request_options=request_options
|
|
540
|
+
)
|
|
541
|
+
return _response.data
|
|
542
|
+
|
|
543
|
+
async def getbyenv(
|
|
544
|
+
self,
|
|
545
|
+
organization_id: str,
|
|
546
|
+
project_id: str,
|
|
547
|
+
environment_id: str,
|
|
548
|
+
function_id: str,
|
|
549
|
+
*,
|
|
550
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
551
|
+
) -> FunctionsGetByEnvResponse:
|
|
552
|
+
"""
|
|
553
|
+
Parameters
|
|
554
|
+
----------
|
|
555
|
+
organization_id : str
|
|
556
|
+
|
|
557
|
+
project_id : str
|
|
558
|
+
|
|
559
|
+
environment_id : str
|
|
560
|
+
|
|
561
|
+
function_id : str
|
|
562
|
+
|
|
563
|
+
request_options : typing.Optional[RequestOptions]
|
|
564
|
+
Request-specific configuration.
|
|
565
|
+
|
|
566
|
+
Returns
|
|
567
|
+
-------
|
|
568
|
+
FunctionsGetByEnvResponse
|
|
569
|
+
Success
|
|
570
|
+
|
|
571
|
+
Examples
|
|
572
|
+
--------
|
|
573
|
+
import asyncio
|
|
574
|
+
|
|
575
|
+
from mirascope.api._generated import AsyncMirascope
|
|
576
|
+
|
|
577
|
+
client = AsyncMirascope()
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
async def main() -> None:
|
|
581
|
+
await client.functions.getbyenv(
|
|
582
|
+
organization_id="organizationId",
|
|
583
|
+
project_id="projectId",
|
|
584
|
+
environment_id="environmentId",
|
|
585
|
+
function_id="functionId",
|
|
586
|
+
)
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
asyncio.run(main())
|
|
590
|
+
"""
|
|
591
|
+
_response = await self._raw_client.getbyenv(
|
|
592
|
+
organization_id,
|
|
593
|
+
project_id,
|
|
594
|
+
environment_id,
|
|
595
|
+
function_id,
|
|
596
|
+
request_options=request_options,
|
|
597
|
+
)
|
|
598
|
+
return _response.data
|
|
599
|
+
|
|
600
|
+
async def listbyenv(
|
|
601
|
+
self,
|
|
602
|
+
organization_id: str,
|
|
603
|
+
project_id: str,
|
|
604
|
+
environment_id: str,
|
|
605
|
+
*,
|
|
606
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
607
|
+
) -> FunctionsListByEnvResponse:
|
|
608
|
+
"""
|
|
609
|
+
Parameters
|
|
610
|
+
----------
|
|
611
|
+
organization_id : str
|
|
612
|
+
|
|
613
|
+
project_id : str
|
|
614
|
+
|
|
615
|
+
environment_id : str
|
|
616
|
+
|
|
617
|
+
request_options : typing.Optional[RequestOptions]
|
|
618
|
+
Request-specific configuration.
|
|
619
|
+
|
|
620
|
+
Returns
|
|
621
|
+
-------
|
|
622
|
+
FunctionsListByEnvResponse
|
|
623
|
+
Success
|
|
624
|
+
|
|
625
|
+
Examples
|
|
626
|
+
--------
|
|
627
|
+
import asyncio
|
|
628
|
+
|
|
629
|
+
from mirascope.api._generated import AsyncMirascope
|
|
630
|
+
|
|
631
|
+
client = AsyncMirascope()
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
async def main() -> None:
|
|
635
|
+
await client.functions.listbyenv(
|
|
636
|
+
organization_id="organizationId",
|
|
637
|
+
project_id="projectId",
|
|
638
|
+
environment_id="environmentId",
|
|
639
|
+
)
|
|
640
|
+
|
|
641
|
+
|
|
642
|
+
asyncio.run(main())
|
|
643
|
+
"""
|
|
644
|
+
_response = await self._raw_client.listbyenv(
|
|
645
|
+
organization_id, project_id, environment_id, request_options=request_options
|
|
646
|
+
)
|
|
433
647
|
return _response.data
|