Skip to content

Commit

Permalink
chore(internal): update some imports (#1642)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Aug 12, 2024
1 parent 2623630 commit fce1ea7
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
from typing import Union
from typing_extensions import Literal, TypeAlias

from ...types import shared_params
from ..shared_params.response_format_text import ResponseFormatText
from ..shared_params.response_format_json_object import ResponseFormatJSONObject
from ..shared_params.response_format_json_schema import ResponseFormatJSONSchema

__all__ = ["AssistantResponseFormatOptionParam"]

AssistantResponseFormatOptionParam: TypeAlias = Union[
Literal["auto"],
shared_params.ResponseFormatText,
shared_params.ResponseFormatJSONObject,
shared_params.ResponseFormatJSONSchema,
Literal["auto"], ResponseFormatText, ResponseFormatJSONObject, ResponseFormatJSONSchema
]
4 changes: 2 additions & 2 deletions src/openai/types/beta/function_tool_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

from typing_extensions import Literal, Required, TypedDict

from ...types import shared_params
from ..shared_params.function_definition import FunctionDefinition

__all__ = ["FunctionToolParam"]


class FunctionToolParam(TypedDict, total=False):
function: Required[shared_params.FunctionDefinition]
function: Required[FunctionDefinition]

type: Required[Literal["function"]]
"""The type of tool being defined: `function`"""
4 changes: 2 additions & 2 deletions src/openai/types/chat/chat_completion_tool_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

from typing_extensions import Literal, Required, TypedDict

from ...types import shared_params
from ..shared_params.function_definition import FunctionDefinition

__all__ = ["ChatCompletionToolParam"]


class ChatCompletionToolParam(TypedDict, total=False):
function: Required[shared_params.FunctionDefinition]
function: Required[FunctionDefinition]

type: Required[Literal["function"]]
"""The type of the tool. Currently, only `function` is supported."""
11 changes: 6 additions & 5 deletions src/openai/types/chat/completion_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
from typing import Dict, List, Union, Iterable, Optional
from typing_extensions import Literal, Required, TypeAlias, TypedDict

from ...types import shared_params
from ..chat_model import ChatModel
from .chat_completion_tool_param import ChatCompletionToolParam
from .chat_completion_message_param import ChatCompletionMessageParam
from ..shared_params.function_parameters import FunctionParameters
from ..shared_params.response_format_text import ResponseFormatText
from .chat_completion_stream_options_param import ChatCompletionStreamOptionsParam
from .chat_completion_tool_choice_option_param import ChatCompletionToolChoiceOptionParam
from ..shared_params.response_format_json_object import ResponseFormatJSONObject
from ..shared_params.response_format_json_schema import ResponseFormatJSONSchema
from .chat_completion_function_call_option_param import ChatCompletionFunctionCallOptionParam

__all__ = [
Expand Down Expand Up @@ -244,7 +247,7 @@ class Function(TypedDict, total=False):
how to call the function.
"""

parameters: shared_params.FunctionParameters
parameters: FunctionParameters
"""The parameters the functions accepts, described as a JSON Schema object.
See the [guide](https://platform.openai.com/docs/guides/function-calling) for
Expand All @@ -256,9 +259,7 @@ class Function(TypedDict, total=False):
"""


ResponseFormat: TypeAlias = Union[
shared_params.ResponseFormatText, shared_params.ResponseFormatJSONObject, shared_params.ResponseFormatJSONSchema
]
ResponseFormat: TypeAlias = Union[ResponseFormatText, ResponseFormatJSONObject, ResponseFormatJSONSchema]


class CompletionCreateParamsNonStreaming(CompletionCreateParamsBase):
Expand Down
4 changes: 2 additions & 2 deletions src/openai/types/shared_params/function_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import Optional
from typing_extensions import Required, TypedDict

from ...types import shared_params
from .function_parameters import FunctionParameters

__all__ = ["FunctionDefinition"]

Expand All @@ -24,7 +24,7 @@ class FunctionDefinition(TypedDict, total=False):
how to call the function.
"""

parameters: shared_params.FunctionParameters
parameters: FunctionParameters
"""The parameters the functions accepts, described as a JSON Schema object.
See the [guide](https://platform.openai.com/docs/guides/function-calling) for
Expand Down

0 comments on commit fce1ea7

Please sign in to comment.