Skip to content

Commit

Permalink
refactor(api): rename FunctionObject to FunctionDefinition (#746)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot committed Nov 9, 2023
1 parent d3d7e1b commit 48834e4
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Shared Types

```python
from openai.types import FunctionObject, FunctionParameters
from openai.types import FunctionDefinition, FunctionParameters
```

# Completions
Expand Down
2 changes: 1 addition & 1 deletion src/openai/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from .edit import Edit as Edit
from .image import Image as Image
from .model import Model as Model
from .shared import FunctionObject as FunctionObject
from .shared import FunctionDefinition as FunctionDefinition
from .shared import FunctionParameters as FunctionParameters
from .embedding import Embedding as Embedding
from .fine_tune import FineTune as FineTune
Expand Down
4 changes: 2 additions & 2 deletions src/openai/types/beta/assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import List, Union, Optional
from typing_extensions import Literal

from ..shared import FunctionObject
from ..shared import FunctionDefinition
from ..._models import BaseModel

__all__ = ["Assistant", "Tool", "ToolCodeInterpreter", "ToolRetrieval", "ToolFunction"]
Expand All @@ -21,7 +21,7 @@ class ToolRetrieval(BaseModel):


class ToolFunction(BaseModel):
function: FunctionObject
function: FunctionDefinition

type: Literal["function"]
"""The type of tool being defined: `function`"""
Expand Down
2 changes: 1 addition & 1 deletion src/openai/types/beta/assistant_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class ToolAssistantToolsRetrieval(TypedDict, total=False):


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

type: Required[Literal["function"]]
"""The type of tool being defined: `function`"""
Expand Down
2 changes: 1 addition & 1 deletion src/openai/types/beta/assistant_update_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class ToolAssistantToolsRetrieval(TypedDict, total=False):


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

type: Required[Literal["function"]]
"""The type of tool being defined: `function`"""
Expand Down
2 changes: 1 addition & 1 deletion src/openai/types/beta/thread_create_and_run_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class ToolAssistantToolsRetrieval(TypedDict, total=False):


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

type: Required[Literal["function"]]
"""The type of tool being defined: `function`"""
Expand Down
4 changes: 2 additions & 2 deletions src/openai/types/beta/threads/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import List, Union, Optional
from typing_extensions import Literal

from ...shared import FunctionObject
from ...shared import FunctionDefinition
from ...._models import BaseModel
from .required_action_function_tool_call import RequiredActionFunctionToolCall

Expand Down Expand Up @@ -52,7 +52,7 @@ class ToolAssistantToolsRetrieval(BaseModel):


class ToolAssistantToolsFunction(BaseModel):
function: FunctionObject
function: FunctionDefinition

type: Literal["function"]
"""The type of tool being defined: `function`"""
Expand Down
2 changes: 1 addition & 1 deletion src/openai/types/beta/threads/run_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class ToolAssistantToolsRetrieval(TypedDict, total=False):


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

type: Required[Literal["function"]]
"""The type of tool being defined: `function`"""
Expand Down
2 changes: 1 addition & 1 deletion src/openai/types/chat/chat_completion_tool_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


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

type: Required[Literal["function"]]
"""The type of the tool. Currently, only `function` is supported."""
2 changes: 1 addition & 1 deletion src/openai/types/shared/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless.

from .function_object import FunctionObject as FunctionObject
from .function_definition import FunctionDefinition as FunctionDefinition
from .function_parameters import FunctionParameters as FunctionParameters
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
from ..._models import BaseModel
from .function_parameters import FunctionParameters

__all__ = ["FunctionObject"]
__all__ = ["FunctionDefinition"]


class FunctionObject(BaseModel):
class FunctionDefinition(BaseModel):
name: str
"""The name of the function to be called.
Expand Down
2 changes: 1 addition & 1 deletion src/openai/types/shared_params/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless.

from .function_object import FunctionObject as FunctionObject
from .function_definition import FunctionDefinition as FunctionDefinition
from .function_parameters import FunctionParameters as FunctionParameters
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

from ...types import shared_params

__all__ = ["FunctionObject"]
__all__ = ["FunctionDefinition"]


class FunctionObject(TypedDict, total=False):
class FunctionDefinition(TypedDict, total=False):
name: Required[str]
"""The name of the function to be called.
Expand Down

0 comments on commit 48834e4

Please sign in to comment.