From 8b0a2c241b4bd494c03e77bc57400b1eadafadd7 Mon Sep 17 00:00:00 2001 From: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com> Date: Thu, 3 Sep 2026 21:35:01 +0100 Subject: [PATCH 1/8] fix: align stable steer input with wire contract --- .../types/responses/response_steer_input.py | 81 +------------------ 1 file changed, 4 insertions(+), 77 deletions(-) diff --git a/src/openai/types/responses/response_steer_input.py b/src/openai/types/responses/response_steer_input.py index 78426ab22c..70ed1acc04 100644 --- a/src/openai/types/responses/response_steer_input.py +++ b/src/openai/types/responses/response_steer_input.py @@ -1,21 +1,15 @@ # File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. from typing import List, Union, Optional -from typing_extensions import Literal, Annotated, TypeAlias +from typing_extensions import Literal, TypeAlias -from ..._utils import PropertyInfo from ..._models import BaseModel from .response_steer_input_content import ResponseSteerInputContent -from .response_function_call_output_item_list import ResponseFunctionCallOutputItemList __all__ = [ "ResponseSteerInput", "ResponseSteerInputItemList", "ResponseSteerInputItemListMessage", - "ResponseSteerInputItemListFunctionCallOutput", - "ResponseSteerInputItemListFunctionCallOutputCaller", - "ResponseSteerInputItemListFunctionCallOutputCallerDirect", - "ResponseSteerInputItemListFunctionCallOutputCallerProgram", ] @@ -26,77 +20,10 @@ class ResponseSteerInputItemListMessage(BaseModel): role: Literal["user"] """The message role. Always `user`.""" - type: Literal["message"] - """The item type. Always `message`.""" + type: Optional[Literal["message"]] = None + """The item type, when provided. Always `message`.""" - id: Optional[str] = None - """The unique ID of this message item.""" - status: Optional[str] = None - """The status of the message item.""" - - -class ResponseSteerInputItemListFunctionCallOutputCallerDirect(BaseModel): - type: Literal["direct"] - """The caller type. Always `direct`.""" - - -class ResponseSteerInputItemListFunctionCallOutputCallerProgram(BaseModel): - caller_id: str - """The call ID of the program item that produced this tool call.""" - - type: Literal["program"] - """The caller type. Always `program`.""" - - -ResponseSteerInputItemListFunctionCallOutputCaller: TypeAlias = Annotated[ - Union[ - ResponseSteerInputItemListFunctionCallOutputCallerDirect, - ResponseSteerInputItemListFunctionCallOutputCallerProgram, - None, - ], - PropertyInfo(discriminator="type"), -] - - -class ResponseSteerInputItemListFunctionCallOutput(BaseModel): - """The output of a function tool call.""" - - output: Union[str, ResponseFunctionCallOutputItemList] - """Text, image, or file output of the function tool call.""" - - type: Literal["function_call_output"] - """The type of the function tool call output. Always `function_call_output`.""" - - id: Optional[str] = None - """The unique ID of the function tool call output. - - Populated when this item is returned via API. - """ - - call_id: Optional[str] = None - """The unique ID of the function tool call generated by the model.""" - - caller: Optional[ResponseSteerInputItemListFunctionCallOutputCaller] = None - """The execution context that produced this tool call.""" - - name: Optional[str] = None - """The name of the tool that produced the output.""" - - namespace: Optional[str] = None - """The namespace of the tool that produced the output.""" - - status: Optional[Literal["in_progress", "completed", "incomplete"]] = None - """The status of the item. - - One of `in_progress`, `completed`, or `incomplete`. Populated when items are - returned via API. - """ - - -ResponseSteerInputItemList: TypeAlias = Annotated[ - Union[ResponseSteerInputItemListMessage, ResponseSteerInputItemListFunctionCallOutput], - PropertyInfo(discriminator="type"), -] +ResponseSteerInputItemList: TypeAlias = ResponseSteerInputItemListMessage ResponseSteerInput: TypeAlias = Union[str, List[ResponseSteerInputItemList]] From 214fa569018e42851e8697a8de8704bf1959fd1a Mon Sep 17 00:00:00 2001 From: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com> Date: Thu, 3 Sep 2026 21:35:13 +0100 Subject: [PATCH 2/8] fix: restrict stable steer params to user messages --- .../responses/response_steer_input_param.py | 74 +------------------ 1 file changed, 4 insertions(+), 70 deletions(-) diff --git a/src/openai/types/responses/response_steer_input_param.py b/src/openai/types/responses/response_steer_input_param.py index dcaa31df0e..5e3ea61700 100644 --- a/src/openai/types/responses/response_steer_input_param.py +++ b/src/openai/types/responses/response_steer_input_param.py @@ -2,20 +2,15 @@ from __future__ import annotations -from typing import Union, Iterable, Optional +from typing import Union, Iterable from typing_extensions import Literal, Required, TypeAlias, TypedDict from .response_steer_input_content_param import ResponseSteerInputContentParam -from .response_function_call_output_item_list_param import ResponseFunctionCallOutputItemListParam __all__ = [ "ResponseSteerInputParam", "ResponseSteerInputItemList", "ResponseSteerInputItemListMessage", - "ResponseSteerInputItemListFunctionCallOutput", - "ResponseSteerInputItemListFunctionCallOutputCaller", - "ResponseSteerInputItemListFunctionCallOutputCallerDirect", - "ResponseSteerInputItemListFunctionCallOutputCallerProgram", ] @@ -26,71 +21,10 @@ class ResponseSteerInputItemListMessage(TypedDict, total=False): role: Required[Literal["user"]] """The message role. Always `user`.""" - type: Required[Literal["message"]] - """The item type. Always `message`.""" + type: Literal["message"] + """The optional item type. When provided, always `message`.""" - id: Optional[str] - """The unique ID of this message item.""" - status: Optional[str] - """The status of the message item.""" - - -class ResponseSteerInputItemListFunctionCallOutputCallerDirect(TypedDict, total=False): - type: Required[Literal["direct"]] - """The caller type. Always `direct`.""" - - -class ResponseSteerInputItemListFunctionCallOutputCallerProgram(TypedDict, total=False): - caller_id: Required[str] - """The call ID of the program item that produced this tool call.""" - - type: Required[Literal["program"]] - """The caller type. Always `program`.""" - - -ResponseSteerInputItemListFunctionCallOutputCaller: TypeAlias = Union[ - ResponseSteerInputItemListFunctionCallOutputCallerDirect, ResponseSteerInputItemListFunctionCallOutputCallerProgram -] - - -class ResponseSteerInputItemListFunctionCallOutput(TypedDict, total=False): - """The output of a function tool call.""" - - output: Required[Union[str, ResponseFunctionCallOutputItemListParam]] - """Text, image, or file output of the function tool call.""" - - type: Required[Literal["function_call_output"]] - """The type of the function tool call output. Always `function_call_output`.""" - - id: Optional[str] - """The unique ID of the function tool call output. - - Populated when this item is returned via API. - """ - - call_id: Optional[str] - """The unique ID of the function tool call generated by the model.""" - - caller: Optional[ResponseSteerInputItemListFunctionCallOutputCaller] - """The execution context that produced this tool call.""" - - name: Optional[str] - """The name of the tool that produced the output.""" - - namespace: Optional[str] - """The namespace of the tool that produced the output.""" - - status: Optional[Literal["in_progress", "completed", "incomplete"]] - """The status of the item. - - One of `in_progress`, `completed`, or `incomplete`. Populated when items are - returned via API. - """ - - -ResponseSteerInputItemList: TypeAlias = Union[ - ResponseSteerInputItemListMessage, ResponseSteerInputItemListFunctionCallOutput -] +ResponseSteerInputItemList: TypeAlias = ResponseSteerInputItemListMessage ResponseSteerInputParam: TypeAlias = Union[str, Iterable[ResponseSteerInputItemList]] From 4cd64c02e3f71263f5b266c307e56e1b6f341b82 Mon Sep 17 00:00:00 2001 From: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com> Date: Thu, 3 Sep 2026 21:35:27 +0100 Subject: [PATCH 3/8] fix: align beta steer input with wire contract --- .../types/beta/beta_response_steer_input.py | 103 +----------------- 1 file changed, 4 insertions(+), 99 deletions(-) diff --git a/src/openai/types/beta/beta_response_steer_input.py b/src/openai/types/beta/beta_response_steer_input.py index aac528e60b..8d2c7fc0f7 100644 --- a/src/openai/types/beta/beta_response_steer_input.py +++ b/src/openai/types/beta/beta_response_steer_input.py @@ -1,33 +1,18 @@ # File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. from typing import List, Union, Optional -from typing_extensions import Literal, Annotated, TypeAlias +from typing_extensions import Literal, TypeAlias -from ..._utils import PropertyInfo from ..._models import BaseModel from .beta_response_steer_input_content import BetaResponseSteerInputContent -from .beta_response_function_call_output_item_list import BetaResponseFunctionCallOutputItemList __all__ = [ "BetaResponseSteerInput", "ResponseSteerInputItemList", "ResponseSteerInputItemListMessage", - "ResponseSteerInputItemListMessageAgent", - "ResponseSteerInputItemListFunctionCallOutput", - "ResponseSteerInputItemListFunctionCallOutputAgent", - "ResponseSteerInputItemListFunctionCallOutputCaller", - "ResponseSteerInputItemListFunctionCallOutputCallerDirect", - "ResponseSteerInputItemListFunctionCallOutputCallerProgram", ] -class ResponseSteerInputItemListMessageAgent(BaseModel): - """The agent that produced this item.""" - - agent_name: str - """The canonical name of the agent that produced this item.""" - - class ResponseSteerInputItemListMessage(BaseModel): content: Union[List[BetaResponseSteerInputContent], str] """The message content, as an array of content parts.""" @@ -35,90 +20,10 @@ class ResponseSteerInputItemListMessage(BaseModel): role: Literal["user"] """The message role. Always `user`.""" - type: Literal["message"] - """The item type. Always `message`.""" - - id: Optional[str] = None - """The unique ID of this message item.""" - - agent: Optional[ResponseSteerInputItemListMessageAgent] = None - """The agent that produced this item.""" - - status: Optional[str] = None - """The status of the message item.""" - - -class ResponseSteerInputItemListFunctionCallOutputAgent(BaseModel): - """The agent that produced this item.""" + type: Optional[Literal["message"]] = None + """The item type, when provided. Always `message`.""" - agent_name: str - """The canonical name of the agent that produced this item.""" - - -class ResponseSteerInputItemListFunctionCallOutputCallerDirect(BaseModel): - type: Literal["direct"] - """The caller type. Always `direct`.""" - - -class ResponseSteerInputItemListFunctionCallOutputCallerProgram(BaseModel): - caller_id: str - """The call ID of the program item that produced this tool call.""" - - type: Literal["program"] - """The caller type. Always `program`.""" - - -ResponseSteerInputItemListFunctionCallOutputCaller: TypeAlias = Annotated[ - Union[ - ResponseSteerInputItemListFunctionCallOutputCallerDirect, - ResponseSteerInputItemListFunctionCallOutputCallerProgram, - None, - ], - PropertyInfo(discriminator="type"), -] - -class ResponseSteerInputItemListFunctionCallOutput(BaseModel): - """The output of a function tool call.""" - - output: Union[str, BetaResponseFunctionCallOutputItemList] - """Text, image, or file output of the function tool call.""" - - type: Literal["function_call_output"] - """The type of the function tool call output. Always `function_call_output`.""" - - id: Optional[str] = None - """The unique ID of the function tool call output. - - Populated when this item is returned via API. - """ - - agent: Optional[ResponseSteerInputItemListFunctionCallOutputAgent] = None - """The agent that produced this item.""" - - call_id: Optional[str] = None - """The unique ID of the function tool call generated by the model.""" - - caller: Optional[ResponseSteerInputItemListFunctionCallOutputCaller] = None - """The execution context that produced this tool call.""" - - name: Optional[str] = None - """The name of the tool that produced the output.""" - - namespace: Optional[str] = None - """The namespace of the tool that produced the output.""" - - status: Optional[Literal["in_progress", "completed", "incomplete"]] = None - """The status of the item. - - One of `in_progress`, `completed`, or `incomplete`. Populated when items are - returned via API. - """ - - -ResponseSteerInputItemList: TypeAlias = Annotated[ - Union[ResponseSteerInputItemListMessage, ResponseSteerInputItemListFunctionCallOutput], - PropertyInfo(discriminator="type"), -] +ResponseSteerInputItemList: TypeAlias = ResponseSteerInputItemListMessage BetaResponseSteerInput: TypeAlias = Union[str, List[ResponseSteerInputItemList]] From d628f343dd5affbfa43b2645ea228095ba3a1296 Mon Sep 17 00:00:00 2001 From: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com> Date: Thu, 3 Sep 2026 21:35:38 +0100 Subject: [PATCH 4/8] fix: restrict beta steer params to user messages --- .../beta/beta_response_steer_input_param.py | 96 +------------------ 1 file changed, 4 insertions(+), 92 deletions(-) diff --git a/src/openai/types/beta/beta_response_steer_input_param.py b/src/openai/types/beta/beta_response_steer_input_param.py index 002369514d..75f1b34b3c 100644 --- a/src/openai/types/beta/beta_response_steer_input_param.py +++ b/src/openai/types/beta/beta_response_steer_input_param.py @@ -2,32 +2,18 @@ from __future__ import annotations -from typing import Union, Iterable, Optional +from typing import Union, Iterable from typing_extensions import Literal, Required, TypeAlias, TypedDict from .beta_response_steer_input_content_param import BetaResponseSteerInputContentParam -from .beta_response_function_call_output_item_list_param import BetaResponseFunctionCallOutputItemListParam __all__ = [ "BetaResponseSteerInputParam", "ResponseSteerInputItemList", "ResponseSteerInputItemListMessage", - "ResponseSteerInputItemListMessageAgent", - "ResponseSteerInputItemListFunctionCallOutput", - "ResponseSteerInputItemListFunctionCallOutputAgent", - "ResponseSteerInputItemListFunctionCallOutputCaller", - "ResponseSteerInputItemListFunctionCallOutputCallerDirect", - "ResponseSteerInputItemListFunctionCallOutputCallerProgram", ] -class ResponseSteerInputItemListMessageAgent(TypedDict, total=False): - """The agent that produced this item.""" - - agent_name: Required[str] - """The canonical name of the agent that produced this item.""" - - class ResponseSteerInputItemListMessage(TypedDict, total=False): content: Required[Union[Iterable[BetaResponseSteerInputContentParam], str]] """The message content, as an array of content parts.""" @@ -35,84 +21,10 @@ class ResponseSteerInputItemListMessage(TypedDict, total=False): role: Required[Literal["user"]] """The message role. Always `user`.""" - type: Required[Literal["message"]] - """The item type. Always `message`.""" - - id: Optional[str] - """The unique ID of this message item.""" - - agent: Optional[ResponseSteerInputItemListMessageAgent] - """The agent that produced this item.""" - - status: Optional[str] - """The status of the message item.""" - - -class ResponseSteerInputItemListFunctionCallOutputAgent(TypedDict, total=False): - """The agent that produced this item.""" + type: Literal["message"] + """The optional item type. When provided, always `message`.""" - agent_name: Required[str] - """The canonical name of the agent that produced this item.""" - - -class ResponseSteerInputItemListFunctionCallOutputCallerDirect(TypedDict, total=False): - type: Required[Literal["direct"]] - """The caller type. Always `direct`.""" - - -class ResponseSteerInputItemListFunctionCallOutputCallerProgram(TypedDict, total=False): - caller_id: Required[str] - """The call ID of the program item that produced this tool call.""" - - type: Required[Literal["program"]] - """The caller type. Always `program`.""" - - -ResponseSteerInputItemListFunctionCallOutputCaller: TypeAlias = Union[ - ResponseSteerInputItemListFunctionCallOutputCallerDirect, ResponseSteerInputItemListFunctionCallOutputCallerProgram -] - -class ResponseSteerInputItemListFunctionCallOutput(TypedDict, total=False): - """The output of a function tool call.""" - - output: Required[Union[str, BetaResponseFunctionCallOutputItemListParam]] - """Text, image, or file output of the function tool call.""" - - type: Required[Literal["function_call_output"]] - """The type of the function tool call output. Always `function_call_output`.""" - - id: Optional[str] - """The unique ID of the function tool call output. - - Populated when this item is returned via API. - """ - - agent: Optional[ResponseSteerInputItemListFunctionCallOutputAgent] - """The agent that produced this item.""" - - call_id: Optional[str] - """The unique ID of the function tool call generated by the model.""" - - caller: Optional[ResponseSteerInputItemListFunctionCallOutputCaller] - """The execution context that produced this tool call.""" - - name: Optional[str] - """The name of the tool that produced the output.""" - - namespace: Optional[str] - """The namespace of the tool that produced the output.""" - - status: Optional[Literal["in_progress", "completed", "incomplete"]] - """The status of the item. - - One of `in_progress`, `completed`, or `incomplete`. Populated when items are - returned via API. - """ - - -ResponseSteerInputItemList: TypeAlias = Union[ - ResponseSteerInputItemListMessage, ResponseSteerInputItemListFunctionCallOutput -] +ResponseSteerInputItemList: TypeAlias = ResponseSteerInputItemListMessage BetaResponseSteerInputParam: TypeAlias = Union[str, Iterable[ResponseSteerInputItemList]] From ae202e8f17aabb775c11a9a334a5349f5055e53c Mon Sep 17 00:00:00 2001 From: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com> Date: Thu, 3 Sep 2026 21:35:52 +0100 Subject: [PATCH 5/8] test: cover response steer input wire contract --- tests/test_response_steer_input_types.py | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/test_response_steer_input_types.py diff --git a/tests/test_response_steer_input_types.py b/tests/test_response_steer_input_types.py new file mode 100644 index 0000000000..e391e8e97b --- /dev/null +++ b/tests/test_response_steer_input_types.py @@ -0,0 +1,26 @@ +from openai.types.beta import beta_response_steer_input as beta_steer +from openai.types.beta import beta_response_steer_input_param as beta_steer_param +from openai.types.responses import response_steer_input as steer +from openai.types.responses import response_steer_input_param as steer_param + + +def test_stable_steer_input_is_user_message_only() -> None: + message = steer.ResponseSteerInputItemListMessage.model_validate({"role": "user", "content": "continue"}) + + assert message.type is None + assert steer.ResponseSteerInputItemList is steer.ResponseSteerInputItemListMessage + assert set(steer_param.ResponseSteerInputItemListMessage.__required_keys__) == {"content", "role"} + assert steer_param.ResponseSteerInputItemList is steer_param.ResponseSteerInputItemListMessage + assert "ResponseSteerInputItemListFunctionCallOutput" not in steer.__all__ + assert "ResponseSteerInputItemListFunctionCallOutput" not in steer_param.__all__ + + +def test_beta_steer_input_is_user_message_only() -> None: + message = beta_steer.ResponseSteerInputItemListMessage.model_validate({"role": "user", "content": "continue"}) + + assert message.type is None + assert beta_steer.ResponseSteerInputItemList is beta_steer.ResponseSteerInputItemListMessage + assert set(beta_steer_param.ResponseSteerInputItemListMessage.__required_keys__) == {"content", "role"} + assert beta_steer_param.ResponseSteerInputItemList is beta_steer_param.ResponseSteerInputItemListMessage + assert "ResponseSteerInputItemListFunctionCallOutput" not in beta_steer.__all__ + assert "ResponseSteerInputItemListFunctionCallOutput" not in beta_steer_param.__all__ From a698af4da15780bbdbaa280f37625ab7936df5ad Mon Sep 17 00:00:00 2001 From: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com> Date: Thu, 3 Sep 2026 21:39:34 +0100 Subject: [PATCH 6/8] refactor: preserve broad steer response model --- .../types/responses/response_steer_input.py | 81 ++++++++++++++++++- 1 file changed, 77 insertions(+), 4 deletions(-) diff --git a/src/openai/types/responses/response_steer_input.py b/src/openai/types/responses/response_steer_input.py index 70ed1acc04..78426ab22c 100644 --- a/src/openai/types/responses/response_steer_input.py +++ b/src/openai/types/responses/response_steer_input.py @@ -1,15 +1,21 @@ # File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. from typing import List, Union, Optional -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Annotated, TypeAlias +from ..._utils import PropertyInfo from ..._models import BaseModel from .response_steer_input_content import ResponseSteerInputContent +from .response_function_call_output_item_list import ResponseFunctionCallOutputItemList __all__ = [ "ResponseSteerInput", "ResponseSteerInputItemList", "ResponseSteerInputItemListMessage", + "ResponseSteerInputItemListFunctionCallOutput", + "ResponseSteerInputItemListFunctionCallOutputCaller", + "ResponseSteerInputItemListFunctionCallOutputCallerDirect", + "ResponseSteerInputItemListFunctionCallOutputCallerProgram", ] @@ -20,10 +26,77 @@ class ResponseSteerInputItemListMessage(BaseModel): role: Literal["user"] """The message role. Always `user`.""" - type: Optional[Literal["message"]] = None - """The item type, when provided. Always `message`.""" + type: Literal["message"] + """The item type. Always `message`.""" + id: Optional[str] = None + """The unique ID of this message item.""" -ResponseSteerInputItemList: TypeAlias = ResponseSteerInputItemListMessage + status: Optional[str] = None + """The status of the message item.""" + + +class ResponseSteerInputItemListFunctionCallOutputCallerDirect(BaseModel): + type: Literal["direct"] + """The caller type. Always `direct`.""" + + +class ResponseSteerInputItemListFunctionCallOutputCallerProgram(BaseModel): + caller_id: str + """The call ID of the program item that produced this tool call.""" + + type: Literal["program"] + """The caller type. Always `program`.""" + + +ResponseSteerInputItemListFunctionCallOutputCaller: TypeAlias = Annotated[ + Union[ + ResponseSteerInputItemListFunctionCallOutputCallerDirect, + ResponseSteerInputItemListFunctionCallOutputCallerProgram, + None, + ], + PropertyInfo(discriminator="type"), +] + + +class ResponseSteerInputItemListFunctionCallOutput(BaseModel): + """The output of a function tool call.""" + + output: Union[str, ResponseFunctionCallOutputItemList] + """Text, image, or file output of the function tool call.""" + + type: Literal["function_call_output"] + """The type of the function tool call output. Always `function_call_output`.""" + + id: Optional[str] = None + """The unique ID of the function tool call output. + + Populated when this item is returned via API. + """ + + call_id: Optional[str] = None + """The unique ID of the function tool call generated by the model.""" + + caller: Optional[ResponseSteerInputItemListFunctionCallOutputCaller] = None + """The execution context that produced this tool call.""" + + name: Optional[str] = None + """The name of the tool that produced the output.""" + + namespace: Optional[str] = None + """The namespace of the tool that produced the output.""" + + status: Optional[Literal["in_progress", "completed", "incomplete"]] = None + """The status of the item. + + One of `in_progress`, `completed`, or `incomplete`. Populated when items are + returned via API. + """ + + +ResponseSteerInputItemList: TypeAlias = Annotated[ + Union[ResponseSteerInputItemListMessage, ResponseSteerInputItemListFunctionCallOutput], + PropertyInfo(discriminator="type"), +] ResponseSteerInput: TypeAlias = Union[str, List[ResponseSteerInputItemList]] From 728aaaa2d671d7591ea42c5f5dcb45a296c0aab0 Mon Sep 17 00:00:00 2001 From: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com> Date: Thu, 3 Sep 2026 21:39:52 +0100 Subject: [PATCH 7/8] refactor: preserve broad beta steer response model --- .../types/beta/beta_response_steer_input.py | 103 +++++++++++++++++- 1 file changed, 99 insertions(+), 4 deletions(-) diff --git a/src/openai/types/beta/beta_response_steer_input.py b/src/openai/types/beta/beta_response_steer_input.py index 8d2c7fc0f7..aac528e60b 100644 --- a/src/openai/types/beta/beta_response_steer_input.py +++ b/src/openai/types/beta/beta_response_steer_input.py @@ -1,18 +1,33 @@ # File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. from typing import List, Union, Optional -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Annotated, TypeAlias +from ..._utils import PropertyInfo from ..._models import BaseModel from .beta_response_steer_input_content import BetaResponseSteerInputContent +from .beta_response_function_call_output_item_list import BetaResponseFunctionCallOutputItemList __all__ = [ "BetaResponseSteerInput", "ResponseSteerInputItemList", "ResponseSteerInputItemListMessage", + "ResponseSteerInputItemListMessageAgent", + "ResponseSteerInputItemListFunctionCallOutput", + "ResponseSteerInputItemListFunctionCallOutputAgent", + "ResponseSteerInputItemListFunctionCallOutputCaller", + "ResponseSteerInputItemListFunctionCallOutputCallerDirect", + "ResponseSteerInputItemListFunctionCallOutputCallerProgram", ] +class ResponseSteerInputItemListMessageAgent(BaseModel): + """The agent that produced this item.""" + + agent_name: str + """The canonical name of the agent that produced this item.""" + + class ResponseSteerInputItemListMessage(BaseModel): content: Union[List[BetaResponseSteerInputContent], str] """The message content, as an array of content parts.""" @@ -20,10 +35,90 @@ class ResponseSteerInputItemListMessage(BaseModel): role: Literal["user"] """The message role. Always `user`.""" - type: Optional[Literal["message"]] = None - """The item type, when provided. Always `message`.""" + type: Literal["message"] + """The item type. Always `message`.""" + + id: Optional[str] = None + """The unique ID of this message item.""" + + agent: Optional[ResponseSteerInputItemListMessageAgent] = None + """The agent that produced this item.""" + + status: Optional[str] = None + """The status of the message item.""" + + +class ResponseSteerInputItemListFunctionCallOutputAgent(BaseModel): + """The agent that produced this item.""" + agent_name: str + """The canonical name of the agent that produced this item.""" + + +class ResponseSteerInputItemListFunctionCallOutputCallerDirect(BaseModel): + type: Literal["direct"] + """The caller type. Always `direct`.""" + + +class ResponseSteerInputItemListFunctionCallOutputCallerProgram(BaseModel): + caller_id: str + """The call ID of the program item that produced this tool call.""" + + type: Literal["program"] + """The caller type. Always `program`.""" + + +ResponseSteerInputItemListFunctionCallOutputCaller: TypeAlias = Annotated[ + Union[ + ResponseSteerInputItemListFunctionCallOutputCallerDirect, + ResponseSteerInputItemListFunctionCallOutputCallerProgram, + None, + ], + PropertyInfo(discriminator="type"), +] -ResponseSteerInputItemList: TypeAlias = ResponseSteerInputItemListMessage + +class ResponseSteerInputItemListFunctionCallOutput(BaseModel): + """The output of a function tool call.""" + + output: Union[str, BetaResponseFunctionCallOutputItemList] + """Text, image, or file output of the function tool call.""" + + type: Literal["function_call_output"] + """The type of the function tool call output. Always `function_call_output`.""" + + id: Optional[str] = None + """The unique ID of the function tool call output. + + Populated when this item is returned via API. + """ + + agent: Optional[ResponseSteerInputItemListFunctionCallOutputAgent] = None + """The agent that produced this item.""" + + call_id: Optional[str] = None + """The unique ID of the function tool call generated by the model.""" + + caller: Optional[ResponseSteerInputItemListFunctionCallOutputCaller] = None + """The execution context that produced this tool call.""" + + name: Optional[str] = None + """The name of the tool that produced the output.""" + + namespace: Optional[str] = None + """The namespace of the tool that produced the output.""" + + status: Optional[Literal["in_progress", "completed", "incomplete"]] = None + """The status of the item. + + One of `in_progress`, `completed`, or `incomplete`. Populated when items are + returned via API. + """ + + +ResponseSteerInputItemList: TypeAlias = Annotated[ + Union[ResponseSteerInputItemListMessage, ResponseSteerInputItemListFunctionCallOutput], + PropertyInfo(discriminator="type"), +] BetaResponseSteerInput: TypeAlias = Union[str, List[ResponseSteerInputItemList]] From 7abcb79cebd671cc021298bd2418af4e725edf4c Mon Sep 17 00:00:00 2001 From: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com> Date: Thu, 3 Sep 2026 21:40:19 +0100 Subject: [PATCH 8/8] test: cover steer request parameter contract --- tests/test_response_steer_input_types.py | 26 +++++++++--------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/tests/test_response_steer_input_types.py b/tests/test_response_steer_input_types.py index e391e8e97b..6d90acec7e 100644 --- a/tests/test_response_steer_input_types.py +++ b/tests/test_response_steer_input_types.py @@ -1,26 +1,20 @@ -from openai.types.beta import beta_response_steer_input as beta_steer from openai.types.beta import beta_response_steer_input_param as beta_steer_param -from openai.types.responses import response_steer_input as steer from openai.types.responses import response_steer_input_param as steer_param -def test_stable_steer_input_is_user_message_only() -> None: - message = steer.ResponseSteerInputItemListMessage.model_validate({"role": "user", "content": "continue"}) +def test_stable_steer_params_match_wire_contract() -> None: + message = steer_param.ResponseSteerInputItemListMessage - assert message.type is None - assert steer.ResponseSteerInputItemList is steer.ResponseSteerInputItemListMessage - assert set(steer_param.ResponseSteerInputItemListMessage.__required_keys__) == {"content", "role"} - assert steer_param.ResponseSteerInputItemList is steer_param.ResponseSteerInputItemListMessage - assert "ResponseSteerInputItemListFunctionCallOutput" not in steer.__all__ + assert set(message.__annotations__) == {"content", "role", "type"} + assert set(message.__required_keys__) == {"content", "role"} + assert steer_param.ResponseSteerInputItemList is message assert "ResponseSteerInputItemListFunctionCallOutput" not in steer_param.__all__ -def test_beta_steer_input_is_user_message_only() -> None: - message = beta_steer.ResponseSteerInputItemListMessage.model_validate({"role": "user", "content": "continue"}) +def test_beta_steer_params_match_wire_contract() -> None: + message = beta_steer_param.ResponseSteerInputItemListMessage - assert message.type is None - assert beta_steer.ResponseSteerInputItemList is beta_steer.ResponseSteerInputItemListMessage - assert set(beta_steer_param.ResponseSteerInputItemListMessage.__required_keys__) == {"content", "role"} - assert beta_steer_param.ResponseSteerInputItemList is beta_steer_param.ResponseSteerInputItemListMessage - assert "ResponseSteerInputItemListFunctionCallOutput" not in beta_steer.__all__ + assert set(message.__annotations__) == {"content", "role", "type"} + assert set(message.__required_keys__) == {"content", "role"} + assert beta_steer_param.ResponseSteerInputItemList is message assert "ResponseSteerInputItemListFunctionCallOutput" not in beta_steer_param.__all__