Bug Fix - Responses API, Loosen restrictions on allowed environments for computer use tool (#10168)

* loosen allowed types on ComputerToolParam

* test_basic_computer_use_preview_tool_call
This commit is contained in:
Ishaan Jaff 2025-04-19 14:40:32 -07:00 committed by GitHub
parent c80e984d7e
commit 653570824a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 111 additions and 1 deletions

View file

@ -892,6 +892,19 @@ OpenAIAudioTranscriptionOptionalParams = Literal[
OpenAIImageVariationOptionalParams = Literal["n", "size", "response_format", "user"]
class ComputerToolParam(TypedDict, total=False):
display_height: Required[float]
"""The height of the computer display."""
display_width: Required[float]
"""The width of the computer display."""
environment: Required[Union[Literal["mac", "windows", "ubuntu", "browser"], str]]
"""The type of computer environment to control."""
type: Required[Union[Literal["computer_use_preview"], str]]
class ResponsesAPIOptionalRequestParams(TypedDict, total=False):
"""TypedDict for Optional parameters supported by the responses API."""
@ -907,7 +920,7 @@ class ResponsesAPIOptionalRequestParams(TypedDict, total=False):
temperature: Optional[float]
text: Optional[ResponseTextConfigParam]
tool_choice: Optional[ToolChoice]
tools: Optional[List[ToolParam]]
tools: Optional[List[Union[ToolParam, ComputerToolParam]]]
top_p: Optional[float]
truncation: Optional[Literal["auto", "disabled"]]
user: Optional[str]