diff --git a/src/otari/_client/__init__.py b/src/otari/_client/__init__.py index 0749d2d..c5f9792 100644 --- a/src/otari/_client/__init__.py +++ b/src/otari/_client/__init__.py @@ -69,10 +69,8 @@ "CCKCompletionTokensDetails", "CCKCompletionUsage", "CCKPromptTokensDetails", - "CCKReasoning", "CCKTopLogprob", "CCPromptTokensDetails", - "CCReasoning", "CCTopLogprob", "Caller", "ChatCompletion", @@ -265,10 +263,8 @@ from otari._client.models.cck_completion_tokens_details import CCKCompletionTokensDetails as CCKCompletionTokensDetails from otari._client.models.cck_completion_usage import CCKCompletionUsage as CCKCompletionUsage from otari._client.models.cck_prompt_tokens_details import CCKPromptTokensDetails as CCKPromptTokensDetails -from otari._client.models.cck_reasoning import CCKReasoning as CCKReasoning 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_reasoning import CCReasoning as CCReasoning from otari._client.models.cc_top_logprob import CCTopLogprob as CCTopLogprob from otari._client.models.caller import Caller as Caller from otari._client.models.chat_completion import ChatCompletion as ChatCompletion diff --git a/src/otari/_client/models/__init__.py b/src/otari/_client/models/__init__.py index f3be3b6..a180f04 100644 --- a/src/otari/_client/models/__init__.py +++ b/src/otari/_client/models/__init__.py @@ -39,10 +39,8 @@ from otari._client.models.cck_completion_tokens_details import CCKCompletionTokensDetails from otari._client.models.cck_completion_usage import CCKCompletionUsage from otari._client.models.cck_prompt_tokens_details import CCKPromptTokensDetails -from otari._client.models.cck_reasoning import CCKReasoning from otari._client.models.cck_top_logprob import CCKTopLogprob from otari._client.models.cc_prompt_tokens_details import CCPromptTokensDetails -from otari._client.models.cc_reasoning import CCReasoning from otari._client.models.cc_top_logprob import CCTopLogprob from otari._client.models.caller import Caller from otari._client.models.chat_completion import ChatCompletion diff --git a/src/otari/_client/models/cc_chat_completion_message.py b/src/otari/_client/models/cc_chat_completion_message.py index b6d515b..4d78a63 100644 --- a/src/otari/_client/models/cc_chat_completion_message.py +++ b/src/otari/_client/models/cc_chat_completion_message.py @@ -17,12 +17,11 @@ 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 otari._client.models.cc_chat_completion_audio import CCChatCompletionAudio from otari._client.models.cc_chat_completion_message_tool_calls_inner import CCChatCompletionMessageToolCallsInner from otari._client.models.cc_function_call import CCFunctionCall -from otari._client.models.cc_reasoning import CCReasoning from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -38,7 +37,7 @@ class CCChatCompletionMessage(BaseModel): audio: Optional[CCChatCompletionAudio] = None function_call: Optional[CCFunctionCall] = None tool_calls: Optional[List[CCChatCompletionMessageToolCallsInner]] = None - reasoning: Optional[CCReasoning] = None + reasoning: Optional[StrictStr] = Field(default=None, description="Filter models by provider name") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["content", "refusal", "role", "annotations", "audio", "function_call", "tool_calls", "reasoning"] @@ -103,9 +102,6 @@ def to_dict(self) -> Dict[str, Any]: if _item_tool_calls: _items.append(_item_tool_calls.to_dict()) _dict['tool_calls'] = _items - # override the default output from pydantic by calling `to_dict()` of reasoning - if self.reasoning: - _dict['reasoning'] = self.reasoning.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(): @@ -165,7 +161,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "audio": CCChatCompletionAudio.from_dict(obj["audio"]) if obj.get("audio") is not None else None, "function_call": CCFunctionCall.from_dict(obj["function_call"]) if obj.get("function_call") is not None else None, "tool_calls": [CCChatCompletionMessageToolCallsInner.from_dict(_item) for _item in obj["tool_calls"]] if obj.get("tool_calls") is not None else None, - "reasoning": CCReasoning.from_dict(obj["reasoning"]) if obj.get("reasoning") is not None else None + "reasoning": obj.get("reasoning") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/src/otari/_client/models/cc_reasoning.py b/src/otari/_client/models/cc_reasoning.py deleted file mode 100644 index a985df3..0000000 --- a/src/otari/_client/models/cc_reasoning.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - otari-gateway - - A clean FastAPI gateway for otari 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 -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 CCReasoning(BaseModel): - """ - Reasoning content emitted by a model. Serializes as a plain JSON string so that responses are compatible with OpenAI-style clients that expect ``delta.reasoning`` / ``message.reasoning`` to be a string. The Python attribute ``content`` remains available for typed access (e.g. ``message.reasoning.content``). - """ # noqa: E501 - content: StrictStr - __properties: ClassVar[List[str]] = ["content"] - - 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 CCReasoning 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. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CCReasoning from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "content": obj.get("content") - }) - return _obj - - diff --git a/src/otari/_client/models/cck_choice_delta.py b/src/otari/_client/models/cck_choice_delta.py index 7e7c7ff..ed4045b 100644 --- a/src/otari/_client/models/cck_choice_delta.py +++ b/src/otari/_client/models/cck_choice_delta.py @@ -17,11 +17,10 @@ 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 otari._client.models.cck_choice_delta_function_call import CCKChoiceDeltaFunctionCall from otari._client.models.cck_choice_delta_tool_call import CCKChoiceDeltaToolCall -from otari._client.models.cck_reasoning import CCKReasoning from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -35,7 +34,7 @@ class CCKChoiceDelta(BaseModel): refusal: Optional[StrictStr] = None role: Optional[StrictStr] = None tool_calls: Optional[List[CCKChoiceDeltaToolCall]] = None - reasoning: Optional[CCKReasoning] = None + reasoning: Optional[StrictStr] = Field(default=None, description="Filter models by provider name") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["content", "function_call", "refusal", "role", "tool_calls", "reasoning"] @@ -100,9 +99,6 @@ def to_dict(self) -> Dict[str, Any]: if _item_tool_calls: _items.append(_item_tool_calls.to_dict()) _dict['tool_calls'] = _items - # override the default output from pydantic by calling `to_dict()` of reasoning - if self.reasoning: - _dict['reasoning'] = self.reasoning.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(): @@ -155,7 +151,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "refusal": obj.get("refusal"), "role": obj.get("role"), "tool_calls": [CCKChoiceDeltaToolCall.from_dict(_item) for _item in obj["tool_calls"]] if obj.get("tool_calls") is not None else None, - "reasoning": CCKReasoning.from_dict(obj["reasoning"]) if obj.get("reasoning") is not None else None + "reasoning": obj.get("reasoning") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/src/otari/_client/models/cck_reasoning.py b/src/otari/_client/models/cck_reasoning.py deleted file mode 100644 index d58cae3..0000000 --- a/src/otari/_client/models/cck_reasoning.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - otari-gateway - - A clean FastAPI gateway for otari 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 -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 CCKReasoning(BaseModel): - """ - Reasoning content emitted by a model. Serializes as a plain JSON string so that responses are compatible with OpenAI-style clients that expect ``delta.reasoning`` / ``message.reasoning`` to be a string. The Python attribute ``content`` remains available for typed access (e.g. ``message.reasoning.content``). - """ # noqa: E501 - content: StrictStr - __properties: ClassVar[List[str]] = ["content"] - - 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 CCKReasoning 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. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CCKReasoning from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "content": obj.get("content") - }) - return _obj - -