openai 4.28.4 → 4.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/README.md +7 -10
- package/index.d.mts +1 -0
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js.map +1 -1
- package/index.mjs.map +1 -1
- package/lib/AbstractAssistantStreamRunner.d.ts +74 -0
- package/lib/AbstractAssistantStreamRunner.d.ts.map +1 -0
- package/lib/AbstractAssistantStreamRunner.js +246 -0
- package/lib/AbstractAssistantStreamRunner.js.map +1 -0
- package/lib/AbstractAssistantStreamRunner.mjs +242 -0
- package/lib/AbstractAssistantStreamRunner.mjs.map +1 -0
- package/lib/AssistantStream.d.ts +56 -0
- package/lib/AssistantStream.d.ts.map +1 -0
- package/lib/AssistantStream.js +526 -0
- package/lib/AssistantStream.js.map +1 -0
- package/lib/AssistantStream.mjs +499 -0
- package/lib/AssistantStream.mjs.map +1 -0
- package/lib/ChatCompletionRunFunctions.test.js +35 -0
- package/lib/ChatCompletionRunFunctions.test.js.map +1 -1
- package/lib/ChatCompletionRunFunctions.test.mjs +35 -0
- package/lib/ChatCompletionRunFunctions.test.mjs.map +1 -1
- package/lib/ChatCompletionStream.d.ts.map +1 -1
- package/lib/ChatCompletionStream.js +21 -3
- package/lib/ChatCompletionStream.js.map +1 -1
- package/lib/ChatCompletionStream.mjs +21 -3
- package/lib/ChatCompletionStream.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/audio/speech.d.ts +3 -6
- package/resources/audio/speech.d.ts.map +1 -1
- package/resources/audio/speech.js.map +1 -1
- package/resources/audio/speech.mjs.map +1 -1
- package/resources/audio/transcriptions.d.ts +14 -4
- package/resources/audio/transcriptions.d.ts.map +1 -1
- package/resources/audio/transcriptions.js.map +1 -1
- package/resources/audio/transcriptions.mjs.map +1 -1
- package/resources/audio/translations.d.ts +2 -1
- package/resources/audio/translations.d.ts.map +1 -1
- package/resources/audio/translations.js.map +1 -1
- package/resources/audio/translations.mjs.map +1 -1
- package/resources/beta/assistants/assistants.d.ts +629 -60
- package/resources/beta/assistants/assistants.d.ts.map +1 -1
- package/resources/beta/assistants/assistants.js.map +1 -1
- package/resources/beta/assistants/assistants.mjs.map +1 -1
- package/resources/beta/assistants/index.d.ts +1 -1
- package/resources/beta/assistants/index.d.ts.map +1 -1
- package/resources/beta/assistants/index.js.map +1 -1
- package/resources/beta/assistants/index.mjs.map +1 -1
- package/resources/beta/beta.d.ts +12 -0
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/index.d.ts +2 -2
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/threads/index.d.ts +3 -3
- package/resources/beta/threads/index.d.ts.map +1 -1
- package/resources/beta/threads/index.js +2 -2
- package/resources/beta/threads/index.js.map +1 -1
- package/resources/beta/threads/index.mjs +1 -1
- package/resources/beta/threads/index.mjs.map +1 -1
- package/resources/beta/threads/messages/index.d.ts +1 -1
- package/resources/beta/threads/messages/index.d.ts.map +1 -1
- package/resources/beta/threads/messages/index.js +2 -2
- package/resources/beta/threads/messages/index.js.map +1 -1
- package/resources/beta/threads/messages/index.mjs +1 -1
- package/resources/beta/threads/messages/index.mjs.map +1 -1
- package/resources/beta/threads/messages/messages.d.ts +289 -86
- package/resources/beta/threads/messages/messages.d.ts.map +1 -1
- package/resources/beta/threads/messages/messages.js +5 -5
- package/resources/beta/threads/messages/messages.js.map +1 -1
- package/resources/beta/threads/messages/messages.mjs +3 -3
- package/resources/beta/threads/messages/messages.mjs.map +1 -1
- package/resources/beta/threads/runs/index.d.ts +2 -2
- package/resources/beta/threads/runs/index.d.ts.map +1 -1
- package/resources/beta/threads/runs/index.js.map +1 -1
- package/resources/beta/threads/runs/index.mjs.map +1 -1
- package/resources/beta/threads/runs/runs.d.ts +153 -49
- package/resources/beta/threads/runs/runs.d.ts.map +1 -1
- package/resources/beta/threads/runs/runs.js +14 -7
- package/resources/beta/threads/runs/runs.js.map +1 -1
- package/resources/beta/threads/runs/runs.mjs +14 -7
- package/resources/beta/threads/runs/runs.mjs.map +1 -1
- package/resources/beta/threads/runs/steps.d.ts +219 -5
- package/resources/beta/threads/runs/steps.d.ts.map +1 -1
- package/resources/beta/threads/runs/steps.js.map +1 -1
- package/resources/beta/threads/runs/steps.mjs.map +1 -1
- package/resources/beta/threads/threads.d.ts +144 -22
- package/resources/beta/threads/threads.d.ts.map +1 -1
- package/resources/beta/threads/threads.js +9 -4
- package/resources/beta/threads/threads.js.map +1 -1
- package/resources/beta/threads/threads.mjs +9 -4
- package/resources/beta/threads/threads.mjs.map +1 -1
- package/resources/chat/completions.d.ts +28 -18
- package/resources/chat/completions.d.ts.map +1 -1
- package/resources/chat/completions.js.map +1 -1
- package/resources/chat/completions.mjs.map +1 -1
- package/resources/completions.d.ts +2 -0
- package/resources/completions.d.ts.map +1 -1
- package/resources/completions.js.map +1 -1
- package/resources/completions.mjs.map +1 -1
- package/resources/files.d.ts +4 -4
- package/resources/images.d.ts +6 -3
- package/resources/images.d.ts.map +1 -1
- package/resources/images.js.map +1 -1
- package/resources/images.mjs.map +1 -1
- package/resources/moderations.d.ts +3 -5
- package/resources/moderations.d.ts.map +1 -1
- package/resources/moderations.js +1 -1
- package/resources/moderations.js.map +1 -1
- package/resources/moderations.mjs +1 -1
- package/resources/moderations.mjs.map +1 -1
- package/resources/shared.d.ts +6 -0
- package/resources/shared.d.ts.map +1 -1
- package/src/index.ts +1 -0
- package/src/lib/AbstractAssistantStreamRunner.ts +340 -0
- package/src/lib/AssistantStream.ts +698 -0
- package/src/lib/ChatCompletionRunFunctions.test.ts +52 -1
- package/src/lib/ChatCompletionStream.ts +29 -6
- package/src/resources/audio/speech.ts +3 -6
- package/src/resources/audio/transcriptions.ts +14 -4
- package/src/resources/audio/translations.ts +2 -1
- package/src/resources/beta/assistants/assistants.ts +768 -76
- package/src/resources/beta/assistants/index.ts +9 -0
- package/src/resources/beta/beta.ts +12 -0
- package/src/resources/beta/index.ts +12 -0
- package/src/resources/beta/threads/index.ts +30 -5
- package/src/resources/beta/threads/messages/index.ts +21 -5
- package/src/resources/beta/threads/messages/messages.ts +332 -94
- package/src/resources/beta/threads/runs/index.ts +18 -1
- package/src/resources/beta/threads/runs/runs.ts +225 -60
- package/src/resources/beta/threads/runs/steps.ts +254 -5
- package/src/resources/beta/threads/threads.ts +182 -25
- package/src/resources/chat/completions.ts +28 -18
- package/src/resources/completions.ts +2 -0
- package/src/resources/files.ts +4 -4
- package/src/resources/images.ts +6 -3
- package/src/resources/moderations.ts +3 -5
- package/src/resources/shared.ts +10 -0
- package/src/streaming.ts +31 -0
- package/src/version.ts +1 -1
- package/streaming.d.ts +2 -0
- package/streaming.d.ts.map +1 -1
- package/streaming.js +32 -1
- package/streaming.js.map +1 -1
- package/streaming.mjs +30 -0
- package/streaming.mjs.map +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -17,7 +17,7 @@ export class Messages extends APIResource {
|
|
|
17
17
|
threadId: string,
|
|
18
18
|
body: MessageCreateParams,
|
|
19
19
|
options?: Core.RequestOptions,
|
|
20
|
-
): Core.APIPromise<
|
|
20
|
+
): Core.APIPromise<Message> {
|
|
21
21
|
return this._client.post(`/threads/${threadId}/messages`, {
|
|
22
22
|
body,
|
|
23
23
|
...options,
|
|
@@ -28,11 +28,7 @@ export class Messages extends APIResource {
|
|
|
28
28
|
/**
|
|
29
29
|
* Retrieve a message.
|
|
30
30
|
*/
|
|
31
|
-
retrieve(
|
|
32
|
-
threadId: string,
|
|
33
|
-
messageId: string,
|
|
34
|
-
options?: Core.RequestOptions,
|
|
35
|
-
): Core.APIPromise<ThreadMessage> {
|
|
31
|
+
retrieve(threadId: string, messageId: string, options?: Core.RequestOptions): Core.APIPromise<Message> {
|
|
36
32
|
return this._client.get(`/threads/${threadId}/messages/${messageId}`, {
|
|
37
33
|
...options,
|
|
38
34
|
headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers },
|
|
@@ -47,7 +43,7 @@ export class Messages extends APIResource {
|
|
|
47
43
|
messageId: string,
|
|
48
44
|
body: MessageUpdateParams,
|
|
49
45
|
options?: Core.RequestOptions,
|
|
50
|
-
): Core.APIPromise<
|
|
46
|
+
): Core.APIPromise<Message> {
|
|
51
47
|
return this._client.post(`/threads/${threadId}/messages/${messageId}`, {
|
|
52
48
|
body,
|
|
53
49
|
...options,
|
|
@@ -62,17 +58,17 @@ export class Messages extends APIResource {
|
|
|
62
58
|
threadId: string,
|
|
63
59
|
query?: MessageListParams,
|
|
64
60
|
options?: Core.RequestOptions,
|
|
65
|
-
): Core.PagePromise<
|
|
66
|
-
list(threadId: string, options?: Core.RequestOptions): Core.PagePromise<
|
|
61
|
+
): Core.PagePromise<MessagesPage, Message>;
|
|
62
|
+
list(threadId: string, options?: Core.RequestOptions): Core.PagePromise<MessagesPage, Message>;
|
|
67
63
|
list(
|
|
68
64
|
threadId: string,
|
|
69
65
|
query: MessageListParams | Core.RequestOptions = {},
|
|
70
66
|
options?: Core.RequestOptions,
|
|
71
|
-
): Core.PagePromise<
|
|
67
|
+
): Core.PagePromise<MessagesPage, Message> {
|
|
72
68
|
if (isRequestOptions(query)) {
|
|
73
69
|
return this.list(threadId, {}, query);
|
|
74
70
|
}
|
|
75
|
-
return this._client.getAPIList(`/threads/${threadId}/messages`,
|
|
71
|
+
return this._client.getAPIList(`/threads/${threadId}/messages`, MessagesPage, {
|
|
76
72
|
query,
|
|
77
73
|
...options,
|
|
78
74
|
headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers },
|
|
@@ -80,129 +76,220 @@ export class Messages extends APIResource {
|
|
|
80
76
|
}
|
|
81
77
|
}
|
|
82
78
|
|
|
83
|
-
export class
|
|
79
|
+
export class MessagesPage extends CursorPage<Message> {}
|
|
84
80
|
|
|
85
81
|
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
82
|
+
* A citation within the message that points to a specific quote from a specific
|
|
83
|
+
* File associated with the assistant or the message. Generated when the assistant
|
|
84
|
+
* uses the "retrieval" tool to search files.
|
|
85
|
+
*/
|
|
86
|
+
export type Annotation = FileCitationAnnotation | FilePathAnnotation;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* A citation within the message that points to a specific quote from a specific
|
|
90
|
+
* File associated with the assistant or the message. Generated when the assistant
|
|
91
|
+
* uses the "retrieval" tool to search files.
|
|
92
|
+
*/
|
|
93
|
+
export type AnnotationDelta = FileCitationDeltaAnnotation | FilePathDeltaAnnotation;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* A citation within the message that points to a specific quote from a specific
|
|
97
|
+
* File associated with the assistant or the message. Generated when the assistant
|
|
98
|
+
* uses the "retrieval" tool to search files.
|
|
88
99
|
*/
|
|
89
|
-
export interface
|
|
90
|
-
|
|
100
|
+
export interface FileCitationAnnotation {
|
|
101
|
+
end_index: number;
|
|
102
|
+
|
|
103
|
+
file_citation: FileCitationAnnotation.FileCitation;
|
|
104
|
+
|
|
105
|
+
start_index: number;
|
|
91
106
|
|
|
92
107
|
/**
|
|
93
|
-
*
|
|
108
|
+
* The text in the message content that needs to be replaced.
|
|
94
109
|
*/
|
|
95
|
-
|
|
110
|
+
text: string;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Always `file_citation`.
|
|
114
|
+
*/
|
|
115
|
+
type: 'file_citation';
|
|
96
116
|
}
|
|
97
117
|
|
|
98
|
-
export namespace
|
|
99
|
-
export interface
|
|
118
|
+
export namespace FileCitationAnnotation {
|
|
119
|
+
export interface FileCitation {
|
|
100
120
|
/**
|
|
101
|
-
* The
|
|
102
|
-
* in the message content.
|
|
121
|
+
* The ID of the specific File the citation is from.
|
|
103
122
|
*/
|
|
104
123
|
file_id: string;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* The specific quote in the file.
|
|
127
|
+
*/
|
|
128
|
+
quote: string;
|
|
105
129
|
}
|
|
106
130
|
}
|
|
107
131
|
|
|
108
132
|
/**
|
|
109
|
-
*
|
|
133
|
+
* A citation within the message that points to a specific quote from a specific
|
|
134
|
+
* File associated with the assistant or the message. Generated when the assistant
|
|
135
|
+
* uses the "retrieval" tool to search files.
|
|
110
136
|
*/
|
|
111
|
-
export interface
|
|
112
|
-
|
|
137
|
+
export interface FileCitationDeltaAnnotation {
|
|
138
|
+
/**
|
|
139
|
+
* The index of the annotation in the text content part.
|
|
140
|
+
*/
|
|
141
|
+
index: number;
|
|
113
142
|
|
|
114
143
|
/**
|
|
115
|
-
* Always `
|
|
144
|
+
* Always `file_citation`.
|
|
116
145
|
*/
|
|
117
|
-
type: '
|
|
146
|
+
type: 'file_citation';
|
|
147
|
+
|
|
148
|
+
end_index?: number;
|
|
149
|
+
|
|
150
|
+
file_citation?: FileCitationDeltaAnnotation.FileCitation;
|
|
151
|
+
|
|
152
|
+
start_index?: number;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* The text in the message content that needs to be replaced.
|
|
156
|
+
*/
|
|
157
|
+
text?: string;
|
|
118
158
|
}
|
|
119
159
|
|
|
120
|
-
export namespace
|
|
121
|
-
export interface
|
|
122
|
-
|
|
160
|
+
export namespace FileCitationDeltaAnnotation {
|
|
161
|
+
export interface FileCitation {
|
|
162
|
+
/**
|
|
163
|
+
* The ID of the specific File the citation is from.
|
|
164
|
+
*/
|
|
165
|
+
file_id?: string;
|
|
123
166
|
|
|
124
167
|
/**
|
|
125
|
-
* The
|
|
168
|
+
* The specific quote in the file.
|
|
126
169
|
*/
|
|
127
|
-
|
|
170
|
+
quote?: string;
|
|
128
171
|
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* A URL for the file that's generated when the assistant used the
|
|
176
|
+
* `code_interpreter` tool to generate a file.
|
|
177
|
+
*/
|
|
178
|
+
export interface FilePathAnnotation {
|
|
179
|
+
end_index: number;
|
|
180
|
+
|
|
181
|
+
file_path: FilePathAnnotation.FilePath;
|
|
182
|
+
|
|
183
|
+
start_index: number;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* The text in the message content that needs to be replaced.
|
|
187
|
+
*/
|
|
188
|
+
text: string;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Always `file_path`.
|
|
192
|
+
*/
|
|
193
|
+
type: 'file_path';
|
|
194
|
+
}
|
|
129
195
|
|
|
130
|
-
|
|
196
|
+
export namespace FilePathAnnotation {
|
|
197
|
+
export interface FilePath {
|
|
131
198
|
/**
|
|
132
|
-
*
|
|
133
|
-
* File associated with the assistant or the message. Generated when the assistant
|
|
134
|
-
* uses the "retrieval" tool to search files.
|
|
199
|
+
* The ID of the file that was generated.
|
|
135
200
|
*/
|
|
136
|
-
|
|
137
|
-
|
|
201
|
+
file_id: string;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* A URL for the file that's generated when the assistant used the
|
|
207
|
+
* `code_interpreter` tool to generate a file.
|
|
208
|
+
*/
|
|
209
|
+
export interface FilePathDeltaAnnotation {
|
|
210
|
+
/**
|
|
211
|
+
* The index of the annotation in the text content part.
|
|
212
|
+
*/
|
|
213
|
+
index: number;
|
|
138
214
|
|
|
139
|
-
|
|
215
|
+
/**
|
|
216
|
+
* Always `file_path`.
|
|
217
|
+
*/
|
|
218
|
+
type: 'file_path';
|
|
140
219
|
|
|
141
|
-
|
|
220
|
+
end_index?: number;
|
|
142
221
|
|
|
143
|
-
|
|
144
|
-
* The text in the message content that needs to be replaced.
|
|
145
|
-
*/
|
|
146
|
-
text: string;
|
|
222
|
+
file_path?: FilePathDeltaAnnotation.FilePath;
|
|
147
223
|
|
|
148
|
-
|
|
149
|
-
* Always `file_citation`.
|
|
150
|
-
*/
|
|
151
|
-
type: 'file_citation';
|
|
152
|
-
}
|
|
224
|
+
start_index?: number;
|
|
153
225
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
file_id: string;
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* The specific quote in the file.
|
|
163
|
-
*/
|
|
164
|
-
quote: string;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
226
|
+
/**
|
|
227
|
+
* The text in the message content that needs to be replaced.
|
|
228
|
+
*/
|
|
229
|
+
text?: string;
|
|
230
|
+
}
|
|
167
231
|
|
|
232
|
+
export namespace FilePathDeltaAnnotation {
|
|
233
|
+
export interface FilePath {
|
|
168
234
|
/**
|
|
169
|
-
*
|
|
170
|
-
* `code_interpreter` tool to generate a file.
|
|
235
|
+
* The ID of the file that was generated.
|
|
171
236
|
*/
|
|
172
|
-
|
|
173
|
-
|
|
237
|
+
file_id?: string;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
174
240
|
|
|
175
|
-
|
|
241
|
+
export interface ImageFile {
|
|
242
|
+
/**
|
|
243
|
+
* The [File](https://platform.openai.com/docs/api-reference/files) ID of the image
|
|
244
|
+
* in the message content.
|
|
245
|
+
*/
|
|
246
|
+
file_id: string;
|
|
247
|
+
}
|
|
176
248
|
|
|
177
|
-
|
|
249
|
+
/**
|
|
250
|
+
* References an image [File](https://platform.openai.com/docs/api-reference/files)
|
|
251
|
+
* in the content of a message.
|
|
252
|
+
*/
|
|
253
|
+
export interface ImageFileContentBlock {
|
|
254
|
+
image_file: ImageFile;
|
|
178
255
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
256
|
+
/**
|
|
257
|
+
* Always `image_file`.
|
|
258
|
+
*/
|
|
259
|
+
type: 'image_file';
|
|
260
|
+
}
|
|
183
261
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
262
|
+
export interface ImageFileDelta {
|
|
263
|
+
/**
|
|
264
|
+
* The [File](https://platform.openai.com/docs/api-reference/files) ID of the image
|
|
265
|
+
* in the message content.
|
|
266
|
+
*/
|
|
267
|
+
file_id?: string;
|
|
268
|
+
}
|
|
189
269
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
270
|
+
/**
|
|
271
|
+
* References an image [File](https://platform.openai.com/docs/api-reference/files)
|
|
272
|
+
* in the content of a message.
|
|
273
|
+
*/
|
|
274
|
+
export interface ImageFileDeltaBlock {
|
|
275
|
+
/**
|
|
276
|
+
* The index of the content part in the message.
|
|
277
|
+
*/
|
|
278
|
+
index: number;
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Always `image_file`.
|
|
282
|
+
*/
|
|
283
|
+
type: 'image_file';
|
|
284
|
+
|
|
285
|
+
image_file?: ImageFileDelta;
|
|
199
286
|
}
|
|
200
287
|
|
|
201
288
|
/**
|
|
202
289
|
* Represents a message within a
|
|
203
290
|
* [thread](https://platform.openai.com/docs/api-reference/threads).
|
|
204
291
|
*/
|
|
205
|
-
export interface
|
|
292
|
+
export interface Message {
|
|
206
293
|
/**
|
|
207
294
|
* The identifier, which can be referenced in API endpoints.
|
|
208
295
|
*/
|
|
@@ -215,10 +302,15 @@ export interface ThreadMessage {
|
|
|
215
302
|
*/
|
|
216
303
|
assistant_id: string | null;
|
|
217
304
|
|
|
305
|
+
/**
|
|
306
|
+
* The Unix timestamp (in seconds) for when the message was completed.
|
|
307
|
+
*/
|
|
308
|
+
completed_at: number | null;
|
|
309
|
+
|
|
218
310
|
/**
|
|
219
311
|
* The content of the message in array of text and/or images.
|
|
220
312
|
*/
|
|
221
|
-
content: Array<
|
|
313
|
+
content: Array<MessageContent>;
|
|
222
314
|
|
|
223
315
|
/**
|
|
224
316
|
* The Unix timestamp (in seconds) for when the message was created.
|
|
@@ -232,6 +324,16 @@ export interface ThreadMessage {
|
|
|
232
324
|
*/
|
|
233
325
|
file_ids: Array<string>;
|
|
234
326
|
|
|
327
|
+
/**
|
|
328
|
+
* The Unix timestamp (in seconds) for when the message was marked as incomplete.
|
|
329
|
+
*/
|
|
330
|
+
incomplete_at: number | null;
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* On an incomplete message, details about why the message is incomplete.
|
|
334
|
+
*/
|
|
335
|
+
incomplete_details: Message.IncompleteDetails | null;
|
|
336
|
+
|
|
235
337
|
/**
|
|
236
338
|
* Set of 16 key-value pairs that can be attached to an object. This can be useful
|
|
237
339
|
* for storing additional information about the object in a structured format. Keys
|
|
@@ -257,6 +359,12 @@ export interface ThreadMessage {
|
|
|
257
359
|
*/
|
|
258
360
|
run_id: string | null;
|
|
259
361
|
|
|
362
|
+
/**
|
|
363
|
+
* The status of the message, which can be either `in_progress`, `incomplete`, or
|
|
364
|
+
* `completed`.
|
|
365
|
+
*/
|
|
366
|
+
status: 'in_progress' | 'incomplete' | 'completed';
|
|
367
|
+
|
|
260
368
|
/**
|
|
261
369
|
* The [thread](https://platform.openai.com/docs/api-reference/threads) ID that
|
|
262
370
|
* this message belongs to.
|
|
@@ -264,7 +372,31 @@ export interface ThreadMessage {
|
|
|
264
372
|
thread_id: string;
|
|
265
373
|
}
|
|
266
374
|
|
|
267
|
-
export
|
|
375
|
+
export namespace Message {
|
|
376
|
+
/**
|
|
377
|
+
* On an incomplete message, details about why the message is incomplete.
|
|
378
|
+
*/
|
|
379
|
+
export interface IncompleteDetails {
|
|
380
|
+
/**
|
|
381
|
+
* The reason the message is incomplete.
|
|
382
|
+
*/
|
|
383
|
+
reason: 'content_filter' | 'max_tokens' | 'run_cancelled' | 'run_expired' | 'run_failed';
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* References an image [File](https://platform.openai.com/docs/api-reference/files)
|
|
389
|
+
* in the content of a message.
|
|
390
|
+
*/
|
|
391
|
+
export type MessageContent = ImageFileContentBlock | TextContentBlock;
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* References an image [File](https://platform.openai.com/docs/api-reference/files)
|
|
395
|
+
* in the content of a message.
|
|
396
|
+
*/
|
|
397
|
+
export type MessageContentDelta = ImageFileDeltaBlock | TextDeltaBlock;
|
|
398
|
+
|
|
399
|
+
export interface MessageDeleted {
|
|
268
400
|
id: string;
|
|
269
401
|
|
|
270
402
|
deleted: boolean;
|
|
@@ -272,6 +404,96 @@ export interface ThreadMessageDeleted {
|
|
|
272
404
|
object: 'thread.message.deleted';
|
|
273
405
|
}
|
|
274
406
|
|
|
407
|
+
/**
|
|
408
|
+
* The delta containing the fields that have changed on the Message.
|
|
409
|
+
*/
|
|
410
|
+
export interface MessageDelta {
|
|
411
|
+
/**
|
|
412
|
+
* The content of the message in array of text and/or images.
|
|
413
|
+
*/
|
|
414
|
+
content?: Array<MessageContentDelta>;
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* A list of [file](https://platform.openai.com/docs/api-reference/files) IDs that
|
|
418
|
+
* the assistant should use. Useful for tools like retrieval and code_interpreter
|
|
419
|
+
* that can access files. A maximum of 10 files can be attached to a message.
|
|
420
|
+
*/
|
|
421
|
+
file_ids?: Array<string>;
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* The entity that produced the message. One of `user` or `assistant`.
|
|
425
|
+
*/
|
|
426
|
+
role?: 'user' | 'assistant';
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Represents a message delta i.e. any changed fields on a message during
|
|
431
|
+
* streaming.
|
|
432
|
+
*/
|
|
433
|
+
export interface MessageDeltaEvent {
|
|
434
|
+
/**
|
|
435
|
+
* The identifier of the message, which can be referenced in API endpoints.
|
|
436
|
+
*/
|
|
437
|
+
id: string;
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* The delta containing the fields that have changed on the Message.
|
|
441
|
+
*/
|
|
442
|
+
delta: MessageDelta;
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* The object type, which is always `thread.message.delta`.
|
|
446
|
+
*/
|
|
447
|
+
object: 'thread.message.delta';
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
export interface Text {
|
|
451
|
+
annotations: Array<Annotation>;
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* The data that makes up the text.
|
|
455
|
+
*/
|
|
456
|
+
value: string;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* The text content that is part of a message.
|
|
461
|
+
*/
|
|
462
|
+
export interface TextContentBlock {
|
|
463
|
+
text: Text;
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Always `text`.
|
|
467
|
+
*/
|
|
468
|
+
type: 'text';
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
export interface TextDelta {
|
|
472
|
+
annotations?: Array<AnnotationDelta>;
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* The data that makes up the text.
|
|
476
|
+
*/
|
|
477
|
+
value?: string;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* The text content that is part of a message.
|
|
482
|
+
*/
|
|
483
|
+
export interface TextDeltaBlock {
|
|
484
|
+
/**
|
|
485
|
+
* The index of the content part in the message.
|
|
486
|
+
*/
|
|
487
|
+
index: number;
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* Always `text`.
|
|
491
|
+
*/
|
|
492
|
+
type: 'text';
|
|
493
|
+
|
|
494
|
+
text?: TextDelta;
|
|
495
|
+
}
|
|
496
|
+
|
|
275
497
|
export interface MessageCreateParams {
|
|
276
498
|
/**
|
|
277
499
|
* The content of the message.
|
|
@@ -328,11 +550,27 @@ export interface MessageListParams extends CursorPageParams {
|
|
|
328
550
|
}
|
|
329
551
|
|
|
330
552
|
export namespace Messages {
|
|
331
|
-
export import
|
|
332
|
-
export import
|
|
333
|
-
export import
|
|
334
|
-
export import
|
|
335
|
-
export import
|
|
553
|
+
export import Annotation = MessagesAPI.Annotation;
|
|
554
|
+
export import AnnotationDelta = MessagesAPI.AnnotationDelta;
|
|
555
|
+
export import FileCitationAnnotation = MessagesAPI.FileCitationAnnotation;
|
|
556
|
+
export import FileCitationDeltaAnnotation = MessagesAPI.FileCitationDeltaAnnotation;
|
|
557
|
+
export import FilePathAnnotation = MessagesAPI.FilePathAnnotation;
|
|
558
|
+
export import FilePathDeltaAnnotation = MessagesAPI.FilePathDeltaAnnotation;
|
|
559
|
+
export import ImageFile = MessagesAPI.ImageFile;
|
|
560
|
+
export import ImageFileContentBlock = MessagesAPI.ImageFileContentBlock;
|
|
561
|
+
export import ImageFileDelta = MessagesAPI.ImageFileDelta;
|
|
562
|
+
export import ImageFileDeltaBlock = MessagesAPI.ImageFileDeltaBlock;
|
|
563
|
+
export import Message = MessagesAPI.Message;
|
|
564
|
+
export import MessageContent = MessagesAPI.MessageContent;
|
|
565
|
+
export import MessageContentDelta = MessagesAPI.MessageContentDelta;
|
|
566
|
+
export import MessageDeleted = MessagesAPI.MessageDeleted;
|
|
567
|
+
export import MessageDelta = MessagesAPI.MessageDelta;
|
|
568
|
+
export import MessageDeltaEvent = MessagesAPI.MessageDeltaEvent;
|
|
569
|
+
export import Text = MessagesAPI.Text;
|
|
570
|
+
export import TextContentBlock = MessagesAPI.TextContentBlock;
|
|
571
|
+
export import TextDelta = MessagesAPI.TextDelta;
|
|
572
|
+
export import TextDeltaBlock = MessagesAPI.TextDeltaBlock;
|
|
573
|
+
export import MessagesPage = MessagesAPI.MessagesPage;
|
|
336
574
|
export import MessageCreateParams = MessagesAPI.MessageCreateParams;
|
|
337
575
|
export import MessageUpdateParams = MessagesAPI.MessageUpdateParams;
|
|
338
576
|
export import MessageListParams = MessagesAPI.MessageListParams;
|
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
|
|
3
3
|
export {
|
|
4
|
-
|
|
4
|
+
CodeInterpreterLogs,
|
|
5
|
+
CodeInterpreterOutputImage,
|
|
6
|
+
CodeInterpreterToolCall,
|
|
7
|
+
CodeInterpreterToolCallDelta,
|
|
5
8
|
FunctionToolCall,
|
|
9
|
+
FunctionToolCallDelta,
|
|
6
10
|
MessageCreationStepDetails,
|
|
7
11
|
RetrievalToolCall,
|
|
12
|
+
RetrievalToolCallDelta,
|
|
8
13
|
RunStep,
|
|
14
|
+
RunStepDelta,
|
|
15
|
+
RunStepDeltaEvent,
|
|
16
|
+
RunStepDeltaMessageDelta,
|
|
17
|
+
ToolCall,
|
|
18
|
+
ToolCallDelta,
|
|
19
|
+
ToolCallDeltaObject,
|
|
9
20
|
ToolCallsStepDetails,
|
|
10
21
|
StepListParams,
|
|
11
22
|
RunStepsPage,
|
|
@@ -16,9 +27,15 @@ export {
|
|
|
16
27
|
Run,
|
|
17
28
|
RunStatus,
|
|
18
29
|
RunCreateParams,
|
|
30
|
+
RunCreateParamsNonStreaming,
|
|
31
|
+
RunCreateParamsStreaming,
|
|
19
32
|
RunUpdateParams,
|
|
20
33
|
RunListParams,
|
|
34
|
+
RunCreateAndStreamParams,
|
|
21
35
|
RunSubmitToolOutputsParams,
|
|
36
|
+
RunSubmitToolOutputsParamsNonStreaming,
|
|
37
|
+
RunSubmitToolOutputsParamsStreaming,
|
|
38
|
+
RunSubmitToolOutputsStreamParams,
|
|
22
39
|
RunsPage,
|
|
23
40
|
Runs,
|
|
24
41
|
} from './runs';
|