openai 4.70.2 → 4.71.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 +16 -0
- package/index.d.mts +2 -2
- package/index.d.ts +2 -2
- package/index.d.ts.map +1 -1
- package/index.js.map +1 -1
- package/index.mjs.map +1 -1
- package/lib/AbstractChatCompletionRunner.d.ts +3 -3
- package/lib/AbstractChatCompletionRunner.d.ts.map +1 -1
- package/lib/AbstractChatCompletionRunner.js +2 -2
- package/lib/AbstractChatCompletionRunner.js.map +1 -1
- package/lib/AbstractChatCompletionRunner.mjs +2 -2
- package/lib/AbstractChatCompletionRunner.mjs.map +1 -1
- package/lib/AssistantStream.d.ts +8 -8
- package/lib/AssistantStream.d.ts.map +1 -1
- package/lib/AssistantStream.js +3 -3
- package/lib/AssistantStream.js.map +1 -1
- package/lib/AssistantStream.mjs +3 -3
- package/lib/AssistantStream.mjs.map +1 -1
- package/lib/ChatCompletionRunner.d.ts +3 -3
- package/lib/ChatCompletionRunner.d.ts.map +1 -1
- package/lib/ChatCompletionStream.d.ts +5 -5
- package/lib/ChatCompletionStream.d.ts.map +1 -1
- package/lib/ChatCompletionStream.js +3 -3
- package/lib/ChatCompletionStream.js.map +1 -1
- package/lib/ChatCompletionStream.mjs +3 -3
- package/lib/ChatCompletionStream.mjs.map +1 -1
- package/lib/ChatCompletionStreamingRunner.d.ts +4 -4
- package/lib/ChatCompletionStreamingRunner.d.ts.map +1 -1
- package/lib/EventStream.d.ts +1 -1
- package/lib/EventStream.d.ts.map +1 -1
- package/lib/EventStream.js +1 -1
- package/lib/EventStream.js.map +1 -1
- package/lib/EventStream.mjs +1 -1
- package/lib/EventStream.mjs.map +1 -1
- package/lib/chatCompletionUtils.d.ts +1 -1
- package/lib/chatCompletionUtils.d.ts.map +1 -1
- package/lib/parser.js +1 -1
- package/lib/parser.js.map +1 -1
- package/lib/parser.mjs +1 -1
- package/lib/parser.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/audio/speech.d.ts +2 -2
- package/resources/audio/transcriptions.d.ts +1 -1
- package/resources/audio/translations.d.ts +1 -1
- package/resources/beta/assistants.d.ts +18 -18
- package/resources/beta/threads/messages.d.ts +2 -2
- package/resources/beta/threads/runs/runs.d.ts +9 -9
- package/resources/beta/threads/runs/steps.d.ts +4 -4
- package/resources/beta/threads/threads.d.ts +5 -5
- package/resources/beta/vector-stores/file-batches.d.ts +2 -2
- package/resources/beta/vector-stores/files.d.ts +2 -2
- package/resources/beta/vector-stores/vector-stores.d.ts +2 -2
- package/resources/chat/chat.d.ts +2 -2
- package/resources/chat/chat.d.ts.map +1 -1
- package/resources/chat/chat.js.map +1 -1
- package/resources/chat/chat.mjs.map +1 -1
- package/resources/chat/completions.d.ts +32 -10
- package/resources/chat/completions.d.ts.map +1 -1
- package/resources/chat/index.d.ts +1 -1
- package/resources/chat/index.d.ts.map +1 -1
- package/resources/chat/index.js.map +1 -1
- package/resources/chat/index.mjs.map +1 -1
- package/resources/completions.d.ts +17 -5
- package/resources/completions.d.ts.map +1 -1
- package/resources/embeddings.d.ts +3 -3
- package/resources/files.d.ts +9 -7
- package/resources/files.d.ts.map +1 -1
- package/resources/files.js +1 -4
- package/resources/files.js.map +1 -1
- package/resources/files.mjs +2 -5
- package/resources/files.mjs.map +1 -1
- package/resources/fine-tuning/jobs/jobs.d.ts +1 -1
- package/resources/images.d.ts +3 -3
- package/resources/moderations.d.ts +1 -1
- package/resources/uploads/uploads.d.ts +1 -1
- package/resources/uploads/uploads.js +1 -1
- package/resources/uploads/uploads.mjs +1 -1
- package/src/index.ts +2 -0
- package/src/lib/AbstractChatCompletionRunner.ts +5 -5
- package/src/lib/AssistantStream.ts +13 -13
- package/src/lib/ChatCompletionRunner.ts +3 -3
- package/src/lib/ChatCompletionStream.ts +8 -8
- package/src/lib/ChatCompletionStreamingRunner.ts +4 -4
- package/src/lib/EventStream.ts +1 -1
- package/src/lib/chatCompletionUtils.ts +1 -1
- package/src/lib/parser.ts +1 -1
- package/src/resources/audio/speech.ts +2 -2
- package/src/resources/audio/transcriptions.ts +1 -1
- package/src/resources/audio/translations.ts +1 -1
- package/src/resources/beta/assistants.ts +18 -18
- package/src/resources/beta/threads/messages.ts +2 -2
- package/src/resources/beta/threads/runs/runs.ts +9 -9
- package/src/resources/beta/threads/runs/steps.ts +4 -4
- package/src/resources/beta/threads/threads.ts +5 -5
- package/src/resources/beta/vector-stores/file-batches.ts +2 -2
- package/src/resources/beta/vector-stores/files.ts +2 -2
- package/src/resources/beta/vector-stores/vector-stores.ts +2 -2
- package/src/resources/chat/chat.ts +2 -0
- package/src/resources/chat/completions.ts +35 -9
- package/src/resources/chat/index.ts +1 -0
- package/src/resources/completions.ts +19 -5
- package/src/resources/embeddings.ts +3 -3
- package/src/resources/files.ts +10 -7
- package/src/resources/fine-tuning/jobs/jobs.ts +1 -1
- package/src/resources/images.ts +3 -3
- package/src/resources/moderations.ts +1 -1
- package/src/resources/uploads/uploads.ts +1 -1
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"completions.d.ts","sourceRoot":"","sources":["../src/resources/completions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAChC,OAAO,KAAK,cAAc,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,kBAAkB,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,kCAAkC,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC;IACvG,MAAM,C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AA+B,IAAI,+BAA+B,GACxE,CAAC;CACH"}
|
|
@@ -74,8 +74,8 @@ export interface EmbeddingCreateParams {
|
|
|
74
74
|
* ID of the model to use. You can use the
|
|
75
75
|
* [List models](https://platform.openai.com/docs/api-reference/models/list) API to
|
|
76
76
|
* see all of your available models, or see our
|
|
77
|
-
* [Model overview](https://platform.openai.com/docs/models
|
|
78
|
-
*
|
|
77
|
+
* [Model overview](https://platform.openai.com/docs/models) for descriptions of
|
|
78
|
+
* them.
|
|
79
79
|
*/
|
|
80
80
|
model: (string & {}) | EmbeddingModel;
|
|
81
81
|
/**
|
|
@@ -91,7 +91,7 @@ export interface EmbeddingCreateParams {
|
|
|
91
91
|
/**
|
|
92
92
|
* A unique identifier representing your end-user, which can help OpenAI to monitor
|
|
93
93
|
* and detect abuse.
|
|
94
|
-
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices
|
|
94
|
+
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).
|
|
95
95
|
*/
|
|
96
96
|
user?: string;
|
|
97
97
|
}
|
package/resources/files.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { APIResource } from "../resource.js";
|
|
2
2
|
import * as Core from "../core.js";
|
|
3
|
-
import {
|
|
3
|
+
import { CursorPage, type CursorPageParams } from "../pagination.js";
|
|
4
4
|
import { type Response } from "../_shims/index.js";
|
|
5
5
|
export declare class Files extends APIResource {
|
|
6
6
|
/**
|
|
@@ -32,7 +32,7 @@ export declare class Files extends APIResource {
|
|
|
32
32
|
*/
|
|
33
33
|
retrieve(fileId: string, options?: Core.RequestOptions): Core.APIPromise<FileObject>;
|
|
34
34
|
/**
|
|
35
|
-
* Returns a list of files
|
|
35
|
+
* Returns a list of files.
|
|
36
36
|
*/
|
|
37
37
|
list(query?: FileListParams, options?: Core.RequestOptions): Core.PagePromise<FileObjectsPage, FileObject>;
|
|
38
38
|
list(options?: Core.RequestOptions): Core.PagePromise<FileObjectsPage, FileObject>;
|
|
@@ -58,10 +58,7 @@ export declare class Files extends APIResource {
|
|
|
58
58
|
maxWait?: number;
|
|
59
59
|
}): Promise<FileObject>;
|
|
60
60
|
}
|
|
61
|
-
|
|
62
|
-
* Note: no pagination actually occurs yet, this is for forwards-compatibility.
|
|
63
|
-
*/
|
|
64
|
-
export declare class FileObjectsPage extends Page<FileObject> {
|
|
61
|
+
export declare class FileObjectsPage extends CursorPage<FileObject> {
|
|
65
62
|
}
|
|
66
63
|
export type FileContent = string;
|
|
67
64
|
export interface FileDeleted {
|
|
@@ -138,7 +135,12 @@ export interface FileCreateParams {
|
|
|
138
135
|
*/
|
|
139
136
|
purpose: FilePurpose;
|
|
140
137
|
}
|
|
141
|
-
export interface FileListParams {
|
|
138
|
+
export interface FileListParams extends CursorPageParams {
|
|
139
|
+
/**
|
|
140
|
+
* Sort order by the `created_at` timestamp of the objects. `asc` for ascending
|
|
141
|
+
* order and `desc` for descending order.
|
|
142
|
+
*/
|
|
143
|
+
order?: 'asc' | 'desc';
|
|
142
144
|
/**
|
|
143
145
|
* Only return files with the given purpose.
|
|
144
146
|
*/
|
package/resources/files.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI1C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI1C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD,qBAAa,KAAM,S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AW,EAC/B,eAAe,IAAI,eAAe,EAClC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,GACtC,CAAC;CACH"}
|
package/resources/files.js
CHANGED
|
@@ -113,10 +113,7 @@ class Files extends resource_1.APIResource {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
exports.Files = Files;
|
|
116
|
-
|
|
117
|
-
* Note: no pagination actually occurs yet, this is for forwards-compatibility.
|
|
118
|
-
*/
|
|
119
|
-
class FileObjectsPage extends pagination_1.Page {
|
|
116
|
+
class FileObjectsPage extends pagination_1.CursorPage {
|
|
120
117
|
}
|
|
121
118
|
exports.FileObjectsPage = FileObjectsPage;
|
|
122
119
|
Files.FileObjectsPage = FileObjectsPage;
|
package/resources/files.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.js","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,6CAA0C;AAC1C,qCAA2C;AAC3C,qCAAgC;AAChC,uCAAqD;AACrD,iDAAgC;AAChC,
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,6CAA0C;AAC1C,qCAA2C;AAC3C,qCAAgC;AAChC,uCAAqD;AACrD,iDAAgC;AAChC,iDAAkE;AAGlE,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,MAAM,CAAC,IAAsB,EAAE,OAA6B;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,2BAA2B,CAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC;IAC7F,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,MAAc,EAAE,O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AC,CAAC,CAAC;QAEnE,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACzB,IAAI,IAAI,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAEnC,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YACxD,MAAM,IAAA,YAAK,EAAC,YAAY,CAAC,CAAC;YAE1B,IAAI,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;YAC/B,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,OAAO,EAAE;gBAChC,MAAM,IAAI,iCAAyB,CAAC;oBAClC,OAAO,EAAE,iCAAiC,EAAE,+BAA+B,OAAO,gBAAgB;iBACnG,CAAC,CAAC;aACJ;SACF;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AArGD,sBAqGC;AAED,MAAa,eAAgB,SAAQ,uBAAsB;CAAG;AAA9D,0CAA8D;AAgH9D,KAAK,CAAC,eAAe,GAAG,eAAe,CAAC"}
|
package/resources/files.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { isRequestOptions } from "../core.mjs";
|
|
|
4
4
|
import { sleep } from "../core.mjs";
|
|
5
5
|
import { APIConnectionTimeoutError } from "../error.mjs";
|
|
6
6
|
import * as Core from "../core.mjs";
|
|
7
|
-
import {
|
|
7
|
+
import { CursorPage } from "../pagination.mjs";
|
|
8
8
|
export class Files extends APIResource {
|
|
9
9
|
/**
|
|
10
10
|
* Upload a file that can be used across various endpoints. Individual files can be
|
|
@@ -86,10 +86,7 @@ export class Files extends APIResource {
|
|
|
86
86
|
return file;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
|
|
90
|
-
* Note: no pagination actually occurs yet, this is for forwards-compatibility.
|
|
91
|
-
*/
|
|
92
|
-
export class FileObjectsPage extends Page {
|
|
89
|
+
export class FileObjectsPage extends CursorPage {
|
|
93
90
|
}
|
|
94
91
|
Files.FileObjectsPage = FileObjectsPage;
|
|
95
92
|
//# sourceMappingURL=files.mjs.map
|
package/resources/files.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.mjs","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OACpB,EAAE,KAAK,EAAE;OACT,EAAE,yBAAyB,EAAE;OAC7B,KAAK,IAAI;OACT,EAAE,
|
|
1
|
+
{"version":3,"file":"files.mjs","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OACpB,EAAE,KAAK,EAAE;OACT,EAAE,yBAAyB,EAAE;OAC7B,KAAK,IAAI;OACT,EAAE,UAAU,EAAyB;AAG5C,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,MAAM,CAAC,IAAsB,EAAE,OAA6B;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,2BAA2B,CAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC;IAC7F,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,MAAc,EAAE,OAA6B;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;IAOD,IAAI,CACF,QAA8C,EAAE,EAChD,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,QA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QAAQ,CAAC,EAAE,CAAC,CAAC;YAC/B,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,OAAO,EAAE;gBAChC,MAAM,IAAI,yBAAyB,CAAC;oBAClC,OAAO,EAAE,iCAAiC,EAAE,+BAA+B,OAAO,gBAAgB;iBACnG,CAAC,CAAC;aACJ;SACF;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,MAAM,OAAO,eAAgB,SAAQ,UAAsB;CAAG;AAgH9D,KAAK,CAAC,eAAe,GAAG,eAAe,CAAC"}
|
|
@@ -218,7 +218,7 @@ export interface FineTuningJobWandbIntegrationObject {
|
|
|
218
218
|
export interface JobCreateParams {
|
|
219
219
|
/**
|
|
220
220
|
* The name of the model to fine-tune. You can select one of the
|
|
221
|
-
* [supported models](https://platform.openai.com/docs/guides/fine-tuning
|
|
221
|
+
* [supported models](https://platform.openai.com/docs/guides/fine-tuning#which-models-can-be-fine-tuned).
|
|
222
222
|
*/
|
|
223
223
|
model: (string & {}) | 'babbage-002' | 'davinci-002' | 'gpt-3.5-turbo' | 'gpt-4o-mini';
|
|
224
224
|
/**
|
package/resources/images.d.ts
CHANGED
|
@@ -68,7 +68,7 @@ export interface ImageCreateVariationParams {
|
|
|
68
68
|
/**
|
|
69
69
|
* A unique identifier representing your end-user, which can help OpenAI to monitor
|
|
70
70
|
* and detect abuse.
|
|
71
|
-
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices
|
|
71
|
+
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).
|
|
72
72
|
*/
|
|
73
73
|
user?: string;
|
|
74
74
|
}
|
|
@@ -112,7 +112,7 @@ export interface ImageEditParams {
|
|
|
112
112
|
/**
|
|
113
113
|
* A unique identifier representing your end-user, which can help OpenAI to monitor
|
|
114
114
|
* and detect abuse.
|
|
115
|
-
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices
|
|
115
|
+
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).
|
|
116
116
|
*/
|
|
117
117
|
user?: string;
|
|
118
118
|
}
|
|
@@ -159,7 +159,7 @@ export interface ImageGenerateParams {
|
|
|
159
159
|
/**
|
|
160
160
|
* A unique identifier representing your end-user, which can help OpenAI to monitor
|
|
161
161
|
* and detect abuse.
|
|
162
|
-
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices
|
|
162
|
+
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).
|
|
163
163
|
*/
|
|
164
164
|
user?: string;
|
|
165
165
|
}
|
|
@@ -284,7 +284,7 @@ export interface ModerationCreateParams {
|
|
|
284
284
|
* The content moderation model you would like to use. Learn more in
|
|
285
285
|
* [the moderation guide](https://platform.openai.com/docs/guides/moderation), and
|
|
286
286
|
* learn about available models
|
|
287
|
-
* [here](https://platform.openai.com/docs/models
|
|
287
|
+
* [here](https://platform.openai.com/docs/models#moderation).
|
|
288
288
|
*/
|
|
289
289
|
model?: (string & {}) | ModerationModel;
|
|
290
290
|
}
|
|
@@ -21,7 +21,7 @@ export declare class Uploads extends APIResource {
|
|
|
21
21
|
* For certain `purpose`s, the correct `mime_type` must be specified. Please refer
|
|
22
22
|
* to documentation for the supported MIME types for your use case:
|
|
23
23
|
*
|
|
24
|
-
* - [Assistants](https://platform.openai.com/docs/assistants/tools/file-search
|
|
24
|
+
* - [Assistants](https://platform.openai.com/docs/assistants/tools/file-search#supported-files)
|
|
25
25
|
*
|
|
26
26
|
* For guidance on the proper filename extensions for each purpose, please follow
|
|
27
27
|
* the documentation on
|
|
@@ -49,7 +49,7 @@ class Uploads extends resource_1.APIResource {
|
|
|
49
49
|
* For certain `purpose`s, the correct `mime_type` must be specified. Please refer
|
|
50
50
|
* to documentation for the supported MIME types for your use case:
|
|
51
51
|
*
|
|
52
|
-
* - [Assistants](https://platform.openai.com/docs/assistants/tools/file-search
|
|
52
|
+
* - [Assistants](https://platform.openai.com/docs/assistants/tools/file-search#supported-files)
|
|
53
53
|
*
|
|
54
54
|
* For guidance on the proper filename extensions for each purpose, please follow
|
|
55
55
|
* the documentation on
|
|
@@ -23,7 +23,7 @@ export class Uploads extends APIResource {
|
|
|
23
23
|
* For certain `purpose`s, the correct `mime_type` must be specified. Please refer
|
|
24
24
|
* to documentation for the supported MIME types for your use case:
|
|
25
25
|
*
|
|
26
|
-
* - [Assistants](https://platform.openai.com/docs/assistants/tools/file-search
|
|
26
|
+
* - [Assistants](https://platform.openai.com/docs/assistants/tools/file-search#supported-files)
|
|
27
27
|
*
|
|
28
28
|
* For guidance on the proper filename extensions for each purpose, please follow
|
|
29
29
|
* the documentation on
|
package/src/index.ts
CHANGED
|
@@ -87,6 +87,7 @@ import {
|
|
|
87
87
|
ChatCompletionMessageToolCall,
|
|
88
88
|
ChatCompletionModality,
|
|
89
89
|
ChatCompletionNamedToolChoice,
|
|
90
|
+
ChatCompletionPredictionContent,
|
|
90
91
|
ChatCompletionRole,
|
|
91
92
|
ChatCompletionStreamOptions,
|
|
92
93
|
ChatCompletionSystemMessageParam,
|
|
@@ -379,6 +380,7 @@ export declare namespace OpenAI {
|
|
|
379
380
|
type ChatCompletionMessageToolCall as ChatCompletionMessageToolCall,
|
|
380
381
|
type ChatCompletionModality as ChatCompletionModality,
|
|
381
382
|
type ChatCompletionNamedToolChoice as ChatCompletionNamedToolChoice,
|
|
383
|
+
type ChatCompletionPredictionContent as ChatCompletionPredictionContent,
|
|
382
384
|
type ChatCompletionRole as ChatCompletionRole,
|
|
383
385
|
type ChatCompletionStreamOptions as ChatCompletionStreamOptions,
|
|
384
386
|
type ChatCompletionSystemMessageParam as ChatCompletionSystemMessageParam,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import * as Core from
|
|
2
|
-
import { type CompletionUsage } from
|
|
1
|
+
import * as Core from '../core';
|
|
2
|
+
import { type CompletionUsage } from '../resources/completions';
|
|
3
3
|
import {
|
|
4
4
|
type ChatCompletion,
|
|
5
5
|
type ChatCompletionMessage,
|
|
6
6
|
type ChatCompletionMessageParam,
|
|
7
7
|
type ChatCompletionCreateParams,
|
|
8
8
|
type ChatCompletionTool,
|
|
9
|
-
} from
|
|
10
|
-
import { OpenAIError } from
|
|
9
|
+
} from '../resources/chat/completions';
|
|
10
|
+
import { OpenAIError } from '../error';
|
|
11
11
|
import {
|
|
12
12
|
type RunnableFunction,
|
|
13
13
|
isRunnableFunctionWithParse,
|
|
@@ -23,7 +23,7 @@ import { isAssistantMessage, isFunctionMessage, isToolMessage } from './chatComp
|
|
|
23
23
|
import { BaseEvents, EventStream } from './EventStream';
|
|
24
24
|
import { ParsedChatCompletion } from '../resources/beta/chat/completions';
|
|
25
25
|
import OpenAI from '../index';
|
|
26
|
-
import { isAutoParsableTool, parseChatCompletion } from
|
|
26
|
+
import { isAutoParsableTool, parseChatCompletion } from '../lib/parser';
|
|
27
27
|
|
|
28
28
|
const DEFAULT_MAX_CHAT_COMPLETIONS = 10;
|
|
29
29
|
export interface RunnerOptions extends Core.RequestOptions {
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
TextDelta,
|
|
9
9
|
MessageDelta,
|
|
10
10
|
MessageContent,
|
|
11
|
-
} from
|
|
12
|
-
import * as Core from
|
|
13
|
-
import { RequestOptions } from
|
|
11
|
+
} from '../resources/beta/threads/messages';
|
|
12
|
+
import * as Core from '../core';
|
|
13
|
+
import { RequestOptions } from '../core';
|
|
14
14
|
import {
|
|
15
15
|
Run,
|
|
16
16
|
RunCreateParamsBase,
|
|
@@ -18,18 +18,18 @@ import {
|
|
|
18
18
|
Runs,
|
|
19
19
|
RunSubmitToolOutputsParamsBase,
|
|
20
20
|
RunSubmitToolOutputsParamsStreaming,
|
|
21
|
-
} from
|
|
22
|
-
import { type ReadableStream } from
|
|
23
|
-
import { Stream } from
|
|
24
|
-
import { APIUserAbortError, OpenAIError } from
|
|
21
|
+
} from '../resources/beta/threads/runs/runs';
|
|
22
|
+
import { type ReadableStream } from '../_shims/index';
|
|
23
|
+
import { Stream } from '../streaming';
|
|
24
|
+
import { APIUserAbortError, OpenAIError } from '../error';
|
|
25
25
|
import {
|
|
26
26
|
AssistantStreamEvent,
|
|
27
27
|
MessageStreamEvent,
|
|
28
28
|
RunStepStreamEvent,
|
|
29
29
|
RunStreamEvent,
|
|
30
|
-
} from
|
|
31
|
-
import { RunStep, RunStepDelta, ToolCall, ToolCallDelta } from
|
|
32
|
-
import { ThreadCreateAndRunParamsBase, Threads } from
|
|
30
|
+
} from '../resources/beta/assistants';
|
|
31
|
+
import { RunStep, RunStepDelta, ToolCall, ToolCallDelta } from '../resources/beta/threads/runs/steps';
|
|
32
|
+
import { ThreadCreateAndRunParamsBase, Threads } from '../resources/beta/threads/threads';
|
|
33
33
|
import { BaseEvents, EventStream } from './EventStream';
|
|
34
34
|
|
|
35
35
|
export interface AssistantStreamEvents extends BaseEvents {
|
|
@@ -192,7 +192,7 @@ export class AssistantStream
|
|
|
192
192
|
runs: Runs,
|
|
193
193
|
params: RunSubmitToolOutputsParamsStream,
|
|
194
194
|
options: RequestOptions | undefined,
|
|
195
|
-
) {
|
|
195
|
+
): AssistantStream {
|
|
196
196
|
const runner = new AssistantStream();
|
|
197
197
|
runner._run(() =>
|
|
198
198
|
runner._runToolAssistantStream(threadId, runId, runs, params, {
|
|
@@ -238,7 +238,7 @@ export class AssistantStream
|
|
|
238
238
|
params: ThreadCreateAndRunParamsBaseStream,
|
|
239
239
|
thread: Threads,
|
|
240
240
|
options?: RequestOptions,
|
|
241
|
-
) {
|
|
241
|
+
): AssistantStream {
|
|
242
242
|
const runner = new AssistantStream();
|
|
243
243
|
runner._run(() =>
|
|
244
244
|
runner._threadAssistantStream(params, thread, {
|
|
@@ -254,7 +254,7 @@ export class AssistantStream
|
|
|
254
254
|
runs: Runs,
|
|
255
255
|
params: RunCreateParamsBaseStream,
|
|
256
256
|
options?: RequestOptions,
|
|
257
|
-
) {
|
|
257
|
+
): AssistantStream {
|
|
258
258
|
const runner = new AssistantStream();
|
|
259
259
|
runner._run(() =>
|
|
260
260
|
runner._runAssistantStream(threadId, runs, params, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
type ChatCompletionMessageParam,
|
|
3
3
|
type ChatCompletionCreateParamsNonStreaming,
|
|
4
|
-
} from
|
|
4
|
+
} from '../resources/chat/completions';
|
|
5
5
|
import { type RunnableFunctions, type BaseFunctionsArgs, RunnableTools } from './RunnableFunction';
|
|
6
6
|
import {
|
|
7
7
|
AbstractChatCompletionRunner,
|
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
RunnerOptions,
|
|
10
10
|
} from './AbstractChatCompletionRunner';
|
|
11
11
|
import { isAssistantMessage } from './chatCompletionUtils';
|
|
12
|
-
import OpenAI from
|
|
13
|
-
import { AutoParseableTool } from
|
|
12
|
+
import OpenAI from '../index';
|
|
13
|
+
import { AutoParseableTool } from '../lib/parser';
|
|
14
14
|
|
|
15
15
|
export interface ChatCompletionRunnerEvents extends AbstractChatCompletionRunnerEvents {
|
|
16
16
|
content: (content: string) => void;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as Core from
|
|
1
|
+
import * as Core from '../core';
|
|
2
2
|
import {
|
|
3
3
|
OpenAIError,
|
|
4
4
|
APIUserAbortError,
|
|
5
5
|
LengthFinishReasonError,
|
|
6
6
|
ContentFilterFinishReasonError,
|
|
7
|
-
} from
|
|
7
|
+
} from '../error';
|
|
8
8
|
import {
|
|
9
9
|
ChatCompletionTokenLogprob,
|
|
10
10
|
type ChatCompletion,
|
|
@@ -12,15 +12,15 @@ import {
|
|
|
12
12
|
type ChatCompletionCreateParams,
|
|
13
13
|
type ChatCompletionCreateParamsStreaming,
|
|
14
14
|
type ChatCompletionCreateParamsBase,
|
|
15
|
-
} from
|
|
15
|
+
} from '../resources/chat/completions';
|
|
16
16
|
import {
|
|
17
17
|
AbstractChatCompletionRunner,
|
|
18
18
|
type AbstractChatCompletionRunnerEvents,
|
|
19
19
|
} from './AbstractChatCompletionRunner';
|
|
20
|
-
import { type ReadableStream } from
|
|
21
|
-
import { Stream } from
|
|
22
|
-
import OpenAI from
|
|
23
|
-
import { ParsedChatCompletion } from
|
|
20
|
+
import { type ReadableStream } from '../_shims/index';
|
|
21
|
+
import { Stream } from '../streaming';
|
|
22
|
+
import OpenAI from '../index';
|
|
23
|
+
import { ParsedChatCompletion } from '../resources/beta/chat/completions';
|
|
24
24
|
import {
|
|
25
25
|
AutoParseableResponseFormat,
|
|
26
26
|
hasAutoParseableInput,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
isAutoParsableTool,
|
|
29
29
|
maybeParseChatCompletion,
|
|
30
30
|
shouldParseToolCall,
|
|
31
|
-
} from
|
|
31
|
+
} from '../lib/parser';
|
|
32
32
|
import { partialParse } from '../_vendor/partial-json-parser/parser';
|
|
33
33
|
|
|
34
34
|
export interface ContentDeltaEvent {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
type ChatCompletionChunk,
|
|
3
3
|
type ChatCompletionCreateParamsStreaming,
|
|
4
|
-
} from
|
|
4
|
+
} from '../resources/chat/completions';
|
|
5
5
|
import { RunnerOptions, type AbstractChatCompletionRunnerEvents } from './AbstractChatCompletionRunner';
|
|
6
|
-
import { type ReadableStream } from
|
|
6
|
+
import { type ReadableStream } from '../_shims/index';
|
|
7
7
|
import { RunnableTools, type BaseFunctionsArgs, type RunnableFunctions } from './RunnableFunction';
|
|
8
8
|
import { ChatCompletionSnapshot, ChatCompletionStream } from './ChatCompletionStream';
|
|
9
|
-
import OpenAI from
|
|
10
|
-
import { AutoParseableTool } from
|
|
9
|
+
import OpenAI from '../index';
|
|
10
|
+
import { AutoParseableTool } from '../lib/parser';
|
|
11
11
|
|
|
12
12
|
export interface ChatCompletionStreamEvents extends AbstractChatCompletionRunnerEvents {
|
|
13
13
|
content: (contentDelta: string, contentSnapshot: string) => void;
|
package/src/lib/EventStream.ts
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
type ChatCompletionFunctionMessageParam,
|
|
4
4
|
type ChatCompletionMessageParam,
|
|
5
5
|
type ChatCompletionToolMessageParam,
|
|
6
|
-
} from
|
|
6
|
+
} from '../resources';
|
|
7
7
|
|
|
8
8
|
export const isAssistantMessage = (
|
|
9
9
|
message: ChatCompletionMessageParam | null | undefined,
|
package/src/lib/parser.ts
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
ParsedFunctionToolCall,
|
|
14
14
|
} from '../resources/beta/chat/completions';
|
|
15
15
|
import { ResponseFormatJSONSchema } from '../resources/shared';
|
|
16
|
-
import { ContentFilterFinishReasonError, LengthFinishReasonError, OpenAIError } from
|
|
16
|
+
import { ContentFilterFinishReasonError, LengthFinishReasonError, OpenAIError } from '../error';
|
|
17
17
|
|
|
18
18
|
type AnyChatCompletionCreateParams =
|
|
19
19
|
| ChatCompletionCreateParams
|
|
@@ -22,7 +22,7 @@ export interface SpeechCreateParams {
|
|
|
22
22
|
input: string;
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
* One of the available [TTS models](https://platform.openai.com/docs/models
|
|
25
|
+
* One of the available [TTS models](https://platform.openai.com/docs/models#tts):
|
|
26
26
|
* `tts-1` or `tts-1-hd`
|
|
27
27
|
*/
|
|
28
28
|
model: (string & {}) | SpeechModel;
|
|
@@ -31,7 +31,7 @@ export interface SpeechCreateParams {
|
|
|
31
31
|
* The voice to use when generating the audio. Supported voices are `alloy`,
|
|
32
32
|
* `echo`, `fable`, `onyx`, `nova`, and `shimmer`. Previews of the voices are
|
|
33
33
|
* available in the
|
|
34
|
-
* [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech
|
|
34
|
+
* [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
|
|
35
35
|
*/
|
|
36
36
|
voice: 'alloy' | 'echo' | 'fable' | 'onyx' | 'nova' | 'shimmer';
|
|
37
37
|
|
|
@@ -174,7 +174,7 @@ export interface TranscriptionCreateParams<
|
|
|
174
174
|
/**
|
|
175
175
|
* An optional text to guide the model's style or continue a previous audio
|
|
176
176
|
* segment. The
|
|
177
|
-
* [prompt](https://platform.openai.com/docs/guides/speech-to-text
|
|
177
|
+
* [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting)
|
|
178
178
|
* should match the audio language.
|
|
179
179
|
*/
|
|
180
180
|
prompt?: string;
|
|
@@ -76,7 +76,7 @@ export interface TranslationCreateParams<
|
|
|
76
76
|
/**
|
|
77
77
|
* An optional text to guide the model's style or continue a previous audio
|
|
78
78
|
* segment. The
|
|
79
|
-
* [prompt](https://platform.openai.com/docs/guides/speech-to-text
|
|
79
|
+
* [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting)
|
|
80
80
|
* should be in English.
|
|
81
81
|
*/
|
|
82
82
|
prompt?: string;
|
|
@@ -121,8 +121,8 @@ export interface Assistant {
|
|
|
121
121
|
* ID of the model to use. You can use the
|
|
122
122
|
* [List models](https://platform.openai.com/docs/api-reference/models/list) API to
|
|
123
123
|
* see all of your available models, or see our
|
|
124
|
-
* [Model overview](https://platform.openai.com/docs/models
|
|
125
|
-
*
|
|
124
|
+
* [Model overview](https://platform.openai.com/docs/models) for descriptions of
|
|
125
|
+
* them.
|
|
126
126
|
*/
|
|
127
127
|
model: string;
|
|
128
128
|
|
|
@@ -145,8 +145,8 @@ export interface Assistant {
|
|
|
145
145
|
|
|
146
146
|
/**
|
|
147
147
|
* Specifies the format that the model must output. Compatible with
|
|
148
|
-
* [GPT-4o](https://platform.openai.com/docs/models
|
|
149
|
-
* [GPT-4 Turbo](https://platform.openai.com/docs/models
|
|
148
|
+
* [GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
|
|
149
|
+
* [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4),
|
|
150
150
|
* and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
|
|
151
151
|
*
|
|
152
152
|
* Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
|
|
@@ -620,7 +620,7 @@ export namespace AssistantStreamEvent {
|
|
|
620
620
|
|
|
621
621
|
/**
|
|
622
622
|
* Occurs when an
|
|
623
|
-
* [error](https://platform.openai.com/docs/guides/error-codes
|
|
623
|
+
* [error](https://platform.openai.com/docs/guides/error-codes#api-errors) occurs.
|
|
624
624
|
* This can happen due to an internal server error or a timeout.
|
|
625
625
|
*/
|
|
626
626
|
export interface ErrorEvent {
|
|
@@ -663,7 +663,7 @@ export namespace FileSearchTool {
|
|
|
663
663
|
*
|
|
664
664
|
* Note that the file search tool may output fewer than `max_num_results` results.
|
|
665
665
|
* See the
|
|
666
|
-
* [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search
|
|
666
|
+
* [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings)
|
|
667
667
|
* for more information.
|
|
668
668
|
*/
|
|
669
669
|
max_num_results?: number;
|
|
@@ -673,7 +673,7 @@ export namespace FileSearchTool {
|
|
|
673
673
|
* will use the `auto` ranker and a score_threshold of 0.
|
|
674
674
|
*
|
|
675
675
|
* See the
|
|
676
|
-
* [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search
|
|
676
|
+
* [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings)
|
|
677
677
|
* for more information.
|
|
678
678
|
*/
|
|
679
679
|
ranking_options?: FileSearch.RankingOptions;
|
|
@@ -685,7 +685,7 @@ export namespace FileSearchTool {
|
|
|
685
685
|
* will use the `auto` ranker and a score_threshold of 0.
|
|
686
686
|
*
|
|
687
687
|
* See the
|
|
688
|
-
* [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search
|
|
688
|
+
* [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings)
|
|
689
689
|
* for more information.
|
|
690
690
|
*/
|
|
691
691
|
export interface RankingOptions {
|
|
@@ -1100,8 +1100,8 @@ export interface AssistantCreateParams {
|
|
|
1100
1100
|
* ID of the model to use. You can use the
|
|
1101
1101
|
* [List models](https://platform.openai.com/docs/api-reference/models/list) API to
|
|
1102
1102
|
* see all of your available models, or see our
|
|
1103
|
-
* [Model overview](https://platform.openai.com/docs/models
|
|
1104
|
-
*
|
|
1103
|
+
* [Model overview](https://platform.openai.com/docs/models) for descriptions of
|
|
1104
|
+
* them.
|
|
1105
1105
|
*/
|
|
1106
1106
|
model: (string & {}) | ChatAPI.ChatModel;
|
|
1107
1107
|
|
|
@@ -1131,8 +1131,8 @@ export interface AssistantCreateParams {
|
|
|
1131
1131
|
|
|
1132
1132
|
/**
|
|
1133
1133
|
* Specifies the format that the model must output. Compatible with
|
|
1134
|
-
* [GPT-4o](https://platform.openai.com/docs/models
|
|
1135
|
-
* [GPT-4 Turbo](https://platform.openai.com/docs/models
|
|
1134
|
+
* [GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
|
|
1135
|
+
* [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4),
|
|
1136
1136
|
* and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
|
|
1137
1137
|
*
|
|
1138
1138
|
* Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
|
|
@@ -1277,8 +1277,8 @@ export interface AssistantUpdateParams {
|
|
|
1277
1277
|
* ID of the model to use. You can use the
|
|
1278
1278
|
* [List models](https://platform.openai.com/docs/api-reference/models/list) API to
|
|
1279
1279
|
* see all of your available models, or see our
|
|
1280
|
-
* [Model overview](https://platform.openai.com/docs/models
|
|
1281
|
-
*
|
|
1280
|
+
* [Model overview](https://platform.openai.com/docs/models) for descriptions of
|
|
1281
|
+
* them.
|
|
1282
1282
|
*/
|
|
1283
1283
|
model?: string;
|
|
1284
1284
|
|
|
@@ -1289,8 +1289,8 @@ export interface AssistantUpdateParams {
|
|
|
1289
1289
|
|
|
1290
1290
|
/**
|
|
1291
1291
|
* Specifies the format that the model must output. Compatible with
|
|
1292
|
-
* [GPT-4o](https://platform.openai.com/docs/models
|
|
1293
|
-
* [GPT-4 Turbo](https://platform.openai.com/docs/models
|
|
1292
|
+
* [GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
|
|
1293
|
+
* [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4),
|
|
1294
1294
|
* and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
|
|
1295
1295
|
*
|
|
1296
1296
|
* Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
|
|
@@ -1383,8 +1383,8 @@ export interface AssistantListParams extends CursorPageParams {
|
|
|
1383
1383
|
/**
|
|
1384
1384
|
* A cursor for use in pagination. `before` is an object ID that defines your place
|
|
1385
1385
|
* in the list. For instance, if you make a list request and receive 100 objects,
|
|
1386
|
-
*
|
|
1387
|
-
* fetch the previous page of the list.
|
|
1386
|
+
* starting with obj_foo, your subsequent call can include before=obj_foo in order
|
|
1387
|
+
* to fetch the previous page of the list.
|
|
1388
1388
|
*/
|
|
1389
1389
|
before?: string;
|
|
1390
1390
|
|
|
@@ -704,8 +704,8 @@ export interface MessageListParams extends CursorPageParams {
|
|
|
704
704
|
/**
|
|
705
705
|
* A cursor for use in pagination. `before` is an object ID that defines your place
|
|
706
706
|
* in the list. For instance, if you make a list request and receive 100 objects,
|
|
707
|
-
*
|
|
708
|
-
* fetch the previous page of the list.
|
|
707
|
+
* starting with obj_foo, your subsequent call can include before=obj_foo in order
|
|
708
|
+
* to fetch the previous page of the list.
|
|
709
709
|
*/
|
|
710
710
|
before?: string;
|
|
711
711
|
|