mirascope 2.0.0a5__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/__init__.py +10 -1
- mirascope/_stubs.py +363 -0
- mirascope/api/__init__.py +8 -0
- mirascope/api/_generated/__init__.py +285 -2
- mirascope/api/_generated/annotations/__init__.py +33 -0
- mirascope/api/_generated/annotations/client.py +506 -0
- mirascope/api/_generated/annotations/raw_client.py +1414 -0
- mirascope/api/_generated/annotations/types/__init__.py +31 -0
- mirascope/api/_generated/annotations/types/annotations_create_request_label.py +5 -0
- mirascope/api/_generated/annotations/types/annotations_create_response.py +48 -0
- mirascope/api/_generated/annotations/types/annotations_create_response_label.py +5 -0
- mirascope/api/_generated/annotations/types/annotations_get_response.py +48 -0
- mirascope/api/_generated/annotations/types/annotations_get_response_label.py +5 -0
- mirascope/api/_generated/annotations/types/annotations_list_request_label.py +5 -0
- mirascope/api/_generated/annotations/types/annotations_list_response.py +21 -0
- mirascope/api/_generated/annotations/types/annotations_list_response_annotations_item.py +50 -0
- mirascope/api/_generated/annotations/types/annotations_list_response_annotations_item_label.py +5 -0
- mirascope/api/_generated/annotations/types/annotations_update_request_label.py +5 -0
- mirascope/api/_generated/annotations/types/annotations_update_response.py +48 -0
- mirascope/api/_generated/annotations/types/annotations_update_response_label.py +5 -0
- mirascope/api/_generated/api_keys/__init__.py +12 -2
- mirascope/api/_generated/api_keys/client.py +77 -0
- mirascope/api/_generated/api_keys/raw_client.py +422 -39
- mirascope/api/_generated/api_keys/types/__init__.py +7 -1
- mirascope/api/_generated/api_keys/types/api_keys_create_response.py +4 -12
- mirascope/api/_generated/api_keys/types/api_keys_get_response.py +4 -12
- mirascope/api/_generated/api_keys/types/api_keys_list_all_for_org_response_item.py +40 -0
- mirascope/api/_generated/api_keys/types/api_keys_list_response_item.py +4 -12
- mirascope/api/_generated/client.py +42 -0
- mirascope/api/_generated/core/client_wrapper.py +2 -14
- mirascope/api/_generated/core/datetime_utils.py +1 -3
- mirascope/api/_generated/core/file.py +2 -5
- mirascope/api/_generated/core/http_client.py +36 -112
- mirascope/api/_generated/core/jsonable_encoder.py +1 -3
- mirascope/api/_generated/core/pydantic_utilities.py +19 -74
- mirascope/api/_generated/core/query_encoder.py +1 -3
- mirascope/api/_generated/core/serialization.py +4 -10
- mirascope/api/_generated/docs/client.py +2 -6
- mirascope/api/_generated/docs/raw_client.py +51 -5
- mirascope/api/_generated/environment.py +3 -3
- mirascope/api/_generated/environments/__init__.py +6 -0
- mirascope/api/_generated/environments/client.py +117 -0
- mirascope/api/_generated/environments/raw_client.py +530 -51
- mirascope/api/_generated/environments/types/__init__.py +10 -0
- mirascope/api/_generated/environments/types/environments_create_response.py +1 -3
- 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/environments/types/environments_get_analytics_response_top_models_item.py +22 -0
- mirascope/api/_generated/environments/types/environments_get_response.py +1 -3
- mirascope/api/_generated/environments/types/environments_list_response_item.py +1 -3
- mirascope/api/_generated/environments/types/environments_update_response.py +1 -3
- mirascope/api/_generated/errors/__init__.py +8 -0
- mirascope/api/_generated/errors/bad_request_error.py +1 -2
- mirascope/api/_generated/errors/conflict_error.py +1 -2
- mirascope/api/_generated/errors/forbidden_error.py +1 -5
- mirascope/api/_generated/errors/internal_server_error.py +1 -6
- mirascope/api/_generated/errors/not_found_error.py +1 -5
- 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/errors/unauthorized_error.py +11 -0
- mirascope/api/_generated/functions/__init__.py +39 -0
- mirascope/api/_generated/functions/client.py +647 -0
- mirascope/api/_generated/functions/raw_client.py +1890 -0
- mirascope/api/_generated/functions/types/__init__.py +53 -0
- mirascope/api/_generated/functions/types/functions_create_request_dependencies_value.py +20 -0
- mirascope/api/_generated/functions/types/functions_create_response.py +37 -0
- mirascope/api/_generated/functions/types/functions_create_response_dependencies_value.py +20 -0
- mirascope/api/_generated/functions/types/functions_find_by_hash_response.py +39 -0
- mirascope/api/_generated/functions/types/functions_find_by_hash_response_dependencies_value.py +20 -0
- 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_get_response.py +37 -0
- mirascope/api/_generated/functions/types/functions_get_response_dependencies_value.py +20 -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/functions/types/functions_list_response.py +21 -0
- mirascope/api/_generated/functions/types/functions_list_response_functions_item.py +41 -0
- mirascope/api/_generated/functions/types/functions_list_response_functions_item_dependencies_value.py +20 -0
- mirascope/api/_generated/health/client.py +2 -6
- mirascope/api/_generated/health/raw_client.py +51 -5
- mirascope/api/_generated/health/types/health_check_response.py +1 -3
- 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 -0
- mirascope/api/_generated/organizations/client.py +465 -0
- mirascope/api/_generated/organizations/raw_client.py +1799 -108
- mirascope/api/_generated/organizations/types/__init__.py +48 -0
- mirascope/api/_generated/organizations/types/organizations_create_payment_intent_response.py +24 -0
- mirascope/api/_generated/organizations/types/organizations_create_response.py +4 -3
- mirascope/api/_generated/organizations/types/organizations_create_response_role.py +1 -3
- mirascope/api/_generated/organizations/types/organizations_get_response.py +4 -3
- mirascope/api/_generated/organizations/types/organizations_get_response_role.py +1 -3
- mirascope/api/_generated/organizations/types/organizations_list_response_item.py +4 -3
- mirascope/api/_generated/organizations/types/organizations_list_response_item_role.py +1 -3
- 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_response.py +4 -3
- mirascope/api/_generated/organizations/types/organizations_update_response_role.py +1 -3
- 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/__init__.py +2 -12
- mirascope/api/_generated/projects/client.py +17 -71
- mirascope/api/_generated/projects/raw_client.py +295 -51
- mirascope/api/_generated/projects/types/__init__.py +1 -6
- mirascope/api/_generated/projects/types/projects_create_response.py +3 -9
- mirascope/api/_generated/projects/types/projects_get_response.py +3 -9
- mirascope/api/_generated/projects/types/projects_list_response_item.py +3 -9
- mirascope/api/_generated/projects/types/projects_update_response.py +3 -9
- mirascope/api/_generated/reference.md +3619 -182
- 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 +42 -0
- mirascope/api/_generated/traces/client.py +941 -0
- mirascope/api/_generated/traces/raw_client.py +2177 -23
- mirascope/api/_generated/traces/types/__init__.py +60 -0
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item.py +4 -11
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource.py +2 -6
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item.py +1 -3
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item_value.py +8 -24
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item_value_array_value.py +2 -6
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item_value_kvlist_value.py +3 -9
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_resource_attributes_item_value_kvlist_value_values_item.py +2 -6
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item.py +3 -9
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope.py +4 -8
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item.py +2 -6
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item_value.py +8 -24
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item_value_array_value.py +2 -6
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item_value_kvlist_value.py +3 -9
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_scope_attributes_item_value_kvlist_value_values_item.py +1 -3
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item.py +6 -18
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item.py +3 -9
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item_value.py +8 -24
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item_value_array_value.py +2 -6
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item_value_kvlist_value.py +2 -6
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_attributes_item_value_kvlist_value_values_item.py +1 -3
- mirascope/api/_generated/traces/types/traces_create_request_resource_spans_item_scope_spans_item_spans_item_status.py +2 -6
- mirascope/api/_generated/traces/types/traces_create_response.py +2 -5
- mirascope/api/_generated/traces/types/traces_create_response_partial_success.py +3 -9
- mirascope/api/_generated/traces/types/traces_get_analytics_summary_response.py +60 -0
- mirascope/api/_generated/traces/types/traces_get_analytics_summary_response_top_functions_item.py +24 -0
- mirascope/api/_generated/traces/types/traces_get_analytics_summary_response_top_models_item.py +22 -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.py +33 -0
- mirascope/api/_generated/traces/types/traces_get_trace_detail_response_spans_item.py +88 -0
- 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_request_attribute_filters_item.py +26 -0
- mirascope/api/_generated/traces/types/traces_search_request_attribute_filters_item_operator.py +7 -0
- mirascope/api/_generated/traces/types/traces_search_request_sort_by.py +7 -0
- mirascope/api/_generated/traces/types/traces_search_request_sort_order.py +5 -0
- mirascope/api/_generated/traces/types/traces_search_response.py +26 -0
- mirascope/api/_generated/traces/types/traces_search_response_spans_item.py +50 -0
- mirascope/api/_generated/types/__init__.py +48 -0
- mirascope/api/_generated/types/already_exists_error.py +1 -3
- mirascope/api/_generated/types/bad_request_error_body.py +50 -0
- mirascope/api/_generated/types/click_house_error.py +22 -0
- mirascope/api/_generated/types/database_error.py +1 -3
- mirascope/api/_generated/types/date.py +3 -0
- mirascope/api/_generated/types/http_api_decode_error.py +1 -3
- mirascope/api/_generated/types/immutable_resource_error.py +22 -0
- mirascope/api/_generated/types/internal_server_error_body.py +49 -0
- mirascope/api/_generated/types/issue.py +1 -3
- mirascope/api/_generated/types/issue_tag.py +1 -8
- mirascope/api/_generated/types/not_found_error_body.py +1 -3
- mirascope/api/_generated/types/number_from_string.py +3 -0
- mirascope/api/_generated/types/permission_denied_error.py +1 -3
- mirascope/api/_generated/types/permission_denied_error_tag.py +1 -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/property_key_key.py +1 -3
- 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/stripe_error.py +20 -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/_generated/types/unauthorized_error_body.py +21 -0
- mirascope/api/_generated/types/unauthorized_error_tag.py +5 -0
- mirascope/api/settings.py +19 -1
- mirascope/llm/__init__.py +55 -8
- 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_call.py +6 -0
- mirascope/llm/content/tool_output.py +22 -5
- mirascope/llm/exceptions.py +284 -71
- mirascope/llm/formatting/__init__.py +19 -2
- mirascope/llm/formatting/format.py +219 -30
- 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 +21 -64
- mirascope/llm/mcp/__init__.py +2 -2
- mirascope/llm/mcp/mcp_client.py +130 -0
- 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 +16 -37
- 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 +18 -2
- mirascope/llm/providers/anthropic/__init__.py +3 -21
- mirascope/llm/providers/anthropic/_utils/__init__.py +2 -0
- mirascope/llm/providers/anthropic/_utils/beta_decode.py +22 -11
- mirascope/llm/providers/anthropic/_utils/beta_encode.py +75 -25
- mirascope/llm/providers/anthropic/_utils/decode.py +22 -11
- mirascope/llm/providers/anthropic/_utils/encode.py +82 -20
- 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 -2
- mirascope/llm/providers/base/_utils.py +55 -11
- mirascope/llm/providers/base/base_provider.py +116 -37
- mirascope/llm/providers/google/__init__.py +2 -17
- mirascope/llm/providers/google/_utils/__init__.py +2 -0
- mirascope/llm/providers/google/_utils/decode.py +37 -15
- mirascope/llm/providers/google/_utils/encode.py +127 -19
- mirascope/llm/providers/google/_utils/errors.py +3 -2
- mirascope/llm/providers/google/model_info.py +1 -0
- mirascope/llm/providers/google/provider.py +68 -19
- mirascope/llm/providers/mirascope/__init__.py +5 -0
- mirascope/llm/providers/mirascope/_utils.py +73 -0
- mirascope/llm/providers/mirascope/provider.py +349 -0
- mirascope/llm/providers/mlx/__init__.py +2 -17
- mirascope/llm/providers/mlx/_utils.py +8 -3
- 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/ollama/__init__.py +1 -13
- mirascope/llm/providers/openai/_utils/errors.py +2 -2
- mirascope/llm/providers/openai/completions/__init__.py +2 -20
- mirascope/llm/providers/openai/completions/_utils/decode.py +14 -3
- mirascope/llm/providers/openai/completions/_utils/encode.py +35 -28
- mirascope/llm/providers/openai/completions/base_provider.py +40 -11
- mirascope/llm/providers/openai/provider.py +40 -10
- mirascope/llm/providers/openai/responses/__init__.py +1 -17
- mirascope/llm/providers/openai/responses/_utils/__init__.py +2 -0
- mirascope/llm/providers/openai/responses/_utils/decode.py +21 -8
- mirascope/llm/providers/openai/responses/_utils/encode.py +59 -19
- mirascope/llm/providers/openai/responses/provider.py +56 -18
- mirascope/llm/providers/provider_id.py +1 -0
- mirascope/llm/providers/provider_registry.py +96 -19
- mirascope/llm/providers/together/__init__.py +1 -13
- 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 +139 -45
- 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 +17 -8
- mirascope/llm/tools/tool_schema.py +43 -10
- mirascope/llm/tools/toolkit.py +35 -27
- mirascope/llm/tools/tools.py +123 -30
- mirascope/ops/__init__.py +64 -109
- 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 -1243
- 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 +141 -12
- mirascope/ops/_internal/tracing.py +78 -1
- mirascope/ops/_internal/utils.py +52 -4
- mirascope/ops/_internal/versioned_functions.py +54 -43
- {mirascope-2.0.0a5.dist-info → mirascope-2.0.1.dist-info}/METADATA +14 -13
- mirascope-2.0.1.dist-info/RECORD +423 -0
- {mirascope-2.0.0a5.dist-info → mirascope-2.0.1.dist-info}/licenses/LICENSE +1 -1
- mirascope/llm/formatting/_utils.py +0 -78
- mirascope/llm/mcp/client.py +0 -118
- mirascope/llm/providers/_missing_import_stubs.py +0 -49
- mirascope-2.0.0a5.dist-info/RECORD +0 -265
- {mirascope-2.0.0a5.dist-info → mirascope-2.0.1.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
from .organization_memberships_list_response_item import (
|
|
6
|
+
OrganizationMembershipsListResponseItem,
|
|
7
|
+
)
|
|
8
|
+
from .organization_memberships_list_response_item_role import (
|
|
9
|
+
OrganizationMembershipsListResponseItemRole,
|
|
10
|
+
)
|
|
11
|
+
from .organization_memberships_update_request_role import (
|
|
12
|
+
OrganizationMembershipsUpdateRequestRole,
|
|
13
|
+
)
|
|
14
|
+
from .organization_memberships_update_response import (
|
|
15
|
+
OrganizationMembershipsUpdateResponse,
|
|
16
|
+
)
|
|
17
|
+
from .organization_memberships_update_response_role import (
|
|
18
|
+
OrganizationMembershipsUpdateResponseRole,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
__all__ = [
|
|
22
|
+
"OrganizationMembershipsListResponseItem",
|
|
23
|
+
"OrganizationMembershipsListResponseItemRole",
|
|
24
|
+
"OrganizationMembershipsUpdateRequestRole",
|
|
25
|
+
"OrganizationMembershipsUpdateResponse",
|
|
26
|
+
"OrganizationMembershipsUpdateResponseRole",
|
|
27
|
+
]
|
|
@@ -0,0 +1,33 @@
|
|
|
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 ...types.date import Date
|
|
10
|
+
from .organization_memberships_list_response_item_role import (
|
|
11
|
+
OrganizationMembershipsListResponseItemRole,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class OrganizationMembershipsListResponseItem(UniversalBaseModel):
|
|
16
|
+
member_id: typing_extensions.Annotated[str, FieldMetadata(alias="memberId")]
|
|
17
|
+
email: str
|
|
18
|
+
name: typing.Optional[str] = None
|
|
19
|
+
role: OrganizationMembershipsListResponseItemRole
|
|
20
|
+
created_at: typing_extensions.Annotated[
|
|
21
|
+
typing.Optional[Date], FieldMetadata(alias="createdAt")
|
|
22
|
+
] = None
|
|
23
|
+
|
|
24
|
+
if IS_PYDANTIC_V2:
|
|
25
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
26
|
+
extra="allow", frozen=True
|
|
27
|
+
) # type: ignore # Pydantic v2
|
|
28
|
+
else:
|
|
29
|
+
|
|
30
|
+
class Config:
|
|
31
|
+
frozen = True
|
|
32
|
+
smart_union = True
|
|
33
|
+
extra = pydantic.Extra.allow
|
mirascope/api/_generated/organization_memberships/types/organization_memberships_update_response.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
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 ...types.date import Date
|
|
10
|
+
from .organization_memberships_update_response_role import (
|
|
11
|
+
OrganizationMembershipsUpdateResponseRole,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class OrganizationMembershipsUpdateResponse(UniversalBaseModel):
|
|
16
|
+
member_id: typing_extensions.Annotated[str, FieldMetadata(alias="memberId")]
|
|
17
|
+
role: OrganizationMembershipsUpdateResponseRole
|
|
18
|
+
created_at: typing_extensions.Annotated[
|
|
19
|
+
typing.Optional[Date], FieldMetadata(alias="createdAt")
|
|
20
|
+
] = None
|
|
21
|
+
|
|
22
|
+
if IS_PYDANTIC_V2:
|
|
23
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
24
|
+
extra="allow", frozen=True
|
|
25
|
+
) # type: ignore # Pydantic v2
|
|
26
|
+
else:
|
|
27
|
+
|
|
28
|
+
class Config:
|
|
29
|
+
frozen = True
|
|
30
|
+
smart_union = True
|
|
31
|
+
extra = pydantic.Extra.allow
|
|
@@ -3,23 +3,49 @@
|
|
|
3
3
|
# isort: skip_file
|
|
4
4
|
|
|
5
5
|
from .types import (
|
|
6
|
+
OrganizationsCreatePaymentIntentResponse,
|
|
6
7
|
OrganizationsCreateResponse,
|
|
7
8
|
OrganizationsCreateResponseRole,
|
|
8
9
|
OrganizationsGetResponse,
|
|
9
10
|
OrganizationsGetResponseRole,
|
|
10
11
|
OrganizationsListResponseItem,
|
|
11
12
|
OrganizationsListResponseItemRole,
|
|
13
|
+
OrganizationsPreviewSubscriptionChangeRequestTargetPlan,
|
|
14
|
+
OrganizationsPreviewSubscriptionChangeResponse,
|
|
15
|
+
OrganizationsPreviewSubscriptionChangeResponseValidationErrorsItem,
|
|
16
|
+
OrganizationsPreviewSubscriptionChangeResponseValidationErrorsItemResource,
|
|
17
|
+
OrganizationsRouterBalanceResponse,
|
|
18
|
+
OrganizationsSubscriptionResponse,
|
|
19
|
+
OrganizationsSubscriptionResponseCurrentPlan,
|
|
20
|
+
OrganizationsSubscriptionResponsePaymentMethod,
|
|
21
|
+
OrganizationsSubscriptionResponseScheduledChange,
|
|
22
|
+
OrganizationsSubscriptionResponseScheduledChangeTargetPlan,
|
|
12
23
|
OrganizationsUpdateResponse,
|
|
13
24
|
OrganizationsUpdateResponseRole,
|
|
25
|
+
OrganizationsUpdateSubscriptionRequestTargetPlan,
|
|
26
|
+
OrganizationsUpdateSubscriptionResponse,
|
|
14
27
|
)
|
|
15
28
|
|
|
16
29
|
__all__ = [
|
|
30
|
+
"OrganizationsCreatePaymentIntentResponse",
|
|
17
31
|
"OrganizationsCreateResponse",
|
|
18
32
|
"OrganizationsCreateResponseRole",
|
|
19
33
|
"OrganizationsGetResponse",
|
|
20
34
|
"OrganizationsGetResponseRole",
|
|
21
35
|
"OrganizationsListResponseItem",
|
|
22
36
|
"OrganizationsListResponseItemRole",
|
|
37
|
+
"OrganizationsPreviewSubscriptionChangeRequestTargetPlan",
|
|
38
|
+
"OrganizationsPreviewSubscriptionChangeResponse",
|
|
39
|
+
"OrganizationsPreviewSubscriptionChangeResponseValidationErrorsItem",
|
|
40
|
+
"OrganizationsPreviewSubscriptionChangeResponseValidationErrorsItemResource",
|
|
41
|
+
"OrganizationsRouterBalanceResponse",
|
|
42
|
+
"OrganizationsSubscriptionResponse",
|
|
43
|
+
"OrganizationsSubscriptionResponseCurrentPlan",
|
|
44
|
+
"OrganizationsSubscriptionResponsePaymentMethod",
|
|
45
|
+
"OrganizationsSubscriptionResponseScheduledChange",
|
|
46
|
+
"OrganizationsSubscriptionResponseScheduledChangeTargetPlan",
|
|
23
47
|
"OrganizationsUpdateResponse",
|
|
24
48
|
"OrganizationsUpdateResponseRole",
|
|
49
|
+
"OrganizationsUpdateSubscriptionRequestTargetPlan",
|
|
50
|
+
"OrganizationsUpdateSubscriptionResponse",
|
|
25
51
|
]
|
|
@@ -5,10 +5,29 @@ 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 AsyncRawOrganizationsClient, RawOrganizationsClient
|
|
8
|
+
from .types.organizations_create_payment_intent_response import (
|
|
9
|
+
OrganizationsCreatePaymentIntentResponse,
|
|
10
|
+
)
|
|
8
11
|
from .types.organizations_create_response import OrganizationsCreateResponse
|
|
9
12
|
from .types.organizations_get_response import OrganizationsGetResponse
|
|
10
13
|
from .types.organizations_list_response_item import OrganizationsListResponseItem
|
|
14
|
+
from .types.organizations_preview_subscription_change_request_target_plan import (
|
|
15
|
+
OrganizationsPreviewSubscriptionChangeRequestTargetPlan,
|
|
16
|
+
)
|
|
17
|
+
from .types.organizations_preview_subscription_change_response import (
|
|
18
|
+
OrganizationsPreviewSubscriptionChangeResponse,
|
|
19
|
+
)
|
|
20
|
+
from .types.organizations_router_balance_response import (
|
|
21
|
+
OrganizationsRouterBalanceResponse,
|
|
22
|
+
)
|
|
23
|
+
from .types.organizations_subscription_response import OrganizationsSubscriptionResponse
|
|
11
24
|
from .types.organizations_update_response import OrganizationsUpdateResponse
|
|
25
|
+
from .types.organizations_update_subscription_request_target_plan import (
|
|
26
|
+
OrganizationsUpdateSubscriptionRequestTargetPlan,
|
|
27
|
+
)
|
|
28
|
+
from .types.organizations_update_subscription_response import (
|
|
29
|
+
OrganizationsUpdateSubscriptionResponse,
|
|
30
|
+
)
|
|
12
31
|
|
|
13
32
|
# this is used as the default value for optional parameters
|
|
14
33
|
OMIT = typing.cast(typing.Any, ...)
|
|
@@ -188,6 +207,203 @@ class OrganizationsClient:
|
|
|
188
207
|
_response = self._raw_client.delete(id, request_options=request_options)
|
|
189
208
|
return _response.data
|
|
190
209
|
|
|
210
|
+
def routerbalance(
|
|
211
|
+
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
212
|
+
) -> OrganizationsRouterBalanceResponse:
|
|
213
|
+
"""
|
|
214
|
+
Parameters
|
|
215
|
+
----------
|
|
216
|
+
id : str
|
|
217
|
+
|
|
218
|
+
request_options : typing.Optional[RequestOptions]
|
|
219
|
+
Request-specific configuration.
|
|
220
|
+
|
|
221
|
+
Returns
|
|
222
|
+
-------
|
|
223
|
+
OrganizationsRouterBalanceResponse
|
|
224
|
+
Success
|
|
225
|
+
|
|
226
|
+
Examples
|
|
227
|
+
--------
|
|
228
|
+
from mirascope.api._generated import Mirascope
|
|
229
|
+
|
|
230
|
+
client = Mirascope()
|
|
231
|
+
client.organizations.routerbalance(
|
|
232
|
+
id="id",
|
|
233
|
+
)
|
|
234
|
+
"""
|
|
235
|
+
_response = self._raw_client.routerbalance(id, request_options=request_options)
|
|
236
|
+
return _response.data
|
|
237
|
+
|
|
238
|
+
def createpaymentintent(
|
|
239
|
+
self,
|
|
240
|
+
id: str,
|
|
241
|
+
*,
|
|
242
|
+
amount: float,
|
|
243
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
244
|
+
) -> OrganizationsCreatePaymentIntentResponse:
|
|
245
|
+
"""
|
|
246
|
+
Parameters
|
|
247
|
+
----------
|
|
248
|
+
id : str
|
|
249
|
+
|
|
250
|
+
amount : float
|
|
251
|
+
a positive number
|
|
252
|
+
|
|
253
|
+
request_options : typing.Optional[RequestOptions]
|
|
254
|
+
Request-specific configuration.
|
|
255
|
+
|
|
256
|
+
Returns
|
|
257
|
+
-------
|
|
258
|
+
OrganizationsCreatePaymentIntentResponse
|
|
259
|
+
Success
|
|
260
|
+
|
|
261
|
+
Examples
|
|
262
|
+
--------
|
|
263
|
+
from mirascope.api._generated import Mirascope
|
|
264
|
+
|
|
265
|
+
client = Mirascope()
|
|
266
|
+
client.organizations.createpaymentintent(
|
|
267
|
+
id="id",
|
|
268
|
+
amount=1.1,
|
|
269
|
+
)
|
|
270
|
+
"""
|
|
271
|
+
_response = self._raw_client.createpaymentintent(
|
|
272
|
+
id, amount=amount, request_options=request_options
|
|
273
|
+
)
|
|
274
|
+
return _response.data
|
|
275
|
+
|
|
276
|
+
def subscription(
|
|
277
|
+
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
278
|
+
) -> OrganizationsSubscriptionResponse:
|
|
279
|
+
"""
|
|
280
|
+
Parameters
|
|
281
|
+
----------
|
|
282
|
+
id : str
|
|
283
|
+
|
|
284
|
+
request_options : typing.Optional[RequestOptions]
|
|
285
|
+
Request-specific configuration.
|
|
286
|
+
|
|
287
|
+
Returns
|
|
288
|
+
-------
|
|
289
|
+
OrganizationsSubscriptionResponse
|
|
290
|
+
Success
|
|
291
|
+
|
|
292
|
+
Examples
|
|
293
|
+
--------
|
|
294
|
+
from mirascope.api._generated import Mirascope
|
|
295
|
+
|
|
296
|
+
client = Mirascope()
|
|
297
|
+
client.organizations.subscription(
|
|
298
|
+
id="id",
|
|
299
|
+
)
|
|
300
|
+
"""
|
|
301
|
+
_response = self._raw_client.subscription(id, request_options=request_options)
|
|
302
|
+
return _response.data
|
|
303
|
+
|
|
304
|
+
def previewsubscriptionchange(
|
|
305
|
+
self,
|
|
306
|
+
id: str,
|
|
307
|
+
*,
|
|
308
|
+
target_plan: OrganizationsPreviewSubscriptionChangeRequestTargetPlan,
|
|
309
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
310
|
+
) -> OrganizationsPreviewSubscriptionChangeResponse:
|
|
311
|
+
"""
|
|
312
|
+
Parameters
|
|
313
|
+
----------
|
|
314
|
+
id : str
|
|
315
|
+
|
|
316
|
+
target_plan : OrganizationsPreviewSubscriptionChangeRequestTargetPlan
|
|
317
|
+
|
|
318
|
+
request_options : typing.Optional[RequestOptions]
|
|
319
|
+
Request-specific configuration.
|
|
320
|
+
|
|
321
|
+
Returns
|
|
322
|
+
-------
|
|
323
|
+
OrganizationsPreviewSubscriptionChangeResponse
|
|
324
|
+
Success
|
|
325
|
+
|
|
326
|
+
Examples
|
|
327
|
+
--------
|
|
328
|
+
from mirascope.api._generated import Mirascope
|
|
329
|
+
|
|
330
|
+
client = Mirascope()
|
|
331
|
+
client.organizations.previewsubscriptionchange(
|
|
332
|
+
id="id",
|
|
333
|
+
target_plan="free",
|
|
334
|
+
)
|
|
335
|
+
"""
|
|
336
|
+
_response = self._raw_client.previewsubscriptionchange(
|
|
337
|
+
id, target_plan=target_plan, request_options=request_options
|
|
338
|
+
)
|
|
339
|
+
return _response.data
|
|
340
|
+
|
|
341
|
+
def updatesubscription(
|
|
342
|
+
self,
|
|
343
|
+
id: str,
|
|
344
|
+
*,
|
|
345
|
+
target_plan: OrganizationsUpdateSubscriptionRequestTargetPlan,
|
|
346
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
347
|
+
) -> OrganizationsUpdateSubscriptionResponse:
|
|
348
|
+
"""
|
|
349
|
+
Parameters
|
|
350
|
+
----------
|
|
351
|
+
id : str
|
|
352
|
+
|
|
353
|
+
target_plan : OrganizationsUpdateSubscriptionRequestTargetPlan
|
|
354
|
+
|
|
355
|
+
request_options : typing.Optional[RequestOptions]
|
|
356
|
+
Request-specific configuration.
|
|
357
|
+
|
|
358
|
+
Returns
|
|
359
|
+
-------
|
|
360
|
+
OrganizationsUpdateSubscriptionResponse
|
|
361
|
+
Success
|
|
362
|
+
|
|
363
|
+
Examples
|
|
364
|
+
--------
|
|
365
|
+
from mirascope.api._generated import Mirascope
|
|
366
|
+
|
|
367
|
+
client = Mirascope()
|
|
368
|
+
client.organizations.updatesubscription(
|
|
369
|
+
id="id",
|
|
370
|
+
target_plan="free",
|
|
371
|
+
)
|
|
372
|
+
"""
|
|
373
|
+
_response = self._raw_client.updatesubscription(
|
|
374
|
+
id, target_plan=target_plan, request_options=request_options
|
|
375
|
+
)
|
|
376
|
+
return _response.data
|
|
377
|
+
|
|
378
|
+
def cancelscheduleddowngrade(
|
|
379
|
+
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
380
|
+
) -> None:
|
|
381
|
+
"""
|
|
382
|
+
Parameters
|
|
383
|
+
----------
|
|
384
|
+
id : str
|
|
385
|
+
|
|
386
|
+
request_options : typing.Optional[RequestOptions]
|
|
387
|
+
Request-specific configuration.
|
|
388
|
+
|
|
389
|
+
Returns
|
|
390
|
+
-------
|
|
391
|
+
None
|
|
392
|
+
|
|
393
|
+
Examples
|
|
394
|
+
--------
|
|
395
|
+
from mirascope.api._generated import Mirascope
|
|
396
|
+
|
|
397
|
+
client = Mirascope()
|
|
398
|
+
client.organizations.cancelscheduleddowngrade(
|
|
399
|
+
id="id",
|
|
400
|
+
)
|
|
401
|
+
"""
|
|
402
|
+
_response = self._raw_client.cancelscheduleddowngrade(
|
|
403
|
+
id, request_options=request_options
|
|
404
|
+
)
|
|
405
|
+
return _response.data
|
|
406
|
+
|
|
191
407
|
|
|
192
408
|
class AsyncOrganizationsClient:
|
|
193
409
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
@@ -402,3 +618,252 @@ class AsyncOrganizationsClient:
|
|
|
402
618
|
"""
|
|
403
619
|
_response = await self._raw_client.delete(id, request_options=request_options)
|
|
404
620
|
return _response.data
|
|
621
|
+
|
|
622
|
+
async def routerbalance(
|
|
623
|
+
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
624
|
+
) -> OrganizationsRouterBalanceResponse:
|
|
625
|
+
"""
|
|
626
|
+
Parameters
|
|
627
|
+
----------
|
|
628
|
+
id : str
|
|
629
|
+
|
|
630
|
+
request_options : typing.Optional[RequestOptions]
|
|
631
|
+
Request-specific configuration.
|
|
632
|
+
|
|
633
|
+
Returns
|
|
634
|
+
-------
|
|
635
|
+
OrganizationsRouterBalanceResponse
|
|
636
|
+
Success
|
|
637
|
+
|
|
638
|
+
Examples
|
|
639
|
+
--------
|
|
640
|
+
import asyncio
|
|
641
|
+
|
|
642
|
+
from mirascope.api._generated import AsyncMirascope
|
|
643
|
+
|
|
644
|
+
client = AsyncMirascope()
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
async def main() -> None:
|
|
648
|
+
await client.organizations.routerbalance(
|
|
649
|
+
id="id",
|
|
650
|
+
)
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+
asyncio.run(main())
|
|
654
|
+
"""
|
|
655
|
+
_response = await self._raw_client.routerbalance(
|
|
656
|
+
id, request_options=request_options
|
|
657
|
+
)
|
|
658
|
+
return _response.data
|
|
659
|
+
|
|
660
|
+
async def createpaymentintent(
|
|
661
|
+
self,
|
|
662
|
+
id: str,
|
|
663
|
+
*,
|
|
664
|
+
amount: float,
|
|
665
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
666
|
+
) -> OrganizationsCreatePaymentIntentResponse:
|
|
667
|
+
"""
|
|
668
|
+
Parameters
|
|
669
|
+
----------
|
|
670
|
+
id : str
|
|
671
|
+
|
|
672
|
+
amount : float
|
|
673
|
+
a positive number
|
|
674
|
+
|
|
675
|
+
request_options : typing.Optional[RequestOptions]
|
|
676
|
+
Request-specific configuration.
|
|
677
|
+
|
|
678
|
+
Returns
|
|
679
|
+
-------
|
|
680
|
+
OrganizationsCreatePaymentIntentResponse
|
|
681
|
+
Success
|
|
682
|
+
|
|
683
|
+
Examples
|
|
684
|
+
--------
|
|
685
|
+
import asyncio
|
|
686
|
+
|
|
687
|
+
from mirascope.api._generated import AsyncMirascope
|
|
688
|
+
|
|
689
|
+
client = AsyncMirascope()
|
|
690
|
+
|
|
691
|
+
|
|
692
|
+
async def main() -> None:
|
|
693
|
+
await client.organizations.createpaymentintent(
|
|
694
|
+
id="id",
|
|
695
|
+
amount=1.1,
|
|
696
|
+
)
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
asyncio.run(main())
|
|
700
|
+
"""
|
|
701
|
+
_response = await self._raw_client.createpaymentintent(
|
|
702
|
+
id, amount=amount, request_options=request_options
|
|
703
|
+
)
|
|
704
|
+
return _response.data
|
|
705
|
+
|
|
706
|
+
async def subscription(
|
|
707
|
+
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
708
|
+
) -> OrganizationsSubscriptionResponse:
|
|
709
|
+
"""
|
|
710
|
+
Parameters
|
|
711
|
+
----------
|
|
712
|
+
id : str
|
|
713
|
+
|
|
714
|
+
request_options : typing.Optional[RequestOptions]
|
|
715
|
+
Request-specific configuration.
|
|
716
|
+
|
|
717
|
+
Returns
|
|
718
|
+
-------
|
|
719
|
+
OrganizationsSubscriptionResponse
|
|
720
|
+
Success
|
|
721
|
+
|
|
722
|
+
Examples
|
|
723
|
+
--------
|
|
724
|
+
import asyncio
|
|
725
|
+
|
|
726
|
+
from mirascope.api._generated import AsyncMirascope
|
|
727
|
+
|
|
728
|
+
client = AsyncMirascope()
|
|
729
|
+
|
|
730
|
+
|
|
731
|
+
async def main() -> None:
|
|
732
|
+
await client.organizations.subscription(
|
|
733
|
+
id="id",
|
|
734
|
+
)
|
|
735
|
+
|
|
736
|
+
|
|
737
|
+
asyncio.run(main())
|
|
738
|
+
"""
|
|
739
|
+
_response = await self._raw_client.subscription(
|
|
740
|
+
id, request_options=request_options
|
|
741
|
+
)
|
|
742
|
+
return _response.data
|
|
743
|
+
|
|
744
|
+
async def previewsubscriptionchange(
|
|
745
|
+
self,
|
|
746
|
+
id: str,
|
|
747
|
+
*,
|
|
748
|
+
target_plan: OrganizationsPreviewSubscriptionChangeRequestTargetPlan,
|
|
749
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
750
|
+
) -> OrganizationsPreviewSubscriptionChangeResponse:
|
|
751
|
+
"""
|
|
752
|
+
Parameters
|
|
753
|
+
----------
|
|
754
|
+
id : str
|
|
755
|
+
|
|
756
|
+
target_plan : OrganizationsPreviewSubscriptionChangeRequestTargetPlan
|
|
757
|
+
|
|
758
|
+
request_options : typing.Optional[RequestOptions]
|
|
759
|
+
Request-specific configuration.
|
|
760
|
+
|
|
761
|
+
Returns
|
|
762
|
+
-------
|
|
763
|
+
OrganizationsPreviewSubscriptionChangeResponse
|
|
764
|
+
Success
|
|
765
|
+
|
|
766
|
+
Examples
|
|
767
|
+
--------
|
|
768
|
+
import asyncio
|
|
769
|
+
|
|
770
|
+
from mirascope.api._generated import AsyncMirascope
|
|
771
|
+
|
|
772
|
+
client = AsyncMirascope()
|
|
773
|
+
|
|
774
|
+
|
|
775
|
+
async def main() -> None:
|
|
776
|
+
await client.organizations.previewsubscriptionchange(
|
|
777
|
+
id="id",
|
|
778
|
+
target_plan="free",
|
|
779
|
+
)
|
|
780
|
+
|
|
781
|
+
|
|
782
|
+
asyncio.run(main())
|
|
783
|
+
"""
|
|
784
|
+
_response = await self._raw_client.previewsubscriptionchange(
|
|
785
|
+
id, target_plan=target_plan, request_options=request_options
|
|
786
|
+
)
|
|
787
|
+
return _response.data
|
|
788
|
+
|
|
789
|
+
async def updatesubscription(
|
|
790
|
+
self,
|
|
791
|
+
id: str,
|
|
792
|
+
*,
|
|
793
|
+
target_plan: OrganizationsUpdateSubscriptionRequestTargetPlan,
|
|
794
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
795
|
+
) -> OrganizationsUpdateSubscriptionResponse:
|
|
796
|
+
"""
|
|
797
|
+
Parameters
|
|
798
|
+
----------
|
|
799
|
+
id : str
|
|
800
|
+
|
|
801
|
+
target_plan : OrganizationsUpdateSubscriptionRequestTargetPlan
|
|
802
|
+
|
|
803
|
+
request_options : typing.Optional[RequestOptions]
|
|
804
|
+
Request-specific configuration.
|
|
805
|
+
|
|
806
|
+
Returns
|
|
807
|
+
-------
|
|
808
|
+
OrganizationsUpdateSubscriptionResponse
|
|
809
|
+
Success
|
|
810
|
+
|
|
811
|
+
Examples
|
|
812
|
+
--------
|
|
813
|
+
import asyncio
|
|
814
|
+
|
|
815
|
+
from mirascope.api._generated import AsyncMirascope
|
|
816
|
+
|
|
817
|
+
client = AsyncMirascope()
|
|
818
|
+
|
|
819
|
+
|
|
820
|
+
async def main() -> None:
|
|
821
|
+
await client.organizations.updatesubscription(
|
|
822
|
+
id="id",
|
|
823
|
+
target_plan="free",
|
|
824
|
+
)
|
|
825
|
+
|
|
826
|
+
|
|
827
|
+
asyncio.run(main())
|
|
828
|
+
"""
|
|
829
|
+
_response = await self._raw_client.updatesubscription(
|
|
830
|
+
id, target_plan=target_plan, request_options=request_options
|
|
831
|
+
)
|
|
832
|
+
return _response.data
|
|
833
|
+
|
|
834
|
+
async def cancelscheduleddowngrade(
|
|
835
|
+
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
836
|
+
) -> None:
|
|
837
|
+
"""
|
|
838
|
+
Parameters
|
|
839
|
+
----------
|
|
840
|
+
id : str
|
|
841
|
+
|
|
842
|
+
request_options : typing.Optional[RequestOptions]
|
|
843
|
+
Request-specific configuration.
|
|
844
|
+
|
|
845
|
+
Returns
|
|
846
|
+
-------
|
|
847
|
+
None
|
|
848
|
+
|
|
849
|
+
Examples
|
|
850
|
+
--------
|
|
851
|
+
import asyncio
|
|
852
|
+
|
|
853
|
+
from mirascope.api._generated import AsyncMirascope
|
|
854
|
+
|
|
855
|
+
client = AsyncMirascope()
|
|
856
|
+
|
|
857
|
+
|
|
858
|
+
async def main() -> None:
|
|
859
|
+
await client.organizations.cancelscheduleddowngrade(
|
|
860
|
+
id="id",
|
|
861
|
+
)
|
|
862
|
+
|
|
863
|
+
|
|
864
|
+
asyncio.run(main())
|
|
865
|
+
"""
|
|
866
|
+
_response = await self._raw_client.cancelscheduleddowngrade(
|
|
867
|
+
id, request_options=request_options
|
|
868
|
+
)
|
|
869
|
+
return _response.data
|