Skip to content

Commit 7c9d0bf

Browse files
khaledosmangithub-actions[bot]
authored andcommitted
chore: regenerate SDK client core from Otari OpenAPI spec
1 parent 0ef4c33 commit 7c9d0bf

9 files changed

Lines changed: 201 additions & 20 deletions

src/otari/_client/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"ChatCompletion",
7878
"ChatCompletionChunk",
7979
"ChatCompletionRequest",
80+
"ChatCompletionRequestToolsInner",
8081
"ChatMessageInput",
8182
"Content",
8283
"Content1",
@@ -279,6 +280,7 @@
279280
from otari._client.models.chat_completion import ChatCompletion as ChatCompletion
280281
from otari._client.models.chat_completion_chunk import ChatCompletionChunk as ChatCompletionChunk
281282
from otari._client.models.chat_completion_request import ChatCompletionRequest as ChatCompletionRequest
283+
from otari._client.models.chat_completion_request_tools_inner import ChatCompletionRequestToolsInner as ChatCompletionRequestToolsInner
282284
from otari._client.models.chat_message_input import ChatMessageInput as ChatMessageInput
283285
from otari._client.models.content import Content as Content
284286
from otari._client.models.content1 import Content1 as Content1

src/otari/_client/api/messages_api.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def count_message_tokens_v1_messages_count_tokens_post(
5757
) -> CountTokensResponse:
5858
"""Count Message Tokens
5959
60-
Anthropic ``/v1/messages/count_tokens``-compatible endpoint. Returns ``{\"input_tokens\": N}`` without contacting an upstream provider: counting is local, so there is no budget reservation, pricing, or usage logging. Authentication mirrors :func:`create_message` — platform mode resolves the caller's token against the platform, standalone mode validates the API key — so the endpoint is not an open token-counting oracle.
60+
Anthropic ``/v1/messages/count_tokens``-compatible endpoint. Returns ``{\"input_tokens\": N}`` without contacting an upstream provider: counting is local, so there is no budget reservation, pricing, or usage logging. Authentication mirrors :func:`create_message` — hybrid mode resolves the caller's token against the platform, standalone mode validates the API key — so the endpoint is not an open token-counting oracle.
6161
6262
:param count_tokens_request: (required)
6363
:type count_tokens_request: CountTokensRequest
@@ -125,7 +125,7 @@ def count_message_tokens_v1_messages_count_tokens_post_with_http_info(
125125
) -> ApiResponse[CountTokensResponse]:
126126
"""Count Message Tokens
127127
128-
Anthropic ``/v1/messages/count_tokens``-compatible endpoint. Returns ``{\"input_tokens\": N}`` without contacting an upstream provider: counting is local, so there is no budget reservation, pricing, or usage logging. Authentication mirrors :func:`create_message` — platform mode resolves the caller's token against the platform, standalone mode validates the API key — so the endpoint is not an open token-counting oracle.
128+
Anthropic ``/v1/messages/count_tokens``-compatible endpoint. Returns ``{\"input_tokens\": N}`` without contacting an upstream provider: counting is local, so there is no budget reservation, pricing, or usage logging. Authentication mirrors :func:`create_message` — hybrid mode resolves the caller's token against the platform, standalone mode validates the API key — so the endpoint is not an open token-counting oracle.
129129
130130
:param count_tokens_request: (required)
131131
:type count_tokens_request: CountTokensRequest
@@ -193,7 +193,7 @@ def count_message_tokens_v1_messages_count_tokens_post_without_preload_content(
193193
) -> RESTResponseType:
194194
"""Count Message Tokens
195195
196-
Anthropic ``/v1/messages/count_tokens``-compatible endpoint. Returns ``{\"input_tokens\": N}`` without contacting an upstream provider: counting is local, so there is no budget reservation, pricing, or usage logging. Authentication mirrors :func:`create_message` — platform mode resolves the caller's token against the platform, standalone mode validates the API key — so the endpoint is not an open token-counting oracle.
196+
Anthropic ``/v1/messages/count_tokens``-compatible endpoint. Returns ``{\"input_tokens\": N}`` without contacting an upstream provider: counting is local, so there is no budget reservation, pricing, or usage logging. Authentication mirrors :func:`create_message` — hybrid mode resolves the caller's token against the platform, standalone mode validates the API key — so the endpoint is not an open token-counting oracle.
197197
198198
:param count_tokens_request: (required)
199199
:type count_tokens_request: CountTokensRequest
@@ -333,7 +333,7 @@ def create_message_v1_messages_post(
333333
) -> MessageResponse:
334334
"""Create Message
335335
336-
Anthropic Messages API-compatible endpoint. Supports MCP tool-use loops, sandboxed code execution, and SearXNG web_search in both standalone mode and platform mode. Platform-mode requests resolve credentials via the platform service and (for non-tool-loop requests) get multi-attempt fallback across the resolved route. Tool-loop requests collapse to a single attempt — once ``on_first_response`` lock-in plumbing lands across the codebase, a follow-up will enable pre-lock-in fallback for tool-loop requests too.
336+
Anthropic Messages API-compatible endpoint. Supports MCP tool-use loops, sandboxed code execution, and SearXNG web_search in both standalone mode and hybrid mode. Hybrid-mode requests resolve credentials via the platform service and (for non-tool-loop requests) get multi-attempt fallback across the resolved route. Tool-loop requests collapse to a single attempt — once ``on_first_response`` lock-in plumbing lands across the codebase, a follow-up will enable pre-lock-in fallback for tool-loop requests too.
337337
338338
:param messages_request: (required)
339339
:type messages_request: MessagesRequest
@@ -401,7 +401,7 @@ def create_message_v1_messages_post_with_http_info(
401401
) -> ApiResponse[MessageResponse]:
402402
"""Create Message
403403
404-
Anthropic Messages API-compatible endpoint. Supports MCP tool-use loops, sandboxed code execution, and SearXNG web_search in both standalone mode and platform mode. Platform-mode requests resolve credentials via the platform service and (for non-tool-loop requests) get multi-attempt fallback across the resolved route. Tool-loop requests collapse to a single attempt — once ``on_first_response`` lock-in plumbing lands across the codebase, a follow-up will enable pre-lock-in fallback for tool-loop requests too.
404+
Anthropic Messages API-compatible endpoint. Supports MCP tool-use loops, sandboxed code execution, and SearXNG web_search in both standalone mode and hybrid mode. Hybrid-mode requests resolve credentials via the platform service and (for non-tool-loop requests) get multi-attempt fallback across the resolved route. Tool-loop requests collapse to a single attempt — once ``on_first_response`` lock-in plumbing lands across the codebase, a follow-up will enable pre-lock-in fallback for tool-loop requests too.
405405
406406
:param messages_request: (required)
407407
:type messages_request: MessagesRequest
@@ -469,7 +469,7 @@ def create_message_v1_messages_post_without_preload_content(
469469
) -> RESTResponseType:
470470
"""Create Message
471471
472-
Anthropic Messages API-compatible endpoint. Supports MCP tool-use loops, sandboxed code execution, and SearXNG web_search in both standalone mode and platform mode. Platform-mode requests resolve credentials via the platform service and (for non-tool-loop requests) get multi-attempt fallback across the resolved route. Tool-loop requests collapse to a single attempt — once ``on_first_response`` lock-in plumbing lands across the codebase, a follow-up will enable pre-lock-in fallback for tool-loop requests too.
472+
Anthropic Messages API-compatible endpoint. Supports MCP tool-use loops, sandboxed code execution, and SearXNG web_search in both standalone mode and hybrid mode. Hybrid-mode requests resolve credentials via the platform service and (for non-tool-loop requests) get multi-attempt fallback across the resolved route. Tool-loop requests collapse to a single attempt — once ``on_first_response`` lock-in plumbing lands across the codebase, a follow-up will enable pre-lock-in fallback for tool-loop requests too.
473473
474474
:param messages_request: (required)
475475
:type messages_request: MessagesRequest

src/otari/_client/api/responses_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def create_response_v1_responses_post(
5555
) -> object:
5656
"""Create Response
5757
58-
OpenAI-compatible Responses endpoint. Supports MCP tool-use loops, sandboxed code execution, and SearXNG web_search in both standalone mode and platform mode. Platform-mode requests resolve credentials via the platform service and (for non-tool-loop requests) get multi-attempt fallback across the resolved route. Tool-loop requests collapse to a single attempt — once ``on_first_response`` lock-in plumbing lands across the codebase, a follow-up will enable pre-lock-in fallback for tool-loop requests too.
58+
OpenAI-compatible Responses endpoint. Supports MCP tool-use loops, sandboxed code execution, and SearXNG web_search in both standalone mode and hybrid mode. Hybrid-mode requests resolve credentials via the platform service and (for non-tool-loop requests) get multi-attempt fallback across the resolved route. Tool-loop requests collapse to a single attempt — once ``on_first_response`` lock-in plumbing lands across the codebase, a follow-up will enable pre-lock-in fallback for tool-loop requests too.
5959
6060
:param responses_request: (required)
6161
:type responses_request: ResponsesRequest
@@ -123,7 +123,7 @@ def create_response_v1_responses_post_with_http_info(
123123
) -> ApiResponse[object]:
124124
"""Create Response
125125
126-
OpenAI-compatible Responses endpoint. Supports MCP tool-use loops, sandboxed code execution, and SearXNG web_search in both standalone mode and platform mode. Platform-mode requests resolve credentials via the platform service and (for non-tool-loop requests) get multi-attempt fallback across the resolved route. Tool-loop requests collapse to a single attempt — once ``on_first_response`` lock-in plumbing lands across the codebase, a follow-up will enable pre-lock-in fallback for tool-loop requests too.
126+
OpenAI-compatible Responses endpoint. Supports MCP tool-use loops, sandboxed code execution, and SearXNG web_search in both standalone mode and hybrid mode. Hybrid-mode requests resolve credentials via the platform service and (for non-tool-loop requests) get multi-attempt fallback across the resolved route. Tool-loop requests collapse to a single attempt — once ``on_first_response`` lock-in plumbing lands across the codebase, a follow-up will enable pre-lock-in fallback for tool-loop requests too.
127127
128128
:param responses_request: (required)
129129
:type responses_request: ResponsesRequest
@@ -191,7 +191,7 @@ def create_response_v1_responses_post_without_preload_content(
191191
) -> RESTResponseType:
192192
"""Create Response
193193
194-
OpenAI-compatible Responses endpoint. Supports MCP tool-use loops, sandboxed code execution, and SearXNG web_search in both standalone mode and platform mode. Platform-mode requests resolve credentials via the platform service and (for non-tool-loop requests) get multi-attempt fallback across the resolved route. Tool-loop requests collapse to a single attempt — once ``on_first_response`` lock-in plumbing lands across the codebase, a follow-up will enable pre-lock-in fallback for tool-loop requests too.
194+
OpenAI-compatible Responses endpoint. Supports MCP tool-use loops, sandboxed code execution, and SearXNG web_search in both standalone mode and hybrid mode. Hybrid-mode requests resolve credentials via the platform service and (for non-tool-loop requests) get multi-attempt fallback across the resolved route. Tool-loop requests collapse to a single attempt — once ``on_first_response`` lock-in plumbing lands across the codebase, a follow-up will enable pre-lock-in fallback for tool-loop requests too.
195195
196196
:param responses_request: (required)
197197
:type responses_request: ResponsesRequest

src/otari/_client/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
from otari._client.models.chat_completion import ChatCompletion
4747
from otari._client.models.chat_completion_chunk import ChatCompletionChunk
4848
from otari._client.models.chat_completion_request import ChatCompletionRequest
49+
from otari._client.models.chat_completion_request_tools_inner import ChatCompletionRequestToolsInner
4950
from otari._client.models.chat_message_input import ChatMessageInput
5051
from otari._client.models.content import Content
5152
from otari._client.models.content1 import Content1

src/otari/_client/models/chat_completion_request.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from typing import Any, ClassVar, Dict, List, Optional, Union
2222
from typing_extensions import Annotated
2323
from uuid import UUID
24+
from otari._client.models.chat_completion_request_tools_inner import ChatCompletionRequestToolsInner
2425
from otari._client.models.chat_message_input import ChatMessageInput
2526
from otari._client.models.guardrail_config import GuardrailConfig
2627
from otari._client.models.mcp_server_config import McpServerConfig
@@ -51,17 +52,18 @@ class ChatCompletionRequest(BaseModel):
5152
reasoning_effort: Optional[StrictStr] = None
5253
response_format: Optional[Dict[str, Any]] = None
5354
seed: Optional[StrictInt] = None
55+
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.")
5456
stop: Optional[Stop] = None
5557
stream: Optional[StrictBool] = False
5658
stream_options: Optional[Dict[str, Any]] = None
5759
temperature: Optional[Union[StrictFloat, StrictInt]] = None
5860
tool_choice: Optional[ToolChoice] = None
59-
tools: Optional[List[Optional[Dict[str, Any]]]] = None
61+
tools: Optional[List[ChatCompletionRequestToolsInner]] = None
6062
tools_header: Optional[Annotated[str, Field(strict=True, max_length=4000)]] = Field(default=None, description="Optional override for the lead-in that the gateway prepends before the per-tool hint block in the system message. Useful for expressing global tool-selection policy (e.g. 'prefer MCP tools over code_execution'). Falls back to OTARI_TOOLS_HEADER env, then to the built-in default.")
6163
top_logprobs: Optional[StrictInt] = None
6264
top_p: Optional[Union[StrictFloat, StrictInt]] = None
6365
user: Optional[StrictStr] = None
64-
__properties: ClassVar[List[str]] = ["frequency_penalty", "guardrails", "logit_bias", "logprobs", "max_completion_tokens", "max_tokens", "max_tool_iterations", "mcp_server_ids", "mcp_servers", "messages", "model", "n", "parallel_tool_calls", "presence_penalty", "reasoning_effort", "response_format", "seed", "stop", "stream", "stream_options", "temperature", "tool_choice", "tools", "tools_header", "top_logprobs", "top_p", "user"]
66+
__properties: ClassVar[List[str]] = ["frequency_penalty", "guardrails", "logit_bias", "logprobs", "max_completion_tokens", "max_tokens", "max_tool_iterations", "mcp_server_ids", "mcp_servers", "messages", "model", "n", "parallel_tool_calls", "presence_penalty", "reasoning_effort", "response_format", "seed", "session_label", "stop", "stream", "stream_options", "temperature", "tool_choice", "tools", "tools_header", "top_logprobs", "top_p", "user"]
6567

6668
@field_validator('reasoning_effort')
6769
def reasoning_effort_validate_enum(cls, value):
@@ -139,6 +141,13 @@ def to_dict(self) -> Dict[str, Any]:
139141
# override the default output from pydantic by calling `to_dict()` of tool_choice
140142
if self.tool_choice:
141143
_dict['tool_choice'] = self.tool_choice.to_dict()
144+
# override the default output from pydantic by calling `to_dict()` of each item in tools (list)
145+
_items = []
146+
if self.tools:
147+
for _item_tools in self.tools:
148+
if _item_tools:
149+
_items.append(_item_tools.to_dict())
150+
_dict['tools'] = _items
142151
# set to None if frequency_penalty (nullable) is None
143152
# and model_fields_set contains the field
144153
if self.frequency_penalty is None and "frequency_penalty" in self.model_fields_set:
@@ -214,6 +223,11 @@ def to_dict(self) -> Dict[str, Any]:
214223
if self.seed is None and "seed" in self.model_fields_set:
215224
_dict['seed'] = None
216225

226+
# set to None if session_label (nullable) is None
227+
# and model_fields_set contains the field
228+
if self.session_label is None and "session_label" in self.model_fields_set:
229+
_dict['session_label'] = None
230+
217231
# set to None if stop (nullable) is None
218232
# and model_fields_set contains the field
219233
if self.stop is None and "stop" in self.model_fields_set:
@@ -288,12 +302,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
288302
"reasoning_effort": obj.get("reasoning_effort"),
289303
"response_format": obj.get("response_format"),
290304
"seed": obj.get("seed"),
305+
"session_label": obj.get("session_label"),
291306
"stop": Stop.from_dict(obj["stop"]) if obj.get("stop") is not None else None,
292307
"stream": obj.get("stream") if obj.get("stream") is not None else False,
293308
"stream_options": obj.get("stream_options"),
294309
"temperature": obj.get("temperature"),
295310
"tool_choice": ToolChoice.from_dict(obj["tool_choice"]) if obj.get("tool_choice") is not None else None,
296-
"tools": obj.get("tools"),
311+
"tools": [ChatCompletionRequestToolsInner.from_dict(_item) for _item in obj["tools"]] if obj.get("tools") is not None else None,
297312
"tools_header": obj.get("tools_header"),
298313
"top_logprobs": obj.get("top_logprobs"),
299314
"top_p": obj.get("top_p"),

0 commit comments

Comments
 (0)