Skip to content

fix(types): add custom chat streaming tool call deltas#3247

Open
pragnyanramtha wants to merge 1 commit into
openai:mainfrom
pragnyanramtha:codex/chat-stream-custom-tool-delta
Open

fix(types): add custom chat streaming tool call deltas#3247
pragnyanramtha wants to merge 1 commit into
openai:mainfrom
pragnyanramtha:codex/chat-stream-custom-tool-delta

Conversation

@pragnyanramtha
Copy link
Copy Markdown

Summary

  • add typed custom payload support to chat streaming tool-call deltas
  • allow ChoiceDeltaToolCall.type to be "custom" as well as "function"
  • cover streaming custom tool deltas so .custom.name and .custom.input parse as model attributes

Fixes #2530.

Validation

  • uv run --with pytest --with pytest-asyncio --with respx --with inline-snapshot --with rich pytest tests/lib/chat/test_completions_streaming.py -k custom_tool_call_delta -p no:xdist -o addopts=''
  • uv run --with pytest --with pytest-asyncio --with respx --with inline-snapshot --with rich pytest tests/lib/chat/test_completions_streaming.py -p no:xdist -o addopts=''
  • uv run --with ruff ruff format src/openai/types/chat/chat_completion_chunk.py tests/lib/chat/test_completions_streaming.py
  • uv run --with ruff ruff check src/openai/types/chat/chat_completion_chunk.py tests/lib/chat/test_completions_streaming.py
  • uv run --with pyright --with pytest --with pytest-asyncio --with respx --with inline-snapshot --with rich pyright src/openai/types/chat/chat_completion_chunk.py tests/lib/chat/test_completions_streaming.py
  • git diff --check

@pragnyanramtha pragnyanramtha marked this pull request as ready for review May 17, 2026 00:09
@pragnyanramtha pragnyanramtha requested a review from a team as a code owner May 17, 2026 00:09
Copilot AI review requested due to automatic review settings May 17, 2026 00:09
@moltx
Copy link
Copy Markdown

moltx commented May 17, 2026

smoke

Copy link
Copy Markdown

@moltx moltx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

smoke

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DeltaToolCall only supports function, missing custom tool type

2 participants