openai 4.8.0 → 4.9.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 +8 -0
- package/README.md +4 -0
- package/_shims/MultipartBody.d.ts +9 -0
- package/_shims/MultipartBody.d.ts.map +1 -0
- package/_shims/MultipartBody.js +16 -0
- package/_shims/MultipartBody.js.map +1 -0
- package/_shims/MultipartBody.mjs +12 -0
- package/_shims/MultipartBody.mjs.map +1 -0
- package/_shims/README.md +46 -0
- package/{src/_shims/ReadableStream-node.ts → _shims/auto/runtime-bun.d.ts} +2 -3
- package/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/_shims/auto/runtime-bun.js +21 -0
- package/_shims/auto/runtime-bun.js.map +1 -0
- package/_shims/auto/runtime-bun.mjs +2 -0
- package/_shims/auto/runtime-bun.mjs.map +1 -0
- package/_shims/auto/runtime-node.d.ts +5 -0
- package/_shims/auto/runtime-node.d.ts.map +1 -0
- package/_shims/auto/runtime-node.js +21 -0
- package/_shims/auto/runtime-node.js.map +1 -0
- package/_shims/auto/runtime-node.mjs +2 -0
- package/_shims/auto/runtime-node.mjs.map +1 -0
- package/_shims/auto/runtime.d.ts +5 -0
- package/_shims/auto/runtime.d.ts.map +1 -0
- package/_shims/auto/runtime.js +21 -0
- package/_shims/auto/runtime.js.map +1 -0
- package/_shims/auto/runtime.mjs +2 -0
- package/_shims/auto/runtime.mjs.map +1 -0
- package/_shims/auto/types-node.d.ts +5 -0
- package/_shims/auto/types-node.d.ts.map +1 -0
- package/_shims/auto/types-node.js +21 -0
- package/_shims/auto/types-node.js.map +1 -0
- package/_shims/auto/types-node.mjs +2 -0
- package/_shims/auto/types-node.mjs.map +1 -0
- package/_shims/auto/types.d.ts +99 -0
- package/_shims/{ReadableStream.js → auto/types.js} +0 -2
- package/{src/_shims/ReadableStream.js → _shims/auto/types.mjs} +0 -2
- package/_shims/bun-runtime.d.ts +6 -0
- package/_shims/bun-runtime.d.ts.map +1 -0
- package/_shims/bun-runtime.js +14 -0
- package/_shims/bun-runtime.js.map +1 -0
- package/_shims/bun-runtime.mjs +10 -0
- package/_shims/bun-runtime.mjs.map +1 -0
- package/_shims/index.d.ts +79 -0
- package/_shims/index.js +13 -0
- package/_shims/index.mjs +7 -0
- package/_shims/manual-types.d.ts +12 -0
- package/_shims/manual-types.js +3 -0
- package/_shims/manual-types.mjs +3 -0
- package/_shims/node-runtime.d.ts +3 -0
- package/_shims/node-runtime.d.ts.map +1 -0
- package/_shims/node-runtime.js +87 -0
- package/_shims/node-runtime.js.map +1 -0
- package/_shims/node-runtime.mjs +54 -0
- package/_shims/node-runtime.mjs.map +1 -0
- package/_shims/node-types.d.ts +42 -0
- package/_shims/node-types.js +3 -0
- package/_shims/node-types.mjs +3 -0
- package/_shims/registry.d.ts +35 -0
- package/_shims/registry.d.ts.map +1 -0
- package/_shims/registry.js +39 -0
- package/_shims/registry.js.map +1 -0
- package/_shims/registry.mjs +35 -0
- package/_shims/registry.mjs.map +1 -0
- package/_shims/web-runtime.d.ts +5 -0
- package/_shims/web-runtime.d.ts.map +1 -0
- package/_shims/web-runtime.js +70 -0
- package/_shims/web-runtime.js.map +1 -0
- package/_shims/web-runtime.mjs +63 -0
- package/_shims/web-runtime.mjs.map +1 -0
- package/_shims/web-types.d.ts +82 -0
- package/_shims/web-types.js +3 -0
- package/_shims/web-types.mjs +3 -0
- package/core.d.ts +170 -218
- package/core.d.ts.map +1 -1
- package/core.js +679 -737
- package/core.js.map +1 -1
- package/core.mjs +673 -688
- package/core.mjs.map +1 -1
- package/error.d.ts +32 -34
- package/error.js +95 -109
- package/error.mjs +92 -94
- package/index.d.mts +164 -175
- package/index.d.ts +164 -175
- package/index.d.ts.map +1 -1
- package/index.js +110 -161
- package/index.mjs +88 -109
- package/package.json +31 -58
- package/pagination.d.ts +31 -41
- package/pagination.js +52 -48
- package/pagination.mjs +50 -46
- package/resource.d.ts +10 -10
- package/resource.js +12 -12
- package/resource.mjs +10 -10
- package/resources/audio/audio.d.ts +12 -12
- package/resources/audio/audio.js +33 -50
- package/resources/audio/audio.mjs +11 -11
- package/resources/audio/index.d.ts +4 -4
- package/resources/audio/index.js +9 -24
- package/resources/audio/index.mjs +4 -4
- package/resources/audio/transcriptions.d.ts +44 -44
- package/resources/audio/transcriptions.js +13 -12
- package/resources/audio/transcriptions.mjs +9 -8
- package/resources/audio/translations.d.ts +38 -38
- package/resources/audio/translations.js +13 -12
- package/resources/audio/translations.mjs +9 -8
- package/resources/chat/chat.d.ts +17 -17
- package/resources/chat/chat.js +30 -47
- package/resources/chat/chat.mjs +8 -8
- package/resources/chat/completions.d.ts +330 -353
- package/resources/chat/completions.js +10 -13
- package/resources/chat/completions.mjs +7 -10
- package/resources/chat/index.d.ts +3 -17
- package/resources/chat/index.js +7 -17
- package/resources/chat/index.mjs +3 -3
- package/resources/completions.d.ts +216 -232
- package/resources/completions.js +10 -13
- package/resources/completions.mjs +7 -10
- package/resources/edits.d.ts +73 -73
- package/resources/edits.js +16 -15
- package/resources/edits.mjs +13 -12
- package/resources/embeddings.d.ts +73 -76
- package/resources/embeddings.js +12 -11
- package/resources/embeddings.mjs +9 -8
- package/resources/files.d.ts +91 -96
- package/resources/files.js +64 -65
- package/resources/files.mjs +57 -58
- package/resources/fine-tunes.d.ts +277 -290
- package/resources/fine-tunes.js +49 -50
- package/resources/fine-tunes.mjs +45 -46
- package/resources/fine-tuning/fine-tuning.d.ts +12 -12
- package/resources/fine-tuning/fine-tuning.js +32 -49
- package/resources/fine-tuning/fine-tuning.mjs +10 -10
- package/resources/fine-tuning/index.d.ts +3 -12
- package/resources/fine-tuning/index.js +9 -29
- package/resources/fine-tuning/index.mjs +3 -3
- package/resources/fine-tuning/jobs.d.ts +173 -179
- package/resources/fine-tuning/jobs.js +50 -47
- package/resources/fine-tuning/jobs.mjs +45 -42
- package/resources/images.d.ts +116 -119
- package/resources/images.js +25 -24
- package/resources/images.mjs +21 -20
- package/resources/index.d.ts +12 -37
- package/resources/index.js +29 -113
- package/resources/index.mjs +12 -12
- package/resources/models.d.ts +41 -40
- package/resources/models.js +30 -28
- package/resources/models.mjs +26 -24
- package/resources/moderations.d.ts +153 -156
- package/resources/moderations.js +12 -11
- package/resources/moderations.mjs +9 -8
- package/shims/node.d.ts +29 -0
- package/shims/node.d.ts.map +1 -0
- package/shims/node.js +31 -0
- package/shims/node.js.map +1 -0
- package/shims/node.mjs +5 -0
- package/shims/node.mjs.map +1 -0
- package/shims/web.d.ts +26 -0
- package/shims/web.d.ts.map +1 -0
- package/shims/web.js +31 -0
- package/shims/web.js.map +1 -0
- package/shims/web.mjs +5 -0
- package/shims/web.mjs.map +1 -0
- package/src/_shims/MultipartBody.ts +9 -0
- package/src/_shims/README.md +46 -0
- package/src/_shims/auto/runtime-bun.ts +4 -0
- package/src/_shims/auto/runtime-node.ts +4 -0
- package/src/_shims/auto/runtime.ts +4 -0
- package/src/_shims/auto/types-node.ts +4 -0
- package/src/_shims/auto/types.d.ts +99 -0
- package/src/_shims/auto/types.js +3 -0
- package/src/_shims/auto/types.mjs +3 -0
- package/src/_shims/bun-runtime.ts +14 -0
- package/src/_shims/index.d.ts +79 -0
- package/src/_shims/index.js +13 -0
- package/src/_shims/index.mjs +7 -0
- package/src/_shims/manual-types.d.ts +12 -0
- package/src/_shims/manual-types.js +3 -0
- package/src/_shims/manual-types.mjs +3 -0
- package/src/_shims/node-runtime.ts +79 -0
- package/src/_shims/node-types.d.ts +42 -0
- package/src/_shims/node-types.js +3 -0
- package/src/_shims/node-types.mjs +3 -0
- package/src/_shims/registry.ts +62 -0
- package/src/_shims/web-runtime.ts +91 -0
- package/src/_shims/web-types.d.ts +82 -0
- package/src/_shims/web-types.js +3 -0
- package/src/_shims/web-types.mjs +3 -0
- package/src/core.ts +34 -17
- package/src/error.ts +1 -1
- package/src/index.ts +6 -6
- package/src/pagination.ts +1 -1
- package/src/resource.ts +1 -1
- package/src/resources/audio/audio.ts +4 -4
- package/src/resources/audio/index.ts +3 -3
- package/src/resources/audio/transcriptions.ts +4 -4
- package/src/resources/audio/translations.ts +4 -4
- package/src/resources/chat/chat.ts +3 -3
- package/src/resources/chat/completions.ts +6 -6
- package/src/resources/chat/index.ts +2 -2
- package/src/resources/completions.ts +5 -5
- package/src/resources/edits.ts +4 -4
- package/src/resources/embeddings.ts +3 -3
- package/src/resources/files.ts +7 -7
- package/src/resources/fine-tunes.ts +7 -7
- package/src/resources/fine-tuning/fine-tuning.ts +3 -3
- package/src/resources/fine-tuning/index.ts +2 -2
- package/src/resources/fine-tuning/jobs.ts +6 -6
- package/src/resources/images.ts +4 -4
- package/src/resources/index.ts +11 -11
- package/src/resources/models.ts +4 -4
- package/src/resources/moderations.ts +3 -3
- package/src/shims/node.ts +50 -0
- package/src/shims/web.ts +50 -0
- package/src/streaming.ts +1 -1
- package/src/uploads.ts +12 -16
- package/src/version.ts +1 -1
- package/streaming.d.ts +9 -8
- package/streaming.d.ts.map +1 -1
- package/streaming.js +194 -185
- package/streaming.mjs +192 -183
- package/uploads.d.ts +23 -39
- package/uploads.d.ts.map +1 -1
- package/uploads.js +115 -157
- package/uploads.js.map +1 -1
- package/uploads.mjs +111 -133
- package/uploads.mjs.map +1 -1
- package/version.d.ts +2 -2
- package/version.js +4 -4
- package/version.mjs +2 -2
- package/_shims/ReadableStream-node.d.ts +0 -6
- package/_shims/ReadableStream-node.d.ts.map +0 -1
- package/_shims/ReadableStream-node.js +0 -14
- package/_shims/ReadableStream-node.js.map +0 -1
- package/_shims/ReadableStream-node.mjs +0 -3
- package/_shims/ReadableStream-node.mjs.map +0 -1
- package/_shims/ReadableStream.d.ts +0 -38
- package/_shims/ReadableStream.mjs +0 -7
- package/_shims/agent-node.d.ts +0 -7
- package/_shims/agent-node.d.ts.map +0 -1
- package/_shims/agent-node.js +0 -28
- package/_shims/agent-node.js.map +0 -1
- package/_shims/agent-node.mjs +0 -16
- package/_shims/agent-node.mjs.map +0 -1
- package/_shims/agent.d.ts +0 -9
- package/_shims/agent.d.ts.map +0 -1
- package/_shims/agent.js +0 -14
- package/_shims/agent.js.map +0 -1
- package/_shims/agent.mjs +0 -10
- package/_shims/agent.mjs.map +0 -1
- package/_shims/fetch-node.d.ts +0 -64
- package/_shims/fetch-node.js +0 -12
- package/_shims/fetch-node.mjs +0 -14
- package/_shims/fetch.d.ts +0 -60
- package/_shims/fetch.js +0 -13
- package/_shims/fetch.mjs +0 -15
- package/_shims/fileFromPath-node.d.ts +0 -17
- package/_shims/fileFromPath-node.d.ts.map +0 -1
- package/_shims/fileFromPath-node.js +0 -17
- package/_shims/fileFromPath-node.js.map +0 -1
- package/_shims/fileFromPath-node.mjs +0 -13
- package/_shims/fileFromPath-node.mjs.map +0 -1
- package/_shims/fileFromPath.d.ts +0 -22
- package/_shims/fileFromPath.d.ts.map +0 -1
- package/_shims/fileFromPath.js +0 -16
- package/_shims/fileFromPath.js.map +0 -1
- package/_shims/fileFromPath.mjs +0 -12
- package/_shims/fileFromPath.mjs.map +0 -1
- package/_shims/form-data-node.d.ts +0 -45
- package/_shims/form-data-node.js +0 -11
- package/_shims/form-data-node.mjs +0 -9
- package/_shims/form-data.d.ts +0 -43
- package/_shims/form-data.js +0 -17
- package/_shims/form-data.mjs +0 -20
- package/_shims/getMultipartRequestOptions-node.d.ts +0 -10
- package/_shims/getMultipartRequestOptions-node.d.ts.map +0 -1
- package/_shims/getMultipartRequestOptions-node.js +0 -22
- package/_shims/getMultipartRequestOptions-node.js.map +0 -1
- package/_shims/getMultipartRequestOptions-node.mjs +0 -18
- package/_shims/getMultipartRequestOptions-node.mjs.map +0 -1
- package/_shims/getMultipartRequestOptions.d.ts +0 -10
- package/_shims/getMultipartRequestOptions.d.ts.map +0 -1
- package/_shims/getMultipartRequestOptions.js +0 -12
- package/_shims/getMultipartRequestOptions.js.map +0 -1
- package/_shims/getMultipartRequestOptions.mjs +0 -8
- package/_shims/getMultipartRequestOptions.mjs.map +0 -1
- package/_shims/node-readable-node.d.ts +0 -8
- package/_shims/node-readable-node.d.ts.map +0 -1
- package/_shims/node-readable-node.js +0 -9
- package/_shims/node-readable-node.js.map +0 -1
- package/_shims/node-readable-node.mjs +0 -5
- package/_shims/node-readable-node.mjs.map +0 -1
- package/_shims/node-readable.d.ts +0 -23
- package/_shims/node-readable.d.ts.map +0 -1
- package/_shims/node-readable.js +0 -11
- package/_shims/node-readable.js.map +0 -1
- package/_shims/node-readable.mjs +0 -7
- package/_shims/node-readable.mjs.map +0 -1
- package/src/_shims/ReadableStream.d.ts +0 -38
- package/src/_shims/ReadableStream.mjs +0 -7
- package/src/_shims/agent-node.ts +0 -22
- package/src/_shims/agent.ts +0 -12
- package/src/_shims/fetch-node.d.ts +0 -64
- package/src/_shims/fetch-node.js +0 -12
- package/src/_shims/fetch-node.mjs +0 -14
- package/src/_shims/fetch.d.ts +0 -60
- package/src/_shims/fetch.js +0 -13
- package/src/_shims/fetch.mjs +0 -15
- package/src/_shims/fileFromPath-node.ts +0 -29
- package/src/_shims/fileFromPath.ts +0 -29
- package/src/_shims/form-data-node.d.ts +0 -45
- package/src/_shims/form-data-node.js +0 -11
- package/src/_shims/form-data-node.mjs +0 -9
- package/src/_shims/form-data.d.ts +0 -43
- package/src/_shims/form-data.js +0 -17
- package/src/_shims/form-data.mjs +0 -20
- package/src/_shims/getMultipartRequestOptions-node.ts +0 -25
- package/src/_shims/getMultipartRequestOptions.ts +0 -14
- package/src/_shims/node-readable-node.ts +0 -10
- package/src/_shims/node-readable.ts +0 -30
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
import { APIResource } from 'openai/resource';
|
|
3
3
|
export class Completions extends APIResource {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
...options,
|
|
9
|
-
stream: (_a = body.stream) !== null && _a !== void 0 ? _a : false,
|
|
10
|
-
});
|
|
11
|
-
}
|
|
4
|
+
create(body, options) {
|
|
5
|
+
var _a;
|
|
6
|
+
return this.post('/completions', { body, ...options, stream: (_a = body.stream) !== null && _a !== void 0 ? _a : false });
|
|
7
|
+
}
|
|
12
8
|
}
|
|
13
|
-
(function (Completions) {
|
|
14
|
-
|
|
9
|
+
(function (Completions) {
|
|
10
|
+
})(Completions || (Completions = {}));
|
|
11
|
+
//# sourceMappingURL=completions.mjs.map
|
package/resources/edits.d.ts
CHANGED
|
@@ -1,90 +1,90 @@
|
|
|
1
1
|
import * as Core from 'openai/core';
|
|
2
2
|
import { APIResource } from 'openai/resource';
|
|
3
3
|
import * as Completions from 'openai/resources/completions';
|
|
4
|
-
import * as API from
|
|
4
|
+
import * as API from "./index.js";
|
|
5
5
|
export declare class Edits extends APIResource {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Creates a new edit for the provided input, instruction, and parameters.
|
|
8
|
+
*
|
|
9
|
+
* @deprecated The Edits API is deprecated; please use Chat Completions instead.
|
|
10
|
+
*
|
|
11
|
+
* https://openai.com/blog/gpt-4-api-general-availability#deprecation-of-the-edits-api
|
|
12
|
+
*/
|
|
13
|
+
create(body: EditCreateParams, options?: Core.RequestOptions): Core.APIPromise<Edit>;
|
|
14
14
|
}
|
|
15
15
|
export interface Edit {
|
|
16
|
-
/**
|
|
17
|
-
* A list of edit choices. Can be more than one if `n` is greater than 1.
|
|
18
|
-
*/
|
|
19
|
-
choices: Array<Edit.Choice>;
|
|
20
|
-
/**
|
|
21
|
-
* The Unix timestamp (in seconds) of when the edit was created.
|
|
22
|
-
*/
|
|
23
|
-
created: number;
|
|
24
|
-
/**
|
|
25
|
-
* The object type, which is always `edit`.
|
|
26
|
-
*/
|
|
27
|
-
object: string;
|
|
28
|
-
/**
|
|
29
|
-
* Usage statistics for the completion request.
|
|
30
|
-
*/
|
|
31
|
-
usage: Completions.CompletionUsage;
|
|
32
|
-
}
|
|
33
|
-
export declare namespace Edit {
|
|
34
|
-
interface Choice {
|
|
35
16
|
/**
|
|
36
|
-
*
|
|
37
|
-
|
|
38
|
-
|
|
17
|
+
* A list of edit choices. Can be more than one if `n` is greater than 1.
|
|
18
|
+
*/
|
|
19
|
+
choices: Array<Edit.Choice>;
|
|
20
|
+
/**
|
|
21
|
+
* The Unix timestamp (in seconds) of when the edit was created.
|
|
39
22
|
*/
|
|
40
|
-
|
|
23
|
+
created: number;
|
|
41
24
|
/**
|
|
42
|
-
* The
|
|
25
|
+
* The object type, which is always `edit`.
|
|
43
26
|
*/
|
|
44
|
-
|
|
27
|
+
object: string;
|
|
45
28
|
/**
|
|
46
|
-
*
|
|
29
|
+
* Usage statistics for the completion request.
|
|
47
30
|
*/
|
|
48
|
-
|
|
49
|
-
|
|
31
|
+
usage: Completions.CompletionUsage;
|
|
32
|
+
}
|
|
33
|
+
export declare namespace Edit {
|
|
34
|
+
interface Choice {
|
|
35
|
+
/**
|
|
36
|
+
* The reason the model stopped generating tokens. This will be `stop` if the model
|
|
37
|
+
* hit a natural stop point or a provided stop sequence, or `length` if the maximum
|
|
38
|
+
* number of tokens specified in the request was reached.
|
|
39
|
+
*/
|
|
40
|
+
finish_reason: 'stop' | 'length';
|
|
41
|
+
/**
|
|
42
|
+
* The index of the choice in the list of choices.
|
|
43
|
+
*/
|
|
44
|
+
index: number;
|
|
45
|
+
/**
|
|
46
|
+
* The edited result.
|
|
47
|
+
*/
|
|
48
|
+
text: string;
|
|
49
|
+
}
|
|
50
50
|
}
|
|
51
51
|
export interface EditCreateParams {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
52
|
+
/**
|
|
53
|
+
* The instruction that tells the model how to edit the prompt.
|
|
54
|
+
*/
|
|
55
|
+
instruction: string;
|
|
56
|
+
/**
|
|
57
|
+
* ID of the model to use. You can use the `text-davinci-edit-001` or
|
|
58
|
+
* `code-davinci-edit-001` model with this endpoint.
|
|
59
|
+
*/
|
|
60
|
+
model: (string & {}) | 'text-davinci-edit-001' | 'code-davinci-edit-001';
|
|
61
|
+
/**
|
|
62
|
+
* The input text to use as a starting point for the edit.
|
|
63
|
+
*/
|
|
64
|
+
input?: string | null;
|
|
65
|
+
/**
|
|
66
|
+
* How many edits to generate for the input and instruction.
|
|
67
|
+
*/
|
|
68
|
+
n?: number | null;
|
|
69
|
+
/**
|
|
70
|
+
* What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
|
|
71
|
+
* make the output more random, while lower values like 0.2 will make it more
|
|
72
|
+
* focused and deterministic.
|
|
73
|
+
*
|
|
74
|
+
* We generally recommend altering this or `top_p` but not both.
|
|
75
|
+
*/
|
|
76
|
+
temperature?: number | null;
|
|
77
|
+
/**
|
|
78
|
+
* An alternative to sampling with temperature, called nucleus sampling, where the
|
|
79
|
+
* model considers the results of the tokens with top_p probability mass. So 0.1
|
|
80
|
+
* means only the tokens comprising the top 10% probability mass are considered.
|
|
81
|
+
*
|
|
82
|
+
* We generally recommend altering this or `temperature` but not both.
|
|
83
|
+
*/
|
|
84
|
+
top_p?: number | null;
|
|
85
85
|
}
|
|
86
86
|
export declare namespace Edits {
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
export import Edit = API.Edit;
|
|
88
|
+
export import EditCreateParams = API.EditCreateParams;
|
|
89
89
|
}
|
|
90
|
-
//# sourceMappingURL=edits.d.ts.map
|
|
90
|
+
//# sourceMappingURL=edits.d.ts.map
|
package/resources/edits.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless.
|
|
3
|
-
Object.defineProperty(exports,
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Edits = void 0;
|
|
5
|
-
const resource_1 = require(
|
|
5
|
+
const resource_1 = require("openai/resource");
|
|
6
6
|
class Edits extends resource_1.APIResource {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Creates a new edit for the provided input, instruction, and parameters.
|
|
9
|
+
*
|
|
10
|
+
* @deprecated The Edits API is deprecated; please use Chat Completions instead.
|
|
11
|
+
*
|
|
12
|
+
* https://openai.com/blog/gpt-4-api-general-availability#deprecation-of-the-edits-api
|
|
13
|
+
*/
|
|
14
|
+
create(body, options) {
|
|
15
|
+
return this.post('/edits', { body, ...options });
|
|
16
|
+
}
|
|
17
17
|
}
|
|
18
18
|
exports.Edits = Edits;
|
|
19
|
-
(function (Edits) {
|
|
20
|
-
|
|
19
|
+
(function (Edits) {
|
|
20
|
+
})(Edits = exports.Edits || (exports.Edits = {}));
|
|
21
|
+
//# sourceMappingURL=edits.js.map
|
package/resources/edits.mjs
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
import { APIResource } from 'openai/resource';
|
|
3
3
|
export class Edits extends APIResource {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Creates a new edit for the provided input, instruction, and parameters.
|
|
6
|
+
*
|
|
7
|
+
* @deprecated The Edits API is deprecated; please use Chat Completions instead.
|
|
8
|
+
*
|
|
9
|
+
* https://openai.com/blog/gpt-4-api-general-availability#deprecation-of-the-edits-api
|
|
10
|
+
*/
|
|
11
|
+
create(body, options) {
|
|
12
|
+
return this.post('/edits', { body, ...options });
|
|
13
|
+
}
|
|
14
14
|
}
|
|
15
|
-
(function (Edits) {
|
|
16
|
-
|
|
15
|
+
(function (Edits) {
|
|
16
|
+
})(Edits || (Edits = {}));
|
|
17
|
+
//# sourceMappingURL=edits.mjs.map
|
|
@@ -1,95 +1,92 @@
|
|
|
1
1
|
import * as Core from 'openai/core';
|
|
2
2
|
import { APIResource } from 'openai/resource';
|
|
3
|
-
import * as API from
|
|
3
|
+
import * as API from "./index.js";
|
|
4
4
|
export declare class Embeddings extends APIResource {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
body: EmbeddingCreateParams,
|
|
10
|
-
options?: Core.RequestOptions,
|
|
11
|
-
): Core.APIPromise<CreateEmbeddingResponse>;
|
|
5
|
+
/**
|
|
6
|
+
* Creates an embedding vector representing the input text.
|
|
7
|
+
*/
|
|
8
|
+
create(body: EmbeddingCreateParams, options?: Core.RequestOptions): Core.APIPromise<CreateEmbeddingResponse>;
|
|
12
9
|
}
|
|
13
10
|
export interface CreateEmbeddingResponse {
|
|
14
|
-
/**
|
|
15
|
-
* The list of embeddings generated by the model.
|
|
16
|
-
*/
|
|
17
|
-
data: Array<Embedding>;
|
|
18
|
-
/**
|
|
19
|
-
* The name of the model used to generate the embedding.
|
|
20
|
-
*/
|
|
21
|
-
model: string;
|
|
22
|
-
/**
|
|
23
|
-
* The object type, which is always "embedding".
|
|
24
|
-
*/
|
|
25
|
-
object: string;
|
|
26
|
-
/**
|
|
27
|
-
* The usage information for the request.
|
|
28
|
-
*/
|
|
29
|
-
usage: CreateEmbeddingResponse.Usage;
|
|
30
|
-
}
|
|
31
|
-
export declare namespace CreateEmbeddingResponse {
|
|
32
|
-
/**
|
|
33
|
-
* The usage information for the request.
|
|
34
|
-
*/
|
|
35
|
-
interface Usage {
|
|
36
11
|
/**
|
|
37
|
-
* The
|
|
12
|
+
* The list of embeddings generated by the model.
|
|
13
|
+
*/
|
|
14
|
+
data: Array<Embedding>;
|
|
15
|
+
/**
|
|
16
|
+
* The name of the model used to generate the embedding.
|
|
38
17
|
*/
|
|
39
|
-
|
|
18
|
+
model: string;
|
|
19
|
+
/**
|
|
20
|
+
* The object type, which is always "embedding".
|
|
21
|
+
*/
|
|
22
|
+
object: string;
|
|
23
|
+
/**
|
|
24
|
+
* The usage information for the request.
|
|
25
|
+
*/
|
|
26
|
+
usage: CreateEmbeddingResponse.Usage;
|
|
27
|
+
}
|
|
28
|
+
export declare namespace CreateEmbeddingResponse {
|
|
40
29
|
/**
|
|
41
|
-
* The
|
|
30
|
+
* The usage information for the request.
|
|
42
31
|
*/
|
|
43
|
-
|
|
44
|
-
|
|
32
|
+
interface Usage {
|
|
33
|
+
/**
|
|
34
|
+
* The number of tokens used by the prompt.
|
|
35
|
+
*/
|
|
36
|
+
prompt_tokens: number;
|
|
37
|
+
/**
|
|
38
|
+
* The total number of tokens used by the request.
|
|
39
|
+
*/
|
|
40
|
+
total_tokens: number;
|
|
41
|
+
}
|
|
45
42
|
}
|
|
46
43
|
/**
|
|
47
44
|
* Represents an embedding vector returned by embedding endpoint.
|
|
48
45
|
*/
|
|
49
46
|
export interface Embedding {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
47
|
+
/**
|
|
48
|
+
* The embedding vector, which is a list of floats. The length of vector depends on
|
|
49
|
+
* the model as listed in the
|
|
50
|
+
* [embedding guide](https://platform.openai.com/docs/guides/embeddings).
|
|
51
|
+
*/
|
|
52
|
+
embedding: Array<number>;
|
|
53
|
+
/**
|
|
54
|
+
* The index of the embedding in the list of embeddings.
|
|
55
|
+
*/
|
|
56
|
+
index: number;
|
|
57
|
+
/**
|
|
58
|
+
* The object type, which is always "embedding".
|
|
59
|
+
*/
|
|
60
|
+
object: string;
|
|
64
61
|
}
|
|
65
62
|
export interface EmbeddingCreateParams {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Input text to embed, encoded as a string or array of tokens. To embed multiple
|
|
65
|
+
* inputs in a single request, pass an array of strings or array of token arrays.
|
|
66
|
+
* Each input must not exceed the max input tokens for the model (8191 tokens for
|
|
67
|
+
* `text-embedding-ada-002`).
|
|
68
|
+
* [Example Python code](https://github.com/openai/openai-cookbook/blob/main/examples/How_to_count_tokens_with_tiktoken.ipynb)
|
|
69
|
+
* for counting tokens.
|
|
70
|
+
*/
|
|
71
|
+
input: string | Array<string> | Array<number> | Array<Array<number>>;
|
|
72
|
+
/**
|
|
73
|
+
* ID of the model to use. You can use the
|
|
74
|
+
* [List models](https://platform.openai.com/docs/api-reference/models/list) API to
|
|
75
|
+
* see all of your available models, or see our
|
|
76
|
+
* [Model overview](https://platform.openai.com/docs/models/overview) for
|
|
77
|
+
* descriptions of them.
|
|
78
|
+
*/
|
|
79
|
+
model: (string & {}) | 'text-embedding-ada-002';
|
|
80
|
+
/**
|
|
81
|
+
* A unique identifier representing your end-user, which can help OpenAI to monitor
|
|
82
|
+
* and detect abuse.
|
|
83
|
+
* [Learn more](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids).
|
|
84
|
+
*/
|
|
85
|
+
user?: string;
|
|
89
86
|
}
|
|
90
87
|
export declare namespace Embeddings {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
export import CreateEmbeddingResponse = API.CreateEmbeddingResponse;
|
|
89
|
+
export import Embedding = API.Embedding;
|
|
90
|
+
export import EmbeddingCreateParams = API.EmbeddingCreateParams;
|
|
94
91
|
}
|
|
95
|
-
//# sourceMappingURL=embeddings.d.ts.map
|
|
92
|
+
//# sourceMappingURL=embeddings.d.ts.map
|
package/resources/embeddings.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless.
|
|
3
|
-
Object.defineProperty(exports,
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Embeddings = void 0;
|
|
5
|
-
const resource_1 = require(
|
|
5
|
+
const resource_1 = require("openai/resource");
|
|
6
6
|
class Embeddings extends resource_1.APIResource {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Creates an embedding vector representing the input text.
|
|
9
|
+
*/
|
|
10
|
+
create(body, options) {
|
|
11
|
+
return this.post('/embeddings', { body, ...options });
|
|
12
|
+
}
|
|
13
13
|
}
|
|
14
14
|
exports.Embeddings = Embeddings;
|
|
15
|
-
(function (Embeddings) {
|
|
16
|
-
|
|
15
|
+
(function (Embeddings) {
|
|
16
|
+
})(Embeddings = exports.Embeddings || (exports.Embeddings = {}));
|
|
17
|
+
//# sourceMappingURL=embeddings.js.map
|
package/resources/embeddings.mjs
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
import { APIResource } from 'openai/resource';
|
|
3
3
|
export class Embeddings extends APIResource {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Creates an embedding vector representing the input text.
|
|
6
|
+
*/
|
|
7
|
+
create(body, options) {
|
|
8
|
+
return this.post('/embeddings', { body, ...options });
|
|
9
|
+
}
|
|
10
10
|
}
|
|
11
|
-
(function (Embeddings) {
|
|
12
|
-
|
|
11
|
+
(function (Embeddings) {
|
|
12
|
+
})(Embeddings || (Embeddings = {}));
|
|
13
|
+
//# sourceMappingURL=embeddings.mjs.map
|