Skip to content

Commit ace7428

Browse files
committed
fix(chat): align named tool choice param
1 parent d3e6321 commit ace7428

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

src/openai/types/chat/chat_completion_named_tool_choice_param.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44

55
from typing_extensions import Literal, Required, TypedDict
66

7-
__all__ = ["ChatCompletionNamedToolChoiceParam", "Function"]
8-
9-
10-
class Function(TypedDict, total=False):
11-
name: Required[str]
12-
"""The name of the function to call."""
7+
__all__ = ["ChatCompletionNamedToolChoiceParam"]
138

149

1510
class ChatCompletionNamedToolChoiceParam(TypedDict, total=False):
@@ -18,7 +13,8 @@ class ChatCompletionNamedToolChoiceParam(TypedDict, total=False):
1813
Use to force the model to call a specific function.
1914
"""
2015

21-
function: Required[Function]
16+
name: Required[str]
17+
"""The name of the function to call."""
2218

2319
type: Required[Literal["function"]]
2420
"""For function calling, the type is always `function`."""
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from openai.types.chat import ChatCompletionNamedToolChoiceParam
2+
3+
4+
def test_chat_completion_named_tool_choice_param_name() -> None:
5+
annotations = ChatCompletionNamedToolChoiceParam.__annotations__
6+
7+
assert "type" in annotations
8+
assert "name" in annotations
9+
assert "function" not in annotations

0 commit comments

Comments
 (0)