Skip to content

Commit 63c98c8

Browse files
feat(api): type updates for conversations, reasoning_effort and results for evals
1 parent 3c68957 commit 63c98c8

File tree

6 files changed

+193
-216
lines changed

6 files changed

+193
-216
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 118
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-d30ff992a48873c1466c49f3c01f2ec8933faebff23424748f8d056065b1bcef.yml
3-
openapi_spec_hash: e933ec43b46f45c348adb78840e5808d
4-
config_hash: bf45940f0a7805b4ec2017eecdd36893
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-380330a93b5d010391ca3b36ea193c5353b0dfdf2ddd02789ef84a84ce427e82.yml
3+
openapi_spec_hash: 859703234259ecdd2a3c6f4de88eb504
4+
config_hash: b619b45c1e7facf819f902dee8fa4f97

api.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -896,22 +896,17 @@ Methods:
896896
Types:
897897

898898
- <code><a href="./src/resources/conversations/conversations.ts">ComputerScreenshotContent</a></code>
899-
- <code><a href="./src/resources/conversations/conversations.ts">ContainerFileCitationBody</a></code>
900899
- <code><a href="./src/resources/conversations/conversations.ts">Conversation</a></code>
901900
- <code><a href="./src/resources/conversations/conversations.ts">ConversationDeleted</a></code>
902901
- <code><a href="./src/resources/conversations/conversations.ts">ConversationDeletedResource</a></code>
903-
- <code><a href="./src/resources/conversations/conversations.ts">FileCitationBody</a></code>
904-
- <code><a href="./src/resources/conversations/conversations.ts">InputFileContent</a></code>
905-
- <code><a href="./src/resources/conversations/conversations.ts">InputImageContent</a></code>
906-
- <code><a href="./src/resources/conversations/conversations.ts">InputTextContent</a></code>
907-
- <code><a href="./src/resources/conversations/conversations.ts">LobProb</a></code>
908902
- <code><a href="./src/resources/conversations/conversations.ts">Message</a></code>
909-
- <code><a href="./src/resources/conversations/conversations.ts">OutputTextContent</a></code>
910-
- <code><a href="./src/resources/conversations/conversations.ts">RefusalContent</a></code>
911903
- <code><a href="./src/resources/conversations/conversations.ts">SummaryTextContent</a></code>
912904
- <code><a href="./src/resources/conversations/conversations.ts">TextContent</a></code>
913-
- <code><a href="./src/resources/conversations/conversations.ts">TopLogProb</a></code>
914-
- <code><a href="./src/resources/conversations/conversations.ts">URLCitationBody</a></code>
905+
- <code><a href="./src/resources/conversations/conversations.ts">InputTextContent</a></code>
906+
- <code><a href="./src/resources/conversations/conversations.ts">OutputTextContent</a></code>
907+
- <code><a href="./src/resources/conversations/conversations.ts">RefusalContent</a></code>
908+
- <code><a href="./src/resources/conversations/conversations.ts">InputImageContent</a></code>
909+
- <code><a href="./src/resources/conversations/conversations.ts">InputFileContent</a></code>
915910

916911
Methods:
917912

src/resources/conversations/conversations.ts

Lines changed: 27 additions & 198 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ export class Conversations extends APIResource {
5454
}
5555
}
5656

