Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/otari/_client/models/execution_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

class ExecutionState(str, Enum):
"""
Whether the remote tool may have run (R-ERR-2). A retry-safety classification, not a description of how the HTTP request went. ``NOT_STARTED`` is Otari saying it knows the tool did not run; ``OUTCOME_UNKNOWN`` is Otari saying it cannot know, which is the only honest answer once the transport has begun writing ``tools/call``.
Whether the remote tool may have run. A retry-safety classification, not a description of how the HTTP request went. ``NOT_STARTED`` is Otari saying it knows the tool did not run; ``OUTCOME_UNKNOWN`` is Otari saying it cannot know, which is the only honest answer once the transport has begun writing ``tools/call``.
"""

"""
Expand Down
2 changes: 1 addition & 1 deletion src/otari/_client/models/mcp_error_body.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

class McpErrorBody(BaseModel):
"""
The one error shape both stored-server endpoints return (R-ERR-1).
The one error shape both stored-server endpoints return.
""" # noqa: E501
code: StrictStr
detail: StrictStr
Expand Down
2 changes: 1 addition & 1 deletion src/otari/_client/models/mcp_execute_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

class McpExecuteRequest(BaseModel):
"""
One stored server, and the exact call the application authorized. No inline server fields (R-REQ-4): a caller registers a remote MCP server through the control plane once and refers to it by id afterwards, which keeps URLs, credentials, revocation and allowlist policy on Otari's side of the boundary instead of in every request. Extras are forbidden rather than ignored, so a caller still sending the old inline ``server`` block is told its configuration was not used instead of watching Otari quietly execute against a different server than the one it named.
One stored server, and the exact call the application authorized. No inline server fields: a caller registers a remote MCP server through the control plane once and refers to it by id afterwards, which keeps URLs, credentials, revocation and allowlist policy on Otari's side of the boundary instead of in every request. Extras are forbidden rather than ignored, so a caller still sending the old inline ``server`` block is told its configuration was not used instead of watching Otari quietly execute against a different server than the one it named.
""" # noqa: E501
arguments: Optional[Dict[str, Any]] = Field(default=None, description="The exact caller-authorized JSON-object arguments.")
client_execution_id: UUID = Field(description="A caller-generated UUID, for correlation only. It is not proof of approval and not an idempotency key: repeating a request with the same value may execute the tool again, so this request must never be retried automatically.")
Expand Down
2 changes: 1 addition & 1 deletion src/otari/_client/models/mcp_tool_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

class McpToolDefinition(BaseModel):
"""
One live tool a caller-orchestrated application may expose to its model. ``annotations`` is the remote server's own metadata, passed through as untrusted data. Otari never turns ``readOnlyHint`` into an authorization decision (R-RISK-1); each application owns its risk policy, and a server cannot waive an application's approval gate by labeling itself read-only.
One live tool a caller-orchestrated application may expose to its model. ``annotations`` is the remote server's own metadata, passed through as untrusted data. Otari never turns ``readOnlyHint`` into an authorization decision; each application owns its risk policy, and a server cannot waive an application's approval gate by labeling itself read-only.
""" # noqa: E501
annotations: Optional[Dict[str, Any]] = Field(default=None, description="Provider-native request fields used as defaults (e.g. exa's 'type', searxng's 'engines').")
description: Optional[StrictStr] = Field(default=None, description="The server's own description, untrusted.")
Expand Down
2 changes: 1 addition & 1 deletion src/otari/_client/models/mcp_tool_warning.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

class McpToolWarning(BaseModel):
"""
One tool that was omitted, and the code that omitted it (R-SCHEMA-3).
One tool that was omitted, and the code that omitted it.
""" # noqa: E501
code: StrictStr
tool_name: StrictStr
Expand Down
2 changes: 1 addition & 1 deletion src/otari/_client/models/mcp_tools_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

class McpToolsResponse(BaseModel):
"""
The authorized catalog for one stored server. Carries no server URL, no credential, and no allowlist entry that the live catalog did not return (R-DISC-2). ``server_revision`` is what an application persists with a proposed call and sends back to ``/api/v1/mcp/execute``, so a stored-configuration change between the two is refused rather than executed.
The authorized catalog for one stored server. Carries no server URL, no credential, and no allowlist entry that the live catalog did not return. ``server_revision`` is what an application persists with a proposed call and sends back to ``/api/v1/mcp/execute``, so a stored-configuration change between the two is refused rather than executed.
""" # noqa: E501
server_id: UUID
server_revision: StrictStr = Field(description="An opaque revision of the stored server's URL, credential, enabled state and allowlist. It detects Otari-side and platform-side configuration changes only: a remote server that changes its own catalog or a tool's behavior behind an unchanged URL will not move it.")
Expand Down
13 changes: 10 additions & 3 deletions src/otari/_client/models/rate_limit_rule_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ class RateLimitRuleCreate(BaseModel):
""" # noqa: E501
lease_sec: Optional[Union[Annotated[float, Field(strict=True, gt=0.0)], Annotated[int, Field(strict=True, gt=0)]]] = Field(default=900.0, description="How long a max_concurrent slot is held at most. A slot is given back when its response ends; this bounds what a process that dies mid-request keeps.")
max_concurrent: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Requests in flight at once.")
models: Optional[List[StrictStr]] = Field(default=None, description="The models a `per: model` rule limits, each as instance:model (the provider instance the model is called through, then the model), each counted on its own. Required there and refused on any other rule.")
name: Annotated[str, Field(strict=True)] = Field(description="Names the rule in a 429's detail and in the counter's key. Unique across rate_limits.")
per: StrictStr = Field(description="What one count is shared by.")
rpm: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Requests per minute.")
tpm: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Tokens per minute. A request is admitted on its estimate (prompt plus max output, or budget_estimate_default_output_tokens) and charged what it used once it completes.")
__properties: ClassVar[List[str]] = ["lease_sec", "max_concurrent", "name", "per", "rpm", "tpm"]
__properties: ClassVar[List[str]] = ["lease_sec", "max_concurrent", "models", "name", "per", "rpm", "tpm"]

