Skip to content

DeltaToolCall only supports function, missing custom tool type #2530

@JoongWonSeo

Description

@JoongWonSeo

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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingopenapi

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions