-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Open
Labels
Description
Confirm this is an issue with the Python library and not an underlying OpenAI API
- This is an issue with the Python library
Describe the bug
Now that custom tools are supported, I can see that the return types have been updated to a discriminated union:
ChatCompletionMessageToolCall: TypeAlias = Annotated[ | |
Union[ChatCompletionMessageFunctionToolCall, ChatCompletionMessageCustomToolCall], | |
PropertyInfo(discriminator="type"), | |
] |
However, I noticed that in the streaming version, the delta tool chunk currently supports function calls:
openai-python/src/openai/types/chat/chat_completion_chunk.py
Lines 47 to 56 in e4ec91e
class ChoiceDeltaToolCall(BaseModel): | |
index: int | |
id: Optional[str] = None | |
"""The ID of the tool call.""" | |
function: Optional[ChoiceDeltaToolCallFunction] = None | |
type: Optional[Literal["function"]] = None | |
"""The type of the tool. Currently, only `function` is supported.""" |
Are streaming custom tool calls not supported yet or is this just an oversight?
OS
macOS
Python version
Python 3.13
Library version
openai v1.99.3
hayescode and madprops