@field_validator('name')
def name_validate_regular_expression(cls, value):
Expand All @@ -49,8 +50,8 @@ def name_validate_regular_expression(cls, value):
@field_validator('per')
def per_validate_enum(cls, value):
"""Validates the enum"""
if value not in set(['deployment', 'key', 'user']):
raise ValueError("must be one of enum values ('deployment', 'key', 'user')")
if value not in set(['deployment', 'key', 'user', 'model']):
raise ValueError("must be one of enum values ('deployment', 'key', 'user', 'model')")
return value

model_config = ConfigDict(
Expand Down Expand Up @@ -97,6 +98,11 @@ def to_dict(self) -> Dict[str, Any]:
if self.max_concurrent is None and "max_concurrent" in self.model_fields_set:
_dict['max_concurrent'] = None

# set to None if models (nullable) is None
# and model_fields_set contains the field
if self.models is None and "models" in self.model_fields_set:
_dict['models'] = None

# set to None if rpm (nullable) is None
# and model_fields_set contains the field
if self.rpm is None and "rpm" in self.model_fields_set:
Expand All @@ -121,6 +127,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
_obj = cls.model_validate({
"lease_sec": obj.get("lease_sec") if obj.get("lease_sec") is not None else 900.0,
"max_concurrent": obj.get("max_concurrent"),
"models": obj.get("models"),
"name": obj.get("name"),
"per": obj.get("per"),
"rpm": obj.get("rpm"),
Expand Down
13 changes: 10 additions & 3 deletions src/otari/_client/models/rate_limit_rule_public.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ class RateLimitRulePublic(BaseModel):
""" # noqa: E501
lease_sec: Optional[Union[Annotated[float, Field(strict=True, gt=0.0)], Annotated[int, Field(strict=True, gt=0)]]] = Field(default=900.0, description="How long a max_concurrent slot is held at most. A slot is given back when its response ends; this bounds what a process that dies mid-request keeps.")
max_concurrent: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Requests in flight at once.")
models: Optional[List[StrictStr]] = Field(default=None, description="The models a `per: model` rule limits, each as instance:model (the provider instance the model is called through, then the model), each counted on its own. Required there and refused on any other rule.")
name: Annotated[str, Field(strict=True)] = Field(description="Names the rule in a 429's detail and in the counter's key. Unique across rate_limits.")
per: StrictStr = Field(description="What one count is shared by.")
rpm: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Requests per minute.")
source: StrictStr = Field(description="'config' for a rule from config.yml, which is read-only here; 'dashboard' for a stored one.")
tpm: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Tokens per minute. A request is admitted on its estimate (prompt plus max output, or budget_estimate_default_output_tokens) and charged what it used once it completes.")
updated_at: Optional[datetime] = Field(default=None, description="When a stored rule last changed.")
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["lease_sec", "max_concurrent", "name", "per", "rpm", "source", "tpm", "updated_at"]
__properties: ClassVar[List[str]] = ["lease_sec", "max_concurrent", "models", "name", "per", "rpm", "source", "tpm", "updated_at"]

@field_validator('name')
def name_validate_regular_expression(cls, value):
Expand All @@ -53,8 +54,8 @@ def name_validate_regular_expression(cls, value):
@field_validator('per')
def per_validate_enum(cls, value):
"""Validates the enum"""
if value not in set(['deployment', 'key', 'user']):
raise ValueError("must be one of enum values ('deployment', 'key', 'user')")
if value not in set(['deployment', 'key', 'user', 'model']):
raise ValueError("must be one of enum values ('deployment', 'key', 'user', 'model')")
return value

@field_validator('source')
Expand Down Expand Up @@ -115,6 +116,11 @@ def to_dict(self) -> Dict[str, Any]:
if self.max_concurrent is None and "max_concurrent" in self.model_fields_set:
_dict['max_concurrent'] = None

# set to None if models (nullable) is None
# and model_fields_set contains the field
if self.models is None and "models" in self.model_fields_set:
_dict['models'] = None

# set to None if rpm (nullable) is None
# and model_fields_set contains the field
if self.rpm is None and "rpm" in self.model_fields_set:
Expand Down Expand Up @@ -144,6 +150,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
_obj = cls.model_validate({
"lease_sec": obj.get("lease_sec") if obj.get("lease_sec") is not None else 900.0,
"max_concurrent": obj.get("max_concurrent"),
"models": obj.get("models"),
"name": obj.get("name"),
"per": obj.get("per"),
"rpm": obj.get("rpm"),
Expand Down
13 changes: 10 additions & 3 deletions src/otari/_client/models/rate_limit_rule_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,20 @@ class RateLimitRuleUpdate(BaseModel):
""" # noqa: E501
lease_sec: Optional[Union[Annotated[float, Field(strict=True, gt=0.0)], Annotated[int, Field(strict=True, gt=0)]]] = Field(default=None, description="How long a max_concurrent slot is held at most.")
max_concurrent: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Requests in flight at once.")
models: Optional[List[StrictStr]] = Field(default=None, description="The instance:model names a per: model rule limits; null for any other rule.")
per: Optional[StrictStr] = Field(default=None, description="What one count is shared by.")
rpm: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Requests per minute.")
tpm: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Tokens per minute.")
__properties: ClassVar[List[str]] = ["lease_sec", "max_concurrent", "per", "rpm", "tpm"]
__properties: ClassVar[List[str]] = ["lease_sec", "max_concurrent", "models", "per", "rpm", "tpm"]

@field_validator('per')
def per_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value

if value not in set(['deployment', 'key', 'user']):
raise ValueError("must be one of enum values ('deployment', 'key', 'user')")
if value not in set(['deployment', 'key', 'user', 'model']):
raise ValueError("must be one of enum values ('deployment', 'key', 'user', 'model')")
return value

model_config = ConfigDict(
Expand Down Expand Up @@ -94,6 +95,11 @@ def to_dict(self) -> Dict[str, Any]:
if self.max_concurrent is None and "max_concurrent" in self.model_fields_set:
_dict['max_concurrent'] = None

# set to None if models (nullable) is None
# and model_fields_set contains the field
if self.models is None and "models" in self.model_fields_set:
_dict['models'] = None

# set to None if per (nullable) is None
# and model_fields_set contains the field
if self.per is None and "per" in self.model_fields_set:
Expand Down Expand Up @@ -123,6 +129,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
_obj = cls.model_validate({
"lease_sec": obj.get("lease_sec"),
"max_concurrent": obj.get("max_concurrent"),
"models": obj.get("models"),
"per": obj.get("per"),
"rpm": obj.get("rpm"),
"tpm": obj.get("tpm")
Expand Down
Loading