From 54d65bd05cbcab7575cad43086e63f8a8992ff99 Mon Sep 17 00:00:00 2001 From: HareeshBahuleyan <13996331+HareeshBahuleyan@users.noreply.github.com> Date: Fri, 4 Sep 2026 10:55:53 +0000 Subject: [PATCH] chore: regenerate SDK client core from Otari OpenAPI spec --- src/otari/_client/__init__.py | 44 +++- .../_client/api/organization_usage_api.py | 54 ++--- src/otari/_client/api/usage_api.py | 54 ++--- src/otari/_client/models/__init__.py | 22 +- src/otari/_client/models/cache_miss_reason.py | 200 ++++++++++++++++++ ...t_completion_message_function_tool_call.py | 15 +- src/otari/_client/models/content10.py | 55 +++-- src/otari/_client/models/content11.py | 70 +++--- src/otari/_client/models/content12.py | 75 +++---- src/otari/_client/models/content13.py | 74 +++++-- src/otari/_client/models/content14.py | 44 ++-- src/otari/_client/models/content15.py | 55 +++-- src/otari/_client/models/content16.py | 137 ++++++++++++ ...{content16_inner.py => content17_inner.py} | 80 ++++--- src/otari/_client/models/content4.py | 59 ++++-- src/otari/_client/models/content5.py | 59 ++---- src/otari/_client/models/content6.py | 78 ++++--- src/otari/_client/models/content7.py | 93 +++----- src/otari/_client/models/content8.py | 74 +++++-- src/otari/_client/models/content9.py | 44 ++-- src/otari/_client/models/message_response.py | 21 +- src/otari/_client/models/messages_request.py | 11 +- ...mr_beta_advisor_message_iteration_usage.py | 133 ++++++++++++ .../mr_beta_advisor_redacted_result_block.py | 117 ++++++++++ .../models/mr_beta_advisor_result_block.py | 117 ++++++++++ .../mr_beta_advisor_tool_result_block.py | 116 ++++++++++ .../mr_beta_advisor_tool_result_error.py | 117 ++++++++++ ...a_bash_code_execution_tool_result_block.py | 6 +- .../mr_beta_cache_miss_messages_changed.py | 110 ++++++++++ .../mr_beta_cache_miss_model_changed.py | 110 ++++++++++ ...a_cache_miss_previous_message_not_found.py | 108 ++++++++++ .../mr_beta_cache_miss_system_changed.py | 110 ++++++++++ .../mr_beta_cache_miss_tools_changed.py | 110 ++++++++++ .../models/mr_beta_cache_miss_unavailable.py | 108 ++++++++++ ...r_beta_code_execution_tool_result_block.py | 6 +- .../models/mr_beta_compaction_block.py | 11 +- ...ics_fallback.py => mr_beta_diagnostics.py} | 18 +- .../_client/models/mr_beta_fallback_block.py | 125 +++++++++++ .../_client/models/mr_beta_fallback_info.py | 105 +++++++++ ...r_beta_fallback_message_iteration_usage.py | 133 ++++++++++++ .../mr_beta_fallback_refusal_trigger.py | 125 +++++++++++ .../models/mr_beta_mcp_tool_result_block.py | 6 +- .../models/mr_beta_message_iteration_usage.py | 8 +- .../models/mr_beta_server_tool_use_block.py | 4 +- ...editor_code_execution_tool_result_block.py | 6 +- .../mr_beta_tool_search_tool_result_block.py | 6 +- .../_client/models/mr_beta_tool_use_block.py | 11 +- .../mr_beta_web_fetch_tool_result_block.py | 6 +- ..._beta_web_fetch_tool_result_error_block.py | 4 +- .../mr_beta_web_search_tool_result_block.py | 6 +- .../mr_code_execution_tool_result_block.py | 6 +- src/otari/_client/models/mr_message_usage.py | 13 +- .../mr_message_usage_iterations_inner.py | 42 +++- .../models/mr_output_tokens_details.py | 101 +++++++++ .../_client/models/mr_refusal_stop_details.py | 4 +- ...editor_code_execution_tool_result_block.py | 6 +- .../mr_tool_search_tool_result_block.py | 6 +- src/otari/_client/models/mr_tool_use_block.py | 11 +- .../models/mr_web_fetch_tool_result_block.py | 6 +- .../mr_web_fetch_tool_result_error_block.py | 4 +- .../models/mr_web_search_tool_result_block.py | 6 +- src/otari/_client/models/usage_entry.py | 4 +- 62 files changed, 2921 insertions(+), 548 deletions(-) create mode 100644 src/otari/_client/models/cache_miss_reason.py create mode 100644 src/otari/_client/models/content16.py rename src/otari/_client/models/{content16_inner.py => content17_inner.py} (75%) create mode 100644 src/otari/_client/models/mr_beta_advisor_message_iteration_usage.py create mode 100644 src/otari/_client/models/mr_beta_advisor_redacted_result_block.py create mode 100644 src/otari/_client/models/mr_beta_advisor_result_block.py create mode 100644 src/otari/_client/models/mr_beta_advisor_tool_result_block.py create mode 100644 src/otari/_client/models/mr_beta_advisor_tool_result_error.py create mode 100644 src/otari/_client/models/mr_beta_cache_miss_messages_changed.py create mode 100644 src/otari/_client/models/mr_beta_cache_miss_model_changed.py create mode 100644 src/otari/_client/models/mr_beta_cache_miss_previous_message_not_found.py create mode 100644 src/otari/_client/models/mr_beta_cache_miss_system_changed.py create mode 100644 src/otari/_client/models/mr_beta_cache_miss_tools_changed.py create mode 100644 src/otari/_client/models/mr_beta_cache_miss_unavailable.py rename src/otari/_client/models/{mr_beta_diagnostics_fallback.py => mr_beta_diagnostics.py} (78%) create mode 100644 src/otari/_client/models/mr_beta_fallback_block.py create mode 100644 src/otari/_client/models/mr_beta_fallback_info.py create mode 100644 src/otari/_client/models/mr_beta_fallback_message_iteration_usage.py create mode 100644 src/otari/_client/models/mr_beta_fallback_refusal_trigger.py create mode 100644 src/otari/_client/models/mr_output_tokens_details.py diff --git a/src/otari/_client/__init__.py b/src/otari/_client/__init__.py index f4027612..d96eaf01 100644 --- a/src/otari/_client/__init__.py +++ b/src/otari/_client/__init__.py @@ -133,6 +133,7 @@ "CCKTopLogprob", "CCPromptTokensDetails", "CCTopLogprob", + "CacheMissReason", "Caller", "Caller1", "CallerIdentityPublic", @@ -155,7 +156,8 @@ "Content13", "Content14", "Content15", - "Content16Inner", + "Content16", + "Content17Inner", "Content2", "Content2AnyOfInner", "Content3", @@ -227,12 +229,23 @@ "MRBashCodeExecutionResultBlock", "MRBashCodeExecutionToolResultBlock", "MRBashCodeExecutionToolResultError", + "MRBetaAdvisorMessageIterationUsage", + "MRBetaAdvisorRedactedResultBlock", + "MRBetaAdvisorResultBlock", + "MRBetaAdvisorToolResultBlock", + "MRBetaAdvisorToolResultError", "MRBetaBase64PDFSource", "MRBetaBashCodeExecutionOutputBlock", "MRBetaBashCodeExecutionResultBlock", "MRBetaBashCodeExecutionToolResultBlock", "MRBetaBashCodeExecutionToolResultError", "MRBetaCacheCreation", + "MRBetaCacheMissMessagesChanged", + "MRBetaCacheMissModelChanged", + "MRBetaCacheMissPreviousMessageNotFound", + "MRBetaCacheMissSystemChanged", + "MRBetaCacheMissToolsChanged", + "MRBetaCacheMissUnavailable", "MRBetaCitationCharLocation", "MRBetaCitationConfig", "MRBetaCitationContentBlockLocation", @@ -250,10 +263,14 @@ "MRBetaContainer", "MRBetaContainerUploadBlock", "MRBetaContextManagementResponse", - "MRBetaDiagnosticsFallback", + "MRBetaDiagnostics", "MRBetaDirectCaller", "MRBetaDocumentBlock", "MRBetaEncryptedCodeExecutionResultBlock", + "MRBetaFallbackBlock", + "MRBetaFallbackInfo", + "MRBetaFallbackMessageIterationUsage", + "MRBetaFallbackRefusalTrigger", "MRBetaMCPToolResultBlock", "MRBetaMCPToolUseBlock", "MRBetaMessageIterationUsage", @@ -299,6 +316,7 @@ "MREncryptedCodeExecutionResultBlock", "MRMessageUsage", "MRMessageUsageIterationsInner", + "MROutputTokensDetails", "MRPlainTextSource", "MRRedactedThinkingBlock", "MRRefusalStopDetails", @@ -651,6 +669,7 @@ from otari._client.models.cck_top_logprob import CCKTopLogprob as CCKTopLogprob from otari._client.models.cc_prompt_tokens_details import CCPromptTokensDetails as CCPromptTokensDetails from otari._client.models.cc_top_logprob import CCTopLogprob as CCTopLogprob +from otari._client.models.cache_miss_reason import CacheMissReason as CacheMissReason from otari._client.models.caller import Caller as Caller from otari._client.models.caller1 import Caller1 as Caller1 from otari._client.models.caller_identity_public import CallerIdentityPublic as CallerIdentityPublic @@ -673,7 +692,8 @@ from otari._client.models.content13 import Content13 as Content13 from otari._client.models.content14 import Content14 as Content14 from otari._client.models.content15 import Content15 as Content15 -from otari._client.models.content16_inner import Content16Inner as Content16Inner +from otari._client.models.content16 import Content16 as Content16 +from otari._client.models.content17_inner import Content17Inner as Content17Inner from otari._client.models.content2 import Content2 as Content2 from otari._client.models.content2_any_of_inner import Content2AnyOfInner as Content2AnyOfInner from otari._client.models.content3 import Content3 as Content3 @@ -745,12 +765,23 @@ from otari._client.models.mr_bash_code_execution_result_block import MRBashCodeExecutionResultBlock as MRBashCodeExecutionResultBlock from otari._client.models.mr_bash_code_execution_tool_result_block import MRBashCodeExecutionToolResultBlock as MRBashCodeExecutionToolResultBlock from otari._client.models.mr_bash_code_execution_tool_result_error import MRBashCodeExecutionToolResultError as MRBashCodeExecutionToolResultError +from otari._client.models.mr_beta_advisor_message_iteration_usage import MRBetaAdvisorMessageIterationUsage as MRBetaAdvisorMessageIterationUsage +from otari._client.models.mr_beta_advisor_redacted_result_block import MRBetaAdvisorRedactedResultBlock as MRBetaAdvisorRedactedResultBlock +from otari._client.models.mr_beta_advisor_result_block import MRBetaAdvisorResultBlock as MRBetaAdvisorResultBlock +from otari._client.models.mr_beta_advisor_tool_result_block import MRBetaAdvisorToolResultBlock as MRBetaAdvisorToolResultBlock +from otari._client.models.mr_beta_advisor_tool_result_error import MRBetaAdvisorToolResultError as MRBetaAdvisorToolResultError from otari._client.models.mr_beta_base64_pdf_source import MRBetaBase64PDFSource as MRBetaBase64PDFSource from otari._client.models.mr_beta_bash_code_execution_output_block import MRBetaBashCodeExecutionOutputBlock as MRBetaBashCodeExecutionOutputBlock from otari._client.models.mr_beta_bash_code_execution_result_block import MRBetaBashCodeExecutionResultBlock as MRBetaBashCodeExecutionResultBlock from otari._client.models.mr_beta_bash_code_execution_tool_result_block import MRBetaBashCodeExecutionToolResultBlock as MRBetaBashCodeExecutionToolResultBlock from otari._client.models.mr_beta_bash_code_execution_tool_result_error import MRBetaBashCodeExecutionToolResultError as MRBetaBashCodeExecutionToolResultError from otari._client.models.mr_beta_cache_creation import MRBetaCacheCreation as MRBetaCacheCreation +from otari._client.models.mr_beta_cache_miss_messages_changed import MRBetaCacheMissMessagesChanged as MRBetaCacheMissMessagesChanged +from otari._client.models.mr_beta_cache_miss_model_changed import MRBetaCacheMissModelChanged as MRBetaCacheMissModelChanged +from otari._client.models.mr_beta_cache_miss_previous_message_not_found import MRBetaCacheMissPreviousMessageNotFound as MRBetaCacheMissPreviousMessageNotFound +from otari._client.models.mr_beta_cache_miss_system_changed import MRBetaCacheMissSystemChanged as MRBetaCacheMissSystemChanged +from otari._client.models.mr_beta_cache_miss_tools_changed import MRBetaCacheMissToolsChanged as MRBetaCacheMissToolsChanged +from otari._client.models.mr_beta_cache_miss_unavailable import MRBetaCacheMissUnavailable as MRBetaCacheMissUnavailable from otari._client.models.mr_beta_citation_char_location import MRBetaCitationCharLocation as MRBetaCitationCharLocation from otari._client.models.mr_beta_citation_config import MRBetaCitationConfig as MRBetaCitationConfig from otari._client.models.mr_beta_citation_content_block_location import MRBetaCitationContentBlockLocation as MRBetaCitationContentBlockLocation @@ -768,10 +799,14 @@ from otari._client.models.mr_beta_container import MRBetaContainer as MRBetaContainer from otari._client.models.mr_beta_container_upload_block import MRBetaContainerUploadBlock as MRBetaContainerUploadBlock from otari._client.models.mr_beta_context_management_response import MRBetaContextManagementResponse as MRBetaContextManagementResponse -from otari._client.models.mr_beta_diagnostics_fallback import MRBetaDiagnosticsFallback as MRBetaDiagnosticsFallback +from otari._client.models.mr_beta_diagnostics import MRBetaDiagnostics as MRBetaDiagnostics from otari._client.models.mr_beta_direct_caller import MRBetaDirectCaller as MRBetaDirectCaller from otari._client.models.mr_beta_document_block import MRBetaDocumentBlock as MRBetaDocumentBlock from otari._client.models.mr_beta_encrypted_code_execution_result_block import MRBetaEncryptedCodeExecutionResultBlock as MRBetaEncryptedCodeExecutionResultBlock +from otari._client.models.mr_beta_fallback_block import MRBetaFallbackBlock as MRBetaFallbackBlock +from otari._client.models.mr_beta_fallback_info import MRBetaFallbackInfo as MRBetaFallbackInfo +from otari._client.models.mr_beta_fallback_message_iteration_usage import MRBetaFallbackMessageIterationUsage as MRBetaFallbackMessageIterationUsage +from otari._client.models.mr_beta_fallback_refusal_trigger import MRBetaFallbackRefusalTrigger as MRBetaFallbackRefusalTrigger from otari._client.models.mr_beta_mcp_tool_result_block import MRBetaMCPToolResultBlock as MRBetaMCPToolResultBlock from otari._client.models.mr_beta_mcp_tool_use_block import MRBetaMCPToolUseBlock as MRBetaMCPToolUseBlock from otari._client.models.mr_beta_message_iteration_usage import MRBetaMessageIterationUsage as MRBetaMessageIterationUsage @@ -817,6 +852,7 @@ from otari._client.models.mr_encrypted_code_execution_result_block import MREncryptedCodeExecutionResultBlock as MREncryptedCodeExecutionResultBlock from otari._client.models.mr_message_usage import MRMessageUsage as MRMessageUsage from otari._client.models.mr_message_usage_iterations_inner import MRMessageUsageIterationsInner as MRMessageUsageIterationsInner +from otari._client.models.mr_output_tokens_details import MROutputTokensDetails as MROutputTokensDetails from otari._client.models.mr_plain_text_source import MRPlainTextSource as MRPlainTextSource from otari._client.models.mr_redacted_thinking_block import MRRedactedThinkingBlock as MRRedactedThinkingBlock from otari._client.models.mr_refusal_stop_details import MRRefusalStopDetails as MRRefusalStopDetails diff --git a/src/otari/_client/api/organization_usage_api.py b/src/otari/_client/api/organization_usage_api.py index 486cb593..ddfe5601 100644 --- a/src/otari/_client/api/organization_usage_api.py +++ b/src/otari/_client/api/organization_usage_api.py @@ -59,7 +59,7 @@ def count_organization_usage_v1_organizations_me_usage_count_get( api_key_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.")] = None, priced: Annotated[Optional[StrictBool], Field(description="Filter by token-pricing state: true = only rows whose model tokens were priced, false = only rows that still need pricing (no cost at all, or tokens that were never metered because the model had no rate). A row charged only for gateway-run tool calls still counts as needing pricing.")] = None, tool: Annotated[Optional[StrictStr], Field(description="Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically.")] = None, - counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget")] = None, + counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key")] = None, request_group_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="Filter to the rows of one or more request groups; repeatable (request_group_id=a&request_group_id=b). A routed request writes one row per attempt, all sharing a request_group_id, so this returns a request's whole plan: its absorbed attempts and the attempt that served it. Ignore ordering by timestamp and read attempt_position to reconstruct the plan. At most 1000 ids per call.")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only usage recorded in this workspace.")] = None, _request_timeout: Union[ @@ -77,7 +77,7 @@ def count_organization_usage_v1_organizations_me_usage_count_get( ) -> UsageCount: """Count Organization Usage - Total rows matching these filters, within the caller's scope. Serves the paginator's \"N of M\" beside the list above, and is scoped the same way, so the total can never describe more rows than the list will show. + Total rows matching these filters, within the caller's scope. Serves the paginator's \"N of M\" beside the list above, and is scoped the same way, so the total can never describe more rows than the list will show. Unlike the deployment-wide ``GET /v1/usage/count``, ``counts_toward_budget=false`` is not narrowed to imported rows here: that narrowing sizes the bulk mutations, and this surface has none. So this total keeps matching the list beside it. :param start_date: Return logs with timestamp >= start_date (ISO 8601 or Unix epoch seconds) :type start_date: datetime @@ -105,7 +105,7 @@ def count_organization_usage_v1_organizations_me_usage_count_get( :type priced: bool :param tool: Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically. :type tool: str - :param counts_toward_budget: Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget + :param counts_toward_budget: Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key :type counts_toward_budget: bool :param request_group_id: Filter to the rows of one or more request groups; repeatable (request_group_id=a&request_group_id=b). A routed request writes one row per attempt, all sharing a request_group_id, so this returns a request's whole plan: its absorbed attempts and the attempt that served it. Ignore ordering by timestamp and read attempt_position to reconstruct the plan. At most 1000 ids per call. :type request_group_id: List[str] @@ -187,7 +187,7 @@ def count_organization_usage_v1_organizations_me_usage_count_get_with_http_info( api_key_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.")] = None, priced: Annotated[Optional[StrictBool], Field(description="Filter by token-pricing state: true = only rows whose model tokens were priced, false = only rows that still need pricing (no cost at all, or tokens that were never metered because the model had no rate). A row charged only for gateway-run tool calls still counts as needing pricing.")] = None, tool: Annotated[Optional[StrictStr], Field(description="Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically.")] = None, - counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget")] = None, + counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key")] = None, request_group_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="Filter to the rows of one or more request groups; repeatable (request_group_id=a&request_group_id=b). A routed request writes one row per attempt, all sharing a request_group_id, so this returns a request's whole plan: its absorbed attempts and the attempt that served it. Ignore ordering by timestamp and read attempt_position to reconstruct the plan. At most 1000 ids per call.")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only usage recorded in this workspace.")] = None, _request_timeout: Union[ @@ -205,7 +205,7 @@ def count_organization_usage_v1_organizations_me_usage_count_get_with_http_info( ) -> ApiResponse[UsageCount]: """Count Organization Usage - Total rows matching these filters, within the caller's scope. Serves the paginator's \"N of M\" beside the list above, and is scoped the same way, so the total can never describe more rows than the list will show. + Total rows matching these filters, within the caller's scope. Serves the paginator's \"N of M\" beside the list above, and is scoped the same way, so the total can never describe more rows than the list will show. Unlike the deployment-wide ``GET /v1/usage/count``, ``counts_toward_budget=false`` is not narrowed to imported rows here: that narrowing sizes the bulk mutations, and this surface has none. So this total keeps matching the list beside it. :param start_date: Return logs with timestamp >= start_date (ISO 8601 or Unix epoch seconds) :type start_date: datetime @@ -233,7 +233,7 @@ def count_organization_usage_v1_organizations_me_usage_count_get_with_http_info( :type priced: bool :param tool: Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically. :type tool: str - :param counts_toward_budget: Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget + :param counts_toward_budget: Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key :type counts_toward_budget: bool :param request_group_id: Filter to the rows of one or more request groups; repeatable (request_group_id=a&request_group_id=b). A routed request writes one row per attempt, all sharing a request_group_id, so this returns a request's whole plan: its absorbed attempts and the attempt that served it. Ignore ordering by timestamp and read attempt_position to reconstruct the plan. At most 1000 ids per call. :type request_group_id: List[str] @@ -315,7 +315,7 @@ def count_organization_usage_v1_organizations_me_usage_count_get_without_preload api_key_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.")] = None, priced: Annotated[Optional[StrictBool], Field(description="Filter by token-pricing state: true = only rows whose model tokens were priced, false = only rows that still need pricing (no cost at all, or tokens that were never metered because the model had no rate). A row charged only for gateway-run tool calls still counts as needing pricing.")] = None, tool: Annotated[Optional[StrictStr], Field(description="Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically.")] = None, - counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget")] = None, + counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key")] = None, request_group_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="Filter to the rows of one or more request groups; repeatable (request_group_id=a&request_group_id=b). A routed request writes one row per attempt, all sharing a request_group_id, so this returns a request's whole plan: its absorbed attempts and the attempt that served it. Ignore ordering by timestamp and read attempt_position to reconstruct the plan. At most 1000 ids per call.")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only usage recorded in this workspace.")] = None, _request_timeout: Union[ @@ -333,7 +333,7 @@ def count_organization_usage_v1_organizations_me_usage_count_get_without_preload ) -> RESTResponseType: """Count Organization Usage - Total rows matching these filters, within the caller's scope. Serves the paginator's \"N of M\" beside the list above, and is scoped the same way, so the total can never describe more rows than the list will show. + Total rows matching these filters, within the caller's scope. Serves the paginator's \"N of M\" beside the list above, and is scoped the same way, so the total can never describe more rows than the list will show. Unlike the deployment-wide ``GET /v1/usage/count``, ``counts_toward_budget=false`` is not narrowed to imported rows here: that narrowing sizes the bulk mutations, and this surface has none. So this total keeps matching the list beside it. :param start_date: Return logs with timestamp >= start_date (ISO 8601 or Unix epoch seconds) :type start_date: datetime @@ -361,7 +361,7 @@ def count_organization_usage_v1_organizations_me_usage_count_get_without_preload :type priced: bool :param tool: Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically. :type tool: str - :param counts_toward_budget: Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget + :param counts_toward_budget: Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key :type counts_toward_budget: bool :param request_group_id: Filter to the rows of one or more request groups; repeatable (request_group_id=a&request_group_id=b). A routed request writes one row per attempt, all sharing a request_group_id, so this returns a request's whole plan: its absorbed attempts and the attempt that served it. Ignore ordering by timestamp and read attempt_position to reconstruct the plan. At most 1000 ids per call. :type request_group_id: List[str] @@ -603,7 +603,7 @@ def list_organization_usage_v1_organizations_me_usage_get( api_key_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.")] = None, priced: Annotated[Optional[StrictBool], Field(description="Filter by token-pricing state: true = only rows whose model tokens were priced, false = only rows that still need pricing (no cost at all, or tokens that were never metered because the model had no rate). A row charged only for gateway-run tool calls still counts as needing pricing.")] = None, tool: Annotated[Optional[StrictStr], Field(description="Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically.")] = None, - counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget")] = None, + counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key")] = None, request_group_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="Filter to the rows of one or more request groups; repeatable (request_group_id=a&request_group_id=b). A routed request writes one row per attempt, all sharing a request_group_id, so this returns a request's whole plan: its absorbed attempts and the attempt that served it. Ignore ordering by timestamp and read attempt_position to reconstruct the plan. At most 1000 ids per call.")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only usage recorded in this workspace.")] = None, skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, @@ -651,7 +651,7 @@ def list_organization_usage_v1_organizations_me_usage_get( :type priced: bool :param tool: Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically. :type tool: str - :param counts_toward_budget: Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget + :param counts_toward_budget: Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key :type counts_toward_budget: bool :param request_group_id: Filter to the rows of one or more request groups; repeatable (request_group_id=a&request_group_id=b). A routed request writes one row per attempt, all sharing a request_group_id, so this returns a request's whole plan: its absorbed attempts and the attempt that served it. Ignore ordering by timestamp and read attempt_position to reconstruct the plan. At most 1000 ids per call. :type request_group_id: List[str] @@ -739,7 +739,7 @@ def list_organization_usage_v1_organizations_me_usage_get_with_http_info( api_key_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.")] = None, priced: Annotated[Optional[StrictBool], Field(description="Filter by token-pricing state: true = only rows whose model tokens were priced, false = only rows that still need pricing (no cost at all, or tokens that were never metered because the model had no rate). A row charged only for gateway-run tool calls still counts as needing pricing.")] = None, tool: Annotated[Optional[StrictStr], Field(description="Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically.")] = None, - counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget")] = None, + counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key")] = None, request_group_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="Filter to the rows of one or more request groups; repeatable (request_group_id=a&request_group_id=b). A routed request writes one row per attempt, all sharing a request_group_id, so this returns a request's whole plan: its absorbed attempts and the attempt that served it. Ignore ordering by timestamp and read attempt_position to reconstruct the plan. At most 1000 ids per call.")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only usage recorded in this workspace.")] = None, skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, @@ -787,7 +787,7 @@ def list_organization_usage_v1_organizations_me_usage_get_with_http_info( :type priced: bool :param tool: Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically. :type tool: str - :param counts_toward_budget: Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget + :param counts_toward_budget: Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key :type counts_toward_budget: bool :param request_group_id: Filter to the rows of one or more request groups; repeatable (request_group_id=a&request_group_id=b). A routed request writes one row per attempt, all sharing a request_group_id, so this returns a request's whole plan: its absorbed attempts and the attempt that served it. Ignore ordering by timestamp and read attempt_position to reconstruct the plan. At most 1000 ids per call. :type request_group_id: List[str] @@ -875,7 +875,7 @@ def list_organization_usage_v1_organizations_me_usage_get_without_preload_conten api_key_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.")] = None, priced: Annotated[Optional[StrictBool], Field(description="Filter by token-pricing state: true = only rows whose model tokens were priced, false = only rows that still need pricing (no cost at all, or tokens that were never metered because the model had no rate). A row charged only for gateway-run tool calls still counts as needing pricing.")] = None, tool: Annotated[Optional[StrictStr], Field(description="Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically.")] = None, - counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget")] = None, + counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key")] = None, request_group_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="Filter to the rows of one or more request groups; repeatable (request_group_id=a&request_group_id=b). A routed request writes one row per attempt, all sharing a request_group_id, so this returns a request's whole plan: its absorbed attempts and the attempt that served it. Ignore ordering by timestamp and read attempt_position to reconstruct the plan. At most 1000 ids per call.")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only usage recorded in this workspace.")] = None, skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, @@ -923,7 +923,7 @@ def list_organization_usage_v1_organizations_me_usage_get_without_preload_conten :type priced: bool :param tool: Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically. :type tool: str - :param counts_toward_budget: Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget + :param counts_toward_budget: Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key :type counts_toward_budget: bool :param request_group_id: Filter to the rows of one or more request groups; repeatable (request_group_id=a&request_group_id=b). A routed request writes one row per attempt, all sharing a request_group_id, so this returns a request's whole plan: its absorbed attempts and the attempt that served it. Ignore ordering by timestamp and read attempt_position to reconstruct the plan. At most 1000 ids per call. :type request_group_id: List[str] @@ -1182,7 +1182,7 @@ def organization_usage_series_v1_organizations_me_usage_series_get( api_key_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.")] = None, priced: Annotated[Optional[StrictBool], Field(description="Filter by token-pricing state: true = only rows whose model tokens were priced, false = only rows that still need pricing (no cost at all, or tokens that were never metered because the model had no rate). A row charged only for gateway-run tool calls still counts as needing pricing.")] = None, tool: Annotated[Optional[StrictStr], Field(description="Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically.")] = None, - counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget")] = None, + counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only usage recorded in this workspace.")] = None, bucket: Annotated[Optional[StrictStr], Field(description="Time-series granularity: 'hour' or 'day'")] = None, _request_timeout: Union[ @@ -1230,7 +1230,7 @@ def organization_usage_series_v1_organizations_me_usage_series_get( :type priced: bool :param tool: Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically. :type tool: str - :param counts_toward_budget: Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget + :param counts_toward_budget: Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key :type counts_toward_budget: bool :param workspace_id: Only usage recorded in this workspace. :type workspace_id: UUID @@ -1314,7 +1314,7 @@ def organization_usage_series_v1_organizations_me_usage_series_get_with_http_inf api_key_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.")] = None, priced: Annotated[Optional[StrictBool], Field(description="Filter by token-pricing state: true = only rows whose model tokens were priced, false = only rows that still need pricing (no cost at all, or tokens that were never metered because the model had no rate). A row charged only for gateway-run tool calls still counts as needing pricing.")] = None, tool: Annotated[Optional[StrictStr], Field(description="Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically.")] = None, - counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget")] = None, + counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only usage recorded in this workspace.")] = None, bucket: Annotated[Optional[StrictStr], Field(description="Time-series granularity: 'hour' or 'day'")] = None, _request_timeout: Union[ @@ -1362,7 +1362,7 @@ def organization_usage_series_v1_organizations_me_usage_series_get_with_http_inf :type priced: bool :param tool: Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically. :type tool: str - :param counts_toward_budget: Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget + :param counts_toward_budget: Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key :type counts_toward_budget: bool :param workspace_id: Only usage recorded in this workspace. :type workspace_id: UUID @@ -1446,7 +1446,7 @@ def organization_usage_series_v1_organizations_me_usage_series_get_without_prelo api_key_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.")] = None, priced: Annotated[Optional[StrictBool], Field(description="Filter by token-pricing state: true = only rows whose model tokens were priced, false = only rows that still need pricing (no cost at all, or tokens that were never metered because the model had no rate). A row charged only for gateway-run tool calls still counts as needing pricing.")] = None, tool: Annotated[Optional[StrictStr], Field(description="Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically.")] = None, - counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget")] = None, + counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only usage recorded in this workspace.")] = None, bucket: Annotated[Optional[StrictStr], Field(description="Time-series granularity: 'hour' or 'day'")] = None, _request_timeout: Union[ @@ -1494,7 +1494,7 @@ def organization_usage_series_v1_organizations_me_usage_series_get_without_prelo :type priced: bool :param tool: Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically. :type tool: str - :param counts_toward_budget: Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget + :param counts_toward_budget: Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key :type counts_toward_budget: bool :param workspace_id: Only usage recorded in this workspace. :type workspace_id: UUID @@ -1741,7 +1741,7 @@ def organization_usage_summary_v1_organizations_me_usage_summary_get( api_key_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.")] = None, priced: Annotated[Optional[StrictBool], Field(description="Filter by token-pricing state: true = only rows whose model tokens were priced, false = only rows that still need pricing (no cost at all, or tokens that were never metered because the model had no rate). A row charged only for gateway-run tool calls still counts as needing pricing.")] = None, tool: Annotated[Optional[StrictStr], Field(description="Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically.")] = None, - counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget")] = None, + counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only usage recorded in this workspace.")] = None, bucket: Annotated[Optional[StrictStr], Field(description="Time-series granularity: 'hour' or 'day'")] = None, dimensions: Annotated[Optional[List[StrictStr]], Field(description="Which breakdowns to compute; repeatable (dimensions=model&dimensions=user). Each value names the 'by_' response field it fills, except 'status_code', which fills the failure taxonomy in 'errors_by_status_code'. Omit for every breakdown (the default); pass 'none' for a totals-and-series-only response. Each dimension left out skips one GROUP BY scan, so a caller that reads only the tiles or the time series should say so. Fields that were not requested come back empty.")] = None, @@ -1788,7 +1788,7 @@ def organization_usage_summary_v1_organizations_me_usage_summary_get( :type priced: bool :param tool: Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically. :type tool: str - :param counts_toward_budget: Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget + :param counts_toward_budget: Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key :type counts_toward_budget: bool :param workspace_id: Only usage recorded in this workspace. :type workspace_id: UUID @@ -1873,7 +1873,7 @@ def organization_usage_summary_v1_organizations_me_usage_summary_get_with_http_i api_key_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.")] = None, priced: Annotated[Optional[StrictBool], Field(description="Filter by token-pricing state: true = only rows whose model tokens were priced, false = only rows that still need pricing (no cost at all, or tokens that were never metered because the model had no rate). A row charged only for gateway-run tool calls still counts as needing pricing.")] = None, tool: Annotated[Optional[StrictStr], Field(description="Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically.")] = None, - counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget")] = None, + counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only usage recorded in this workspace.")] = None, bucket: Annotated[Optional[StrictStr], Field(description="Time-series granularity: 'hour' or 'day'")] = None, dimensions: Annotated[Optional[List[StrictStr]], Field(description="Which breakdowns to compute; repeatable (dimensions=model&dimensions=user). Each value names the 'by_' response field it fills, except 'status_code', which fills the failure taxonomy in 'errors_by_status_code'. Omit for every breakdown (the default); pass 'none' for a totals-and-series-only response. Each dimension left out skips one GROUP BY scan, so a caller that reads only the tiles or the time series should say so. Fields that were not requested come back empty.")] = None, @@ -1920,7 +1920,7 @@ def organization_usage_summary_v1_organizations_me_usage_summary_get_with_http_i :type priced: bool :param tool: Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically. :type tool: str - :param counts_toward_budget: Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget + :param counts_toward_budget: Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key :type counts_toward_budget: bool :param workspace_id: Only usage recorded in this workspace. :type workspace_id: UUID @@ -2005,7 +2005,7 @@ def organization_usage_summary_v1_organizations_me_usage_summary_get_without_pre api_key_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.")] = None, priced: Annotated[Optional[StrictBool], Field(description="Filter by token-pricing state: true = only rows whose model tokens were priced, false = only rows that still need pricing (no cost at all, or tokens that were never metered because the model had no rate). A row charged only for gateway-run tool calls still counts as needing pricing.")] = None, tool: Annotated[Optional[StrictStr], Field(description="Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically.")] = None, - counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget")] = None, + counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only usage recorded in this workspace.")] = None, bucket: Annotated[Optional[StrictStr], Field(description="Time-series granularity: 'hour' or 'day'")] = None, dimensions: Annotated[Optional[List[StrictStr]], Field(description="Which breakdowns to compute; repeatable (dimensions=model&dimensions=user). Each value names the 'by_' response field it fills, except 'status_code', which fills the failure taxonomy in 'errors_by_status_code'. Omit for every breakdown (the default); pass 'none' for a totals-and-series-only response. Each dimension left out skips one GROUP BY scan, so a caller that reads only the tiles or the time series should say so. Fields that were not requested come back empty.")] = None, @@ -2052,7 +2052,7 @@ def organization_usage_summary_v1_organizations_me_usage_summary_get_without_pre :type priced: bool :param tool: Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically. :type tool: str - :param counts_toward_budget: Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget + :param counts_toward_budget: Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key :type counts_toward_budget: bool :param workspace_id: Only usage recorded in this workspace. :type workspace_id: UUID diff --git a/src/otari/_client/api/usage_api.py b/src/otari/_client/api/usage_api.py index 94c2d11e..3482b55e 100644 --- a/src/otari/_client/api/usage_api.py +++ b/src/otari/_client/api/usage_api.py @@ -66,7 +66,7 @@ def count_usage_v1_usage_count_get( api_key_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.")] = None, priced: Annotated[Optional[StrictBool], Field(description="Filter by token-pricing state: true = only rows whose model tokens were priced, false = only rows that still need pricing (no cost at all, or tokens that were never metered because the model had no rate). A row charged only for gateway-run tool calls still counts as needing pricing.")] = None, tool: Annotated[Optional[StrictStr], Field(description="Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically.")] = None, - counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget")] = None, + counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation: true = only enforced gateway rows, false = only imported rows, narrowed past the filter of the same name on GET /v1/usage so the total matches what bulk delete and set-price can reach")] = None, request_group_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="Filter to the rows of one or more request groups; repeatable (request_group_id=a&request_group_id=b). A routed request writes one row per attempt, all sharing a request_group_id, so this returns a request's whole plan: its absorbed attempts and the attempt that served it. Ignore ordering by timestamp and read attempt_position to reconstruct the plan. At most 1000 ids per call.")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only usage recorded in this workspace.")] = None, _request_timeout: Union[ @@ -84,7 +84,7 @@ def count_usage_v1_usage_count_get( ) -> UsageCount: """Count Usage - Total number of usage logs matching the given filters. Serves the dashboard paginator's \"N of M\" total without changing the bare array contract of ``GET /v1/usage``. Runs only when the client asks (a separate request), so the ``COUNT(*)`` is not paid on every page load. With ``counts_toward_budget=false`` it also backs the \"select all N matching this filter\" affordance for bulk delete / set-price, which touch imported rows only. + Total number of usage logs matching the given filters. Serves the dashboard paginator's \"N of M\" total without changing the bare array contract of ``GET /v1/usage``. Runs only when the client asks (a separate request), so the ``COUNT(*)`` is not paid on every page load. With ``counts_toward_budget=false`` it also backs the \"select all N matching this filter\" affordance for bulk delete / set-price, which touch imported rows only. That value is the one place this count is narrower than ``GET /v1/usage``: it also excludes rows this deployment served itself, so the number an operator confirms is the number the mutation can reach. The list still pages the budget-exempt gateway rows it omits. :param start_date: Return logs with timestamp >= start_date (ISO 8601 or Unix epoch seconds) :type start_date: datetime @@ -112,7 +112,7 @@ def count_usage_v1_usage_count_get( :type priced: bool :param tool: Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically. :type tool: str - :param counts_toward_budget: Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget + :param counts_toward_budget: Filter by budget participation: true = only enforced gateway rows, false = only imported rows, narrowed past the filter of the same name on GET /v1/usage so the total matches what bulk delete and set-price can reach :type counts_toward_budget: bool :param request_group_id: Filter to the rows of one or more request groups; repeatable (request_group_id=a&request_group_id=b). A routed request writes one row per attempt, all sharing a request_group_id, so this returns a request's whole plan: its absorbed attempts and the attempt that served it. Ignore ordering by timestamp and read attempt_position to reconstruct the plan. At most 1000 ids per call. :type request_group_id: List[str] @@ -194,7 +194,7 @@ def count_usage_v1_usage_count_get_with_http_info( api_key_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.")] = None, priced: Annotated[Optional[StrictBool], Field(description="Filter by token-pricing state: true = only rows whose model tokens were priced, false = only rows that still need pricing (no cost at all, or tokens that were never metered because the model had no rate). A row charged only for gateway-run tool calls still counts as needing pricing.")] = None, tool: Annotated[Optional[StrictStr], Field(description="Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically.")] = None, - counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget")] = None, + counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation: true = only enforced gateway rows, false = only imported rows, narrowed past the filter of the same name on GET /v1/usage so the total matches what bulk delete and set-price can reach")] = None, request_group_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="Filter to the rows of one or more request groups; repeatable (request_group_id=a&request_group_id=b). A routed request writes one row per attempt, all sharing a request_group_id, so this returns a request's whole plan: its absorbed attempts and the attempt that served it. Ignore ordering by timestamp and read attempt_position to reconstruct the plan. At most 1000 ids per call.")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only usage recorded in this workspace.")] = None, _request_timeout: Union[ @@ -212,7 +212,7 @@ def count_usage_v1_usage_count_get_with_http_info( ) -> ApiResponse[UsageCount]: """Count Usage - Total number of usage logs matching the given filters. Serves the dashboard paginator's \"N of M\" total without changing the bare array contract of ``GET /v1/usage``. Runs only when the client asks (a separate request), so the ``COUNT(*)`` is not paid on every page load. With ``counts_toward_budget=false`` it also backs the \"select all N matching this filter\" affordance for bulk delete / set-price, which touch imported rows only. + Total number of usage logs matching the given filters. Serves the dashboard paginator's \"N of M\" total without changing the bare array contract of ``GET /v1/usage``. Runs only when the client asks (a separate request), so the ``COUNT(*)`` is not paid on every page load. With ``counts_toward_budget=false`` it also backs the \"select all N matching this filter\" affordance for bulk delete / set-price, which touch imported rows only. That value is the one place this count is narrower than ``GET /v1/usage``: it also excludes rows this deployment served itself, so the number an operator confirms is the number the mutation can reach. The list still pages the budget-exempt gateway rows it omits. :param start_date: Return logs with timestamp >= start_date (ISO 8601 or Unix epoch seconds) :type start_date: datetime @@ -240,7 +240,7 @@ def count_usage_v1_usage_count_get_with_http_info( :type priced: bool :param tool: Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically. :type tool: str - :param counts_toward_budget: Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget + :param counts_toward_budget: Filter by budget participation: true = only enforced gateway rows, false = only imported rows, narrowed past the filter of the same name on GET /v1/usage so the total matches what bulk delete and set-price can reach :type counts_toward_budget: bool :param request_group_id: Filter to the rows of one or more request groups; repeatable (request_group_id=a&request_group_id=b). A routed request writes one row per attempt, all sharing a request_group_id, so this returns a request's whole plan: its absorbed attempts and the attempt that served it. Ignore ordering by timestamp and read attempt_position to reconstruct the plan. At most 1000 ids per call. :type request_group_id: List[str] @@ -322,7 +322,7 @@ def count_usage_v1_usage_count_get_without_preload_content( api_key_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.")] = None, priced: Annotated[Optional[StrictBool], Field(description="Filter by token-pricing state: true = only rows whose model tokens were priced, false = only rows that still need pricing (no cost at all, or tokens that were never metered because the model had no rate). A row charged only for gateway-run tool calls still counts as needing pricing.")] = None, tool: Annotated[Optional[StrictStr], Field(description="Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically.")] = None, - counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget")] = None, + counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation: true = only enforced gateway rows, false = only imported rows, narrowed past the filter of the same name on GET /v1/usage so the total matches what bulk delete and set-price can reach")] = None, request_group_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="Filter to the rows of one or more request groups; repeatable (request_group_id=a&request_group_id=b). A routed request writes one row per attempt, all sharing a request_group_id, so this returns a request's whole plan: its absorbed attempts and the attempt that served it. Ignore ordering by timestamp and read attempt_position to reconstruct the plan. At most 1000 ids per call.")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only usage recorded in this workspace.")] = None, _request_timeout: Union[ @@ -340,7 +340,7 @@ def count_usage_v1_usage_count_get_without_preload_content( ) -> RESTResponseType: """Count Usage - Total number of usage logs matching the given filters. Serves the dashboard paginator's \"N of M\" total without changing the bare array contract of ``GET /v1/usage``. Runs only when the client asks (a separate request), so the ``COUNT(*)`` is not paid on every page load. With ``counts_toward_budget=false`` it also backs the \"select all N matching this filter\" affordance for bulk delete / set-price, which touch imported rows only. + Total number of usage logs matching the given filters. Serves the dashboard paginator's \"N of M\" total without changing the bare array contract of ``GET /v1/usage``. Runs only when the client asks (a separate request), so the ``COUNT(*)`` is not paid on every page load. With ``counts_toward_budget=false`` it also backs the \"select all N matching this filter\" affordance for bulk delete / set-price, which touch imported rows only. That value is the one place this count is narrower than ``GET /v1/usage``: it also excludes rows this deployment served itself, so the number an operator confirms is the number the mutation can reach. The list still pages the budget-exempt gateway rows it omits. :param start_date: Return logs with timestamp >= start_date (ISO 8601 or Unix epoch seconds) :type start_date: datetime @@ -368,7 +368,7 @@ def count_usage_v1_usage_count_get_without_preload_content( :type priced: bool :param tool: Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically. :type tool: str - :param counts_toward_budget: Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget + :param counts_toward_budget: Filter by budget participation: true = only enforced gateway rows, false = only imported rows, narrowed past the filter of the same name on GET /v1/usage so the total matches what bulk delete and set-price can reach :type counts_toward_budget: bool :param request_group_id: Filter to the rows of one or more request groups; repeatable (request_group_id=a&request_group_id=b). A routed request writes one row per attempt, all sharing a request_group_id, so this returns a request's whole plan: its absorbed attempts and the attempt that served it. Ignore ordering by timestamp and read attempt_position to reconstruct the plan. At most 1000 ids per call. :type request_group_id: List[str] @@ -1413,7 +1413,7 @@ def list_usage_v1_usage_get( api_key_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.")] = None, priced: Annotated[Optional[StrictBool], Field(description="Filter by token-pricing state: true = only rows whose model tokens were priced, false = only rows that still need pricing (no cost at all, or tokens that were never metered because the model had no rate). A row charged only for gateway-run tool calls still counts as needing pricing.")] = None, tool: Annotated[Optional[StrictStr], Field(description="Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically.")] = None, - counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget")] = None, + counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key")] = None, request_group_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="Filter to the rows of one or more request groups; repeatable (request_group_id=a&request_group_id=b). A routed request writes one row per attempt, all sharing a request_group_id, so this returns a request's whole plan: its absorbed attempts and the attempt that served it. Ignore ordering by timestamp and read attempt_position to reconstruct the plan. At most 1000 ids per call.")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only usage recorded in this workspace.")] = None, skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, @@ -1461,7 +1461,7 @@ def list_usage_v1_usage_get( :type priced: bool :param tool: Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically. :type tool: str - :param counts_toward_budget: Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget + :param counts_toward_budget: Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key :type counts_toward_budget: bool :param request_group_id: Filter to the rows of one or more request groups; repeatable (request_group_id=a&request_group_id=b). A routed request writes one row per attempt, all sharing a request_group_id, so this returns a request's whole plan: its absorbed attempts and the attempt that served it. Ignore ordering by timestamp and read attempt_position to reconstruct the plan. At most 1000 ids per call. :type request_group_id: List[str] @@ -1549,7 +1549,7 @@ def list_usage_v1_usage_get_with_http_info( api_key_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.")] = None, priced: Annotated[Optional[StrictBool], Field(description="Filter by token-pricing state: true = only rows whose model tokens were priced, false = only rows that still need pricing (no cost at all, or tokens that were never metered because the model had no rate). A row charged only for gateway-run tool calls still counts as needing pricing.")] = None, tool: Annotated[Optional[StrictStr], Field(description="Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically.")] = None, - counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget")] = None, + counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key")] = None, request_group_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="Filter to the rows of one or more request groups; repeatable (request_group_id=a&request_group_id=b). A routed request writes one row per attempt, all sharing a request_group_id, so this returns a request's whole plan: its absorbed attempts and the attempt that served it. Ignore ordering by timestamp and read attempt_position to reconstruct the plan. At most 1000 ids per call.")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only usage recorded in this workspace.")] = None, skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, @@ -1597,7 +1597,7 @@ def list_usage_v1_usage_get_with_http_info( :type priced: bool :param tool: Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically. :type tool: str - :param counts_toward_budget: Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget + :param counts_toward_budget: Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key :type counts_toward_budget: bool :param request_group_id: Filter to the rows of one or more request groups; repeatable (request_group_id=a&request_group_id=b). A routed request writes one row per attempt, all sharing a request_group_id, so this returns a request's whole plan: its absorbed attempts and the attempt that served it. Ignore ordering by timestamp and read attempt_position to reconstruct the plan. At most 1000 ids per call. :type request_group_id: List[str] @@ -1685,7 +1685,7 @@ def list_usage_v1_usage_get_without_preload_content( api_key_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.")] = None, priced: Annotated[Optional[StrictBool], Field(description="Filter by token-pricing state: true = only rows whose model tokens were priced, false = only rows that still need pricing (no cost at all, or tokens that were never metered because the model had no rate). A row charged only for gateway-run tool calls still counts as needing pricing.")] = None, tool: Annotated[Optional[StrictStr], Field(description="Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically.")] = None, - counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget")] = None, + counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key")] = None, request_group_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="Filter to the rows of one or more request groups; repeatable (request_group_id=a&request_group_id=b). A routed request writes one row per attempt, all sharing a request_group_id, so this returns a request's whole plan: its absorbed attempts and the attempt that served it. Ignore ordering by timestamp and read attempt_position to reconstruct the plan. At most 1000 ids per call.")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only usage recorded in this workspace.")] = None, skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, @@ -1733,7 +1733,7 @@ def list_usage_v1_usage_get_without_preload_content( :type priced: bool :param tool: Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically. :type tool: str - :param counts_toward_budget: Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget + :param counts_toward_budget: Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key :type counts_toward_budget: bool :param request_group_id: Filter to the rows of one or more request groups; repeatable (request_group_id=a&request_group_id=b). A routed request writes one row per attempt, all sharing a request_group_id, so this returns a request's whole plan: its absorbed attempts and the attempt that served it. Ignore ordering by timestamp and read attempt_position to reconstruct the plan. At most 1000 ids per call. :type request_group_id: List[str] @@ -2270,7 +2270,7 @@ def usage_series_v1_usage_series_get( api_key_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.")] = None, priced: Annotated[Optional[StrictBool], Field(description="Filter by token-pricing state: true = only rows whose model tokens were priced, false = only rows that still need pricing (no cost at all, or tokens that were never metered because the model had no rate). A row charged only for gateway-run tool calls still counts as needing pricing.")] = None, tool: Annotated[Optional[StrictStr], Field(description="Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically.")] = None, - counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget")] = None, + counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only usage recorded in this workspace.")] = None, bucket: Annotated[Optional[StrictStr], Field(description="Time-series granularity: 'hour' or 'day'")] = None, _request_timeout: Union[ @@ -2318,7 +2318,7 @@ def usage_series_v1_usage_series_get( :type priced: bool :param tool: Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically. :type tool: str - :param counts_toward_budget: Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget + :param counts_toward_budget: Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key :type counts_toward_budget: bool :param workspace_id: Only usage recorded in this workspace. :type workspace_id: UUID @@ -2402,7 +2402,7 @@ def usage_series_v1_usage_series_get_with_http_info( api_key_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.")] = None, priced: Annotated[Optional[StrictBool], Field(description="Filter by token-pricing state: true = only rows whose model tokens were priced, false = only rows that still need pricing (no cost at all, or tokens that were never metered because the model had no rate). A row charged only for gateway-run tool calls still counts as needing pricing.")] = None, tool: Annotated[Optional[StrictStr], Field(description="Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically.")] = None, - counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget")] = None, + counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only usage recorded in this workspace.")] = None, bucket: Annotated[Optional[StrictStr], Field(description="Time-series granularity: 'hour' or 'day'")] = None, _request_timeout: Union[ @@ -2450,7 +2450,7 @@ def usage_series_v1_usage_series_get_with_http_info( :type priced: bool :param tool: Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically. :type tool: str - :param counts_toward_budget: Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget + :param counts_toward_budget: Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key :type counts_toward_budget: bool :param workspace_id: Only usage recorded in this workspace. :type workspace_id: UUID @@ -2534,7 +2534,7 @@ def usage_series_v1_usage_series_get_without_preload_content( api_key_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.")] = None, priced: Annotated[Optional[StrictBool], Field(description="Filter by token-pricing state: true = only rows whose model tokens were priced, false = only rows that still need pricing (no cost at all, or tokens that were never metered because the model had no rate). A row charged only for gateway-run tool calls still counts as needing pricing.")] = None, tool: Annotated[Optional[StrictStr], Field(description="Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically.")] = None, - counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget")] = None, + counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only usage recorded in this workspace.")] = None, bucket: Annotated[Optional[StrictStr], Field(description="Time-series granularity: 'hour' or 'day'")] = None, _request_timeout: Union[ @@ -2582,7 +2582,7 @@ def usage_series_v1_usage_series_get_without_preload_content( :type priced: bool :param tool: Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically. :type tool: str - :param counts_toward_budget: Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget + :param counts_toward_budget: Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key :type counts_toward_budget: bool :param workspace_id: Only usage recorded in this workspace. :type workspace_id: UUID @@ -2829,7 +2829,7 @@ def usage_summary_v1_usage_summary_get( api_key_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.")] = None, priced: Annotated[Optional[StrictBool], Field(description="Filter by token-pricing state: true = only rows whose model tokens were priced, false = only rows that still need pricing (no cost at all, or tokens that were never metered because the model had no rate). A row charged only for gateway-run tool calls still counts as needing pricing.")] = None, tool: Annotated[Optional[StrictStr], Field(description="Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically.")] = None, - counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget")] = None, + counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only usage recorded in this workspace.")] = None, bucket: Annotated[Optional[StrictStr], Field(description="Time-series granularity: 'hour' or 'day'")] = None, dimensions: Annotated[Optional[List[StrictStr]], Field(description="Which breakdowns to compute; repeatable (dimensions=model&dimensions=user). Each value names the 'by_' response field it fills, except 'status_code', which fills the failure taxonomy in 'errors_by_status_code'. Omit for every breakdown (the default); pass 'none' for a totals-and-series-only response. Each dimension left out skips one GROUP BY scan, so a caller that reads only the tiles or the time series should say so. Fields that were not requested come back empty.")] = None, @@ -2876,7 +2876,7 @@ def usage_summary_v1_usage_summary_get( :type priced: bool :param tool: Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically. :type tool: str - :param counts_toward_budget: Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget + :param counts_toward_budget: Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key :type counts_toward_budget: bool :param workspace_id: Only usage recorded in this workspace. :type workspace_id: UUID @@ -2961,7 +2961,7 @@ def usage_summary_v1_usage_summary_get_with_http_info( api_key_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.")] = None, priced: Annotated[Optional[StrictBool], Field(description="Filter by token-pricing state: true = only rows whose model tokens were priced, false = only rows that still need pricing (no cost at all, or tokens that were never metered because the model had no rate). A row charged only for gateway-run tool calls still counts as needing pricing.")] = None, tool: Annotated[Optional[StrictStr], Field(description="Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically.")] = None, - counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget")] = None, + counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only usage recorded in this workspace.")] = None, bucket: Annotated[Optional[StrictStr], Field(description="Time-series granularity: 'hour' or 'day'")] = None, dimensions: Annotated[Optional[List[StrictStr]], Field(description="Which breakdowns to compute; repeatable (dimensions=model&dimensions=user). Each value names the 'by_' response field it fills, except 'status_code', which fills the failure taxonomy in 'errors_by_status_code'. Omit for every breakdown (the default); pass 'none' for a totals-and-series-only response. Each dimension left out skips one GROUP BY scan, so a caller that reads only the tiles or the time series should say so. Fields that were not requested come back empty.")] = None, @@ -3008,7 +3008,7 @@ def usage_summary_v1_usage_summary_get_with_http_info( :type priced: bool :param tool: Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically. :type tool: str - :param counts_toward_budget: Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget + :param counts_toward_budget: Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key :type counts_toward_budget: bool :param workspace_id: Only usage recorded in this workspace. :type workspace_id: UUID @@ -3093,7 +3093,7 @@ def usage_summary_v1_usage_summary_get_without_preload_content( api_key_id: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.")] = None, priced: Annotated[Optional[StrictBool], Field(description="Filter by token-pricing state: true = only rows whose model tokens were priced, false = only rows that still need pricing (no cost at all, or tokens that were never metered because the model had no rate). A row charged only for gateway-run tool calls still counts as needing pricing.")] = None, tool: Annotated[Optional[StrictStr], Field(description="Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically.")] = None, - counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget")] = None, + counts_toward_budget: Annotated[Optional[StrictBool], Field(description="Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only usage recorded in this workspace.")] = None, bucket: Annotated[Optional[StrictStr], Field(description="Time-series granularity: 'hour' or 'day'")] = None, dimensions: Annotated[Optional[List[StrictStr]], Field(description="Which breakdowns to compute; repeatable (dimensions=model&dimensions=user). Each value names the 'by_' response field it fills, except 'status_code', which fills the failure taxonomy in 'errors_by_status_code'. Omit for every breakdown (the default); pass 'none' for a totals-and-series-only response. Each dimension left out skips one GROUP BY scan, so a caller that reads only the tiles or the time series should say so. Fields that were not requested come back empty.")] = None, @@ -3140,7 +3140,7 @@ def usage_summary_v1_usage_summary_get_without_preload_content( :type priced: bool :param tool: Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, code_execution) matches that tool specifically. :type tool: str - :param counts_toward_budget: Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget + :param counts_toward_budget: Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key :type counts_toward_budget: bool :param workspace_id: Only usage recorded in this workspace. :type workspace_id: UUID diff --git a/src/otari/_client/models/__init__.py b/src/otari/_client/models/__init__.py index 93735baf..e45d5067 100644 --- a/src/otari/_client/models/__init__.py +++ b/src/otari/_client/models/__init__.py @@ -73,6 +73,7 @@ from otari._client.models.cck_top_logprob import CCKTopLogprob from otari._client.models.cc_prompt_tokens_details import CCPromptTokensDetails from otari._client.models.cc_top_logprob import CCTopLogprob +from otari._client.models.cache_miss_reason import CacheMissReason from otari._client.models.caller import Caller from otari._client.models.caller1 import Caller1 from otari._client.models.caller_identity_public import CallerIdentityPublic @@ -95,7 +96,8 @@ from otari._client.models.content13 import Content13 from otari._client.models.content14 import Content14 from otari._client.models.content15 import Content15 -from otari._client.models.content16_inner import Content16Inner +from otari._client.models.content16 import Content16 +from otari._client.models.content17_inner import Content17Inner from otari._client.models.content2 import Content2 from otari._client.models.content2_any_of_inner import Content2AnyOfInner from otari._client.models.content3 import Content3 @@ -167,12 +169,23 @@ from otari._client.models.mr_bash_code_execution_result_block import MRBashCodeExecutionResultBlock from otari._client.models.mr_bash_code_execution_tool_result_block import MRBashCodeExecutionToolResultBlock from otari._client.models.mr_bash_code_execution_tool_result_error import MRBashCodeExecutionToolResultError +from otari._client.models.mr_beta_advisor_message_iteration_usage import MRBetaAdvisorMessageIterationUsage +from otari._client.models.mr_beta_advisor_redacted_result_block import MRBetaAdvisorRedactedResultBlock +from otari._client.models.mr_beta_advisor_result_block import MRBetaAdvisorResultBlock +from otari._client.models.mr_beta_advisor_tool_result_block import MRBetaAdvisorToolResultBlock +from otari._client.models.mr_beta_advisor_tool_result_error import MRBetaAdvisorToolResultError from otari._client.models.mr_beta_base64_pdf_source import MRBetaBase64PDFSource from otari._client.models.mr_beta_bash_code_execution_output_block import MRBetaBashCodeExecutionOutputBlock from otari._client.models.mr_beta_bash_code_execution_result_block import MRBetaBashCodeExecutionResultBlock from otari._client.models.mr_beta_bash_code_execution_tool_result_block import MRBetaBashCodeExecutionToolResultBlock from otari._client.models.mr_beta_bash_code_execution_tool_result_error import MRBetaBashCodeExecutionToolResultError from otari._client.models.mr_beta_cache_creation import MRBetaCacheCreation +from otari._client.models.mr_beta_cache_miss_messages_changed import MRBetaCacheMissMessagesChanged +from otari._client.models.mr_beta_cache_miss_model_changed import MRBetaCacheMissModelChanged +from otari._client.models.mr_beta_cache_miss_previous_message_not_found import MRBetaCacheMissPreviousMessageNotFound +from otari._client.models.mr_beta_cache_miss_system_changed import MRBetaCacheMissSystemChanged +from otari._client.models.mr_beta_cache_miss_tools_changed import MRBetaCacheMissToolsChanged +from otari._client.models.mr_beta_cache_miss_unavailable import MRBetaCacheMissUnavailable from otari._client.models.mr_beta_citation_char_location import MRBetaCitationCharLocation from otari._client.models.mr_beta_citation_config import MRBetaCitationConfig from otari._client.models.mr_beta_citation_content_block_location import MRBetaCitationContentBlockLocation @@ -190,10 +203,14 @@ from otari._client.models.mr_beta_container import MRBetaContainer from otari._client.models.mr_beta_container_upload_block import MRBetaContainerUploadBlock from otari._client.models.mr_beta_context_management_response import MRBetaContextManagementResponse -from otari._client.models.mr_beta_diagnostics_fallback import MRBetaDiagnosticsFallback +from otari._client.models.mr_beta_diagnostics import MRBetaDiagnostics from otari._client.models.mr_beta_direct_caller import MRBetaDirectCaller from otari._client.models.mr_beta_document_block import MRBetaDocumentBlock from otari._client.models.mr_beta_encrypted_code_execution_result_block import MRBetaEncryptedCodeExecutionResultBlock +from otari._client.models.mr_beta_fallback_block import MRBetaFallbackBlock +from otari._client.models.mr_beta_fallback_info import MRBetaFallbackInfo +from otari._client.models.mr_beta_fallback_message_iteration_usage import MRBetaFallbackMessageIterationUsage +from otari._client.models.mr_beta_fallback_refusal_trigger import MRBetaFallbackRefusalTrigger from otari._client.models.mr_beta_mcp_tool_result_block import MRBetaMCPToolResultBlock from otari._client.models.mr_beta_mcp_tool_use_block import MRBetaMCPToolUseBlock from otari._client.models.mr_beta_message_iteration_usage import MRBetaMessageIterationUsage @@ -239,6 +256,7 @@ from otari._client.models.mr_encrypted_code_execution_result_block import MREncryptedCodeExecutionResultBlock from otari._client.models.mr_message_usage import MRMessageUsage from otari._client.models.mr_message_usage_iterations_inner import MRMessageUsageIterationsInner +from otari._client.models.mr_output_tokens_details import MROutputTokensDetails from otari._client.models.mr_plain_text_source import MRPlainTextSource from otari._client.models.mr_redacted_thinking_block import MRRedactedThinkingBlock from otari._client.models.mr_refusal_stop_details import MRRefusalStopDetails diff --git a/src/otari/_client/models/cache_miss_reason.py b/src/otari/_client/models/cache_miss_reason.py new file mode 100644 index 00000000..790e4d67 --- /dev/null +++ b/src/otari/_client/models/cache_miss_reason.py @@ -0,0 +1,200 @@ +# coding: utf-8 + +""" + otari + + Otari, an OpenAI-compatible LLM gateway with API key management + + The version of the OpenAPI document: 0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Optional +from otari._client.models.mr_beta_cache_miss_messages_changed import MRBetaCacheMissMessagesChanged +from otari._client.models.mr_beta_cache_miss_model_changed import MRBetaCacheMissModelChanged +from otari._client.models.mr_beta_cache_miss_previous_message_not_found import MRBetaCacheMissPreviousMessageNotFound +from otari._client.models.mr_beta_cache_miss_system_changed import MRBetaCacheMissSystemChanged +from otari._client.models.mr_beta_cache_miss_tools_changed import MRBetaCacheMissToolsChanged +from otari._client.models.mr_beta_cache_miss_unavailable import MRBetaCacheMissUnavailable +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CACHEMISSREASON_ANY_OF_SCHEMAS = ["MRBetaCacheMissMessagesChanged", "MRBetaCacheMissModelChanged", "MRBetaCacheMissPreviousMessageNotFound", "MRBetaCacheMissSystemChanged", "MRBetaCacheMissToolsChanged", "MRBetaCacheMissUnavailable"] + +class CacheMissReason(BaseModel): + """ + CacheMissReason + """ + + # data type: MRBetaCacheMissModelChanged + anyof_schema_1_validator: Optional[MRBetaCacheMissModelChanged] = None + # data type: MRBetaCacheMissSystemChanged + anyof_schema_2_validator: Optional[MRBetaCacheMissSystemChanged] = None + # data type: MRBetaCacheMissToolsChanged + anyof_schema_3_validator: Optional[MRBetaCacheMissToolsChanged] = None + # data type: MRBetaCacheMissMessagesChanged + anyof_schema_4_validator: Optional[MRBetaCacheMissMessagesChanged] = None + # data type: MRBetaCacheMissPreviousMessageNotFound + anyof_schema_5_validator: Optional[MRBetaCacheMissPreviousMessageNotFound] = None + # data type: MRBetaCacheMissUnavailable + anyof_schema_6_validator: Optional[MRBetaCacheMissUnavailable] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[MRBetaCacheMissMessagesChanged, MRBetaCacheMissModelChanged, MRBetaCacheMissPreviousMessageNotFound, MRBetaCacheMissSystemChanged, MRBetaCacheMissToolsChanged, MRBetaCacheMissUnavailable]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "MRBetaCacheMissMessagesChanged", "MRBetaCacheMissModelChanged", "MRBetaCacheMissPreviousMessageNotFound", "MRBetaCacheMissSystemChanged", "MRBetaCacheMissToolsChanged", "MRBetaCacheMissUnavailable" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + if v is None: + return v + + instance = CacheMissReason.model_construct() + error_messages = [] + # validate data type: MRBetaCacheMissModelChanged + if not isinstance(v, MRBetaCacheMissModelChanged): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaCacheMissModelChanged`") + else: + return v + + # validate data type: MRBetaCacheMissSystemChanged + if not isinstance(v, MRBetaCacheMissSystemChanged): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaCacheMissSystemChanged`") + else: + return v + + # validate data type: MRBetaCacheMissToolsChanged + if not isinstance(v, MRBetaCacheMissToolsChanged): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaCacheMissToolsChanged`") + else: + return v + + # validate data type: MRBetaCacheMissMessagesChanged + if not isinstance(v, MRBetaCacheMissMessagesChanged): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaCacheMissMessagesChanged`") + else: + return v + + # validate data type: MRBetaCacheMissPreviousMessageNotFound + if not isinstance(v, MRBetaCacheMissPreviousMessageNotFound): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaCacheMissPreviousMessageNotFound`") + else: + return v + + # validate data type: MRBetaCacheMissUnavailable + if not isinstance(v, MRBetaCacheMissUnavailable): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaCacheMissUnavailable`") + else: + return v + + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in CacheMissReason with anyOf schemas: MRBetaCacheMissMessagesChanged, MRBetaCacheMissModelChanged, MRBetaCacheMissPreviousMessageNotFound, MRBetaCacheMissSystemChanged, MRBetaCacheMissToolsChanged, MRBetaCacheMissUnavailable. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + if json_str is None: + return instance + + error_messages = [] + # anyof_schema_1_validator: Optional[MRBetaCacheMissModelChanged] = None + try: + instance.actual_instance = MRBetaCacheMissModelChanged.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[MRBetaCacheMissSystemChanged] = None + try: + instance.actual_instance = MRBetaCacheMissSystemChanged.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_3_validator: Optional[MRBetaCacheMissToolsChanged] = None + try: + instance.actual_instance = MRBetaCacheMissToolsChanged.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_4_validator: Optional[MRBetaCacheMissMessagesChanged] = None + try: + instance.actual_instance = MRBetaCacheMissMessagesChanged.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_5_validator: Optional[MRBetaCacheMissPreviousMessageNotFound] = None + try: + instance.actual_instance = MRBetaCacheMissPreviousMessageNotFound.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_6_validator: Optional[MRBetaCacheMissUnavailable] = None + try: + instance.actual_instance = MRBetaCacheMissUnavailable.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into CacheMissReason with anyOf schemas: MRBetaCacheMissMessagesChanged, MRBetaCacheMissModelChanged, MRBetaCacheMissPreviousMessageNotFound, MRBetaCacheMissSystemChanged, MRBetaCacheMissToolsChanged, MRBetaCacheMissUnavailable. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], MRBetaCacheMissMessagesChanged, MRBetaCacheMissModelChanged, MRBetaCacheMissPreviousMessageNotFound, MRBetaCacheMissSystemChanged, MRBetaCacheMissToolsChanged, MRBetaCacheMissUnavailable]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/src/otari/_client/models/cc_chat_completion_message_function_tool_call.py b/src/otari/_client/models/cc_chat_completion_message_function_tool_call.py index 89b94a40..c0589f8e 100644 --- a/src/otari/_client/models/cc_chat_completion_message_function_tool_call.py +++ b/src/otari/_client/models/cc_chat_completion_message_function_tool_call.py @@ -18,7 +18,7 @@ import json from pydantic import BaseModel, ConfigDict, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List +from typing import Any, ClassVar, Dict, List, Optional from otari._client.models.cc_function import CCFunction from typing import Optional, Set from typing_extensions import Self @@ -26,13 +26,14 @@ class CCChatCompletionMessageFunctionToolCall(BaseModel): """ - A call to a function tool created by the model. + Extended tool call type that includes extra_content for provider-specific data. The extra_content field is used to store provider-specific metadata that needs to be preserved across multi-turn conversations. For example, Gemini 3 models require thought_signature to be passed back with function calls. Example extra_content structure for Gemini: {\"google\": {\"thought_signature\": \"\"}} """ # noqa: E501 id: StrictStr function: CCFunction type: StrictStr + extra_content: Optional[Dict[str, Any]] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["id", "function", "type"] + __properties: ClassVar[List[str]] = ["id", "function", "type", "extra_content"] @field_validator('type') def type_validate_enum(cls, value): @@ -90,6 +91,11 @@ def to_dict(self) -> Dict[str, Any]: for _key, _value in self.additional_properties.items(): _dict[_key] = _value + # set to None if extra_content (nullable) is None + # and model_fields_set contains the field + if self.extra_content is None and "extra_content" in self.model_fields_set: + _dict['extra_content'] = None + return _dict @classmethod @@ -104,7 +110,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "id": obj.get("id"), "function": CCFunction.from_dict(obj["function"]) if obj.get("function") is not None else None, - "type": obj.get("type") + "type": obj.get("type"), + "extra_content": obj.get("extra_content") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/src/otari/_client/models/content10.py b/src/otari/_client/models/content10.py index e7d624d0..f654c06e 100644 --- a/src/otari/_client/models/content10.py +++ b/src/otari/_client/models/content10.py @@ -18,29 +18,29 @@ import pprint import re # noqa: F401 from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator -from typing import List, Optional -from otari._client.models.mr_beta_web_search_result_block import MRBetaWebSearchResultBlock -from otari._client.models.mr_beta_web_search_tool_result_error import MRBetaWebSearchToolResultError +from typing import Optional +from otari._client.models.mr_beta_web_fetch_block import MRBetaWebFetchBlock +from otari._client.models.mr_beta_web_fetch_tool_result_error_block import MRBetaWebFetchToolResultErrorBlock from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict from typing_extensions import Literal, Self from pydantic import Field -CONTENT10_ANY_OF_SCHEMAS = ["List[MRBetaWebSearchResultBlock]", "MRBetaWebSearchToolResultError"] +CONTENT10_ANY_OF_SCHEMAS = ["MRBetaWebFetchBlock", "MRBetaWebFetchToolResultErrorBlock"] class Content10(BaseModel): """ Content10 """ - # data type: MRBetaWebSearchToolResultError - anyof_schema_1_validator: Optional[MRBetaWebSearchToolResultError] = None - # data type: List[MRBetaWebSearchResultBlock] - anyof_schema_2_validator: Optional[List[MRBetaWebSearchResultBlock]] = None + # data type: MRBetaWebFetchToolResultErrorBlock + anyof_schema_1_validator: Optional[MRBetaWebFetchToolResultErrorBlock] = None + # data type: MRBetaWebFetchBlock + anyof_schema_2_validator: Optional[MRBetaWebFetchBlock] = None if TYPE_CHECKING: - actual_instance: Optional[Union[List[MRBetaWebSearchResultBlock], MRBetaWebSearchToolResultError]] = None + actual_instance: Optional[Union[MRBetaWebFetchBlock, MRBetaWebFetchToolResultErrorBlock]] = None else: actual_instance: Any = None - any_of_schemas: Set[str] = { "List[MRBetaWebSearchResultBlock]", "MRBetaWebSearchToolResultError" } + any_of_schemas: Set[str] = { "MRBetaWebFetchBlock", "MRBetaWebFetchToolResultErrorBlock" } model_config = { "validate_assignment": True, @@ -61,21 +61,21 @@ def __init__(self, *args, **kwargs) -> None: def actual_instance_must_validate_anyof(cls, v): instance = Content10.model_construct() error_messages = [] - # validate data type: MRBetaWebSearchToolResultError - if not isinstance(v, MRBetaWebSearchToolResultError): - error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaWebSearchToolResultError`") + # validate data type: MRBetaWebFetchToolResultErrorBlock + if not isinstance(v, MRBetaWebFetchToolResultErrorBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaWebFetchToolResultErrorBlock`") else: return v - # validate data type: List[MRBetaWebSearchResultBlock] - try: - instance.anyof_schema_2_validator = v + # validate data type: MRBetaWebFetchBlock + if not isinstance(v, MRBetaWebFetchBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaWebFetchBlock`") + else: return v - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) + if error_messages: # no match - raise ValueError("No match found when setting the actual_instance in Content10 with anyOf schemas: List[MRBetaWebSearchResultBlock], MRBetaWebSearchToolResultError. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting the actual_instance in Content10 with anyOf schemas: MRBetaWebFetchBlock, MRBetaWebFetchToolResultErrorBlock. Details: " + ", ".join(error_messages)) else: return v @@ -88,25 +88,22 @@ def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" instance = cls.model_construct() error_messages = [] - # anyof_schema_1_validator: Optional[MRBetaWebSearchToolResultError] = None + # anyof_schema_1_validator: Optional[MRBetaWebFetchToolResultErrorBlock] = None try: - instance.actual_instance = MRBetaWebSearchToolResultError.from_json(json_str) + instance.actual_instance = MRBetaWebFetchToolResultErrorBlock.from_json(json_str) return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # deserialize data into List[MRBetaWebSearchResultBlock] + # anyof_schema_2_validator: Optional[MRBetaWebFetchBlock] = None try: - # validation - instance.anyof_schema_2_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.anyof_schema_2_validator + instance.actual_instance = MRBetaWebFetchBlock.from_json(json_str) return instance except (ValidationError, ValueError) as e: - error_messages.append(str(e)) + error_messages.append(str(e)) if error_messages: # no match - raise ValueError("No match found when deserializing the JSON string into Content10 with anyOf schemas: List[MRBetaWebSearchResultBlock], MRBetaWebSearchToolResultError. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into Content10 with anyOf schemas: MRBetaWebFetchBlock, MRBetaWebFetchToolResultErrorBlock. Details: " + ", ".join(error_messages)) else: return instance @@ -120,7 +117,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], List[MRBetaWebSearchResultBlock], MRBetaWebSearchToolResultError]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], MRBetaWebFetchBlock, MRBetaWebFetchToolResultErrorBlock]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/src/otari/_client/models/content11.py b/src/otari/_client/models/content11.py index decf6400..caadf5f1 100644 --- a/src/otari/_client/models/content11.py +++ b/src/otari/_client/models/content11.py @@ -18,32 +18,29 @@ import pprint import re # noqa: F401 from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator -from typing import Optional -from otari._client.models.mr_code_execution_result_block import MRCodeExecutionResultBlock -from otari._client.models.mr_code_execution_tool_result_error import MRCodeExecutionToolResultError -from otari._client.models.mr_encrypted_code_execution_result_block import MREncryptedCodeExecutionResultBlock +from typing import List, Optional +from otari._client.models.mr_beta_web_search_result_block import MRBetaWebSearchResultBlock +from otari._client.models.mr_beta_web_search_tool_result_error import MRBetaWebSearchToolResultError from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict from typing_extensions import Literal, Self from pydantic import Field -CONTENT11_ANY_OF_SCHEMAS = ["MRCodeExecutionResultBlock", "MRCodeExecutionToolResultError", "MREncryptedCodeExecutionResultBlock"] +CONTENT11_ANY_OF_SCHEMAS = ["List[MRBetaWebSearchResultBlock]", "MRBetaWebSearchToolResultError"] class Content11(BaseModel): """ Content11 """ - # data type: MRCodeExecutionToolResultError - anyof_schema_1_validator: Optional[MRCodeExecutionToolResultError] = None - # data type: MRCodeExecutionResultBlock - anyof_schema_2_validator: Optional[MRCodeExecutionResultBlock] = None - # data type: MREncryptedCodeExecutionResultBlock - anyof_schema_3_validator: Optional[MREncryptedCodeExecutionResultBlock] = None + # data type: MRBetaWebSearchToolResultError + anyof_schema_1_validator: Optional[MRBetaWebSearchToolResultError] = None + # data type: List[MRBetaWebSearchResultBlock] + anyof_schema_2_validator: Optional[List[MRBetaWebSearchResultBlock]] = None if TYPE_CHECKING: - actual_instance: Optional[Union[MRCodeExecutionResultBlock, MRCodeExecutionToolResultError, MREncryptedCodeExecutionResultBlock]] = None + actual_instance: Optional[Union[List[MRBetaWebSearchResultBlock], MRBetaWebSearchToolResultError]] = None else: actual_instance: Any = None - any_of_schemas: Set[str] = { "MRCodeExecutionResultBlock", "MRCodeExecutionToolResultError", "MREncryptedCodeExecutionResultBlock" } + any_of_schemas: Set[str] = { "List[MRBetaWebSearchResultBlock]", "MRBetaWebSearchToolResultError" } model_config = { "validate_assignment": True, @@ -64,27 +61,21 @@ def __init__(self, *args, **kwargs) -> None: def actual_instance_must_validate_anyof(cls, v): instance = Content11.model_construct() error_messages = [] - # validate data type: MRCodeExecutionToolResultError - if not isinstance(v, MRCodeExecutionToolResultError): - error_messages.append(f"Error! Input type `{type(v)}` is not `MRCodeExecutionToolResultError`") + # validate data type: MRBetaWebSearchToolResultError + if not isinstance(v, MRBetaWebSearchToolResultError): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaWebSearchToolResultError`") else: return v - # validate data type: MRCodeExecutionResultBlock - if not isinstance(v, MRCodeExecutionResultBlock): - error_messages.append(f"Error! Input type `{type(v)}` is not `MRCodeExecutionResultBlock`") - else: - return v - - # validate data type: MREncryptedCodeExecutionResultBlock - if not isinstance(v, MREncryptedCodeExecutionResultBlock): - error_messages.append(f"Error! Input type `{type(v)}` is not `MREncryptedCodeExecutionResultBlock`") - else: + # validate data type: List[MRBetaWebSearchResultBlock] + try: + instance.anyof_schema_2_validator = v return v - + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) if error_messages: # no match - raise ValueError("No match found when setting the actual_instance in Content11 with anyOf schemas: MRCodeExecutionResultBlock, MRCodeExecutionToolResultError, MREncryptedCodeExecutionResultBlock. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting the actual_instance in Content11 with anyOf schemas: List[MRBetaWebSearchResultBlock], MRBetaWebSearchToolResultError. Details: " + ", ".join(error_messages)) else: return v @@ -97,28 +88,25 @@ def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" instance = cls.model_construct() error_messages = [] - # anyof_schema_1_validator: Optional[MRCodeExecutionToolResultError] = None - try: - instance.actual_instance = MRCodeExecutionToolResultError.from_json(json_str) - return instance - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # anyof_schema_2_validator: Optional[MRCodeExecutionResultBlock] = None + # anyof_schema_1_validator: Optional[MRBetaWebSearchToolResultError] = None try: - instance.actual_instance = MRCodeExecutionResultBlock.from_json(json_str) + instance.actual_instance = MRBetaWebSearchToolResultError.from_json(json_str) return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # anyof_schema_3_validator: Optional[MREncryptedCodeExecutionResultBlock] = None + # deserialize data into List[MRBetaWebSearchResultBlock] try: - instance.actual_instance = MREncryptedCodeExecutionResultBlock.from_json(json_str) + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator return instance except (ValidationError, ValueError) as e: - error_messages.append(str(e)) + error_messages.append(str(e)) if error_messages: # no match - raise ValueError("No match found when deserializing the JSON string into Content11 with anyOf schemas: MRCodeExecutionResultBlock, MRCodeExecutionToolResultError, MREncryptedCodeExecutionResultBlock. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into Content11 with anyOf schemas: List[MRBetaWebSearchResultBlock], MRBetaWebSearchToolResultError. Details: " + ", ".join(error_messages)) else: return instance @@ -132,7 +120,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], MRCodeExecutionResultBlock, MRCodeExecutionToolResultError, MREncryptedCodeExecutionResultBlock]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], List[MRBetaWebSearchResultBlock], MRBetaWebSearchToolResultError]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/src/otari/_client/models/content12.py b/src/otari/_client/models/content12.py index ae283af6..6337fc50 100644 --- a/src/otari/_client/models/content12.py +++ b/src/otari/_client/models/content12.py @@ -19,34 +19,31 @@ import re # noqa: F401 from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Optional -from otari._client.models.mr_text_editor_code_execution_create_result_block import MRTextEditorCodeExecutionCreateResultBlock -from otari._client.models.mr_text_editor_code_execution_str_replace_result_block import MRTextEditorCodeExecutionStrReplaceResultBlock -from otari._client.models.mr_text_editor_code_execution_tool_result_error import MRTextEditorCodeExecutionToolResultError -from otari._client.models.mr_text_editor_code_execution_view_result_block import MRTextEditorCodeExecutionViewResultBlock +from otari._client.models.mr_code_execution_result_block import MRCodeExecutionResultBlock +from otari._client.models.mr_code_execution_tool_result_error import MRCodeExecutionToolResultError +from otari._client.models.mr_encrypted_code_execution_result_block import MREncryptedCodeExecutionResultBlock from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict from typing_extensions import Literal, Self from pydantic import Field -CONTENT12_ANY_OF_SCHEMAS = ["MRTextEditorCodeExecutionCreateResultBlock", "MRTextEditorCodeExecutionStrReplaceResultBlock", "MRTextEditorCodeExecutionToolResultError", "MRTextEditorCodeExecutionViewResultBlock"] +CONTENT12_ANY_OF_SCHEMAS = ["MRCodeExecutionResultBlock", "MRCodeExecutionToolResultError", "MREncryptedCodeExecutionResultBlock"] class Content12(BaseModel): """ Content12 """ - # data type: MRTextEditorCodeExecutionToolResultError - anyof_schema_1_validator: Optional[MRTextEditorCodeExecutionToolResultError] = None - # data type: MRTextEditorCodeExecutionViewResultBlock - anyof_schema_2_validator: Optional[MRTextEditorCodeExecutionViewResultBlock] = None - # data type: MRTextEditorCodeExecutionCreateResultBlock - anyof_schema_3_validator: Optional[MRTextEditorCodeExecutionCreateResultBlock] = None - # data type: MRTextEditorCodeExecutionStrReplaceResultBlock - anyof_schema_4_validator: Optional[MRTextEditorCodeExecutionStrReplaceResultBlock] = None + # data type: MRCodeExecutionToolResultError + anyof_schema_1_validator: Optional[MRCodeExecutionToolResultError] = None + # data type: MRCodeExecutionResultBlock + anyof_schema_2_validator: Optional[MRCodeExecutionResultBlock] = None + # data type: MREncryptedCodeExecutionResultBlock + anyof_schema_3_validator: Optional[MREncryptedCodeExecutionResultBlock] = None if TYPE_CHECKING: - actual_instance: Optional[Union[MRTextEditorCodeExecutionCreateResultBlock, MRTextEditorCodeExecutionStrReplaceResultBlock, MRTextEditorCodeExecutionToolResultError, MRTextEditorCodeExecutionViewResultBlock]] = None + actual_instance: Optional[Union[MRCodeExecutionResultBlock, MRCodeExecutionToolResultError, MREncryptedCodeExecutionResultBlock]] = None else: actual_instance: Any = None - any_of_schemas: Set[str] = { "MRTextEditorCodeExecutionCreateResultBlock", "MRTextEditorCodeExecutionStrReplaceResultBlock", "MRTextEditorCodeExecutionToolResultError", "MRTextEditorCodeExecutionViewResultBlock" } + any_of_schemas: Set[str] = { "MRCodeExecutionResultBlock", "MRCodeExecutionToolResultError", "MREncryptedCodeExecutionResultBlock" } model_config = { "validate_assignment": True, @@ -67,33 +64,27 @@ def __init__(self, *args, **kwargs) -> None: def actual_instance_must_validate_anyof(cls, v): instance = Content12.model_construct() error_messages = [] - # validate data type: MRTextEditorCodeExecutionToolResultError - if not isinstance(v, MRTextEditorCodeExecutionToolResultError): - error_messages.append(f"Error! Input type `{type(v)}` is not `MRTextEditorCodeExecutionToolResultError`") + # validate data type: MRCodeExecutionToolResultError + if not isinstance(v, MRCodeExecutionToolResultError): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRCodeExecutionToolResultError`") else: return v - # validate data type: MRTextEditorCodeExecutionViewResultBlock - if not isinstance(v, MRTextEditorCodeExecutionViewResultBlock): - error_messages.append(f"Error! Input type `{type(v)}` is not `MRTextEditorCodeExecutionViewResultBlock`") + # validate data type: MRCodeExecutionResultBlock + if not isinstance(v, MRCodeExecutionResultBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRCodeExecutionResultBlock`") else: return v - # validate data type: MRTextEditorCodeExecutionCreateResultBlock - if not isinstance(v, MRTextEditorCodeExecutionCreateResultBlock): - error_messages.append(f"Error! Input type `{type(v)}` is not `MRTextEditorCodeExecutionCreateResultBlock`") - else: - return v - - # validate data type: MRTextEditorCodeExecutionStrReplaceResultBlock - if not isinstance(v, MRTextEditorCodeExecutionStrReplaceResultBlock): - error_messages.append(f"Error! Input type `{type(v)}` is not `MRTextEditorCodeExecutionStrReplaceResultBlock`") + # validate data type: MREncryptedCodeExecutionResultBlock + if not isinstance(v, MREncryptedCodeExecutionResultBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `MREncryptedCodeExecutionResultBlock`") else: return v if error_messages: # no match - raise ValueError("No match found when setting the actual_instance in Content12 with anyOf schemas: MRTextEditorCodeExecutionCreateResultBlock, MRTextEditorCodeExecutionStrReplaceResultBlock, MRTextEditorCodeExecutionToolResultError, MRTextEditorCodeExecutionViewResultBlock. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting the actual_instance in Content12 with anyOf schemas: MRCodeExecutionResultBlock, MRCodeExecutionToolResultError, MREncryptedCodeExecutionResultBlock. Details: " + ", ".join(error_messages)) else: return v @@ -106,34 +97,28 @@ def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" instance = cls.model_construct() error_messages = [] - # anyof_schema_1_validator: Optional[MRTextEditorCodeExecutionToolResultError] = None - try: - instance.actual_instance = MRTextEditorCodeExecutionToolResultError.from_json(json_str) - return instance - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # anyof_schema_2_validator: Optional[MRTextEditorCodeExecutionViewResultBlock] = None + # anyof_schema_1_validator: Optional[MRCodeExecutionToolResultError] = None try: - instance.actual_instance = MRTextEditorCodeExecutionViewResultBlock.from_json(json_str) + instance.actual_instance = MRCodeExecutionToolResultError.from_json(json_str) return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # anyof_schema_3_validator: Optional[MRTextEditorCodeExecutionCreateResultBlock] = None + # anyof_schema_2_validator: Optional[MRCodeExecutionResultBlock] = None try: - instance.actual_instance = MRTextEditorCodeExecutionCreateResultBlock.from_json(json_str) + instance.actual_instance = MRCodeExecutionResultBlock.from_json(json_str) return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # anyof_schema_4_validator: Optional[MRTextEditorCodeExecutionStrReplaceResultBlock] = None + # anyof_schema_3_validator: Optional[MREncryptedCodeExecutionResultBlock] = None try: - instance.actual_instance = MRTextEditorCodeExecutionStrReplaceResultBlock.from_json(json_str) + instance.actual_instance = MREncryptedCodeExecutionResultBlock.from_json(json_str) return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) if error_messages: # no match - raise ValueError("No match found when deserializing the JSON string into Content12 with anyOf schemas: MRTextEditorCodeExecutionCreateResultBlock, MRTextEditorCodeExecutionStrReplaceResultBlock, MRTextEditorCodeExecutionToolResultError, MRTextEditorCodeExecutionViewResultBlock. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into Content12 with anyOf schemas: MRCodeExecutionResultBlock, MRCodeExecutionToolResultError, MREncryptedCodeExecutionResultBlock. Details: " + ", ".join(error_messages)) else: return instance @@ -147,7 +132,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], MRTextEditorCodeExecutionCreateResultBlock, MRTextEditorCodeExecutionStrReplaceResultBlock, MRTextEditorCodeExecutionToolResultError, MRTextEditorCodeExecutionViewResultBlock]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], MRCodeExecutionResultBlock, MRCodeExecutionToolResultError, MREncryptedCodeExecutionResultBlock]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/src/otari/_client/models/content13.py b/src/otari/_client/models/content13.py index 923cc1a1..8eebfcdd 100644 --- a/src/otari/_client/models/content13.py +++ b/src/otari/_client/models/content13.py @@ -19,28 +19,34 @@ import re # noqa: F401 from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Optional -from otari._client.models.mr_tool_search_tool_result_error import MRToolSearchToolResultError -from otari._client.models.mr_tool_search_tool_search_result_block import MRToolSearchToolSearchResultBlock +from otari._client.models.mr_text_editor_code_execution_create_result_block import MRTextEditorCodeExecutionCreateResultBlock +from otari._client.models.mr_text_editor_code_execution_str_replace_result_block import MRTextEditorCodeExecutionStrReplaceResultBlock +from otari._client.models.mr_text_editor_code_execution_tool_result_error import MRTextEditorCodeExecutionToolResultError +from otari._client.models.mr_text_editor_code_execution_view_result_block import MRTextEditorCodeExecutionViewResultBlock from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict from typing_extensions import Literal, Self from pydantic import Field -CONTENT13_ANY_OF_SCHEMAS = ["MRToolSearchToolResultError", "MRToolSearchToolSearchResultBlock"] +CONTENT13_ANY_OF_SCHEMAS = ["MRTextEditorCodeExecutionCreateResultBlock", "MRTextEditorCodeExecutionStrReplaceResultBlock", "MRTextEditorCodeExecutionToolResultError", "MRTextEditorCodeExecutionViewResultBlock"] class Content13(BaseModel): """ Content13 """ - # data type: MRToolSearchToolResultError - anyof_schema_1_validator: Optional[MRToolSearchToolResultError] = None - # data type: MRToolSearchToolSearchResultBlock - anyof_schema_2_validator: Optional[MRToolSearchToolSearchResultBlock] = None + # data type: MRTextEditorCodeExecutionToolResultError + anyof_schema_1_validator: Optional[MRTextEditorCodeExecutionToolResultError] = None + # data type: MRTextEditorCodeExecutionViewResultBlock + anyof_schema_2_validator: Optional[MRTextEditorCodeExecutionViewResultBlock] = None + # data type: MRTextEditorCodeExecutionCreateResultBlock + anyof_schema_3_validator: Optional[MRTextEditorCodeExecutionCreateResultBlock] = None + # data type: MRTextEditorCodeExecutionStrReplaceResultBlock + anyof_schema_4_validator: Optional[MRTextEditorCodeExecutionStrReplaceResultBlock] = None if TYPE_CHECKING: - actual_instance: Optional[Union[MRToolSearchToolResultError, MRToolSearchToolSearchResultBlock]] = None + actual_instance: Optional[Union[MRTextEditorCodeExecutionCreateResultBlock, MRTextEditorCodeExecutionStrReplaceResultBlock, MRTextEditorCodeExecutionToolResultError, MRTextEditorCodeExecutionViewResultBlock]] = None else: actual_instance: Any = None - any_of_schemas: Set[str] = { "MRToolSearchToolResultError", "MRToolSearchToolSearchResultBlock" } + any_of_schemas: Set[str] = { "MRTextEditorCodeExecutionCreateResultBlock", "MRTextEditorCodeExecutionStrReplaceResultBlock", "MRTextEditorCodeExecutionToolResultError", "MRTextEditorCodeExecutionViewResultBlock" } model_config = { "validate_assignment": True, @@ -61,21 +67,33 @@ def __init__(self, *args, **kwargs) -> None: def actual_instance_must_validate_anyof(cls, v): instance = Content13.model_construct() error_messages = [] - # validate data type: MRToolSearchToolResultError - if not isinstance(v, MRToolSearchToolResultError): - error_messages.append(f"Error! Input type `{type(v)}` is not `MRToolSearchToolResultError`") + # validate data type: MRTextEditorCodeExecutionToolResultError + if not isinstance(v, MRTextEditorCodeExecutionToolResultError): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRTextEditorCodeExecutionToolResultError`") else: return v - # validate data type: MRToolSearchToolSearchResultBlock - if not isinstance(v, MRToolSearchToolSearchResultBlock): - error_messages.append(f"Error! Input type `{type(v)}` is not `MRToolSearchToolSearchResultBlock`") + # validate data type: MRTextEditorCodeExecutionViewResultBlock + if not isinstance(v, MRTextEditorCodeExecutionViewResultBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRTextEditorCodeExecutionViewResultBlock`") + else: + return v + + # validate data type: MRTextEditorCodeExecutionCreateResultBlock + if not isinstance(v, MRTextEditorCodeExecutionCreateResultBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRTextEditorCodeExecutionCreateResultBlock`") + else: + return v + + # validate data type: MRTextEditorCodeExecutionStrReplaceResultBlock + if not isinstance(v, MRTextEditorCodeExecutionStrReplaceResultBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRTextEditorCodeExecutionStrReplaceResultBlock`") else: return v if error_messages: # no match - raise ValueError("No match found when setting the actual_instance in Content13 with anyOf schemas: MRToolSearchToolResultError, MRToolSearchToolSearchResultBlock. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting the actual_instance in Content13 with anyOf schemas: MRTextEditorCodeExecutionCreateResultBlock, MRTextEditorCodeExecutionStrReplaceResultBlock, MRTextEditorCodeExecutionToolResultError, MRTextEditorCodeExecutionViewResultBlock. Details: " + ", ".join(error_messages)) else: return v @@ -88,22 +106,34 @@ def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" instance = cls.model_construct() error_messages = [] - # anyof_schema_1_validator: Optional[MRToolSearchToolResultError] = None + # anyof_schema_1_validator: Optional[MRTextEditorCodeExecutionToolResultError] = None + try: + instance.actual_instance = MRTextEditorCodeExecutionToolResultError.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[MRTextEditorCodeExecutionViewResultBlock] = None + try: + instance.actual_instance = MRTextEditorCodeExecutionViewResultBlock.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_3_validator: Optional[MRTextEditorCodeExecutionCreateResultBlock] = None try: - instance.actual_instance = MRToolSearchToolResultError.from_json(json_str) + instance.actual_instance = MRTextEditorCodeExecutionCreateResultBlock.from_json(json_str) return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # anyof_schema_2_validator: Optional[MRToolSearchToolSearchResultBlock] = None + # anyof_schema_4_validator: Optional[MRTextEditorCodeExecutionStrReplaceResultBlock] = None try: - instance.actual_instance = MRToolSearchToolSearchResultBlock.from_json(json_str) + instance.actual_instance = MRTextEditorCodeExecutionStrReplaceResultBlock.from_json(json_str) return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) if error_messages: # no match - raise ValueError("No match found when deserializing the JSON string into Content13 with anyOf schemas: MRToolSearchToolResultError, MRToolSearchToolSearchResultBlock. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into Content13 with anyOf schemas: MRTextEditorCodeExecutionCreateResultBlock, MRTextEditorCodeExecutionStrReplaceResultBlock, MRTextEditorCodeExecutionToolResultError, MRTextEditorCodeExecutionViewResultBlock. Details: " + ", ".join(error_messages)) else: return instance @@ -117,7 +147,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], MRToolSearchToolResultError, MRToolSearchToolSearchResultBlock]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], MRTextEditorCodeExecutionCreateResultBlock, MRTextEditorCodeExecutionStrReplaceResultBlock, MRTextEditorCodeExecutionToolResultError, MRTextEditorCodeExecutionViewResultBlock]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/src/otari/_client/models/content14.py b/src/otari/_client/models/content14.py index 6a60a69b..b2231677 100644 --- a/src/otari/_client/models/content14.py +++ b/src/otari/_client/models/content14.py @@ -19,28 +19,28 @@ import re # noqa: F401 from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Optional -from otari._client.models.mr_web_fetch_block import MRWebFetchBlock -from otari._client.models.mr_web_fetch_tool_result_error_block import MRWebFetchToolResultErrorBlock +from otari._client.models.mr_tool_search_tool_result_error import MRToolSearchToolResultError +from otari._client.models.mr_tool_search_tool_search_result_block import MRToolSearchToolSearchResultBlock from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict from typing_extensions import Literal, Self from pydantic import Field -CONTENT14_ANY_OF_SCHEMAS = ["MRWebFetchBlock", "MRWebFetchToolResultErrorBlock"] +CONTENT14_ANY_OF_SCHEMAS = ["MRToolSearchToolResultError", "MRToolSearchToolSearchResultBlock"] class Content14(BaseModel): """ Content14 """ - # data type: MRWebFetchToolResultErrorBlock - anyof_schema_1_validator: Optional[MRWebFetchToolResultErrorBlock] = None - # data type: MRWebFetchBlock - anyof_schema_2_validator: Optional[MRWebFetchBlock] = None + # data type: MRToolSearchToolResultError + anyof_schema_1_validator: Optional[MRToolSearchToolResultError] = None + # data type: MRToolSearchToolSearchResultBlock + anyof_schema_2_validator: Optional[MRToolSearchToolSearchResultBlock] = None if TYPE_CHECKING: - actual_instance: Optional[Union[MRWebFetchBlock, MRWebFetchToolResultErrorBlock]] = None + actual_instance: Optional[Union[MRToolSearchToolResultError, MRToolSearchToolSearchResultBlock]] = None else: actual_instance: Any = None - any_of_schemas: Set[str] = { "MRWebFetchBlock", "MRWebFetchToolResultErrorBlock" } + any_of_schemas: Set[str] = { "MRToolSearchToolResultError", "MRToolSearchToolSearchResultBlock" } model_config = { "validate_assignment": True, @@ -61,21 +61,21 @@ def __init__(self, *args, **kwargs) -> None: def actual_instance_must_validate_anyof(cls, v): instance = Content14.model_construct() error_messages = [] - # validate data type: MRWebFetchToolResultErrorBlock - if not isinstance(v, MRWebFetchToolResultErrorBlock): - error_messages.append(f"Error! Input type `{type(v)}` is not `MRWebFetchToolResultErrorBlock`") + # validate data type: MRToolSearchToolResultError + if not isinstance(v, MRToolSearchToolResultError): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRToolSearchToolResultError`") else: return v - # validate data type: MRWebFetchBlock - if not isinstance(v, MRWebFetchBlock): - error_messages.append(f"Error! Input type `{type(v)}` is not `MRWebFetchBlock`") + # validate data type: MRToolSearchToolSearchResultBlock + if not isinstance(v, MRToolSearchToolSearchResultBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRToolSearchToolSearchResultBlock`") else: return v if error_messages: # no match - raise ValueError("No match found when setting the actual_instance in Content14 with anyOf schemas: MRWebFetchBlock, MRWebFetchToolResultErrorBlock. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting the actual_instance in Content14 with anyOf schemas: MRToolSearchToolResultError, MRToolSearchToolSearchResultBlock. Details: " + ", ".join(error_messages)) else: return v @@ -88,22 +88,22 @@ def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" instance = cls.model_construct() error_messages = [] - # anyof_schema_1_validator: Optional[MRWebFetchToolResultErrorBlock] = None + # anyof_schema_1_validator: Optional[MRToolSearchToolResultError] = None try: - instance.actual_instance = MRWebFetchToolResultErrorBlock.from_json(json_str) + instance.actual_instance = MRToolSearchToolResultError.from_json(json_str) return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # anyof_schema_2_validator: Optional[MRWebFetchBlock] = None + # anyof_schema_2_validator: Optional[MRToolSearchToolSearchResultBlock] = None try: - instance.actual_instance = MRWebFetchBlock.from_json(json_str) + instance.actual_instance = MRToolSearchToolSearchResultBlock.from_json(json_str) return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) if error_messages: # no match - raise ValueError("No match found when deserializing the JSON string into Content14 with anyOf schemas: MRWebFetchBlock, MRWebFetchToolResultErrorBlock. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into Content14 with anyOf schemas: MRToolSearchToolResultError, MRToolSearchToolSearchResultBlock. Details: " + ", ".join(error_messages)) else: return instance @@ -117,7 +117,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], MRWebFetchBlock, MRWebFetchToolResultErrorBlock]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], MRToolSearchToolResultError, MRToolSearchToolSearchResultBlock]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/src/otari/_client/models/content15.py b/src/otari/_client/models/content15.py index da02e6f0..5ab1a714 100644 --- a/src/otari/_client/models/content15.py +++ b/src/otari/_client/models/content15.py @@ -18,29 +18,29 @@ import pprint import re # noqa: F401 from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator -from typing import List, Optional -from otari._client.models.mr_web_search_result_block import MRWebSearchResultBlock -from otari._client.models.mr_web_search_tool_result_error import MRWebSearchToolResultError +from typing import Optional +from otari._client.models.mr_web_fetch_block import MRWebFetchBlock +from otari._client.models.mr_web_fetch_tool_result_error_block import MRWebFetchToolResultErrorBlock from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict from typing_extensions import Literal, Self from pydantic import Field -CONTENT15_ANY_OF_SCHEMAS = ["List[MRWebSearchResultBlock]", "MRWebSearchToolResultError"] +CONTENT15_ANY_OF_SCHEMAS = ["MRWebFetchBlock", "MRWebFetchToolResultErrorBlock"] class Content15(BaseModel): """ Content15 """ - # data type: MRWebSearchToolResultError - anyof_schema_1_validator: Optional[MRWebSearchToolResultError] = None - # data type: List[MRWebSearchResultBlock] - anyof_schema_2_validator: Optional[List[MRWebSearchResultBlock]] = None + # data type: MRWebFetchToolResultErrorBlock + anyof_schema_1_validator: Optional[MRWebFetchToolResultErrorBlock] = None + # data type: MRWebFetchBlock + anyof_schema_2_validator: Optional[MRWebFetchBlock] = None if TYPE_CHECKING: - actual_instance: Optional[Union[List[MRWebSearchResultBlock], MRWebSearchToolResultError]] = None + actual_instance: Optional[Union[MRWebFetchBlock, MRWebFetchToolResultErrorBlock]] = None else: actual_instance: Any = None - any_of_schemas: Set[str] = { "List[MRWebSearchResultBlock]", "MRWebSearchToolResultError" } + any_of_schemas: Set[str] = { "MRWebFetchBlock", "MRWebFetchToolResultErrorBlock" } model_config = { "validate_assignment": True, @@ -61,21 +61,21 @@ def __init__(self, *args, **kwargs) -> None: def actual_instance_must_validate_anyof(cls, v): instance = Content15.model_construct() error_messages = [] - # validate data type: MRWebSearchToolResultError - if not isinstance(v, MRWebSearchToolResultError): - error_messages.append(f"Error! Input type `{type(v)}` is not `MRWebSearchToolResultError`") + # validate data type: MRWebFetchToolResultErrorBlock + if not isinstance(v, MRWebFetchToolResultErrorBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRWebFetchToolResultErrorBlock`") else: return v - # validate data type: List[MRWebSearchResultBlock] - try: - instance.anyof_schema_2_validator = v + # validate data type: MRWebFetchBlock + if not isinstance(v, MRWebFetchBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRWebFetchBlock`") + else: return v - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) + if error_messages: # no match - raise ValueError("No match found when setting the actual_instance in Content15 with anyOf schemas: List[MRWebSearchResultBlock], MRWebSearchToolResultError. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting the actual_instance in Content15 with anyOf schemas: MRWebFetchBlock, MRWebFetchToolResultErrorBlock. Details: " + ", ".join(error_messages)) else: return v @@ -88,25 +88,22 @@ def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" instance = cls.model_construct() error_messages = [] - # anyof_schema_1_validator: Optional[MRWebSearchToolResultError] = None + # anyof_schema_1_validator: Optional[MRWebFetchToolResultErrorBlock] = None try: - instance.actual_instance = MRWebSearchToolResultError.from_json(json_str) + instance.actual_instance = MRWebFetchToolResultErrorBlock.from_json(json_str) return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # deserialize data into List[MRWebSearchResultBlock] + # anyof_schema_2_validator: Optional[MRWebFetchBlock] = None try: - # validation - instance.anyof_schema_2_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.anyof_schema_2_validator + instance.actual_instance = MRWebFetchBlock.from_json(json_str) return instance except (ValidationError, ValueError) as e: - error_messages.append(str(e)) + error_messages.append(str(e)) if error_messages: # no match - raise ValueError("No match found when deserializing the JSON string into Content15 with anyOf schemas: List[MRWebSearchResultBlock], MRWebSearchToolResultError. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into Content15 with anyOf schemas: MRWebFetchBlock, MRWebFetchToolResultErrorBlock. Details: " + ", ".join(error_messages)) else: return instance @@ -120,7 +117,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], List[MRWebSearchResultBlock], MRWebSearchToolResultError]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], MRWebFetchBlock, MRWebFetchToolResultErrorBlock]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/src/otari/_client/models/content16.py b/src/otari/_client/models/content16.py new file mode 100644 index 00000000..43006e80 --- /dev/null +++ b/src/otari/_client/models/content16.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + otari + + Otari, an OpenAI-compatible LLM gateway with API key management + + The version of the OpenAPI document: 0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import List, Optional +from otari._client.models.mr_web_search_result_block import MRWebSearchResultBlock +from otari._client.models.mr_web_search_tool_result_error import MRWebSearchToolResultError +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CONTENT16_ANY_OF_SCHEMAS = ["List[MRWebSearchResultBlock]", "MRWebSearchToolResultError"] + +class Content16(BaseModel): + """ + Content16 + """ + + # data type: MRWebSearchToolResultError + anyof_schema_1_validator: Optional[MRWebSearchToolResultError] = None + # data type: List[MRWebSearchResultBlock] + anyof_schema_2_validator: Optional[List[MRWebSearchResultBlock]] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[List[MRWebSearchResultBlock], MRWebSearchToolResultError]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "List[MRWebSearchResultBlock]", "MRWebSearchToolResultError" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Content16.model_construct() + error_messages = [] + # validate data type: MRWebSearchToolResultError + if not isinstance(v, MRWebSearchToolResultError): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRWebSearchToolResultError`") + else: + return v + + # validate data type: List[MRWebSearchResultBlock] + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Content16 with anyOf schemas: List[MRWebSearchResultBlock], MRWebSearchToolResultError. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[MRWebSearchToolResultError] = None + try: + instance.actual_instance = MRWebSearchToolResultError.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into List[MRWebSearchResultBlock] + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Content16 with anyOf schemas: List[MRWebSearchResultBlock], MRWebSearchToolResultError. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], List[MRWebSearchResultBlock], MRWebSearchToolResultError]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/src/otari/_client/models/content16_inner.py b/src/otari/_client/models/content17_inner.py similarity index 75% rename from src/otari/_client/models/content16_inner.py rename to src/otari/_client/models/content17_inner.py index 6cf027bf..d3283788 100644 --- a/src/otari/_client/models/content16_inner.py +++ b/src/otari/_client/models/content17_inner.py @@ -22,10 +22,12 @@ from otari._client.models.mr_anthropic_types_thinking_block_thinking_block import MRAnthropicTypesThinkingBlockThinkingBlock from otari._client.models.mr_any_llm_types_messages_thinking_block import MRAnyLlmTypesMessagesThinkingBlock from otari._client.models.mr_bash_code_execution_tool_result_block import MRBashCodeExecutionToolResultBlock +from otari._client.models.mr_beta_advisor_tool_result_block import MRBetaAdvisorToolResultBlock from otari._client.models.mr_beta_bash_code_execution_tool_result_block import MRBetaBashCodeExecutionToolResultBlock from otari._client.models.mr_beta_code_execution_tool_result_block import MRBetaCodeExecutionToolResultBlock from otari._client.models.mr_beta_compaction_block import MRBetaCompactionBlock from otari._client.models.mr_beta_container_upload_block import MRBetaContainerUploadBlock +from otari._client.models.mr_beta_fallback_block import MRBetaFallbackBlock from otari._client.models.mr_beta_mcp_tool_result_block import MRBetaMCPToolResultBlock from otari._client.models.mr_beta_mcp_tool_use_block import MRBetaMCPToolUseBlock from otari._client.models.mr_beta_redacted_thinking_block import MRBetaRedactedThinkingBlock @@ -51,11 +53,11 @@ from typing_extensions import Literal, Self from pydantic import Field -CONTENT16INNER_ANY_OF_SCHEMAS = ["MRAnthropicTypesThinkingBlockThinkingBlock", "MRAnyLlmTypesMessagesThinkingBlock", "MRBashCodeExecutionToolResultBlock", "MRBetaBashCodeExecutionToolResultBlock", "MRBetaCodeExecutionToolResultBlock", "MRBetaCompactionBlock", "MRBetaContainerUploadBlock", "MRBetaMCPToolResultBlock", "MRBetaMCPToolUseBlock", "MRBetaRedactedThinkingBlock", "MRBetaServerToolUseBlock", "MRBetaTextBlock", "MRBetaTextEditorCodeExecutionToolResultBlock", "MRBetaThinkingBlock", "MRBetaToolSearchToolResultBlock", "MRBetaToolUseBlock", "MRBetaWebFetchToolResultBlock", "MRBetaWebSearchToolResultBlock", "MRCodeExecutionToolResultBlock", "MRContainerUploadBlock", "MRRedactedThinkingBlock", "MRServerToolUseBlock", "MRTextBlock", "MRTextEditorCodeExecutionToolResultBlock", "MRToolSearchToolResultBlock", "MRToolUseBlock", "MRWebFetchToolResultBlock", "MRWebSearchToolResultBlock"] +CONTENT17INNER_ANY_OF_SCHEMAS = ["MRAnthropicTypesThinkingBlockThinkingBlock", "MRAnyLlmTypesMessagesThinkingBlock", "MRBashCodeExecutionToolResultBlock", "MRBetaAdvisorToolResultBlock", "MRBetaBashCodeExecutionToolResultBlock", "MRBetaCodeExecutionToolResultBlock", "MRBetaCompactionBlock", "MRBetaContainerUploadBlock", "MRBetaFallbackBlock", "MRBetaMCPToolResultBlock", "MRBetaMCPToolUseBlock", "MRBetaRedactedThinkingBlock", "MRBetaServerToolUseBlock", "MRBetaTextBlock", "MRBetaTextEditorCodeExecutionToolResultBlock", "MRBetaThinkingBlock", "MRBetaToolSearchToolResultBlock", "MRBetaToolUseBlock", "MRBetaWebFetchToolResultBlock", "MRBetaWebSearchToolResultBlock", "MRCodeExecutionToolResultBlock", "MRContainerUploadBlock", "MRRedactedThinkingBlock", "MRServerToolUseBlock", "MRTextBlock", "MRTextEditorCodeExecutionToolResultBlock", "MRToolSearchToolResultBlock", "MRToolUseBlock", "MRWebFetchToolResultBlock", "MRWebSearchToolResultBlock"] -class Content16Inner(BaseModel): +class Content17Inner(BaseModel): """ - Content16Inner + Content17Inner """ # data type: MRAnyLlmTypesMessagesThinkingBlock @@ -98,27 +100,31 @@ class Content16Inner(BaseModel): anyof_schema_19_validator: Optional[MRBetaWebSearchToolResultBlock] = None # data type: MRBetaWebFetchToolResultBlock anyof_schema_20_validator: Optional[MRBetaWebFetchToolResultBlock] = None + # data type: MRBetaAdvisorToolResultBlock + anyof_schema_21_validator: Optional[MRBetaAdvisorToolResultBlock] = None # data type: MRBetaCodeExecutionToolResultBlock - anyof_schema_21_validator: Optional[MRBetaCodeExecutionToolResultBlock] = None + anyof_schema_22_validator: Optional[MRBetaCodeExecutionToolResultBlock] = None # data type: MRBetaBashCodeExecutionToolResultBlock - anyof_schema_22_validator: Optional[MRBetaBashCodeExecutionToolResultBlock] = None + anyof_schema_23_validator: Optional[MRBetaBashCodeExecutionToolResultBlock] = None # data type: MRBetaTextEditorCodeExecutionToolResultBlock - anyof_schema_23_validator: Optional[MRBetaTextEditorCodeExecutionToolResultBlock] = None + anyof_schema_24_validator: Optional[MRBetaTextEditorCodeExecutionToolResultBlock] = None # data type: MRBetaToolSearchToolResultBlock - anyof_schema_24_validator: Optional[MRBetaToolSearchToolResultBlock] = None + anyof_schema_25_validator: Optional[MRBetaToolSearchToolResultBlock] = None # data type: MRBetaMCPToolUseBlock - anyof_schema_25_validator: Optional[MRBetaMCPToolUseBlock] = None + anyof_schema_26_validator: Optional[MRBetaMCPToolUseBlock] = None # data type: MRBetaMCPToolResultBlock - anyof_schema_26_validator: Optional[MRBetaMCPToolResultBlock] = None + anyof_schema_27_validator: Optional[MRBetaMCPToolResultBlock] = None # data type: MRBetaContainerUploadBlock - anyof_schema_27_validator: Optional[MRBetaContainerUploadBlock] = None + anyof_schema_28_validator: Optional[MRBetaContainerUploadBlock] = None # data type: MRBetaCompactionBlock - anyof_schema_28_validator: Optional[MRBetaCompactionBlock] = None + anyof_schema_29_validator: Optional[MRBetaCompactionBlock] = None + # data type: MRBetaFallbackBlock + anyof_schema_30_validator: Optional[MRBetaFallbackBlock] = None if TYPE_CHECKING: - actual_instance: Optional[Union[MRAnthropicTypesThinkingBlockThinkingBlock, MRAnyLlmTypesMessagesThinkingBlock, MRBashCodeExecutionToolResultBlock, MRBetaBashCodeExecutionToolResultBlock, MRBetaCodeExecutionToolResultBlock, MRBetaCompactionBlock, MRBetaContainerUploadBlock, MRBetaMCPToolResultBlock, MRBetaMCPToolUseBlock, MRBetaRedactedThinkingBlock, MRBetaServerToolUseBlock, MRBetaTextBlock, MRBetaTextEditorCodeExecutionToolResultBlock, MRBetaThinkingBlock, MRBetaToolSearchToolResultBlock, MRBetaToolUseBlock, MRBetaWebFetchToolResultBlock, MRBetaWebSearchToolResultBlock, MRCodeExecutionToolResultBlock, MRContainerUploadBlock, MRRedactedThinkingBlock, MRServerToolUseBlock, MRTextBlock, MRTextEditorCodeExecutionToolResultBlock, MRToolSearchToolResultBlock, MRToolUseBlock, MRWebFetchToolResultBlock, MRWebSearchToolResultBlock]] = None + actual_instance: Optional[Union[MRAnthropicTypesThinkingBlockThinkingBlock, MRAnyLlmTypesMessagesThinkingBlock, MRBashCodeExecutionToolResultBlock, MRBetaAdvisorToolResultBlock, MRBetaBashCodeExecutionToolResultBlock, MRBetaCodeExecutionToolResultBlock, MRBetaCompactionBlock, MRBetaContainerUploadBlock, MRBetaFallbackBlock, MRBetaMCPToolResultBlock, MRBetaMCPToolUseBlock, MRBetaRedactedThinkingBlock, MRBetaServerToolUseBlock, MRBetaTextBlock, MRBetaTextEditorCodeExecutionToolResultBlock, MRBetaThinkingBlock, MRBetaToolSearchToolResultBlock, MRBetaToolUseBlock, MRBetaWebFetchToolResultBlock, MRBetaWebSearchToolResultBlock, MRCodeExecutionToolResultBlock, MRContainerUploadBlock, MRRedactedThinkingBlock, MRServerToolUseBlock, MRTextBlock, MRTextEditorCodeExecutionToolResultBlock, MRToolSearchToolResultBlock, MRToolUseBlock, MRWebFetchToolResultBlock, MRWebSearchToolResultBlock]] = None else: actual_instance: Any = None - any_of_schemas: Set[str] = { "MRAnthropicTypesThinkingBlockThinkingBlock", "MRAnyLlmTypesMessagesThinkingBlock", "MRBashCodeExecutionToolResultBlock", "MRBetaBashCodeExecutionToolResultBlock", "MRBetaCodeExecutionToolResultBlock", "MRBetaCompactionBlock", "MRBetaContainerUploadBlock", "MRBetaMCPToolResultBlock", "MRBetaMCPToolUseBlock", "MRBetaRedactedThinkingBlock", "MRBetaServerToolUseBlock", "MRBetaTextBlock", "MRBetaTextEditorCodeExecutionToolResultBlock", "MRBetaThinkingBlock", "MRBetaToolSearchToolResultBlock", "MRBetaToolUseBlock", "MRBetaWebFetchToolResultBlock", "MRBetaWebSearchToolResultBlock", "MRCodeExecutionToolResultBlock", "MRContainerUploadBlock", "MRRedactedThinkingBlock", "MRServerToolUseBlock", "MRTextBlock", "MRTextEditorCodeExecutionToolResultBlock", "MRToolSearchToolResultBlock", "MRToolUseBlock", "MRWebFetchToolResultBlock", "MRWebSearchToolResultBlock" } + any_of_schemas: Set[str] = { "MRAnthropicTypesThinkingBlockThinkingBlock", "MRAnyLlmTypesMessagesThinkingBlock", "MRBashCodeExecutionToolResultBlock", "MRBetaAdvisorToolResultBlock", "MRBetaBashCodeExecutionToolResultBlock", "MRBetaCodeExecutionToolResultBlock", "MRBetaCompactionBlock", "MRBetaContainerUploadBlock", "MRBetaFallbackBlock", "MRBetaMCPToolResultBlock", "MRBetaMCPToolUseBlock", "MRBetaRedactedThinkingBlock", "MRBetaServerToolUseBlock", "MRBetaTextBlock", "MRBetaTextEditorCodeExecutionToolResultBlock", "MRBetaThinkingBlock", "MRBetaToolSearchToolResultBlock", "MRBetaToolUseBlock", "MRBetaWebFetchToolResultBlock", "MRBetaWebSearchToolResultBlock", "MRCodeExecutionToolResultBlock", "MRContainerUploadBlock", "MRRedactedThinkingBlock", "MRServerToolUseBlock", "MRTextBlock", "MRTextEditorCodeExecutionToolResultBlock", "MRToolSearchToolResultBlock", "MRToolUseBlock", "MRWebFetchToolResultBlock", "MRWebSearchToolResultBlock" } model_config = { "validate_assignment": True, @@ -137,7 +143,7 @@ def __init__(self, *args, **kwargs) -> None: @field_validator('actual_instance') def actual_instance_must_validate_anyof(cls, v): - instance = Content16Inner.model_construct() + instance = Content17Inner.model_construct() error_messages = [] # validate data type: MRAnyLlmTypesMessagesThinkingBlock if not isinstance(v, MRAnyLlmTypesMessagesThinkingBlock): @@ -259,6 +265,12 @@ def actual_instance_must_validate_anyof(cls, v): else: return v + # validate data type: MRBetaAdvisorToolResultBlock + if not isinstance(v, MRBetaAdvisorToolResultBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaAdvisorToolResultBlock`") + else: + return v + # validate data type: MRBetaCodeExecutionToolResultBlock if not isinstance(v, MRBetaCodeExecutionToolResultBlock): error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaCodeExecutionToolResultBlock`") @@ -307,9 +319,15 @@ def actual_instance_must_validate_anyof(cls, v): else: return v + # validate data type: MRBetaFallbackBlock + if not isinstance(v, MRBetaFallbackBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaFallbackBlock`") + else: + return v + if error_messages: # no match - raise ValueError("No match found when setting the actual_instance in Content16Inner with anyOf schemas: MRAnthropicTypesThinkingBlockThinkingBlock, MRAnyLlmTypesMessagesThinkingBlock, MRBashCodeExecutionToolResultBlock, MRBetaBashCodeExecutionToolResultBlock, MRBetaCodeExecutionToolResultBlock, MRBetaCompactionBlock, MRBetaContainerUploadBlock, MRBetaMCPToolResultBlock, MRBetaMCPToolUseBlock, MRBetaRedactedThinkingBlock, MRBetaServerToolUseBlock, MRBetaTextBlock, MRBetaTextEditorCodeExecutionToolResultBlock, MRBetaThinkingBlock, MRBetaToolSearchToolResultBlock, MRBetaToolUseBlock, MRBetaWebFetchToolResultBlock, MRBetaWebSearchToolResultBlock, MRCodeExecutionToolResultBlock, MRContainerUploadBlock, MRRedactedThinkingBlock, MRServerToolUseBlock, MRTextBlock, MRTextEditorCodeExecutionToolResultBlock, MRToolSearchToolResultBlock, MRToolUseBlock, MRWebFetchToolResultBlock, MRWebSearchToolResultBlock. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting the actual_instance in Content17Inner with anyOf schemas: MRAnthropicTypesThinkingBlockThinkingBlock, MRAnyLlmTypesMessagesThinkingBlock, MRBashCodeExecutionToolResultBlock, MRBetaAdvisorToolResultBlock, MRBetaBashCodeExecutionToolResultBlock, MRBetaCodeExecutionToolResultBlock, MRBetaCompactionBlock, MRBetaContainerUploadBlock, MRBetaFallbackBlock, MRBetaMCPToolResultBlock, MRBetaMCPToolUseBlock, MRBetaRedactedThinkingBlock, MRBetaServerToolUseBlock, MRBetaTextBlock, MRBetaTextEditorCodeExecutionToolResultBlock, MRBetaThinkingBlock, MRBetaToolSearchToolResultBlock, MRBetaToolUseBlock, MRBetaWebFetchToolResultBlock, MRBetaWebSearchToolResultBlock, MRCodeExecutionToolResultBlock, MRContainerUploadBlock, MRRedactedThinkingBlock, MRServerToolUseBlock, MRTextBlock, MRTextEditorCodeExecutionToolResultBlock, MRToolSearchToolResultBlock, MRToolUseBlock, MRWebFetchToolResultBlock, MRWebSearchToolResultBlock. Details: " + ", ".join(error_messages)) else: return v @@ -442,58 +460,70 @@ def from_json(cls, json_str: str) -> Self: return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # anyof_schema_21_validator: Optional[MRBetaCodeExecutionToolResultBlock] = None + # anyof_schema_21_validator: Optional[MRBetaAdvisorToolResultBlock] = None + try: + instance.actual_instance = MRBetaAdvisorToolResultBlock.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_22_validator: Optional[MRBetaCodeExecutionToolResultBlock] = None try: instance.actual_instance = MRBetaCodeExecutionToolResultBlock.from_json(json_str) return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # anyof_schema_22_validator: Optional[MRBetaBashCodeExecutionToolResultBlock] = None + # anyof_schema_23_validator: Optional[MRBetaBashCodeExecutionToolResultBlock] = None try: instance.actual_instance = MRBetaBashCodeExecutionToolResultBlock.from_json(json_str) return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # anyof_schema_23_validator: Optional[MRBetaTextEditorCodeExecutionToolResultBlock] = None + # anyof_schema_24_validator: Optional[MRBetaTextEditorCodeExecutionToolResultBlock] = None try: instance.actual_instance = MRBetaTextEditorCodeExecutionToolResultBlock.from_json(json_str) return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # anyof_schema_24_validator: Optional[MRBetaToolSearchToolResultBlock] = None + # anyof_schema_25_validator: Optional[MRBetaToolSearchToolResultBlock] = None try: instance.actual_instance = MRBetaToolSearchToolResultBlock.from_json(json_str) return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # anyof_schema_25_validator: Optional[MRBetaMCPToolUseBlock] = None + # anyof_schema_26_validator: Optional[MRBetaMCPToolUseBlock] = None try: instance.actual_instance = MRBetaMCPToolUseBlock.from_json(json_str) return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # anyof_schema_26_validator: Optional[MRBetaMCPToolResultBlock] = None + # anyof_schema_27_validator: Optional[MRBetaMCPToolResultBlock] = None try: instance.actual_instance = MRBetaMCPToolResultBlock.from_json(json_str) return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # anyof_schema_27_validator: Optional[MRBetaContainerUploadBlock] = None + # anyof_schema_28_validator: Optional[MRBetaContainerUploadBlock] = None try: instance.actual_instance = MRBetaContainerUploadBlock.from_json(json_str) return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # anyof_schema_28_validator: Optional[MRBetaCompactionBlock] = None + # anyof_schema_29_validator: Optional[MRBetaCompactionBlock] = None try: instance.actual_instance = MRBetaCompactionBlock.from_json(json_str) return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) + # anyof_schema_30_validator: Optional[MRBetaFallbackBlock] = None + try: + instance.actual_instance = MRBetaFallbackBlock.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) if error_messages: # no match - raise ValueError("No match found when deserializing the JSON string into Content16Inner with anyOf schemas: MRAnthropicTypesThinkingBlockThinkingBlock, MRAnyLlmTypesMessagesThinkingBlock, MRBashCodeExecutionToolResultBlock, MRBetaBashCodeExecutionToolResultBlock, MRBetaCodeExecutionToolResultBlock, MRBetaCompactionBlock, MRBetaContainerUploadBlock, MRBetaMCPToolResultBlock, MRBetaMCPToolUseBlock, MRBetaRedactedThinkingBlock, MRBetaServerToolUseBlock, MRBetaTextBlock, MRBetaTextEditorCodeExecutionToolResultBlock, MRBetaThinkingBlock, MRBetaToolSearchToolResultBlock, MRBetaToolUseBlock, MRBetaWebFetchToolResultBlock, MRBetaWebSearchToolResultBlock, MRCodeExecutionToolResultBlock, MRContainerUploadBlock, MRRedactedThinkingBlock, MRServerToolUseBlock, MRTextBlock, MRTextEditorCodeExecutionToolResultBlock, MRToolSearchToolResultBlock, MRToolUseBlock, MRWebFetchToolResultBlock, MRWebSearchToolResultBlock. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into Content17Inner with anyOf schemas: MRAnthropicTypesThinkingBlockThinkingBlock, MRAnyLlmTypesMessagesThinkingBlock, MRBashCodeExecutionToolResultBlock, MRBetaAdvisorToolResultBlock, MRBetaBashCodeExecutionToolResultBlock, MRBetaCodeExecutionToolResultBlock, MRBetaCompactionBlock, MRBetaContainerUploadBlock, MRBetaFallbackBlock, MRBetaMCPToolResultBlock, MRBetaMCPToolUseBlock, MRBetaRedactedThinkingBlock, MRBetaServerToolUseBlock, MRBetaTextBlock, MRBetaTextEditorCodeExecutionToolResultBlock, MRBetaThinkingBlock, MRBetaToolSearchToolResultBlock, MRBetaToolUseBlock, MRBetaWebFetchToolResultBlock, MRBetaWebSearchToolResultBlock, MRCodeExecutionToolResultBlock, MRContainerUploadBlock, MRRedactedThinkingBlock, MRServerToolUseBlock, MRTextBlock, MRTextEditorCodeExecutionToolResultBlock, MRToolSearchToolResultBlock, MRToolUseBlock, MRWebFetchToolResultBlock, MRWebSearchToolResultBlock. Details: " + ", ".join(error_messages)) else: return instance @@ -507,7 +537,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], MRAnthropicTypesThinkingBlockThinkingBlock, MRAnyLlmTypesMessagesThinkingBlock, MRBashCodeExecutionToolResultBlock, MRBetaBashCodeExecutionToolResultBlock, MRBetaCodeExecutionToolResultBlock, MRBetaCompactionBlock, MRBetaContainerUploadBlock, MRBetaMCPToolResultBlock, MRBetaMCPToolUseBlock, MRBetaRedactedThinkingBlock, MRBetaServerToolUseBlock, MRBetaTextBlock, MRBetaTextEditorCodeExecutionToolResultBlock, MRBetaThinkingBlock, MRBetaToolSearchToolResultBlock, MRBetaToolUseBlock, MRBetaWebFetchToolResultBlock, MRBetaWebSearchToolResultBlock, MRCodeExecutionToolResultBlock, MRContainerUploadBlock, MRRedactedThinkingBlock, MRServerToolUseBlock, MRTextBlock, MRTextEditorCodeExecutionToolResultBlock, MRToolSearchToolResultBlock, MRToolUseBlock, MRWebFetchToolResultBlock, MRWebSearchToolResultBlock]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], MRAnthropicTypesThinkingBlockThinkingBlock, MRAnyLlmTypesMessagesThinkingBlock, MRBashCodeExecutionToolResultBlock, MRBetaAdvisorToolResultBlock, MRBetaBashCodeExecutionToolResultBlock, MRBetaCodeExecutionToolResultBlock, MRBetaCompactionBlock, MRBetaContainerUploadBlock, MRBetaFallbackBlock, MRBetaMCPToolResultBlock, MRBetaMCPToolUseBlock, MRBetaRedactedThinkingBlock, MRBetaServerToolUseBlock, MRBetaTextBlock, MRBetaTextEditorCodeExecutionToolResultBlock, MRBetaThinkingBlock, MRBetaToolSearchToolResultBlock, MRBetaToolUseBlock, MRBetaWebFetchToolResultBlock, MRBetaWebSearchToolResultBlock, MRCodeExecutionToolResultBlock, MRContainerUploadBlock, MRRedactedThinkingBlock, MRServerToolUseBlock, MRTextBlock, MRTextEditorCodeExecutionToolResultBlock, MRToolSearchToolResultBlock, MRToolUseBlock, MRWebFetchToolResultBlock, MRWebSearchToolResultBlock]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/src/otari/_client/models/content4.py b/src/otari/_client/models/content4.py index b4e5f775..58b802ef 100644 --- a/src/otari/_client/models/content4.py +++ b/src/otari/_client/models/content4.py @@ -19,28 +19,31 @@ import re # noqa: F401 from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Optional -from otari._client.models.mr_beta_bash_code_execution_result_block import MRBetaBashCodeExecutionResultBlock -from otari._client.models.mr_beta_bash_code_execution_tool_result_error import MRBetaBashCodeExecutionToolResultError +from otari._client.models.mr_beta_advisor_redacted_result_block import MRBetaAdvisorRedactedResultBlock +from otari._client.models.mr_beta_advisor_result_block import MRBetaAdvisorResultBlock +from otari._client.models.mr_beta_advisor_tool_result_error import MRBetaAdvisorToolResultError from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict from typing_extensions import Literal, Self from pydantic import Field -CONTENT4_ANY_OF_SCHEMAS = ["MRBetaBashCodeExecutionResultBlock", "MRBetaBashCodeExecutionToolResultError"] +CONTENT4_ANY_OF_SCHEMAS = ["MRBetaAdvisorRedactedResultBlock", "MRBetaAdvisorResultBlock", "MRBetaAdvisorToolResultError"] class Content4(BaseModel): """ Content4 """ - # data type: MRBetaBashCodeExecutionToolResultError - anyof_schema_1_validator: Optional[MRBetaBashCodeExecutionToolResultError] = None - # data type: MRBetaBashCodeExecutionResultBlock - anyof_schema_2_validator: Optional[MRBetaBashCodeExecutionResultBlock] = None + # data type: MRBetaAdvisorToolResultError + anyof_schema_1_validator: Optional[MRBetaAdvisorToolResultError] = None + # data type: MRBetaAdvisorResultBlock + anyof_schema_2_validator: Optional[MRBetaAdvisorResultBlock] = None + # data type: MRBetaAdvisorRedactedResultBlock + anyof_schema_3_validator: Optional[MRBetaAdvisorRedactedResultBlock] = None if TYPE_CHECKING: - actual_instance: Optional[Union[MRBetaBashCodeExecutionResultBlock, MRBetaBashCodeExecutionToolResultError]] = None + actual_instance: Optional[Union[MRBetaAdvisorRedactedResultBlock, MRBetaAdvisorResultBlock, MRBetaAdvisorToolResultError]] = None else: actual_instance: Any = None - any_of_schemas: Set[str] = { "MRBetaBashCodeExecutionResultBlock", "MRBetaBashCodeExecutionToolResultError" } + any_of_schemas: Set[str] = { "MRBetaAdvisorRedactedResultBlock", "MRBetaAdvisorResultBlock", "MRBetaAdvisorToolResultError" } model_config = { "validate_assignment": True, @@ -61,21 +64,27 @@ def __init__(self, *args, **kwargs) -> None: def actual_instance_must_validate_anyof(cls, v): instance = Content4.model_construct() error_messages = [] - # validate data type: MRBetaBashCodeExecutionToolResultError - if not isinstance(v, MRBetaBashCodeExecutionToolResultError): - error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaBashCodeExecutionToolResultError`") + # validate data type: MRBetaAdvisorToolResultError + if not isinstance(v, MRBetaAdvisorToolResultError): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaAdvisorToolResultError`") else: return v - # validate data type: MRBetaBashCodeExecutionResultBlock - if not isinstance(v, MRBetaBashCodeExecutionResultBlock): - error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaBashCodeExecutionResultBlock`") + # validate data type: MRBetaAdvisorResultBlock + if not isinstance(v, MRBetaAdvisorResultBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaAdvisorResultBlock`") + else: + return v + + # validate data type: MRBetaAdvisorRedactedResultBlock + if not isinstance(v, MRBetaAdvisorRedactedResultBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaAdvisorRedactedResultBlock`") else: return v if error_messages: # no match - raise ValueError("No match found when setting the actual_instance in Content4 with anyOf schemas: MRBetaBashCodeExecutionResultBlock, MRBetaBashCodeExecutionToolResultError. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting the actual_instance in Content4 with anyOf schemas: MRBetaAdvisorRedactedResultBlock, MRBetaAdvisorResultBlock, MRBetaAdvisorToolResultError. Details: " + ", ".join(error_messages)) else: return v @@ -88,22 +97,28 @@ def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" instance = cls.model_construct() error_messages = [] - # anyof_schema_1_validator: Optional[MRBetaBashCodeExecutionToolResultError] = None + # anyof_schema_1_validator: Optional[MRBetaAdvisorToolResultError] = None + try: + instance.actual_instance = MRBetaAdvisorToolResultError.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[MRBetaAdvisorResultBlock] = None try: - instance.actual_instance = MRBetaBashCodeExecutionToolResultError.from_json(json_str) + instance.actual_instance = MRBetaAdvisorResultBlock.from_json(json_str) return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # anyof_schema_2_validator: Optional[MRBetaBashCodeExecutionResultBlock] = None + # anyof_schema_3_validator: Optional[MRBetaAdvisorRedactedResultBlock] = None try: - instance.actual_instance = MRBetaBashCodeExecutionResultBlock.from_json(json_str) + instance.actual_instance = MRBetaAdvisorRedactedResultBlock.from_json(json_str) return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) if error_messages: # no match - raise ValueError("No match found when deserializing the JSON string into Content4 with anyOf schemas: MRBetaBashCodeExecutionResultBlock, MRBetaBashCodeExecutionToolResultError. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into Content4 with anyOf schemas: MRBetaAdvisorRedactedResultBlock, MRBetaAdvisorResultBlock, MRBetaAdvisorToolResultError. Details: " + ", ".join(error_messages)) else: return instance @@ -117,7 +132,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], MRBetaBashCodeExecutionResultBlock, MRBetaBashCodeExecutionToolResultError]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], MRBetaAdvisorRedactedResultBlock, MRBetaAdvisorResultBlock, MRBetaAdvisorToolResultError]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/src/otari/_client/models/content5.py b/src/otari/_client/models/content5.py index 124a5334..afb2f6fa 100644 --- a/src/otari/_client/models/content5.py +++ b/src/otari/_client/models/content5.py @@ -19,31 +19,28 @@ import re # noqa: F401 from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Optional -from otari._client.models.mr_beta_code_execution_result_block import MRBetaCodeExecutionResultBlock -from otari._client.models.mr_beta_code_execution_tool_result_error import MRBetaCodeExecutionToolResultError -from otari._client.models.mr_beta_encrypted_code_execution_result_block import MRBetaEncryptedCodeExecutionResultBlock +from otari._client.models.mr_beta_bash_code_execution_result_block import MRBetaBashCodeExecutionResultBlock +from otari._client.models.mr_beta_bash_code_execution_tool_result_error import MRBetaBashCodeExecutionToolResultError from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict from typing_extensions import Literal, Self from pydantic import Field -CONTENT5_ANY_OF_SCHEMAS = ["MRBetaCodeExecutionResultBlock", "MRBetaCodeExecutionToolResultError", "MRBetaEncryptedCodeExecutionResultBlock"] +CONTENT5_ANY_OF_SCHEMAS = ["MRBetaBashCodeExecutionResultBlock", "MRBetaBashCodeExecutionToolResultError"] class Content5(BaseModel): """ Content5 """ - # data type: MRBetaCodeExecutionToolResultError - anyof_schema_1_validator: Optional[MRBetaCodeExecutionToolResultError] = None - # data type: MRBetaCodeExecutionResultBlock - anyof_schema_2_validator: Optional[MRBetaCodeExecutionResultBlock] = None - # data type: MRBetaEncryptedCodeExecutionResultBlock - anyof_schema_3_validator: Optional[MRBetaEncryptedCodeExecutionResultBlock] = None + # data type: MRBetaBashCodeExecutionToolResultError + anyof_schema_1_validator: Optional[MRBetaBashCodeExecutionToolResultError] = None + # data type: MRBetaBashCodeExecutionResultBlock + anyof_schema_2_validator: Optional[MRBetaBashCodeExecutionResultBlock] = None if TYPE_CHECKING: - actual_instance: Optional[Union[MRBetaCodeExecutionResultBlock, MRBetaCodeExecutionToolResultError, MRBetaEncryptedCodeExecutionResultBlock]] = None + actual_instance: Optional[Union[MRBetaBashCodeExecutionResultBlock, MRBetaBashCodeExecutionToolResultError]] = None else: actual_instance: Any = None - any_of_schemas: Set[str] = { "MRBetaCodeExecutionResultBlock", "MRBetaCodeExecutionToolResultError", "MRBetaEncryptedCodeExecutionResultBlock" } + any_of_schemas: Set[str] = { "MRBetaBashCodeExecutionResultBlock", "MRBetaBashCodeExecutionToolResultError" } model_config = { "validate_assignment": True, @@ -64,27 +61,21 @@ def __init__(self, *args, **kwargs) -> None: def actual_instance_must_validate_anyof(cls, v): instance = Content5.model_construct() error_messages = [] - # validate data type: MRBetaCodeExecutionToolResultError - if not isinstance(v, MRBetaCodeExecutionToolResultError): - error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaCodeExecutionToolResultError`") + # validate data type: MRBetaBashCodeExecutionToolResultError + if not isinstance(v, MRBetaBashCodeExecutionToolResultError): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaBashCodeExecutionToolResultError`") else: return v - # validate data type: MRBetaCodeExecutionResultBlock - if not isinstance(v, MRBetaCodeExecutionResultBlock): - error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaCodeExecutionResultBlock`") - else: - return v - - # validate data type: MRBetaEncryptedCodeExecutionResultBlock - if not isinstance(v, MRBetaEncryptedCodeExecutionResultBlock): - error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaEncryptedCodeExecutionResultBlock`") + # validate data type: MRBetaBashCodeExecutionResultBlock + if not isinstance(v, MRBetaBashCodeExecutionResultBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaBashCodeExecutionResultBlock`") else: return v if error_messages: # no match - raise ValueError("No match found when setting the actual_instance in Content5 with anyOf schemas: MRBetaCodeExecutionResultBlock, MRBetaCodeExecutionToolResultError, MRBetaEncryptedCodeExecutionResultBlock. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting the actual_instance in Content5 with anyOf schemas: MRBetaBashCodeExecutionResultBlock, MRBetaBashCodeExecutionToolResultError. Details: " + ", ".join(error_messages)) else: return v @@ -97,28 +88,22 @@ def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" instance = cls.model_construct() error_messages = [] - # anyof_schema_1_validator: Optional[MRBetaCodeExecutionToolResultError] = None - try: - instance.actual_instance = MRBetaCodeExecutionToolResultError.from_json(json_str) - return instance - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # anyof_schema_2_validator: Optional[MRBetaCodeExecutionResultBlock] = None + # anyof_schema_1_validator: Optional[MRBetaBashCodeExecutionToolResultError] = None try: - instance.actual_instance = MRBetaCodeExecutionResultBlock.from_json(json_str) + instance.actual_instance = MRBetaBashCodeExecutionToolResultError.from_json(json_str) return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # anyof_schema_3_validator: Optional[MRBetaEncryptedCodeExecutionResultBlock] = None + # anyof_schema_2_validator: Optional[MRBetaBashCodeExecutionResultBlock] = None try: - instance.actual_instance = MRBetaEncryptedCodeExecutionResultBlock.from_json(json_str) + instance.actual_instance = MRBetaBashCodeExecutionResultBlock.from_json(json_str) return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) if error_messages: # no match - raise ValueError("No match found when deserializing the JSON string into Content5 with anyOf schemas: MRBetaCodeExecutionResultBlock, MRBetaCodeExecutionToolResultError, MRBetaEncryptedCodeExecutionResultBlock. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into Content5 with anyOf schemas: MRBetaBashCodeExecutionResultBlock, MRBetaBashCodeExecutionToolResultError. Details: " + ", ".join(error_messages)) else: return instance @@ -132,7 +117,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], MRBetaCodeExecutionResultBlock, MRBetaCodeExecutionToolResultError, MRBetaEncryptedCodeExecutionResultBlock]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], MRBetaBashCodeExecutionResultBlock, MRBetaBashCodeExecutionToolResultError]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/src/otari/_client/models/content6.py b/src/otari/_client/models/content6.py index ce841106..64a54b1a 100644 --- a/src/otari/_client/models/content6.py +++ b/src/otari/_client/models/content6.py @@ -18,28 +18,32 @@ import pprint import re # noqa: F401 from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator -from typing import List, Optional -from otari._client.models.mr_beta_text_block import MRBetaTextBlock +from typing import Optional +from otari._client.models.mr_beta_code_execution_result_block import MRBetaCodeExecutionResultBlock +from otari._client.models.mr_beta_code_execution_tool_result_error import MRBetaCodeExecutionToolResultError +from otari._client.models.mr_beta_encrypted_code_execution_result_block import MRBetaEncryptedCodeExecutionResultBlock from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict from typing_extensions import Literal, Self from pydantic import Field -CONTENT6_ANY_OF_SCHEMAS = ["List[MRBetaTextBlock]", "str"] +CONTENT6_ANY_OF_SCHEMAS = ["MRBetaCodeExecutionResultBlock", "MRBetaCodeExecutionToolResultError", "MRBetaEncryptedCodeExecutionResultBlock"] class Content6(BaseModel): """ Content6 """ - # data type: str - anyof_schema_1_validator: Optional[StrictStr] = None - # data type: List[MRBetaTextBlock] - anyof_schema_2_validator: Optional[List[MRBetaTextBlock]] = None + # data type: MRBetaCodeExecutionToolResultError + anyof_schema_1_validator: Optional[MRBetaCodeExecutionToolResultError] = None + # data type: MRBetaCodeExecutionResultBlock + anyof_schema_2_validator: Optional[MRBetaCodeExecutionResultBlock] = None + # data type: MRBetaEncryptedCodeExecutionResultBlock + anyof_schema_3_validator: Optional[MRBetaEncryptedCodeExecutionResultBlock] = None if TYPE_CHECKING: - actual_instance: Optional[Union[List[MRBetaTextBlock], str]] = None + actual_instance: Optional[Union[MRBetaCodeExecutionResultBlock, MRBetaCodeExecutionToolResultError, MRBetaEncryptedCodeExecutionResultBlock]] = None else: actual_instance: Any = None - any_of_schemas: Set[str] = { "List[MRBetaTextBlock]", "str" } + any_of_schemas: Set[str] = { "MRBetaCodeExecutionResultBlock", "MRBetaCodeExecutionToolResultError", "MRBetaEncryptedCodeExecutionResultBlock" } model_config = { "validate_assignment": True, @@ -60,21 +64,27 @@ def __init__(self, *args, **kwargs) -> None: def actual_instance_must_validate_anyof(cls, v): instance = Content6.model_construct() error_messages = [] - # validate data type: str - try: - instance.anyof_schema_1_validator = v + # validate data type: MRBetaCodeExecutionToolResultError + if not isinstance(v, MRBetaCodeExecutionToolResultError): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaCodeExecutionToolResultError`") + else: return v - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # validate data type: List[MRBetaTextBlock] - try: - instance.anyof_schema_2_validator = v + + # validate data type: MRBetaCodeExecutionResultBlock + if not isinstance(v, MRBetaCodeExecutionResultBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaCodeExecutionResultBlock`") + else: return v - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) + + # validate data type: MRBetaEncryptedCodeExecutionResultBlock + if not isinstance(v, MRBetaEncryptedCodeExecutionResultBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaEncryptedCodeExecutionResultBlock`") + else: + return v + if error_messages: # no match - raise ValueError("No match found when setting the actual_instance in Content6 with anyOf schemas: List[MRBetaTextBlock], str. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting the actual_instance in Content6 with anyOf schemas: MRBetaCodeExecutionResultBlock, MRBetaCodeExecutionToolResultError, MRBetaEncryptedCodeExecutionResultBlock. Details: " + ", ".join(error_messages)) else: return v @@ -87,28 +97,28 @@ def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" instance = cls.model_construct() error_messages = [] - # deserialize data into str + # anyof_schema_1_validator: Optional[MRBetaCodeExecutionToolResultError] = None + try: + instance.actual_instance = MRBetaCodeExecutionToolResultError.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[MRBetaCodeExecutionResultBlock] = None try: - # validation - instance.anyof_schema_1_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.anyof_schema_1_validator + instance.actual_instance = MRBetaCodeExecutionResultBlock.from_json(json_str) return instance except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into List[MRBetaTextBlock] + error_messages.append(str(e)) + # anyof_schema_3_validator: Optional[MRBetaEncryptedCodeExecutionResultBlock] = None try: - # validation - instance.anyof_schema_2_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.anyof_schema_2_validator + instance.actual_instance = MRBetaEncryptedCodeExecutionResultBlock.from_json(json_str) return instance except (ValidationError, ValueError) as e: - error_messages.append(str(e)) + error_messages.append(str(e)) if error_messages: # no match - raise ValueError("No match found when deserializing the JSON string into Content6 with anyOf schemas: List[MRBetaTextBlock], str. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into Content6 with anyOf schemas: MRBetaCodeExecutionResultBlock, MRBetaCodeExecutionToolResultError, MRBetaEncryptedCodeExecutionResultBlock. Details: " + ", ".join(error_messages)) else: return instance @@ -122,7 +132,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], List[MRBetaTextBlock], str]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], MRBetaCodeExecutionResultBlock, MRBetaCodeExecutionToolResultError, MRBetaEncryptedCodeExecutionResultBlock]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/src/otari/_client/models/content7.py b/src/otari/_client/models/content7.py index b4fb493e..87b6177b 100644 --- a/src/otari/_client/models/content7.py +++ b/src/otari/_client/models/content7.py @@ -18,35 +18,28 @@ import pprint import re # noqa: F401 from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator -from typing import Optional -from otari._client.models.mr_beta_text_editor_code_execution_create_result_block import MRBetaTextEditorCodeExecutionCreateResultBlock -from otari._client.models.mr_beta_text_editor_code_execution_str_replace_result_block import MRBetaTextEditorCodeExecutionStrReplaceResultBlock -from otari._client.models.mr_beta_text_editor_code_execution_tool_result_error import MRBetaTextEditorCodeExecutionToolResultError -from otari._client.models.mr_beta_text_editor_code_execution_view_result_block import MRBetaTextEditorCodeExecutionViewResultBlock +from typing import List, Optional +from otari._client.models.mr_beta_text_block import MRBetaTextBlock from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict from typing_extensions import Literal, Self from pydantic import Field -CONTENT7_ANY_OF_SCHEMAS = ["MRBetaTextEditorCodeExecutionCreateResultBlock", "MRBetaTextEditorCodeExecutionStrReplaceResultBlock", "MRBetaTextEditorCodeExecutionToolResultError", "MRBetaTextEditorCodeExecutionViewResultBlock"] +CONTENT7_ANY_OF_SCHEMAS = ["List[MRBetaTextBlock]", "str"] class Content7(BaseModel): """ Content7 """ - # data type: MRBetaTextEditorCodeExecutionToolResultError - anyof_schema_1_validator: Optional[MRBetaTextEditorCodeExecutionToolResultError] = None - # data type: MRBetaTextEditorCodeExecutionViewResultBlock - anyof_schema_2_validator: Optional[MRBetaTextEditorCodeExecutionViewResultBlock] = None - # data type: MRBetaTextEditorCodeExecutionCreateResultBlock - anyof_schema_3_validator: Optional[MRBetaTextEditorCodeExecutionCreateResultBlock] = None - # data type: MRBetaTextEditorCodeExecutionStrReplaceResultBlock - anyof_schema_4_validator: Optional[MRBetaTextEditorCodeExecutionStrReplaceResultBlock] = None + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: List[MRBetaTextBlock] + anyof_schema_2_validator: Optional[List[MRBetaTextBlock]] = None if TYPE_CHECKING: - actual_instance: Optional[Union[MRBetaTextEditorCodeExecutionCreateResultBlock, MRBetaTextEditorCodeExecutionStrReplaceResultBlock, MRBetaTextEditorCodeExecutionToolResultError, MRBetaTextEditorCodeExecutionViewResultBlock]] = None + actual_instance: Optional[Union[List[MRBetaTextBlock], str]] = None else: actual_instance: Any = None - any_of_schemas: Set[str] = { "MRBetaTextEditorCodeExecutionCreateResultBlock", "MRBetaTextEditorCodeExecutionStrReplaceResultBlock", "MRBetaTextEditorCodeExecutionToolResultError", "MRBetaTextEditorCodeExecutionViewResultBlock" } + any_of_schemas: Set[str] = { "List[MRBetaTextBlock]", "str" } model_config = { "validate_assignment": True, @@ -67,33 +60,21 @@ def __init__(self, *args, **kwargs) -> None: def actual_instance_must_validate_anyof(cls, v): instance = Content7.model_construct() error_messages = [] - # validate data type: MRBetaTextEditorCodeExecutionToolResultError - if not isinstance(v, MRBetaTextEditorCodeExecutionToolResultError): - error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaTextEditorCodeExecutionToolResultError`") - else: - return v - - # validate data type: MRBetaTextEditorCodeExecutionViewResultBlock - if not isinstance(v, MRBetaTextEditorCodeExecutionViewResultBlock): - error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaTextEditorCodeExecutionViewResultBlock`") - else: - return v - - # validate data type: MRBetaTextEditorCodeExecutionCreateResultBlock - if not isinstance(v, MRBetaTextEditorCodeExecutionCreateResultBlock): - error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaTextEditorCodeExecutionCreateResultBlock`") - else: + # validate data type: str + try: + instance.anyof_schema_1_validator = v return v - - # validate data type: MRBetaTextEditorCodeExecutionStrReplaceResultBlock - if not isinstance(v, MRBetaTextEditorCodeExecutionStrReplaceResultBlock): - error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaTextEditorCodeExecutionStrReplaceResultBlock`") - else: + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: List[MRBetaTextBlock] + try: + instance.anyof_schema_2_validator = v return v - + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) if error_messages: # no match - raise ValueError("No match found when setting the actual_instance in Content7 with anyOf schemas: MRBetaTextEditorCodeExecutionCreateResultBlock, MRBetaTextEditorCodeExecutionStrReplaceResultBlock, MRBetaTextEditorCodeExecutionToolResultError, MRBetaTextEditorCodeExecutionViewResultBlock. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting the actual_instance in Content7 with anyOf schemas: List[MRBetaTextBlock], str. Details: " + ", ".join(error_messages)) else: return v @@ -106,34 +87,28 @@ def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" instance = cls.model_construct() error_messages = [] - # anyof_schema_1_validator: Optional[MRBetaTextEditorCodeExecutionToolResultError] = None - try: - instance.actual_instance = MRBetaTextEditorCodeExecutionToolResultError.from_json(json_str) - return instance - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # anyof_schema_2_validator: Optional[MRBetaTextEditorCodeExecutionViewResultBlock] = None - try: - instance.actual_instance = MRBetaTextEditorCodeExecutionViewResultBlock.from_json(json_str) - return instance - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # anyof_schema_3_validator: Optional[MRBetaTextEditorCodeExecutionCreateResultBlock] = None + # deserialize data into str try: - instance.actual_instance = MRBetaTextEditorCodeExecutionCreateResultBlock.from_json(json_str) + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator return instance except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # anyof_schema_4_validator: Optional[MRBetaTextEditorCodeExecutionStrReplaceResultBlock] = None + error_messages.append(str(e)) + # deserialize data into List[MRBetaTextBlock] try: - instance.actual_instance = MRBetaTextEditorCodeExecutionStrReplaceResultBlock.from_json(json_str) + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator return instance except (ValidationError, ValueError) as e: - error_messages.append(str(e)) + error_messages.append(str(e)) if error_messages: # no match - raise ValueError("No match found when deserializing the JSON string into Content7 with anyOf schemas: MRBetaTextEditorCodeExecutionCreateResultBlock, MRBetaTextEditorCodeExecutionStrReplaceResultBlock, MRBetaTextEditorCodeExecutionToolResultError, MRBetaTextEditorCodeExecutionViewResultBlock. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into Content7 with anyOf schemas: List[MRBetaTextBlock], str. Details: " + ", ".join(error_messages)) else: return instance @@ -147,7 +122,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], MRBetaTextEditorCodeExecutionCreateResultBlock, MRBetaTextEditorCodeExecutionStrReplaceResultBlock, MRBetaTextEditorCodeExecutionToolResultError, MRBetaTextEditorCodeExecutionViewResultBlock]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], List[MRBetaTextBlock], str]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/src/otari/_client/models/content8.py b/src/otari/_client/models/content8.py index ffffde5a..2b9b042d 100644 --- a/src/otari/_client/models/content8.py +++ b/src/otari/_client/models/content8.py @@ -19,28 +19,34 @@ import re # noqa: F401 from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Optional -from otari._client.models.mr_beta_tool_search_tool_result_error import MRBetaToolSearchToolResultError -from otari._client.models.mr_beta_tool_search_tool_search_result_block import MRBetaToolSearchToolSearchResultBlock +from otari._client.models.mr_beta_text_editor_code_execution_create_result_block import MRBetaTextEditorCodeExecutionCreateResultBlock +from otari._client.models.mr_beta_text_editor_code_execution_str_replace_result_block import MRBetaTextEditorCodeExecutionStrReplaceResultBlock +from otari._client.models.mr_beta_text_editor_code_execution_tool_result_error import MRBetaTextEditorCodeExecutionToolResultError +from otari._client.models.mr_beta_text_editor_code_execution_view_result_block import MRBetaTextEditorCodeExecutionViewResultBlock from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict from typing_extensions import Literal, Self from pydantic import Field -CONTENT8_ANY_OF_SCHEMAS = ["MRBetaToolSearchToolResultError", "MRBetaToolSearchToolSearchResultBlock"] +CONTENT8_ANY_OF_SCHEMAS = ["MRBetaTextEditorCodeExecutionCreateResultBlock", "MRBetaTextEditorCodeExecutionStrReplaceResultBlock", "MRBetaTextEditorCodeExecutionToolResultError", "MRBetaTextEditorCodeExecutionViewResultBlock"] class Content8(BaseModel): """ Content8 """ - # data type: MRBetaToolSearchToolResultError - anyof_schema_1_validator: Optional[MRBetaToolSearchToolResultError] = None - # data type: MRBetaToolSearchToolSearchResultBlock - anyof_schema_2_validator: Optional[MRBetaToolSearchToolSearchResultBlock] = None + # data type: MRBetaTextEditorCodeExecutionToolResultError + anyof_schema_1_validator: Optional[MRBetaTextEditorCodeExecutionToolResultError] = None + # data type: MRBetaTextEditorCodeExecutionViewResultBlock + anyof_schema_2_validator: Optional[MRBetaTextEditorCodeExecutionViewResultBlock] = None + # data type: MRBetaTextEditorCodeExecutionCreateResultBlock + anyof_schema_3_validator: Optional[MRBetaTextEditorCodeExecutionCreateResultBlock] = None + # data type: MRBetaTextEditorCodeExecutionStrReplaceResultBlock + anyof_schema_4_validator: Optional[MRBetaTextEditorCodeExecutionStrReplaceResultBlock] = None if TYPE_CHECKING: - actual_instance: Optional[Union[MRBetaToolSearchToolResultError, MRBetaToolSearchToolSearchResultBlock]] = None + actual_instance: Optional[Union[MRBetaTextEditorCodeExecutionCreateResultBlock, MRBetaTextEditorCodeExecutionStrReplaceResultBlock, MRBetaTextEditorCodeExecutionToolResultError, MRBetaTextEditorCodeExecutionViewResultBlock]] = None else: actual_instance: Any = None - any_of_schemas: Set[str] = { "MRBetaToolSearchToolResultError", "MRBetaToolSearchToolSearchResultBlock" } + any_of_schemas: Set[str] = { "MRBetaTextEditorCodeExecutionCreateResultBlock", "MRBetaTextEditorCodeExecutionStrReplaceResultBlock", "MRBetaTextEditorCodeExecutionToolResultError", "MRBetaTextEditorCodeExecutionViewResultBlock" } model_config = { "validate_assignment": True, @@ -61,21 +67,33 @@ def __init__(self, *args, **kwargs) -> None: def actual_instance_must_validate_anyof(cls, v): instance = Content8.model_construct() error_messages = [] - # validate data type: MRBetaToolSearchToolResultError - if not isinstance(v, MRBetaToolSearchToolResultError): - error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaToolSearchToolResultError`") + # validate data type: MRBetaTextEditorCodeExecutionToolResultError + if not isinstance(v, MRBetaTextEditorCodeExecutionToolResultError): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaTextEditorCodeExecutionToolResultError`") else: return v - # validate data type: MRBetaToolSearchToolSearchResultBlock - if not isinstance(v, MRBetaToolSearchToolSearchResultBlock): - error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaToolSearchToolSearchResultBlock`") + # validate data type: MRBetaTextEditorCodeExecutionViewResultBlock + if not isinstance(v, MRBetaTextEditorCodeExecutionViewResultBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaTextEditorCodeExecutionViewResultBlock`") + else: + return v + + # validate data type: MRBetaTextEditorCodeExecutionCreateResultBlock + if not isinstance(v, MRBetaTextEditorCodeExecutionCreateResultBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaTextEditorCodeExecutionCreateResultBlock`") + else: + return v + + # validate data type: MRBetaTextEditorCodeExecutionStrReplaceResultBlock + if not isinstance(v, MRBetaTextEditorCodeExecutionStrReplaceResultBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaTextEditorCodeExecutionStrReplaceResultBlock`") else: return v if error_messages: # no match - raise ValueError("No match found when setting the actual_instance in Content8 with anyOf schemas: MRBetaToolSearchToolResultError, MRBetaToolSearchToolSearchResultBlock. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting the actual_instance in Content8 with anyOf schemas: MRBetaTextEditorCodeExecutionCreateResultBlock, MRBetaTextEditorCodeExecutionStrReplaceResultBlock, MRBetaTextEditorCodeExecutionToolResultError, MRBetaTextEditorCodeExecutionViewResultBlock. Details: " + ", ".join(error_messages)) else: return v @@ -88,22 +106,34 @@ def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" instance = cls.model_construct() error_messages = [] - # anyof_schema_1_validator: Optional[MRBetaToolSearchToolResultError] = None + # anyof_schema_1_validator: Optional[MRBetaTextEditorCodeExecutionToolResultError] = None + try: + instance.actual_instance = MRBetaTextEditorCodeExecutionToolResultError.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[MRBetaTextEditorCodeExecutionViewResultBlock] = None + try: + instance.actual_instance = MRBetaTextEditorCodeExecutionViewResultBlock.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_3_validator: Optional[MRBetaTextEditorCodeExecutionCreateResultBlock] = None try: - instance.actual_instance = MRBetaToolSearchToolResultError.from_json(json_str) + instance.actual_instance = MRBetaTextEditorCodeExecutionCreateResultBlock.from_json(json_str) return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # anyof_schema_2_validator: Optional[MRBetaToolSearchToolSearchResultBlock] = None + # anyof_schema_4_validator: Optional[MRBetaTextEditorCodeExecutionStrReplaceResultBlock] = None try: - instance.actual_instance = MRBetaToolSearchToolSearchResultBlock.from_json(json_str) + instance.actual_instance = MRBetaTextEditorCodeExecutionStrReplaceResultBlock.from_json(json_str) return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) if error_messages: # no match - raise ValueError("No match found when deserializing the JSON string into Content8 with anyOf schemas: MRBetaToolSearchToolResultError, MRBetaToolSearchToolSearchResultBlock. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into Content8 with anyOf schemas: MRBetaTextEditorCodeExecutionCreateResultBlock, MRBetaTextEditorCodeExecutionStrReplaceResultBlock, MRBetaTextEditorCodeExecutionToolResultError, MRBetaTextEditorCodeExecutionViewResultBlock. Details: " + ", ".join(error_messages)) else: return instance @@ -117,7 +147,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], MRBetaToolSearchToolResultError, MRBetaToolSearchToolSearchResultBlock]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], MRBetaTextEditorCodeExecutionCreateResultBlock, MRBetaTextEditorCodeExecutionStrReplaceResultBlock, MRBetaTextEditorCodeExecutionToolResultError, MRBetaTextEditorCodeExecutionViewResultBlock]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/src/otari/_client/models/content9.py b/src/otari/_client/models/content9.py index 6f2219fa..7c021cc7 100644 --- a/src/otari/_client/models/content9.py +++ b/src/otari/_client/models/content9.py @@ -19,28 +19,28 @@ import re # noqa: F401 from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Optional -from otari._client.models.mr_beta_web_fetch_block import MRBetaWebFetchBlock -from otari._client.models.mr_beta_web_fetch_tool_result_error_block import MRBetaWebFetchToolResultErrorBlock +from otari._client.models.mr_beta_tool_search_tool_result_error import MRBetaToolSearchToolResultError +from otari._client.models.mr_beta_tool_search_tool_search_result_block import MRBetaToolSearchToolSearchResultBlock from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict from typing_extensions import Literal, Self from pydantic import Field -CONTENT9_ANY_OF_SCHEMAS = ["MRBetaWebFetchBlock", "MRBetaWebFetchToolResultErrorBlock"] +CONTENT9_ANY_OF_SCHEMAS = ["MRBetaToolSearchToolResultError", "MRBetaToolSearchToolSearchResultBlock"] class Content9(BaseModel): """ Content9 """ - # data type: MRBetaWebFetchToolResultErrorBlock - anyof_schema_1_validator: Optional[MRBetaWebFetchToolResultErrorBlock] = None - # data type: MRBetaWebFetchBlock - anyof_schema_2_validator: Optional[MRBetaWebFetchBlock] = None + # data type: MRBetaToolSearchToolResultError + anyof_schema_1_validator: Optional[MRBetaToolSearchToolResultError] = None + # data type: MRBetaToolSearchToolSearchResultBlock + anyof_schema_2_validator: Optional[MRBetaToolSearchToolSearchResultBlock] = None if TYPE_CHECKING: - actual_instance: Optional[Union[MRBetaWebFetchBlock, MRBetaWebFetchToolResultErrorBlock]] = None + actual_instance: Optional[Union[MRBetaToolSearchToolResultError, MRBetaToolSearchToolSearchResultBlock]] = None else: actual_instance: Any = None - any_of_schemas: Set[str] = { "MRBetaWebFetchBlock", "MRBetaWebFetchToolResultErrorBlock" } + any_of_schemas: Set[str] = { "MRBetaToolSearchToolResultError", "MRBetaToolSearchToolSearchResultBlock" } model_config = { "validate_assignment": True, @@ -61,21 +61,21 @@ def __init__(self, *args, **kwargs) -> None: def actual_instance_must_validate_anyof(cls, v): instance = Content9.model_construct() error_messages = [] - # validate data type: MRBetaWebFetchToolResultErrorBlock - if not isinstance(v, MRBetaWebFetchToolResultErrorBlock): - error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaWebFetchToolResultErrorBlock`") + # validate data type: MRBetaToolSearchToolResultError + if not isinstance(v, MRBetaToolSearchToolResultError): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaToolSearchToolResultError`") else: return v - # validate data type: MRBetaWebFetchBlock - if not isinstance(v, MRBetaWebFetchBlock): - error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaWebFetchBlock`") + # validate data type: MRBetaToolSearchToolSearchResultBlock + if not isinstance(v, MRBetaToolSearchToolSearchResultBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaToolSearchToolSearchResultBlock`") else: return v if error_messages: # no match - raise ValueError("No match found when setting the actual_instance in Content9 with anyOf schemas: MRBetaWebFetchBlock, MRBetaWebFetchToolResultErrorBlock. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting the actual_instance in Content9 with anyOf schemas: MRBetaToolSearchToolResultError, MRBetaToolSearchToolSearchResultBlock. Details: " + ", ".join(error_messages)) else: return v @@ -88,22 +88,22 @@ def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" instance = cls.model_construct() error_messages = [] - # anyof_schema_1_validator: Optional[MRBetaWebFetchToolResultErrorBlock] = None + # anyof_schema_1_validator: Optional[MRBetaToolSearchToolResultError] = None try: - instance.actual_instance = MRBetaWebFetchToolResultErrorBlock.from_json(json_str) + instance.actual_instance = MRBetaToolSearchToolResultError.from_json(json_str) return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # anyof_schema_2_validator: Optional[MRBetaWebFetchBlock] = None + # anyof_schema_2_validator: Optional[MRBetaToolSearchToolSearchResultBlock] = None try: - instance.actual_instance = MRBetaWebFetchBlock.from_json(json_str) + instance.actual_instance = MRBetaToolSearchToolSearchResultBlock.from_json(json_str) return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) if error_messages: # no match - raise ValueError("No match found when deserializing the JSON string into Content9 with anyOf schemas: MRBetaWebFetchBlock, MRBetaWebFetchToolResultErrorBlock. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into Content9 with anyOf schemas: MRBetaToolSearchToolResultError, MRBetaToolSearchToolSearchResultBlock. Details: " + ", ".join(error_messages)) else: return instance @@ -117,7 +117,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], MRBetaWebFetchBlock, MRBetaWebFetchToolResultErrorBlock]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], MRBetaToolSearchToolResultError, MRBetaToolSearchToolSearchResultBlock]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/src/otari/_client/models/message_response.py b/src/otari/_client/models/message_response.py index 216d4e0a..4d2fc105 100644 --- a/src/otari/_client/models/message_response.py +++ b/src/otari/_client/models/message_response.py @@ -19,11 +19,11 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from otari._client.models.content16_inner import Content16Inner +from otari._client.models.content17_inner import Content17Inner from otari._client.models.model1 import Model1 from otari._client.models.mr_beta_container import MRBetaContainer from otari._client.models.mr_beta_context_management_response import MRBetaContextManagementResponse -from otari._client.models.mr_beta_diagnostics_fallback import MRBetaDiagnosticsFallback +from otari._client.models.mr_beta_diagnostics import MRBetaDiagnostics from otari._client.models.mr_message_usage import MRMessageUsage from otari._client.models.mr_refusal_stop_details import MRRefusalStopDetails from typing import Optional, Set @@ -36,7 +36,7 @@ class MessageResponse(BaseModel): """ # noqa: E501 id: StrictStr container: Optional[MRBetaContainer] = None - content: List[Content16Inner] + content: List[Content17Inner] model: Model1 role: StrictStr stop_details: Optional[MRRefusalStopDetails] = None @@ -44,10 +44,11 @@ class MessageResponse(BaseModel): stop_sequence: Optional[StrictStr] = Field(default=None, description="Filter to a single event type or metric name (e.g. 'tool_result', 'claude_code.commit.count')") type: StrictStr usage: MRMessageUsage + request_id: Optional[StrictStr] = Field(default=None, description="Filter to a single event type or metric name (e.g. 'tool_result', 'claude_code.commit.count')") context_management: Optional[MRBetaContextManagementResponse] = None - diagnostics: Optional[MRBetaDiagnosticsFallback] = None + diagnostics: Optional[MRBetaDiagnostics] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["id", "container", "content", "model", "role", "stop_details", "stop_reason", "stop_sequence", "type", "usage", "context_management", "diagnostics"] + __properties: ClassVar[List[str]] = ["id", "container", "content", "model", "role", "stop_details", "stop_reason", "stop_sequence", "type", "usage", "request_id", "context_management", "diagnostics"] @field_validator('role') def role_validate_enum(cls, value): @@ -164,6 +165,11 @@ def to_dict(self) -> Dict[str, Any]: if self.stop_sequence is None and "stop_sequence" in self.model_fields_set: _dict['stop_sequence'] = None + # set to None if request_id (nullable) is None + # and model_fields_set contains the field + if self.request_id is None and "request_id" in self.model_fields_set: + _dict['request_id'] = None + # set to None if context_management (nullable) is None # and model_fields_set contains the field if self.context_management is None and "context_management" in self.model_fields_set: @@ -188,7 +194,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "id": obj.get("id"), "container": MRBetaContainer.from_dict(obj["container"]) if obj.get("container") is not None else None, - "content": [Content16Inner.from_dict(_item) for _item in obj["content"]] if obj.get("content") is not None else None, + "content": [Content17Inner.from_dict(_item) for _item in obj["content"]] if obj.get("content") is not None else None, "model": Model1.from_dict(obj["model"]) if obj.get("model") is not None else None, "role": obj.get("role"), "stop_details": MRRefusalStopDetails.from_dict(obj["stop_details"]) if obj.get("stop_details") is not None else None, @@ -196,8 +202,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "stop_sequence": obj.get("stop_sequence"), "type": obj.get("type"), "usage": MRMessageUsage.from_dict(obj["usage"]) if obj.get("usage") is not None else None, + "request_id": obj.get("request_id"), "context_management": MRBetaContextManagementResponse.from_dict(obj["context_management"]) if obj.get("context_management") is not None else None, - "diagnostics": MRBetaDiagnosticsFallback.from_dict(obj["diagnostics"]) if obj.get("diagnostics") is not None else None + "diagnostics": MRBetaDiagnostics.from_dict(obj["diagnostics"]) if obj.get("diagnostics") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/src/otari/_client/models/messages_request.py b/src/otari/_client/models/messages_request.py index 2a6a3a94..fa63ccb0 100644 --- a/src/otari/_client/models/messages_request.py +++ b/src/otari/_client/models/messages_request.py @@ -30,7 +30,7 @@ class MessagesRequest(BaseModel): """ - Anthropic Messages API-compatible request. The wire fields are derived from any-llm's ``MessagesParams`` (see ``_schema_derive``) so the schema cannot silently drop a param any-llm forwards. ``container`` is an Anthropic wire param ``MessagesParams`` does not model, declared here and forwarded as an any-llm ``**kwargs`` param. Gateway-internal fields (``mcp_servers``, ``mcp_server_ids``, ``guardrails``, ``tools_header``, ``max_tool_iterations``) opt the request into gateway-managed MCP / sandbox / web_search / guardrails without changing the upstream wire shape. They're stripped before the request is forwarded. + Anthropic Messages API-compatible request. The wire fields are derived from any-llm's ``MessagesParams`` (see ``_schema_derive``) so the schema cannot silently drop a param any-llm forwards. Gateway-internal fields (``mcp_servers``, ``mcp_server_ids``, ``guardrails``, ``tools_header``, ``max_tool_iterations``) opt the request into gateway-managed MCP / sandbox / web_search / guardrails without changing the upstream wire shape. They're stripped before the request is forwarded. """ # noqa: E501 betas: Optional[List[StrictStr]] = None cache_control: Optional[Dict[str, Any]] = None @@ -46,6 +46,7 @@ class MessagesRequest(BaseModel): model: StrictStr output_format: Optional[Dict[str, Any]] = Field(default=None, description="Provider-native request fields used as defaults (e.g. exa's 'type', searxng's 'engines').") prompt_cache_key: Optional[StrictStr] = None + service_tier: Optional[StrictStr] = None session_label: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Optional caller-supplied label for cost attribution (per run, experiment, or conversation). In hybrid mode it is forwarded onto the platform usage report so spend can be sliced by session without standing up OpenTelemetry. Stripped before the request is forwarded upstream to the provider. Has no effect in standalone mode, where there is no platform to report it to.") stop_sequences: Optional[List[StrictStr]] = None stream: Optional[StrictBool] = False @@ -57,7 +58,7 @@ class MessagesRequest(BaseModel): tools_header: Optional[StrictStr] = None top_k: Optional[StrictInt] = None top_p: Optional[Union[StrictFloat, StrictInt]] = None - __properties: ClassVar[List[str]] = ["betas", "cache_control", "container", "context_management", "guardrails", "max_tokens", "max_tool_iterations", "mcp_server_ids", "mcp_servers", "messages", "metadata", "model", "output_format", "prompt_cache_key", "session_label", "stop_sequences", "stream", "system", "temperature", "thinking", "tool_choice", "tools", "tools_header", "top_k", "top_p"] + __properties: ClassVar[List[str]] = ["betas", "cache_control", "container", "context_management", "guardrails", "max_tokens", "max_tool_iterations", "mcp_server_ids", "mcp_servers", "messages", "metadata", "model", "output_format", "prompt_cache_key", "service_tier", "session_label", "stop_sequences", "stream", "system", "temperature", "thinking", "tool_choice", "tools", "tools_header", "top_k", "top_p"] model_config = ConfigDict( validate_by_name=True, @@ -170,6 +171,11 @@ def to_dict(self) -> Dict[str, Any]: if self.prompt_cache_key is None and "prompt_cache_key" in self.model_fields_set: _dict['prompt_cache_key'] = None + # set to None if service_tier (nullable) is None + # and model_fields_set contains the field + if self.service_tier is None and "service_tier" in self.model_fields_set: + _dict['service_tier'] = None + # set to None if session_label (nullable) is None # and model_fields_set contains the field if self.session_label is None and "session_label" in self.model_fields_set: @@ -246,6 +252,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "model": obj.get("model"), "output_format": obj.get("output_format"), "prompt_cache_key": obj.get("prompt_cache_key"), + "service_tier": obj.get("service_tier"), "session_label": obj.get("session_label"), "stop_sequences": obj.get("stop_sequences"), "stream": obj.get("stream") if obj.get("stream") is not None else False, diff --git a/src/otari/_client/models/mr_beta_advisor_message_iteration_usage.py b/src/otari/_client/models/mr_beta_advisor_message_iteration_usage.py new file mode 100644 index 00000000..24f49126 --- /dev/null +++ b/src/otari/_client/models/mr_beta_advisor_message_iteration_usage.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + otari + + Otari, an OpenAI-compatible LLM gateway with API key management + + The version of the OpenAPI document: 0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from otari._client.models.model1 import Model1 +from otari._client.models.mr_beta_cache_creation import MRBetaCacheCreation +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MRBetaAdvisorMessageIterationUsage(BaseModel): + """ + Token usage for an advisor sub-inference iteration. + """ # noqa: E501 + cache_creation: Optional[MRBetaCacheCreation] = None + cache_creation_input_tokens: StrictInt + cache_read_input_tokens: StrictInt + input_tokens: StrictInt + model: Model1 + output_tokens: StrictInt + type: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["cache_creation", "cache_creation_input_tokens", "cache_read_input_tokens", "input_tokens", "model", "output_tokens", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['advisor_message']): + raise ValueError("must be one of enum values ('advisor_message')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MRBetaAdvisorMessageIterationUsage from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of cache_creation + if self.cache_creation: + _dict['cache_creation'] = self.cache_creation.to_dict() + # override the default output from pydantic by calling `to_dict()` of model + if self.model: + _dict['model'] = self.model.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if cache_creation (nullable) is None + # and model_fields_set contains the field + if self.cache_creation is None and "cache_creation" in self.model_fields_set: + _dict['cache_creation'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MRBetaAdvisorMessageIterationUsage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "cache_creation": MRBetaCacheCreation.from_dict(obj["cache_creation"]) if obj.get("cache_creation") is not None else None, + "cache_creation_input_tokens": obj.get("cache_creation_input_tokens"), + "cache_read_input_tokens": obj.get("cache_read_input_tokens"), + "input_tokens": obj.get("input_tokens"), + "model": Model1.from_dict(obj["model"]) if obj.get("model") is not None else None, + "output_tokens": obj.get("output_tokens"), + "type": obj.get("type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/src/otari/_client/models/mr_beta_advisor_redacted_result_block.py b/src/otari/_client/models/mr_beta_advisor_redacted_result_block.py new file mode 100644 index 00000000..d2da4218 --- /dev/null +++ b/src/otari/_client/models/mr_beta_advisor_redacted_result_block.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + otari + + Otari, an OpenAI-compatible LLM gateway with API key management + + The version of the OpenAPI document: 0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MRBetaAdvisorRedactedResultBlock(BaseModel): + """ + MRBetaAdvisorRedactedResultBlock + """ # noqa: E501 + encrypted_content: StrictStr + stop_reason: Optional[StrictStr] = None + type: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["encrypted_content", "stop_reason", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['advisor_redacted_result']): + raise ValueError("must be one of enum values ('advisor_redacted_result')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MRBetaAdvisorRedactedResultBlock from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if stop_reason (nullable) is None + # and model_fields_set contains the field + if self.stop_reason is None and "stop_reason" in self.model_fields_set: + _dict['stop_reason'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MRBetaAdvisorRedactedResultBlock from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "encrypted_content": obj.get("encrypted_content"), + "stop_reason": obj.get("stop_reason"), + "type": obj.get("type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/src/otari/_client/models/mr_beta_advisor_result_block.py b/src/otari/_client/models/mr_beta_advisor_result_block.py new file mode 100644 index 00000000..45f2ea60 --- /dev/null +++ b/src/otari/_client/models/mr_beta_advisor_result_block.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + otari + + Otari, an OpenAI-compatible LLM gateway with API key management + + The version of the OpenAPI document: 0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MRBetaAdvisorResultBlock(BaseModel): + """ + MRBetaAdvisorResultBlock + """ # noqa: E501 + stop_reason: Optional[StrictStr] = None + text: StrictStr + type: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["stop_reason", "text", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['advisor_result']): + raise ValueError("must be one of enum values ('advisor_result')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MRBetaAdvisorResultBlock from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if stop_reason (nullable) is None + # and model_fields_set contains the field + if self.stop_reason is None and "stop_reason" in self.model_fields_set: + _dict['stop_reason'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MRBetaAdvisorResultBlock from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "stop_reason": obj.get("stop_reason"), + "text": obj.get("text"), + "type": obj.get("type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/src/otari/_client/models/mr_beta_advisor_tool_result_block.py b/src/otari/_client/models/mr_beta_advisor_tool_result_block.py new file mode 100644 index 00000000..29fcbf32 --- /dev/null +++ b/src/otari/_client/models/mr_beta_advisor_tool_result_block.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + otari + + Otari, an OpenAI-compatible LLM gateway with API key management + + The version of the OpenAPI document: 0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from otari._client.models.content4 import Content4 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MRBetaAdvisorToolResultBlock(BaseModel): + """ + MRBetaAdvisorToolResultBlock + """ # noqa: E501 + content: Content4 + tool_use_id: StrictStr + type: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["content", "tool_use_id", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['advisor_tool_result']): + raise ValueError("must be one of enum values ('advisor_tool_result')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MRBetaAdvisorToolResultBlock from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of content + if self.content: + _dict['content'] = self.content.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MRBetaAdvisorToolResultBlock from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "content": Content4.from_dict(obj["content"]) if obj.get("content") is not None else None, + "tool_use_id": obj.get("tool_use_id"), + "type": obj.get("type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/src/otari/_client/models/mr_beta_advisor_tool_result_error.py b/src/otari/_client/models/mr_beta_advisor_tool_result_error.py new file mode 100644 index 00000000..9f918a88 --- /dev/null +++ b/src/otari/_client/models/mr_beta_advisor_tool_result_error.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + otari + + Otari, an OpenAI-compatible LLM gateway with API key management + + The version of the OpenAPI document: 0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MRBetaAdvisorToolResultError(BaseModel): + """ + MRBetaAdvisorToolResultError + """ # noqa: E501 + error_code: StrictStr + type: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["error_code", "type"] + + @field_validator('error_code') + def error_code_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['max_uses_exceeded', 'prompt_too_long', 'too_many_requests', 'overloaded', 'unavailable', 'execution_time_exceeded', 'model_not_found']): + raise ValueError("must be one of enum values ('max_uses_exceeded', 'prompt_too_long', 'too_many_requests', 'overloaded', 'unavailable', 'execution_time_exceeded', 'model_not_found')") + return value + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['advisor_tool_result_error']): + raise ValueError("must be one of enum values ('advisor_tool_result_error')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MRBetaAdvisorToolResultError from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MRBetaAdvisorToolResultError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "error_code": obj.get("error_code"), + "type": obj.get("type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/src/otari/_client/models/mr_beta_bash_code_execution_tool_result_block.py b/src/otari/_client/models/mr_beta_bash_code_execution_tool_result_block.py index 12fe08e9..359459f4 100644 --- a/src/otari/_client/models/mr_beta_bash_code_execution_tool_result_block.py +++ b/src/otari/_client/models/mr_beta_bash_code_execution_tool_result_block.py @@ -19,7 +19,7 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List -from otari._client.models.content4 import Content4 +from otari._client.models.content5 import Content5 from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -28,7 +28,7 @@ class MRBetaBashCodeExecutionToolResultBlock(BaseModel): """ MRBetaBashCodeExecutionToolResultBlock """ # noqa: E501 - content: Content4 + content: Content5 tool_use_id: StrictStr type: StrictStr additional_properties: Dict[str, Any] = {} @@ -102,7 +102,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "content": Content4.from_dict(obj["content"]) if obj.get("content") is not None else None, + "content": Content5.from_dict(obj["content"]) if obj.get("content") is not None else None, "tool_use_id": obj.get("tool_use_id"), "type": obj.get("type") }) diff --git a/src/otari/_client/models/mr_beta_cache_miss_messages_changed.py b/src/otari/_client/models/mr_beta_cache_miss_messages_changed.py new file mode 100644 index 00000000..c4519c79 --- /dev/null +++ b/src/otari/_client/models/mr_beta_cache_miss_messages_changed.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + otari + + Otari, an OpenAI-compatible LLM gateway with API key management + + The version of the OpenAPI document: 0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MRBetaCacheMissMessagesChanged(BaseModel): + """ + MRBetaCacheMissMessagesChanged + """ # noqa: E501 + cache_missed_input_tokens: StrictInt + type: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["cache_missed_input_tokens", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['messages_changed']): + raise ValueError("must be one of enum values ('messages_changed')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MRBetaCacheMissMessagesChanged from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MRBetaCacheMissMessagesChanged from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "cache_missed_input_tokens": obj.get("cache_missed_input_tokens"), + "type": obj.get("type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/src/otari/_client/models/mr_beta_cache_miss_model_changed.py b/src/otari/_client/models/mr_beta_cache_miss_model_changed.py new file mode 100644 index 00000000..fa6491e4 --- /dev/null +++ b/src/otari/_client/models/mr_beta_cache_miss_model_changed.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + otari + + Otari, an OpenAI-compatible LLM gateway with API key management + + The version of the OpenAPI document: 0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MRBetaCacheMissModelChanged(BaseModel): + """ + MRBetaCacheMissModelChanged + """ # noqa: E501 + cache_missed_input_tokens: StrictInt + type: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["cache_missed_input_tokens", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['model_changed']): + raise ValueError("must be one of enum values ('model_changed')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MRBetaCacheMissModelChanged from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MRBetaCacheMissModelChanged from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "cache_missed_input_tokens": obj.get("cache_missed_input_tokens"), + "type": obj.get("type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/src/otari/_client/models/mr_beta_cache_miss_previous_message_not_found.py b/src/otari/_client/models/mr_beta_cache_miss_previous_message_not_found.py new file mode 100644 index 00000000..a237f884 --- /dev/null +++ b/src/otari/_client/models/mr_beta_cache_miss_previous_message_not_found.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + otari + + Otari, an OpenAI-compatible LLM gateway with API key management + + The version of the OpenAPI document: 0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MRBetaCacheMissPreviousMessageNotFound(BaseModel): + """ + MRBetaCacheMissPreviousMessageNotFound + """ # noqa: E501 + type: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['previous_message_not_found']): + raise ValueError("must be one of enum values ('previous_message_not_found')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MRBetaCacheMissPreviousMessageNotFound from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MRBetaCacheMissPreviousMessageNotFound from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/src/otari/_client/models/mr_beta_cache_miss_system_changed.py b/src/otari/_client/models/mr_beta_cache_miss_system_changed.py new file mode 100644 index 00000000..3e72f294 --- /dev/null +++ b/src/otari/_client/models/mr_beta_cache_miss_system_changed.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + otari + + Otari, an OpenAI-compatible LLM gateway with API key management + + The version of the OpenAPI document: 0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MRBetaCacheMissSystemChanged(BaseModel): + """ + MRBetaCacheMissSystemChanged + """ # noqa: E501 + cache_missed_input_tokens: StrictInt + type: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["cache_missed_input_tokens", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['system_changed']): + raise ValueError("must be one of enum values ('system_changed')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MRBetaCacheMissSystemChanged from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MRBetaCacheMissSystemChanged from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "cache_missed_input_tokens": obj.get("cache_missed_input_tokens"), + "type": obj.get("type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/src/otari/_client/models/mr_beta_cache_miss_tools_changed.py b/src/otari/_client/models/mr_beta_cache_miss_tools_changed.py new file mode 100644 index 00000000..611d1df2 --- /dev/null +++ b/src/otari/_client/models/mr_beta_cache_miss_tools_changed.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + otari + + Otari, an OpenAI-compatible LLM gateway with API key management + + The version of the OpenAPI document: 0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MRBetaCacheMissToolsChanged(BaseModel): + """ + MRBetaCacheMissToolsChanged + """ # noqa: E501 + cache_missed_input_tokens: StrictInt + type: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["cache_missed_input_tokens", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['tools_changed']): + raise ValueError("must be one of enum values ('tools_changed')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MRBetaCacheMissToolsChanged from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MRBetaCacheMissToolsChanged from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "cache_missed_input_tokens": obj.get("cache_missed_input_tokens"), + "type": obj.get("type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/src/otari/_client/models/mr_beta_cache_miss_unavailable.py b/src/otari/_client/models/mr_beta_cache_miss_unavailable.py new file mode 100644 index 00000000..ce527451 --- /dev/null +++ b/src/otari/_client/models/mr_beta_cache_miss_unavailable.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + otari + + Otari, an OpenAI-compatible LLM gateway with API key management + + The version of the OpenAPI document: 0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MRBetaCacheMissUnavailable(BaseModel): + """ + MRBetaCacheMissUnavailable + """ # noqa: E501 + type: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['unavailable']): + raise ValueError("must be one of enum values ('unavailable')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MRBetaCacheMissUnavailable from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MRBetaCacheMissUnavailable from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/src/otari/_client/models/mr_beta_code_execution_tool_result_block.py b/src/otari/_client/models/mr_beta_code_execution_tool_result_block.py index cd876233..9a4f82b6 100644 --- a/src/otari/_client/models/mr_beta_code_execution_tool_result_block.py +++ b/src/otari/_client/models/mr_beta_code_execution_tool_result_block.py @@ -19,7 +19,7 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List -from otari._client.models.content5 import Content5 +from otari._client.models.content6 import Content6 from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -28,7 +28,7 @@ class MRBetaCodeExecutionToolResultBlock(BaseModel): """ MRBetaCodeExecutionToolResultBlock """ # noqa: E501 - content: Content5 + content: Content6 tool_use_id: StrictStr type: StrictStr additional_properties: Dict[str, Any] = {} @@ -102,7 +102,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "content": Content5.from_dict(obj["content"]) if obj.get("content") is not None else None, + "content": Content6.from_dict(obj["content"]) if obj.get("content") is not None else None, "tool_use_id": obj.get("tool_use_id"), "type": obj.get("type") }) diff --git a/src/otari/_client/models/mr_beta_compaction_block.py b/src/otari/_client/models/mr_beta_compaction_block.py index e05a67cc..8920f23d 100644 --- a/src/otari/_client/models/mr_beta_compaction_block.py +++ b/src/otari/_client/models/mr_beta_compaction_block.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -28,9 +28,10 @@ class MRBetaCompactionBlock(BaseModel): A compaction block returned when autocompact is triggered. When content is None, it indicates the compaction failed to produce a valid summary (e.g., malformed output from the model). Clients may round-trip compaction blocks with null content; the server treats them as no-ops. """ # noqa: E501 content: Optional[StrictStr] = None + encrypted_content: Optional[StrictStr] = Field(default=None, description="Filter to a single event type or metric name (e.g. 'tool_result', 'claude_code.commit.count')") type: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["content", "type"] + __properties: ClassVar[List[str]] = ["content", "encrypted_content", "type"] @field_validator('type') def type_validate_enum(cls, value): @@ -90,6 +91,11 @@ def to_dict(self) -> Dict[str, Any]: if self.content is None and "content" in self.model_fields_set: _dict['content'] = None + # set to None if encrypted_content (nullable) is None + # and model_fields_set contains the field + if self.encrypted_content is None and "encrypted_content" in self.model_fields_set: + _dict['encrypted_content'] = None + return _dict @classmethod @@ -103,6 +109,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "content": obj.get("content"), + "encrypted_content": obj.get("encrypted_content"), "type": obj.get("type") }) # store additional fields in additional_properties diff --git a/src/otari/_client/models/mr_beta_diagnostics_fallback.py b/src/otari/_client/models/mr_beta_diagnostics.py similarity index 78% rename from src/otari/_client/models/mr_beta_diagnostics_fallback.py rename to src/otari/_client/models/mr_beta_diagnostics.py index 78cd7a3f..bdc6439f 100644 --- a/src/otari/_client/models/mr_beta_diagnostics_fallback.py +++ b/src/otari/_client/models/mr_beta_diagnostics.py @@ -17,17 +17,18 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field +from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional +from otari._client.models.cache_miss_reason import CacheMissReason from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python -class MRBetaDiagnosticsFallback(BaseModel): +class MRBetaDiagnostics(BaseModel): """ - MRBetaDiagnosticsFallback + Response envelope for request-level diagnostics. Present (possibly null) whenever the caller supplied `diagnostics` on the request. """ # noqa: E501 - cache_miss_reason: Optional[Dict[str, Any]] = Field(default=None, description="Provider-native request fields used as defaults (e.g. exa's 'type', searxng's 'engines').") + cache_miss_reason: Optional[CacheMissReason] = None additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["cache_miss_reason"] @@ -49,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of MRBetaDiagnosticsFallback from a JSON string""" + """Create an instance of MRBetaDiagnostics from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -72,6 +73,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of cache_miss_reason + if self.cache_miss_reason: + _dict['cache_miss_reason'] = self.cache_miss_reason.to_dict() # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): @@ -86,7 +90,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of MRBetaDiagnosticsFallback from a dict""" + """Create an instance of MRBetaDiagnostics from a dict""" if obj is None: return None @@ -94,7 +98,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "cache_miss_reason": obj.get("cache_miss_reason") + "cache_miss_reason": CacheMissReason.from_dict(obj["cache_miss_reason"]) if obj.get("cache_miss_reason") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/src/otari/_client/models/mr_beta_fallback_block.py b/src/otari/_client/models/mr_beta_fallback_block.py new file mode 100644 index 00000000..cf329f75 --- /dev/null +++ b/src/otari/_client/models/mr_beta_fallback_block.py @@ -0,0 +1,125 @@ +# coding: utf-8 + +""" + otari + + Otari, an OpenAI-compatible LLM gateway with API key management + + The version of the OpenAPI document: 0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from otari._client.models.mr_beta_fallback_info import MRBetaFallbackInfo +from otari._client.models.mr_beta_fallback_refusal_trigger import MRBetaFallbackRefusalTrigger +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MRBetaFallbackBlock(BaseModel): + """ + Marks the point in `content` where one model's output gives way to the next. One block appears per hop where a preceding model actually ran this turn and declined. A turn where no preceding model ran and declined has no such boundary and carries no block — the signal for whether a fallback model served the response is the presence of a `fallback_message` entry in `usage.iterations`, not this block. The block is treated like a server-tool content block for streaming: it arrives via the standard `content_block_start` / `content_block_stop` pair and carries no deltas. + """ # noqa: E501 + var_from: MRBetaFallbackInfo = Field(alias="from") + to: MRBetaFallbackInfo + trigger: MRBetaFallbackRefusalTrigger + type: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["from", "to", "trigger", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['fallback']): + raise ValueError("must be one of enum values ('fallback')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MRBetaFallbackBlock from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of var_from + if self.var_from: + _dict['from'] = self.var_from.to_dict() + # override the default output from pydantic by calling `to_dict()` of to + if self.to: + _dict['to'] = self.to.to_dict() + # override the default output from pydantic by calling `to_dict()` of trigger + if self.trigger: + _dict['trigger'] = self.trigger.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MRBetaFallbackBlock from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "from": MRBetaFallbackInfo.from_dict(obj["from"]) if obj.get("from") is not None else None, + "to": MRBetaFallbackInfo.from_dict(obj["to"]) if obj.get("to") is not None else None, + "trigger": MRBetaFallbackRefusalTrigger.from_dict(obj["trigger"]) if obj.get("trigger") is not None else None, + "type": obj.get("type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/src/otari/_client/models/mr_beta_fallback_info.py b/src/otari/_client/models/mr_beta_fallback_info.py new file mode 100644 index 00000000..8b5cc768 --- /dev/null +++ b/src/otari/_client/models/mr_beta_fallback_info.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + otari + + Otari, an OpenAI-compatible LLM gateway with API key management + + The version of the OpenAPI document: 0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from otari._client.models.model1 import Model1 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MRBetaFallbackInfo(BaseModel): + """ + Identifies one hop of a fallback transition. + """ # noqa: E501 + model: Model1 + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["model"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MRBetaFallbackInfo from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of model + if self.model: + _dict['model'] = self.model.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MRBetaFallbackInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "model": Model1.from_dict(obj["model"]) if obj.get("model") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/src/otari/_client/models/mr_beta_fallback_message_iteration_usage.py b/src/otari/_client/models/mr_beta_fallback_message_iteration_usage.py new file mode 100644 index 00000000..f92b3595 --- /dev/null +++ b/src/otari/_client/models/mr_beta_fallback_message_iteration_usage.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + otari + + Otari, an OpenAI-compatible LLM gateway with API key management + + The version of the OpenAPI document: 0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from otari._client.models.model1 import Model1 +from otari._client.models.mr_beta_cache_creation import MRBetaCacheCreation +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MRBetaFallbackMessageIterationUsage(BaseModel): + """ + Token usage for the fallback-model attempt of a server-side fallback request. Produced in place of a `message` entry for whichever hop served the response. A declined hop produces the existing `message` entry. Whether a fallback model served the response is signalled by the presence of this entry in `usage.iterations`. + """ # noqa: E501 + cache_creation: Optional[MRBetaCacheCreation] = None + cache_creation_input_tokens: StrictInt + cache_read_input_tokens: StrictInt + input_tokens: StrictInt + model: Model1 + output_tokens: StrictInt + type: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["cache_creation", "cache_creation_input_tokens", "cache_read_input_tokens", "input_tokens", "model", "output_tokens", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['fallback_message']): + raise ValueError("must be one of enum values ('fallback_message')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MRBetaFallbackMessageIterationUsage from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of cache_creation + if self.cache_creation: + _dict['cache_creation'] = self.cache_creation.to_dict() + # override the default output from pydantic by calling `to_dict()` of model + if self.model: + _dict['model'] = self.model.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if cache_creation (nullable) is None + # and model_fields_set contains the field + if self.cache_creation is None and "cache_creation" in self.model_fields_set: + _dict['cache_creation'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MRBetaFallbackMessageIterationUsage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "cache_creation": MRBetaCacheCreation.from_dict(obj["cache_creation"]) if obj.get("cache_creation") is not None else None, + "cache_creation_input_tokens": obj.get("cache_creation_input_tokens"), + "cache_read_input_tokens": obj.get("cache_read_input_tokens"), + "input_tokens": obj.get("input_tokens"), + "model": Model1.from_dict(obj["model"]) if obj.get("model") is not None else None, + "output_tokens": obj.get("output_tokens"), + "type": obj.get("type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/src/otari/_client/models/mr_beta_fallback_refusal_trigger.py b/src/otari/_client/models/mr_beta_fallback_refusal_trigger.py new file mode 100644 index 00000000..ebc10a47 --- /dev/null +++ b/src/otari/_client/models/mr_beta_fallback_refusal_trigger.py @@ -0,0 +1,125 @@ +# coding: utf-8 + +""" + otari + + Otari, an OpenAI-compatible LLM gateway with API key management + + The version of the OpenAPI document: 0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MRBetaFallbackRefusalTrigger(BaseModel): + """ + The `from` model declined for policy reasons. + """ # noqa: E501 + category: Optional[StrictStr] = None + type: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["category", "type"] + + @field_validator('category') + def category_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['cyber', 'bio', 'frontier_llm', 'reasoning_extraction', 'general_harms']): + raise ValueError("must be one of enum values ('cyber', 'bio', 'frontier_llm', 'reasoning_extraction', 'general_harms')") + return value + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['refusal']): + raise ValueError("must be one of enum values ('refusal')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MRBetaFallbackRefusalTrigger from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if category (nullable) is None + # and model_fields_set contains the field + if self.category is None and "category" in self.model_fields_set: + _dict['category'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MRBetaFallbackRefusalTrigger from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "category": obj.get("category"), + "type": obj.get("type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/src/otari/_client/models/mr_beta_mcp_tool_result_block.py b/src/otari/_client/models/mr_beta_mcp_tool_result_block.py index ed3a13d6..a05da8e9 100644 --- a/src/otari/_client/models/mr_beta_mcp_tool_result_block.py +++ b/src/otari/_client/models/mr_beta_mcp_tool_result_block.py @@ -19,7 +19,7 @@ from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List -from otari._client.models.content6 import Content6 +from otari._client.models.content7 import Content7 from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -28,7 +28,7 @@ class MRBetaMCPToolResultBlock(BaseModel): """ MRBetaMCPToolResultBlock """ # noqa: E501 - content: Content6 + content: Content7 is_error: StrictBool tool_use_id: StrictStr type: StrictStr @@ -103,7 +103,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "content": Content6.from_dict(obj["content"]) if obj.get("content") is not None else None, + "content": Content7.from_dict(obj["content"]) if obj.get("content") is not None else None, "is_error": obj.get("is_error"), "tool_use_id": obj.get("tool_use_id"), "type": obj.get("type") diff --git a/src/otari/_client/models/mr_beta_message_iteration_usage.py b/src/otari/_client/models/mr_beta_message_iteration_usage.py index b7e806d8..5d0b0761 100644 --- a/src/otari/_client/models/mr_beta_message_iteration_usage.py +++ b/src/otari/_client/models/mr_beta_message_iteration_usage.py @@ -19,6 +19,7 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional +from otari._client.models.model1 import Model1 from otari._client.models.mr_beta_cache_creation import MRBetaCacheCreation from typing import Optional, Set from typing_extensions import Self @@ -32,10 +33,11 @@ class MRBetaMessageIterationUsage(BaseModel): cache_creation_input_tokens: StrictInt cache_read_input_tokens: StrictInt input_tokens: StrictInt + model: Model1 output_tokens: StrictInt type: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["cache_creation", "cache_creation_input_tokens", "cache_read_input_tokens", "input_tokens", "output_tokens", "type"] + __properties: ClassVar[List[str]] = ["cache_creation", "cache_creation_input_tokens", "cache_read_input_tokens", "input_tokens", "model", "output_tokens", "type"] @field_validator('type') def type_validate_enum(cls, value): @@ -88,6 +90,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of cache_creation if self.cache_creation: _dict['cache_creation'] = self.cache_creation.to_dict() + # override the default output from pydantic by calling `to_dict()` of model + if self.model: + _dict['model'] = self.model.to_dict() # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): @@ -114,6 +119,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "cache_creation_input_tokens": obj.get("cache_creation_input_tokens"), "cache_read_input_tokens": obj.get("cache_read_input_tokens"), "input_tokens": obj.get("input_tokens"), + "model": Model1.from_dict(obj["model"]) if obj.get("model") is not None else None, "output_tokens": obj.get("output_tokens"), "type": obj.get("type") }) diff --git a/src/otari/_client/models/mr_beta_server_tool_use_block.py b/src/otari/_client/models/mr_beta_server_tool_use_block.py index d2f4e4c9..2501aec7 100644 --- a/src/otari/_client/models/mr_beta_server_tool_use_block.py +++ b/src/otari/_client/models/mr_beta_server_tool_use_block.py @@ -39,8 +39,8 @@ class MRBetaServerToolUseBlock(BaseModel): @field_validator('name') def name_validate_enum(cls, value): """Validates the enum""" - if value not in set(['web_search', 'web_fetch', 'code_execution', 'bash_code_execution', 'text_editor_code_execution', 'tool_search_tool_regex', 'tool_search_tool_bm25']): - raise ValueError("must be one of enum values ('web_search', 'web_fetch', 'code_execution', 'bash_code_execution', 'text_editor_code_execution', 'tool_search_tool_regex', 'tool_search_tool_bm25')") + if value not in set(['advisor', 'web_search', 'web_fetch', 'code_execution', 'bash_code_execution', 'text_editor_code_execution', 'tool_search_tool_regex', 'tool_search_tool_bm25']): + raise ValueError("must be one of enum values ('advisor', 'web_search', 'web_fetch', 'code_execution', 'bash_code_execution', 'text_editor_code_execution', 'tool_search_tool_regex', 'tool_search_tool_bm25')") return value @field_validator('type') diff --git a/src/otari/_client/models/mr_beta_text_editor_code_execution_tool_result_block.py b/src/otari/_client/models/mr_beta_text_editor_code_execution_tool_result_block.py index f338a5e7..47af5a07 100644 --- a/src/otari/_client/models/mr_beta_text_editor_code_execution_tool_result_block.py +++ b/src/otari/_client/models/mr_beta_text_editor_code_execution_tool_result_block.py @@ -19,7 +19,7 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List -from otari._client.models.content7 import Content7 +from otari._client.models.content8 import Content8 from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -28,7 +28,7 @@ class MRBetaTextEditorCodeExecutionToolResultBlock(BaseModel): """ MRBetaTextEditorCodeExecutionToolResultBlock """ # noqa: E501 - content: Content7 + content: Content8 tool_use_id: StrictStr type: StrictStr additional_properties: Dict[str, Any] = {} @@ -102,7 +102,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "content": Content7.from_dict(obj["content"]) if obj.get("content") is not None else None, + "content": Content8.from_dict(obj["content"]) if obj.get("content") is not None else None, "tool_use_id": obj.get("tool_use_id"), "type": obj.get("type") }) diff --git a/src/otari/_client/models/mr_beta_tool_search_tool_result_block.py b/src/otari/_client/models/mr_beta_tool_search_tool_result_block.py index 241b64d1..f22120ba 100644 --- a/src/otari/_client/models/mr_beta_tool_search_tool_result_block.py +++ b/src/otari/_client/models/mr_beta_tool_search_tool_result_block.py @@ -19,7 +19,7 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List -from otari._client.models.content8 import Content8 +from otari._client.models.content9 import Content9 from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -28,7 +28,7 @@ class MRBetaToolSearchToolResultBlock(BaseModel): """ MRBetaToolSearchToolResultBlock """ # noqa: E501 - content: Content8 + content: Content9 tool_use_id: StrictStr type: StrictStr additional_properties: Dict[str, Any] = {} @@ -102,7 +102,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "content": Content8.from_dict(obj["content"]) if obj.get("content") is not None else None, + "content": Content9.from_dict(obj["content"]) if obj.get("content") is not None else None, "tool_use_id": obj.get("tool_use_id"), "type": obj.get("type") }) diff --git a/src/otari/_client/models/mr_beta_tool_use_block.py b/src/otari/_client/models/mr_beta_tool_use_block.py index e5e139fb..e3f30d8d 100644 --- a/src/otari/_client/models/mr_beta_tool_use_block.py +++ b/src/otari/_client/models/mr_beta_tool_use_block.py @@ -33,8 +33,9 @@ class MRBetaToolUseBlock(BaseModel): name: StrictStr type: StrictStr caller: Optional[Caller] = None + toolset_name: Optional[StrictStr] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["id", "input", "name", "type", "caller"] + __properties: ClassVar[List[str]] = ["id", "input", "name", "type", "caller", "toolset_name"] @field_validator('type') def type_validate_enum(cls, value): @@ -97,6 +98,11 @@ def to_dict(self) -> Dict[str, Any]: if self.caller is None and "caller" in self.model_fields_set: _dict['caller'] = None + # set to None if toolset_name (nullable) is None + # and model_fields_set contains the field + if self.toolset_name is None and "toolset_name" in self.model_fields_set: + _dict['toolset_name'] = None + return _dict @classmethod @@ -113,7 +119,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "input": obj.get("input"), "name": obj.get("name"), "type": obj.get("type"), - "caller": Caller.from_dict(obj["caller"]) if obj.get("caller") is not None else None + "caller": Caller.from_dict(obj["caller"]) if obj.get("caller") is not None else None, + "toolset_name": obj.get("toolset_name") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/src/otari/_client/models/mr_beta_web_fetch_tool_result_block.py b/src/otari/_client/models/mr_beta_web_fetch_tool_result_block.py index 5acd3908..25219862 100644 --- a/src/otari/_client/models/mr_beta_web_fetch_tool_result_block.py +++ b/src/otari/_client/models/mr_beta_web_fetch_tool_result_block.py @@ -20,7 +20,7 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from otari._client.models.caller import Caller -from otari._client.models.content9 import Content9 +from otari._client.models.content10 import Content10 from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -29,7 +29,7 @@ class MRBetaWebFetchToolResultBlock(BaseModel): """ MRBetaWebFetchToolResultBlock """ # noqa: E501 - content: Content9 + content: Content10 tool_use_id: StrictStr type: StrictStr caller: Optional[Caller] = None @@ -112,7 +112,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "content": Content9.from_dict(obj["content"]) if obj.get("content") is not None else None, + "content": Content10.from_dict(obj["content"]) if obj.get("content") is not None else None, "tool_use_id": obj.get("tool_use_id"), "type": obj.get("type"), "caller": Caller.from_dict(obj["caller"]) if obj.get("caller") is not None else None diff --git a/src/otari/_client/models/mr_beta_web_fetch_tool_result_error_block.py b/src/otari/_client/models/mr_beta_web_fetch_tool_result_error_block.py index 9b65d43c..a1256c09 100644 --- a/src/otari/_client/models/mr_beta_web_fetch_tool_result_error_block.py +++ b/src/otari/_client/models/mr_beta_web_fetch_tool_result_error_block.py @@ -35,8 +35,8 @@ class MRBetaWebFetchToolResultErrorBlock(BaseModel): @field_validator('error_code') def error_code_validate_enum(cls, value): """Validates the enum""" - if value not in set(['invalid_tool_input', 'url_too_long', 'url_not_allowed', 'url_not_accessible', 'unsupported_content_type', 'too_many_requests', 'max_uses_exceeded', 'unavailable']): - raise ValueError("must be one of enum values ('invalid_tool_input', 'url_too_long', 'url_not_allowed', 'url_not_accessible', 'unsupported_content_type', 'too_many_requests', 'max_uses_exceeded', 'unavailable')") + if value not in set(['invalid_tool_input', 'url_too_long', 'url_not_allowed', 'url_not_in_prior_context', 'url_not_accessible', 'unsupported_content_type', 'too_many_requests', 'max_uses_exceeded', 'unavailable']): + raise ValueError("must be one of enum values ('invalid_tool_input', 'url_too_long', 'url_not_allowed', 'url_not_in_prior_context', 'url_not_accessible', 'unsupported_content_type', 'too_many_requests', 'max_uses_exceeded', 'unavailable')") return value @field_validator('type') diff --git a/src/otari/_client/models/mr_beta_web_search_tool_result_block.py b/src/otari/_client/models/mr_beta_web_search_tool_result_block.py index fccbdacd..4699c605 100644 --- a/src/otari/_client/models/mr_beta_web_search_tool_result_block.py +++ b/src/otari/_client/models/mr_beta_web_search_tool_result_block.py @@ -20,7 +20,7 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from otari._client.models.caller import Caller -from otari._client.models.content10 import Content10 +from otari._client.models.content11 import Content11 from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -29,7 +29,7 @@ class MRBetaWebSearchToolResultBlock(BaseModel): """ MRBetaWebSearchToolResultBlock """ # noqa: E501 - content: Content10 + content: Content11 tool_use_id: StrictStr type: StrictStr caller: Optional[Caller] = None @@ -112,7 +112,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "content": Content10.from_dict(obj["content"]) if obj.get("content") is not None else None, + "content": Content11.from_dict(obj["content"]) if obj.get("content") is not None else None, "tool_use_id": obj.get("tool_use_id"), "type": obj.get("type"), "caller": Caller.from_dict(obj["caller"]) if obj.get("caller") is not None else None diff --git a/src/otari/_client/models/mr_code_execution_tool_result_block.py b/src/otari/_client/models/mr_code_execution_tool_result_block.py index 8ecb425e..508caa69 100644 --- a/src/otari/_client/models/mr_code_execution_tool_result_block.py +++ b/src/otari/_client/models/mr_code_execution_tool_result_block.py @@ -19,7 +19,7 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List -from otari._client.models.content11 import Content11 +from otari._client.models.content12 import Content12 from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -28,7 +28,7 @@ class MRCodeExecutionToolResultBlock(BaseModel): """ MRCodeExecutionToolResultBlock """ # noqa: E501 - content: Content11 + content: Content12 tool_use_id: StrictStr type: StrictStr additional_properties: Dict[str, Any] = {} @@ -102,7 +102,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "content": Content11.from_dict(obj["content"]) if obj.get("content") is not None else None, + "content": Content12.from_dict(obj["content"]) if obj.get("content") is not None else None, "tool_use_id": obj.get("tool_use_id"), "type": obj.get("type") }) diff --git a/src/otari/_client/models/mr_message_usage.py b/src/otari/_client/models/mr_message_usage.py index 8ac52c01..9561a825 100644 --- a/src/otari/_client/models/mr_message_usage.py +++ b/src/otari/_client/models/mr_message_usage.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from otari._client.models.mr_cache_creation import MRCacheCreation from otari._client.models.mr_message_usage_iterations_inner import MRMessageUsageIterationsInner +from otari._client.models.mr_output_tokens_details import MROutputTokensDetails from otari._client.models.mr_server_tool_usage import MRServerToolUsage from typing import Optional, Set from typing_extensions import Self @@ -36,12 +37,13 @@ class MRMessageUsage(BaseModel): inference_geo: Optional[StrictStr] = Field(default=None, description="Filter to a single event type or metric name (e.g. 'tool_result', 'claude_code.commit.count')") input_tokens: StrictInt output_tokens: StrictInt + output_tokens_details: Optional[MROutputTokensDetails] = None server_tool_use: Optional[MRServerToolUsage] = None service_tier: Optional[StrictStr] = None iterations: Optional[List[MRMessageUsageIterationsInner]] = None speed: Optional[StrictStr] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["cache_creation", "cache_creation_input_tokens", "cache_read_input_tokens", "inference_geo", "input_tokens", "output_tokens", "server_tool_use", "service_tier", "iterations", "speed"] + __properties: ClassVar[List[str]] = ["cache_creation", "cache_creation_input_tokens", "cache_read_input_tokens", "inference_geo", "input_tokens", "output_tokens", "output_tokens_details", "server_tool_use", "service_tier", "iterations", "speed"] @field_validator('service_tier') def service_tier_validate_enum(cls, value): @@ -107,6 +109,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of cache_creation if self.cache_creation: _dict['cache_creation'] = self.cache_creation.to_dict() + # override the default output from pydantic by calling `to_dict()` of output_tokens_details + if self.output_tokens_details: + _dict['output_tokens_details'] = self.output_tokens_details.to_dict() # override the default output from pydantic by calling `to_dict()` of server_tool_use if self.server_tool_use: _dict['server_tool_use'] = self.server_tool_use.to_dict() @@ -142,6 +147,11 @@ def to_dict(self) -> Dict[str, Any]: if self.inference_geo is None and "inference_geo" in self.model_fields_set: _dict['inference_geo'] = None + # set to None if output_tokens_details (nullable) is None + # and model_fields_set contains the field + if self.output_tokens_details is None and "output_tokens_details" in self.model_fields_set: + _dict['output_tokens_details'] = None + # set to None if server_tool_use (nullable) is None # and model_fields_set contains the field if self.server_tool_use is None and "server_tool_use" in self.model_fields_set: @@ -180,6 +190,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "inference_geo": obj.get("inference_geo"), "input_tokens": obj.get("input_tokens"), "output_tokens": obj.get("output_tokens"), + "output_tokens_details": MROutputTokensDetails.from_dict(obj["output_tokens_details"]) if obj.get("output_tokens_details") is not None else None, "server_tool_use": MRServerToolUsage.from_dict(obj["server_tool_use"]) if obj.get("server_tool_use") is not None else None, "service_tier": obj.get("service_tier"), "iterations": [MRMessageUsageIterationsInner.from_dict(_item) for _item in obj["iterations"]] if obj.get("iterations") is not None else None, diff --git a/src/otari/_client/models/mr_message_usage_iterations_inner.py b/src/otari/_client/models/mr_message_usage_iterations_inner.py index b683d936..77c6d75b 100644 --- a/src/otari/_client/models/mr_message_usage_iterations_inner.py +++ b/src/otari/_client/models/mr_message_usage_iterations_inner.py @@ -19,13 +19,15 @@ import re # noqa: F401 from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Optional +from otari._client.models.mr_beta_advisor_message_iteration_usage import MRBetaAdvisorMessageIterationUsage from otari._client.models.mr_beta_compaction_iteration_usage import MRBetaCompactionIterationUsage +from otari._client.models.mr_beta_fallback_message_iteration_usage import MRBetaFallbackMessageIterationUsage from otari._client.models.mr_beta_message_iteration_usage import MRBetaMessageIterationUsage from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict from typing_extensions import Literal, Self from pydantic import Field -MRMESSAGEUSAGEITERATIONSINNER_ANY_OF_SCHEMAS = ["MRBetaCompactionIterationUsage", "MRBetaMessageIterationUsage"] +MRMESSAGEUSAGEITERATIONSINNER_ANY_OF_SCHEMAS = ["MRBetaAdvisorMessageIterationUsage", "MRBetaCompactionIterationUsage", "MRBetaFallbackMessageIterationUsage", "MRBetaMessageIterationUsage"] class MRMessageUsageIterationsInner(BaseModel): """ @@ -36,11 +38,15 @@ class MRMessageUsageIterationsInner(BaseModel): anyof_schema_1_validator: Optional[MRBetaMessageIterationUsage] = None # data type: MRBetaCompactionIterationUsage anyof_schema_2_validator: Optional[MRBetaCompactionIterationUsage] = None + # data type: MRBetaAdvisorMessageIterationUsage + anyof_schema_3_validator: Optional[MRBetaAdvisorMessageIterationUsage] = None + # data type: MRBetaFallbackMessageIterationUsage + anyof_schema_4_validator: Optional[MRBetaFallbackMessageIterationUsage] = None if TYPE_CHECKING: - actual_instance: Optional[Union[MRBetaCompactionIterationUsage, MRBetaMessageIterationUsage]] = None + actual_instance: Optional[Union[MRBetaAdvisorMessageIterationUsage, MRBetaCompactionIterationUsage, MRBetaFallbackMessageIterationUsage, MRBetaMessageIterationUsage]] = None else: actual_instance: Any = None - any_of_schemas: Set[str] = { "MRBetaCompactionIterationUsage", "MRBetaMessageIterationUsage" } + any_of_schemas: Set[str] = { "MRBetaAdvisorMessageIterationUsage", "MRBetaCompactionIterationUsage", "MRBetaFallbackMessageIterationUsage", "MRBetaMessageIterationUsage" } model_config = { "validate_assignment": True, @@ -73,9 +79,21 @@ def actual_instance_must_validate_anyof(cls, v): else: return v + # validate data type: MRBetaAdvisorMessageIterationUsage + if not isinstance(v, MRBetaAdvisorMessageIterationUsage): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaAdvisorMessageIterationUsage`") + else: + return v + + # validate data type: MRBetaFallbackMessageIterationUsage + if not isinstance(v, MRBetaFallbackMessageIterationUsage): + error_messages.append(f"Error! Input type `{type(v)}` is not `MRBetaFallbackMessageIterationUsage`") + else: + return v + if error_messages: # no match - raise ValueError("No match found when setting the actual_instance in MRMessageUsageIterationsInner with anyOf schemas: MRBetaCompactionIterationUsage, MRBetaMessageIterationUsage. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting the actual_instance in MRMessageUsageIterationsInner with anyOf schemas: MRBetaAdvisorMessageIterationUsage, MRBetaCompactionIterationUsage, MRBetaFallbackMessageIterationUsage, MRBetaMessageIterationUsage. Details: " + ", ".join(error_messages)) else: return v @@ -100,10 +118,22 @@ def from_json(cls, json_str: str) -> Self: return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) + # anyof_schema_3_validator: Optional[MRBetaAdvisorMessageIterationUsage] = None + try: + instance.actual_instance = MRBetaAdvisorMessageIterationUsage.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_4_validator: Optional[MRBetaFallbackMessageIterationUsage] = None + try: + instance.actual_instance = MRBetaFallbackMessageIterationUsage.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) if error_messages: # no match - raise ValueError("No match found when deserializing the JSON string into MRMessageUsageIterationsInner with anyOf schemas: MRBetaCompactionIterationUsage, MRBetaMessageIterationUsage. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into MRMessageUsageIterationsInner with anyOf schemas: MRBetaAdvisorMessageIterationUsage, MRBetaCompactionIterationUsage, MRBetaFallbackMessageIterationUsage, MRBetaMessageIterationUsage. Details: " + ", ".join(error_messages)) else: return instance @@ -117,7 +147,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], MRBetaCompactionIterationUsage, MRBetaMessageIterationUsage]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], MRBetaAdvisorMessageIterationUsage, MRBetaCompactionIterationUsage, MRBetaFallbackMessageIterationUsage, MRBetaMessageIterationUsage]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/src/otari/_client/models/mr_output_tokens_details.py b/src/otari/_client/models/mr_output_tokens_details.py new file mode 100644 index 00000000..b5c09ff5 --- /dev/null +++ b/src/otari/_client/models/mr_output_tokens_details.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + otari + + Otari, an OpenAI-compatible LLM gateway with API key management + + The version of the OpenAPI document: 0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MROutputTokensDetails(BaseModel): + """ + MROutputTokensDetails + """ # noqa: E501 + thinking_tokens: StrictInt + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["thinking_tokens"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MROutputTokensDetails from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MROutputTokensDetails from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "thinking_tokens": obj.get("thinking_tokens") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/src/otari/_client/models/mr_refusal_stop_details.py b/src/otari/_client/models/mr_refusal_stop_details.py index 63286b42..43dbd127 100644 --- a/src/otari/_client/models/mr_refusal_stop_details.py +++ b/src/otari/_client/models/mr_refusal_stop_details.py @@ -39,8 +39,8 @@ def category_validate_enum(cls, value): if value is None: return value - if value not in set(['cyber', 'bio']): - raise ValueError("must be one of enum values ('cyber', 'bio')") + if value not in set(['cyber', 'bio', 'frontier_llm', 'reasoning_extraction', 'general_harms']): + raise ValueError("must be one of enum values ('cyber', 'bio', 'frontier_llm', 'reasoning_extraction', 'general_harms')") return value @field_validator('type') diff --git a/src/otari/_client/models/mr_text_editor_code_execution_tool_result_block.py b/src/otari/_client/models/mr_text_editor_code_execution_tool_result_block.py index 5c853b7e..86957e69 100644 --- a/src/otari/_client/models/mr_text_editor_code_execution_tool_result_block.py +++ b/src/otari/_client/models/mr_text_editor_code_execution_tool_result_block.py @@ -19,7 +19,7 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List -from otari._client.models.content12 import Content12 +from otari._client.models.content13 import Content13 from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -28,7 +28,7 @@ class MRTextEditorCodeExecutionToolResultBlock(BaseModel): """ MRTextEditorCodeExecutionToolResultBlock """ # noqa: E501 - content: Content12 + content: Content13 tool_use_id: StrictStr type: StrictStr additional_properties: Dict[str, Any] = {} @@ -102,7 +102,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "content": Content12.from_dict(obj["content"]) if obj.get("content") is not None else None, + "content": Content13.from_dict(obj["content"]) if obj.get("content") is not None else None, "tool_use_id": obj.get("tool_use_id"), "type": obj.get("type") }) diff --git a/src/otari/_client/models/mr_tool_search_tool_result_block.py b/src/otari/_client/models/mr_tool_search_tool_result_block.py index 2a174a0d..f823c8e6 100644 --- a/src/otari/_client/models/mr_tool_search_tool_result_block.py +++ b/src/otari/_client/models/mr_tool_search_tool_result_block.py @@ -19,7 +19,7 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List -from otari._client.models.content13 import Content13 +from otari._client.models.content14 import Content14 from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -28,7 +28,7 @@ class MRToolSearchToolResultBlock(BaseModel): """ MRToolSearchToolResultBlock """ # noqa: E501 - content: Content13 + content: Content14 tool_use_id: StrictStr type: StrictStr additional_properties: Dict[str, Any] = {} @@ -102,7 +102,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "content": Content13.from_dict(obj["content"]) if obj.get("content") is not None else None, + "content": Content14.from_dict(obj["content"]) if obj.get("content") is not None else None, "tool_use_id": obj.get("tool_use_id"), "type": obj.get("type") }) diff --git a/src/otari/_client/models/mr_tool_use_block.py b/src/otari/_client/models/mr_tool_use_block.py index 2c3db18d..aa70599c 100644 --- a/src/otari/_client/models/mr_tool_use_block.py +++ b/src/otari/_client/models/mr_tool_use_block.py @@ -33,8 +33,9 @@ class MRToolUseBlock(BaseModel): input: Dict[str, Any] name: StrictStr type: StrictStr + toolset_name: Optional[StrictStr] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["id", "caller", "input", "name", "type"] + __properties: ClassVar[List[str]] = ["id", "caller", "input", "name", "type", "toolset_name"] @field_validator('type') def type_validate_enum(cls, value): @@ -97,6 +98,11 @@ def to_dict(self) -> Dict[str, Any]: if self.caller is None and "caller" in self.model_fields_set: _dict['caller'] = None + # set to None if toolset_name (nullable) is None + # and model_fields_set contains the field + if self.toolset_name is None and "toolset_name" in self.model_fields_set: + _dict['toolset_name'] = None + return _dict @classmethod @@ -113,7 +119,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "caller": Caller1.from_dict(obj["caller"]) if obj.get("caller") is not None else None, "input": obj.get("input"), "name": obj.get("name"), - "type": obj.get("type") + "type": obj.get("type"), + "toolset_name": obj.get("toolset_name") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/src/otari/_client/models/mr_web_fetch_tool_result_block.py b/src/otari/_client/models/mr_web_fetch_tool_result_block.py index 7a96a9db..2cd13605 100644 --- a/src/otari/_client/models/mr_web_fetch_tool_result_block.py +++ b/src/otari/_client/models/mr_web_fetch_tool_result_block.py @@ -20,7 +20,7 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from otari._client.models.caller1 import Caller1 -from otari._client.models.content14 import Content14 +from otari._client.models.content15 import Content15 from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -30,7 +30,7 @@ class MRWebFetchToolResultBlock(BaseModel): MRWebFetchToolResultBlock """ # noqa: E501 caller: Optional[Caller1] = None - content: Content14 + content: Content15 tool_use_id: StrictStr type: StrictStr additional_properties: Dict[str, Any] = {} @@ -113,7 +113,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "caller": Caller1.from_dict(obj["caller"]) if obj.get("caller") is not None else None, - "content": Content14.from_dict(obj["content"]) if obj.get("content") is not None else None, + "content": Content15.from_dict(obj["content"]) if obj.get("content") is not None else None, "tool_use_id": obj.get("tool_use_id"), "type": obj.get("type") }) diff --git a/src/otari/_client/models/mr_web_fetch_tool_result_error_block.py b/src/otari/_client/models/mr_web_fetch_tool_result_error_block.py index 7ab44a07..743bed40 100644 --- a/src/otari/_client/models/mr_web_fetch_tool_result_error_block.py +++ b/src/otari/_client/models/mr_web_fetch_tool_result_error_block.py @@ -35,8 +35,8 @@ class MRWebFetchToolResultErrorBlock(BaseModel): @field_validator('error_code') def error_code_validate_enum(cls, value): """Validates the enum""" - if value not in set(['invalid_tool_input', 'url_too_long', 'url_not_allowed', 'url_not_accessible', 'unsupported_content_type', 'too_many_requests', 'max_uses_exceeded', 'unavailable']): - raise ValueError("must be one of enum values ('invalid_tool_input', 'url_too_long', 'url_not_allowed', 'url_not_accessible', 'unsupported_content_type', 'too_many_requests', 'max_uses_exceeded', 'unavailable')") + if value not in set(['invalid_tool_input', 'url_too_long', 'url_not_allowed', 'url_not_in_prior_context', 'url_not_accessible', 'unsupported_content_type', 'too_many_requests', 'max_uses_exceeded', 'unavailable']): + raise ValueError("must be one of enum values ('invalid_tool_input', 'url_too_long', 'url_not_allowed', 'url_not_in_prior_context', 'url_not_accessible', 'unsupported_content_type', 'too_many_requests', 'max_uses_exceeded', 'unavailable')") return value @field_validator('type') diff --git a/src/otari/_client/models/mr_web_search_tool_result_block.py b/src/otari/_client/models/mr_web_search_tool_result_block.py index 94d7a8aa..419fc6ed 100644 --- a/src/otari/_client/models/mr_web_search_tool_result_block.py +++ b/src/otari/_client/models/mr_web_search_tool_result_block.py @@ -20,7 +20,7 @@ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from otari._client.models.caller1 import Caller1 -from otari._client.models.content15 import Content15 +from otari._client.models.content16 import Content16 from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -30,7 +30,7 @@ class MRWebSearchToolResultBlock(BaseModel): MRWebSearchToolResultBlock """ # noqa: E501 caller: Optional[Caller1] = None - content: Content15 + content: Content16 tool_use_id: StrictStr type: StrictStr additional_properties: Dict[str, Any] = {} @@ -113,7 +113,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "caller": Caller1.from_dict(obj["caller"]) if obj.get("caller") is not None else None, - "content": Content15.from_dict(obj["content"]) if obj.get("content") is not None else None, + "content": Content16.from_dict(obj["content"]) if obj.get("content") is not None else None, "tool_use_id": obj.get("tool_use_id"), "type": obj.get("type") }) diff --git a/src/otari/_client/models/usage_entry.py b/src/otari/_client/models/usage_entry.py index 212d491e..2ed56e96 100644 --- a/src/otari/_client/models/usage_entry.py +++ b/src/otari/_client/models/usage_entry.py @@ -34,6 +34,7 @@ class UsageEntry(BaseModel): attempt_count: Optional[StrictInt] = None attempt_position: Optional[StrictInt] = None billing_meters: Optional[BillingMeters] + bulk_editable: StrictBool cache_read_tokens: Optional[StrictInt] cache_write_1h_tokens: Optional[StrictInt] cache_write_tokens: Optional[StrictInt] @@ -59,7 +60,7 @@ class UsageEntry(BaseModel): total_tokens: Optional[StrictInt] user_alias: Optional[StrictStr] = None user_id: Optional[StrictStr] - __properties: ClassVar[List[str]] = ["api_key_id", "api_key_name", "attempt_count", "attempt_position", "billing_meters", "cache_read_tokens", "cache_write_1h_tokens", "cache_write_tokens", "completion_tokens", "cost", "counts_toward_budget", "endpoint", "error_message", "id", "latency_ms", "model", "policy_name", "pricing_breakdown", "prompt_tokens", "provider", "request_group_id", "selection_reason", "source", "source_label", "status", "status_code", "timestamp", "total_tokens", "user_alias", "user_id"] + __properties: ClassVar[List[str]] = ["api_key_id", "api_key_name", "attempt_count", "attempt_position", "billing_meters", "bulk_editable", "cache_read_tokens", "cache_write_1h_tokens", "cache_write_tokens", "completion_tokens", "cost", "counts_toward_budget", "endpoint", "error_message", "id", "latency_ms", "model", "policy_name", "pricing_breakdown", "prompt_tokens", "provider", "request_group_id", "selection_reason", "source", "source_label", "status", "status_code", "timestamp", "total_tokens", "user_alias", "user_id"] model_config = ConfigDict( validate_by_name=True, @@ -242,6 +243,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "attempt_count": obj.get("attempt_count"), "attempt_position": obj.get("attempt_position"), "billing_meters": BillingMeters.from_dict(obj["billing_meters"]) if obj.get("billing_meters") is not None else None, + "bulk_editable": obj.get("bulk_editable"), "cache_read_tokens": obj.get("cache_read_tokens"), "cache_write_1h_tokens": obj.get("cache_write_1h_tokens"), "cache_write_tokens": obj.get("cache_write_tokens"),