57+
/**
58+
* A screenshot of a computer.
59+
*/
5760
export interface ComputerScreenshotContent {
5861
/**
5962
* The identifier of an uploaded file that contains the screenshot.
@@ -72,38 +75,6 @@ export interface ComputerScreenshotContent {
7275
type: 'computer_screenshot';
7376
}
7477

75-
export interface ContainerFileCitationBody {
76-
/**
77-
* The ID of the container file.
78-
*/
79-
container_id: string;
80-
81-
/**
82-
* The index of the last character of the container file citation in the message.
83-
*/
84-
end_index: number;
85-
86-
/**
87-
* The ID of the file.
88-
*/
89-
file_id: string;
90-
91-
/**
92-
* The filename of the container file cited.
93-
*/
94-
filename: string;
95-
96-
/**
97-
* The index of the first character of the container file citation in the message.
98-
*/
99-
start_index: number;
100-
101-
/**
102-
* The type of the container file citation. Always `container_file_citation`.
103-
*/
104-
type: 'container_file_citation';
105-
}
106-
10778
export interface Conversation {
10879
/**
10980
* The unique ID of the conversation.
@@ -147,96 +118,9 @@ export interface ConversationDeletedResource {
147118
object: 'conversation.deleted';
148119
}
149120

150-
export interface FileCitationBody {
151-
/**
152-
* The ID of the file.
153-
*/
154-
file_id: string;
155-
156-
/**
157-
* The filename of the file cited.
158-
*/
159-
filename: string;
160-
161-
/**
162-
* The index of the file in the list of files.
163-
*/
164-
index: number;
165-
166-
/**
167-
* The type of the file citation. Always `file_citation`.
168-
*/
169-
type: 'file_citation';
170-
}
171-
172-
export interface InputFileContent {
173-
/**
174-
* The ID of the file to be sent to the model.
175-
*/
176-
file_id: string | null;
177-
178-
/**
179-
* The type of the input item. Always `input_file`.
180-
*/
181-
type: 'input_file';
182-
183-
/**
184-
* The URL of the file to be sent to the model.
185-
*/
186-
file_url?: string;
187-
188-
/**
189-
* The name of the file to be sent to the model.
190-
*/
191-
filename?: string;
192-
}
193-
194-
export interface InputImageContent {
195-
/**
196-
* The detail level of the image to be sent to the model. One of `high`, `low`, or
197-
* `auto`. Defaults to `auto`.
198-
*/
199-
detail: 'low' | 'high' | 'auto';
200-
201-
/**
202-
* The ID of the file to be sent to the model.
203-
*/
204-
file_id: string | null;
205-
206-
/**
207-
* The URL of the image to be sent to the model. A fully qualified URL or base64
208-
* encoded image in a data URL.
209-
*/
210-
image_url: string | null;
211-
212-
/**
213-
* The type of the input item. Always `input_image`.
214-
*/
215-
type: 'input_image';
216-
}
217-
218-
export interface InputTextContent {
219-
/**
220-
* The text input to the model.
221-
*/
222-
text: string;
223-
224-
/**
225-
* The type of the input item. Always `input_text`.
226-
*/
227-
type: 'input_text';
228-
}
229-
230-
export interface LobProb {
231-
token: string;
232-
233-
bytes: Array<number>;
234-
235-
logprob: number;
236-
237-
top_logprobs: Array<TopLogProb>;
238-
}
239-
121+
/**
122+
* A message to or from the model.
123+
*/
240124
export interface Message {
241125
/**
242126
* The unique ID of the message.
@@ -247,14 +131,14 @@ export interface Message {
247131
* The content of the message
248132
*/
249133
content: Array<
250-
| InputTextContent
251-
| OutputTextContent
134+
| ResponsesAPI.ResponseInputText
135+
| ResponsesAPI.ResponseOutputText
252136
| TextContent
253137
| SummaryTextContent
254-
| RefusalContent
255-
| InputImageContent
138+
| ResponsesAPI.ResponseOutputRefusal
139+
| ResponsesAPI.ResponseInputImage
256140
| ComputerScreenshotContent
257-
| InputFileContent
141+
| ResponsesAPI.ResponseInputFile
258142
>;
259143

260144
/**
@@ -275,83 +159,33 @@ export interface Message {
275159
type: 'message';
276160
}
277161

278-
export interface OutputTextContent {
279-
/**
280-
* The annotations of the text output.
281-
*/
282-
annotations: Array<FileCitationBody | URLCitationBody | ContainerFileCitationBody>;
283-
284-
/**
285-
* The text output from the model.
286-
*/
287-
text: string;
288-
289-
/**
290-
* The type of the output text. Always `output_text`.
291-
*/
292-
type: 'output_text';
293-
294-
logprobs?: Array<LobProb>;
295-
}
296-
297-
export interface RefusalContent {
298-
/**
299-
* The refusal explanation from the model.
300-
*/
301-
refusal: string;
302-
303-
/**
304-
* The type of the refusal. Always `refusal`.
305-
*/
306-
type: 'refusal';
307-
}
308-
162+
/**
163+
* A summary text from the model.
164+
*/
309165
export interface SummaryTextContent {
310166
text: string;
311167

312168
type: 'summary_text';
313169
}
314170

171+
/**
172+
* A text content.
173+
*/
315174
export interface TextContent {
316175
text: string;
317176

318177
type: 'text';
319178
}
320179

321-
export interface TopLogProb {
322-
token: string;
180+
export type InputTextContent = ResponsesAPI.ResponseInputText;
323181

324-
bytes: Array<number>;
182+
export type OutputTextContent = ResponsesAPI.ResponseOutputText;
325183

326-
logprob: number;
327-
}
184+
export type RefusalContent = ResponsesAPI.ResponseOutputRefusal;
328185

329-
export interface URLCitationBody {
330-
/**
331-
* The index of the last character of the URL citation in the message.
332-
*/
333-
end_index: number;
186+
export type InputImageContent = ResponsesAPI.ResponseInputImage;
334187

335-
/**
336-
* The index of the first character of the URL citation in the message.
337-
*/
338-
start_index: number;
339-
340-
/**
341-
* The title of the web resource.
342-
*/
343-
title: string;
344-
345-
/**
346-
* The type of the URL citation. Always `url_citation`.
347-
*/
348-
type: 'url_citation';
349-
350-
/**
351-
* The URL of the web resource.
352-
*/
353-
url: string;
354-
}
188+
export type InputFileContent = ResponsesAPI.ResponseInputFile;
355189

356190
export interface ConversationCreateParams {
357191
/**
@@ -387,22 +221,17 @@ Conversations.Items = Items;
387221
export declare namespace Conversations {
388222
export {
389223
type ComputerScreenshotContent as ComputerScreenshotContent,
390-
type ContainerFileCitationBody as ContainerFileCitationBody,
391224
type Conversation as Conversation,
392225
type ConversationDeleted as ConversationDeleted,
393226
type ConversationDeletedResource as ConversationDeletedResource,
394-
type FileCitationBody as FileCitationBody,
395-
type InputFileContent as InputFileContent,
396-
type InputImageContent as InputImageContent,
397-
type InputTextContent as InputTextContent,
398-
type LobProb as LobProb,
399227
type Message as Message,
400-
type OutputTextContent as OutputTextContent,
401-
type RefusalContent as RefusalContent,
402228
type SummaryTextContent as SummaryTextContent,
403229
type TextContent as TextContent,
404-
type TopLogProb as TopLogProb,
405-
type URLCitationBody as URLCitationBody,
230+
type InputTextContent as InputTextContent,
231+
type OutputTextContent as OutputTextContent,
232+
type RefusalContent as RefusalContent,
233+
type InputImageContent as InputImageContent,
234+
type InputFileContent as InputFileContent,
406235
type ConversationCreateParams as ConversationCreateParams,
407236
type ConversationUpdateParams as ConversationUpdateParams,
408237
};

0 commit comments

Comments
 (0)