@@ -77,9 +77,10 @@ response = client.responses.create(
77
77
input = [
78
78
{
79
79
" role" : " user" ,
80
- " content" : " Check the latest OpenAI news on bing.com."
80
+ " content" : " Check the latest AI news on bing.com."
81
81
}
82
- ]
82
+ ],
83
+ truncation = " auto"
83
84
)
84
85
85
86
print (response.output)
@@ -90,11 +91,11 @@ print(response.output)
90
91
``` console
91
92
[
92
93
ResponseComputerToolCall(
93
- id='comp_xxxxxxxxxxxxxxxxxxxxxxxxxxxx ',
94
+ id='cu_67d841873c1081908bfc88b90a8555e0 ',
94
95
action=ActionScreenshot(type='screenshot'),
95
- call_id=None ,
96
- pending_safety_checks=None ,
97
- status=None ,
96
+ call_id='call_wwEnfFDqQr1Z4Edk62Fyo7Nh' ,
97
+ pending_safety_checks=[] ,
98
+ status='completed' ,
98
99
type='computer_call'
99
100
)
100
101
]
@@ -112,58 +113,81 @@ curl ${MY_ENDPOINT}/openai/responses?api-version=2025-03-01-preview \
112
113
{
113
114
"type": "message",
114
115
"role": "user",
115
- "content": "Search Bing for the latest news in AI."
116
- },
117
- "tools": [{
116
+ "content": "Check the latest AI news on bing.com."
117
+ }
118
+ ],
119
+ "tools": [{
118
120
"type": "computer-preview",
119
121
"display_width": 1024,
120
122
"display_height": 768,
121
- "environment": "browser" # other possible values: "mac", "windows", "ubuntu"
122
- }]
123
- ]
123
+ "environment": "browser"
124
+ }],
125
+ "truncation":"auto"
124
126
}'
125
127
```
126
128
127
129
### Output
128
130
129
131
``` json
130
132
{
131
- "id" : " resp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx " ,
133
+ "id" : " resp_xxxxxxxxxxxxxxxxxxxxxxxx " ,
132
134
"object" : " response" ,
133
- "created_at" : 1741716005 ,
135
+ "created_at" : 1742227653 ,
134
136
"status" : " completed" ,
135
- "model" : " computer-use-preview-2025-02-11" ,
136
- "previous_response_id" : null ,
137
+ "error" : null ,
138
+ "incomplete_details" : null ,
139
+ "instructions" : null ,
140
+ "max_output_tokens" : null ,
141
+ "model" : " computer-use-preview" ,
137
142
"output" : [
138
143
{
139
144
"type" : " computer_call" ,
140
- "id" : " comp_xxxxxxxxxxxxxxxxxxxx" ,
145
+ "id" : " cu_xxxxxxxxxxxxxxxxxxxxxxxxxx" ,
146
+ "call_id" : " call_xxxxxxxxxxxxxxxxxxxxxxx" ,
141
147
"action" : {
142
148
"type" : " screenshot"
143
- }
149
+ },
150
+ "pending_safety_checks" : [],
151
+ "status" : " completed"
144
152
}
145
153
],
146
- "error" : null ,
154
+ "parallel_tool_calls" : true ,
155
+ "previous_response_id" : null ,
156
+ "reasoning" : {
157
+ "effort" : " medium" ,
158
+ "generate_summary" : null
159
+ },
160
+ "store" : true ,
161
+ "temperature" : 1.0 ,
162
+ "text" : {
163
+ "format" : {
164
+ "type" : " text"
165
+ }
166
+ },
147
167
"tools" : [
148
168
{
149
- "type" : " computer-preview " ,
150
- "environment " : " browser " ,
169
+ "type" : " computer_use_preview " ,
170
+ "display_height " : 768 ,
151
171
"display_width" : 1024 ,
152
- "display_height " : 768
172
+ "environment " : " browser "
153
173
}
154
174
],
155
175
"top_p" : 1.0 ,
156
- "temperature" : 1.0 ,
157
- "reasoning_effort" : null ,
176
+ "truncation" : " auto" ,
158
177
"usage" : {
159
- "input_tokens" : 510 ,
178
+ "input_tokens" : 519 ,
179
+ "input_tokens_details" : {
180
+ "cached_tokens" : 0
181
+ },
160
182
"output_tokens" : 7 ,
161
- "total_tokens" : 517 ,
162
183
"output_tokens_details" : {
163
184
"reasoning_tokens" : 0
164
- }
185
+ },
186
+ "total_tokens" : 526
165
187
},
188
+ "user" : null ,
166
189
"metadata" : {}
190
+ }
167
191
```
168
192
169
193
---
@@ -207,7 +231,8 @@ response_2 = client.responses.create(
207
231
" image_url" : f " data:image/png;base64, { < base64_string> } "
208
232
}
209
233
}
210
- ]
234
+ ],
235
+ truncation = " auto"
211
236
)
212
237
```
213
238
@@ -235,7 +260,8 @@ curl ${MY_ENDPOINT}/openai/responses?api-version=2025-03-01-preview \
235
260
"image_url": "<base64_string>"
236
261
}
237
262
}
238
- ]
263
+ ],
264
+ "truncation":"auto"
239
265
}'
240
266
```
241
267
0 commit comments