Skip to content

Commit 1afd138

Browse files
refactor(api): rename FunctionObject to FunctionDefinition (#746)
1 parent 920567c commit 1afd138

13 files changed

+17
-17
lines changed

api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Shared Types
22

33
```python
4-
from openai.types import FunctionObject, FunctionParameters
4+
from openai.types import FunctionDefinition, FunctionParameters
55
```
66

77
# Completions

src/openai/types/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from .edit import Edit as Edit
66
from .image import Image as Image
77
from .model import Model as Model
8-
from .shared import FunctionObject as FunctionObject
8+
from .shared import FunctionDefinition as FunctionDefinition
99
from .shared import FunctionParameters as FunctionParameters
1010
from .embedding import Embedding as Embedding
1111
from .fine_tune import FineTune as FineTune

src/openai/types/beta/assistant.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from typing import List, Union, Optional
55
from typing_extensions import Literal
66

7-
from ..shared import FunctionObject
7+
from ..shared import FunctionDefinition
88
from ..._models import BaseModel
99

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

2222

2323
class ToolFunction(BaseModel):
24-
function: FunctionObject
24+
function: FunctionDefinition
2525

2626
type: Literal["function"]
2727
"""The type of tool being defined: `function`"""

src/openai/types/beta/assistant_create_params.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class ToolAssistantToolsRetrieval(TypedDict, total=False):
7373

7474

7575
class ToolAssistantToolsFunction(TypedDict, total=False):
76-
function: Required[shared_params.FunctionObject]
76+
function: Required[shared_params.FunctionDefinition]
7777

7878
type: Required[Literal["function"]]
7979
"""The type of tool being defined: `function`"""

src/openai/types/beta/assistant_update_params.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class ToolAssistantToolsRetrieval(TypedDict, total=False):
7575

7676

7777
class ToolAssistantToolsFunction(TypedDict, total=False):
78-
function: Required[shared_params.FunctionObject]
78+
function: Required[shared_params.FunctionDefinition]
7979

8080
type: Required[Literal["function"]]
8181
"""The type of tool being defined: `function`"""

src/openai/types/beta/thread_create_and_run_params.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class ToolAssistantToolsRetrieval(TypedDict, total=False):
112112

113113

114114
class ToolAssistantToolsFunction(TypedDict, total=False):
115-
function: Required[shared_params.FunctionObject]
115+
function: Required[shared_params.FunctionDefinition]
116116

117117
type: Required[Literal["function"]]
118118
"""The type of tool being defined: `function`"""

src/openai/types/beta/threads/run.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from typing import List, Union, Optional
55
from typing_extensions import Literal
66

7-
from ...shared import FunctionObject
7+
from ...shared import FunctionDefinition
88
from ...._models import BaseModel
99
from .required_action_function_tool_call import RequiredActionFunctionToolCall
1010

@@ -52,7 +52,7 @@ class ToolAssistantToolsRetrieval(BaseModel):
5252

5353

5454
class ToolAssistantToolsFunction(BaseModel):
55-
function: FunctionObject
55+
function: FunctionDefinition
5656

5757
type: Literal["function"]
5858
"""The type of tool being defined: `function`"""

src/openai/types/beta/threads/run_create_params.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class ToolAssistantToolsRetrieval(TypedDict, total=False):
6464

6565

6666
class ToolAssistantToolsFunction(TypedDict, total=False):
67-
function: Required[shared_params.FunctionObject]
67+
function: Required[shared_params.FunctionDefinition]
6868

6969
type: Required[Literal["function"]]
7070
"""The type of tool being defined: `function`"""

src/openai/types/chat/chat_completion_tool_param.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
class ChatCompletionToolParam(TypedDict, total=False):
13-
function: Required[shared_params.FunctionObject]
13+
function: Required[shared_params.FunctionDefinition]
1414

1515
type: Required[Literal["function"]]
1616
"""The type of the tool. Currently, only `function` is supported."""

src/openai/types/shared/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless.
22

3-
from .function_object import FunctionObject as FunctionObject
3+
from .function_definition import FunctionDefinition as FunctionDefinition
44
from .function_parameters import FunctionParameters as FunctionParameters

src/openai/types/shared/function_object.py src/openai/types/shared/function_definition.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
from ..._models import BaseModel
66
from .function_parameters import FunctionParameters
77

8-
__all__ = ["FunctionObject"]
8+
__all__ = ["FunctionDefinition"]
99

1010

11-
class FunctionObject(BaseModel):
11+
class FunctionDefinition(BaseModel):
1212
name: str
1313
"""The name of the function to be called.
1414
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless.
22

3-
from .function_object import FunctionObject as FunctionObject
3+
from .function_definition import FunctionDefinition as FunctionDefinition
44
from .function_parameters import FunctionParameters as FunctionParameters

src/openai/types/shared_params/function_object.py src/openai/types/shared_params/function_definition.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
from ...types import shared_params
88

9-
__all__ = ["FunctionObject"]
9+
__all__ = ["FunctionDefinition"]
1010

1111

12-
class FunctionObject(TypedDict, total=False):
12+
class FunctionDefinition(TypedDict, total=False):
1313
name: Required[str]
1414
"""The name of the function to be called.
1515

0 commit comments

Comments
 (0)