Implementation:Openai Openai python Response Custom Tool Call Input Delta
| Knowledge Sources | |
|---|---|
| Domains | API_Types, Responses_API |
| Last Updated | 2026-02-15 00:00 GMT |
Overview
Concrete streaming event type representing a partial update to the input of a custom tool call, provided by the openai-python SDK.
Description
ResponseCustomToolCallInputDeltaEvent is a Pydantic model representing a streaming delta event for custom tool call input. As the model generates arguments for a custom tool call, this event delivers incremental delta string chunks. It also includes an item_id linking to the associated API item, an output_index for the output position, a sequence_number for ordering, and a fixed type of "response.custom_tool_call_input.delta". This type is auto-generated from the OpenAI OpenAPI specification by Stainless.
Usage
Import ResponseCustomToolCallInputDeltaEvent when processing streaming events and you need to incrementally assemble the input arguments for a custom tool call as they arrive.
Code Reference
Source Location
- Repository: openai-python
- File: src/openai/types/responses/response_custom_tool_call_input_delta_event.py
Signature
class ResponseCustomToolCallInputDeltaEvent(BaseModel):
"""Event representing a delta (partial update) to the input of a custom tool call."""
delta: str
item_id: str
output_index: int
sequence_number: int
type: Literal["response.custom_tool_call_input.delta"]
Import
from openai.types.responses import ResponseCustomToolCallInputDeltaEvent
I/O Contract
Fields
| Name | Type | Required | Description |
|---|---|---|---|
| delta | str |
Yes | The incremental input data (delta) for the custom tool call. |
| item_id | str |
Yes | Unique identifier for the API item associated with this event. |
| output_index | int |
Yes | The index of the output this delta applies to. |
| sequence_number | int |
Yes | The sequence number of this event. |
| type | Literal["response.custom_tool_call_input.delta"] |
Yes | The event type identifier. |
Usage Examples
from openai.types.responses import ResponseCustomToolCallInputDeltaEvent
# Accumulate custom tool call input from streaming deltas
input_buffer = ""
for event in stream:
if isinstance(event, ResponseCustomToolCallInputDeltaEvent):
input_buffer += event.delta
print(f"Delta received for item {event.item_id}: {event.delta}")
print(f"Complete input: {input_buffer}")