Skip to content

chore(internal): update some imports #1642

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 12, 2024
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
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