openai 4.20.1 → 4.22.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 +37 -0
- package/README.md +3 -3
- package/error.d.ts.map +1 -1
- package/error.js +2 -1
- package/error.js.map +1 -1
- package/error.mjs +2 -1
- package/error.mjs.map +1 -1
- package/index.d.mts +7 -5
- package/index.d.ts +7 -5
- package/index.d.ts.map +1 -1
- package/index.js +5 -5
- package/index.js.map +1 -1
- package/index.mjs +5 -5
- package/index.mjs.map +1 -1
- package/lib/AbstractChatCompletionRunner.d.ts +1 -1
- package/lib/AbstractChatCompletionRunner.d.ts.map +1 -1
- package/lib/AbstractChatCompletionRunner.js +21 -6
- package/lib/AbstractChatCompletionRunner.js.map +1 -1
- package/lib/AbstractChatCompletionRunner.mjs +21 -6
- package/lib/AbstractChatCompletionRunner.mjs.map +1 -1
- package/lib/ChatCompletionRunFunctions.test.js +823 -549
- package/lib/ChatCompletionRunFunctions.test.js.map +1 -1
- package/lib/ChatCompletionRunFunctions.test.mjs +824 -550
- package/lib/ChatCompletionRunFunctions.test.mjs.map +1 -1
- package/lib/ChatCompletionRunner.d.ts +1 -0
- package/lib/ChatCompletionRunner.d.ts.map +1 -1
- package/lib/ChatCompletionRunner.js +11 -2
- package/lib/ChatCompletionRunner.js.map +1 -1
- package/lib/ChatCompletionRunner.mjs +11 -2
- package/lib/ChatCompletionRunner.mjs.map +1 -1
- package/lib/ChatCompletionStreamingRunner.d.ts +1 -0
- package/lib/ChatCompletionStreamingRunner.d.ts.map +1 -1
- package/lib/ChatCompletionStreamingRunner.js +7 -4
- package/lib/ChatCompletionStreamingRunner.js.map +1 -1
- package/lib/ChatCompletionStreamingRunner.mjs +7 -4
- package/lib/ChatCompletionStreamingRunner.mjs.map +1 -1
- package/lib/RunnableFunction.d.ts +19 -3
- package/lib/RunnableFunction.d.ts.map +1 -1
- package/lib/RunnableFunction.js +14 -1
- package/lib/RunnableFunction.js.map +1 -1
- package/lib/RunnableFunction.mjs +12 -0
- package/lib/RunnableFunction.mjs.map +1 -1
- package/package.json +3 -2
- package/resources/audio/speech.d.ts +3 -1
- 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/beta/chat/completions.d.ts +2 -8
- package/resources/beta/chat/completions.d.ts.map +1 -1
- package/resources/beta/chat/completions.js +2 -1
- package/resources/beta/chat/completions.js.map +1 -1
- package/resources/beta/chat/completions.mjs +1 -1
- package/resources/beta/chat/completions.mjs.map +1 -1
- package/resources/chat/completions.d.ts +52 -34
- 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 -2
- package/resources/embeddings.d.ts +2 -1
- package/resources/embeddings.d.ts.map +1 -1
- package/resources/embeddings.js.map +1 -1
- package/resources/embeddings.mjs.map +1 -1
- package/resources/files.d.ts +3 -3
- package/resources/files.js +3 -3
- package/resources/files.mjs +3 -3
- package/resources/shared.d.ts +12 -14
- package/resources/shared.d.ts.map +1 -1
- package/src/error.ts +2 -1
- package/src/index.ts +8 -5
- package/src/lib/AbstractChatCompletionRunner.ts +37 -13
- package/src/lib/ChatCompletionRunFunctions.test.ts +828 -558
- package/src/lib/ChatCompletionRunner.ts +11 -2
- package/src/lib/ChatCompletionStreamingRunner.ts +11 -12
- package/src/lib/RunnableFunction.ts +33 -7
- package/src/resources/audio/speech.ts +3 -1
- package/src/resources/beta/chat/completions.ts +2 -7
- package/src/resources/chat/completions.ts +56 -35
- package/src/resources/completions.ts +2 -2
- package/src/resources/embeddings.ts +2 -1
- package/src/resources/files.ts +3 -3
- package/src/resources/shared.ts +13 -15
- package/src/streaming.ts +4 -1
- package/src/uploads.ts +2 -3
- package/src/version.ts +1 -1
- package/streaming.d.ts.map +1 -1
- package/streaming.js.map +1 -1
- package/streaming.mjs.map +1 -1
- package/uploads.d.ts.map +1 -1
- package/uploads.js +2 -1
- package/uploads.js.map +1 -1
- package/uploads.mjs +2 -1
- package/uploads.mjs.map +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -30,13 +30,18 @@ export type ChatCompletionToolRunnerParams<FunctionsArgs extends BaseFunctionsAr
|
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
export class ChatCompletionRunner extends AbstractChatCompletionRunner<ChatCompletionRunnerEvents> {
|
|
33
|
+
/** @deprecated - please use `runTools` instead. */
|
|
33
34
|
static runFunctions(
|
|
34
35
|
completions: Completions,
|
|
35
36
|
params: ChatCompletionFunctionRunnerParams<any[]>,
|
|
36
37
|
options?: RunnerOptions,
|
|
37
38
|
): ChatCompletionRunner {
|
|
38
39
|
const runner = new ChatCompletionRunner();
|
|
39
|
-
|
|
40
|
+
const opts = {
|
|
41
|
+
...options,
|
|
42
|
+
headers: { ...options?.headers, 'X-Stainless-Helper-Method': 'runFunctions' },
|
|
43
|
+
};
|
|
44
|
+
runner._run(() => runner._runFunctions(completions, params, opts));
|
|
40
45
|
return runner;
|
|
41
46
|
}
|
|
42
47
|
|
|
@@ -46,7 +51,11 @@ export class ChatCompletionRunner extends AbstractChatCompletionRunner<ChatCompl
|
|
|
46
51
|
options?: RunnerOptions,
|
|
47
52
|
): ChatCompletionRunner {
|
|
48
53
|
const runner = new ChatCompletionRunner();
|
|
49
|
-
|
|
54
|
+
const opts = {
|
|
55
|
+
...options,
|
|
56
|
+
headers: { ...options?.headers, 'X-Stainless-Helper-Method': 'runTools' },
|
|
57
|
+
};
|
|
58
|
+
runner._run(() => runner._runTools(completions, params, opts));
|
|
50
59
|
return runner;
|
|
51
60
|
}
|
|
52
61
|
|
|
@@ -37,18 +37,18 @@ export class ChatCompletionStreamingRunner
|
|
|
37
37
|
return runner;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
/** @deprecated - please use `runTools` instead. */
|
|
40
41
|
static runFunctions<T extends (string | object)[]>(
|
|
41
42
|
completions: Completions,
|
|
42
43
|
params: ChatCompletionStreamingFunctionRunnerParams<T>,
|
|
43
44
|
options?: RunnerOptions,
|
|
44
45
|
): ChatCompletionStreamingRunner {
|
|
45
46
|
const runner = new ChatCompletionStreamingRunner();
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
);
|
|
47
|
+
const opts = {
|
|
48
|
+
...options,
|
|
49
|
+
headers: { ...options?.headers, 'X-Stainless-Helper-Method': 'runFunctions' },
|
|
50
|
+
};
|
|
51
|
+
runner._run(() => runner._runFunctions(completions, params, opts));
|
|
52
52
|
return runner;
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -58,12 +58,11 @@ export class ChatCompletionStreamingRunner
|
|
|
58
58
|
options?: RunnerOptions,
|
|
59
59
|
): ChatCompletionStreamingRunner {
|
|
60
60
|
const runner = new ChatCompletionStreamingRunner();
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
);
|
|
61
|
+
const opts = {
|
|
62
|
+
...options,
|
|
63
|
+
headers: { ...options?.headers, 'X-Stainless-Helper-Method': 'runTools' },
|
|
64
|
+
};
|
|
65
|
+
runner._run(() => runner._runTools(completions, params, opts));
|
|
67
66
|
return runner;
|
|
68
67
|
}
|
|
69
68
|
}
|
|
@@ -61,9 +61,18 @@ export type RunnableFunction<Args extends object | string> =
|
|
|
61
61
|
: Args extends object ? RunnableFunctionWithParse<Args>
|
|
62
62
|
: never;
|
|
63
63
|
|
|
64
|
-
export type RunnableToolFunction<Args extends object | string> =
|
|
64
|
+
export type RunnableToolFunction<Args extends object | string> =
|
|
65
|
+
Args extends string ? RunnableToolFunctionWithoutParse
|
|
66
|
+
: Args extends object ? RunnableToolFunctionWithParse<Args>
|
|
67
|
+
: never;
|
|
68
|
+
|
|
69
|
+
export type RunnableToolFunctionWithoutParse = {
|
|
70
|
+
type: 'function';
|
|
71
|
+
function: RunnableFunctionWithoutParse;
|
|
72
|
+
};
|
|
73
|
+
export type RunnableToolFunctionWithParse<Args extends object> = {
|
|
65
74
|
type: 'function';
|
|
66
|
-
function:
|
|
75
|
+
function: RunnableFunctionWithParse<Args>;
|
|
67
76
|
};
|
|
68
77
|
|
|
69
78
|
export function isRunnableFunctionWithParse<Args extends object>(
|
|
@@ -91,8 +100,16 @@ export type RunnableTools<FunctionsArgs extends BaseFunctionsArgs> =
|
|
|
91
100
|
/**
|
|
92
101
|
* This is helper class for passing a `function` and `parse` where the `function`
|
|
93
102
|
* argument type matches the `parse` return type.
|
|
103
|
+
*
|
|
104
|
+
* @deprecated - please use ParsingToolFunction instead.
|
|
94
105
|
*/
|
|
95
106
|
export class ParsingFunction<Args extends object> {
|
|
107
|
+
function: RunnableFunctionWithParse<Args>['function'];
|
|
108
|
+
parse: RunnableFunctionWithParse<Args>['parse'];
|
|
109
|
+
parameters: RunnableFunctionWithParse<Args>['parameters'];
|
|
110
|
+
description: RunnableFunctionWithParse<Args>['description'];
|
|
111
|
+
name?: RunnableFunctionWithParse<Args>['name'];
|
|
112
|
+
|
|
96
113
|
constructor(input: RunnableFunctionWithParse<Args>) {
|
|
97
114
|
this.function = input.function;
|
|
98
115
|
this.parse = input.parse;
|
|
@@ -100,9 +117,18 @@ export class ParsingFunction<Args extends object> {
|
|
|
100
117
|
this.description = input.description;
|
|
101
118
|
this.name = input.name;
|
|
102
119
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* This is helper class for passing a `function` and `parse` where the `function`
|
|
124
|
+
* argument type matches the `parse` return type.
|
|
125
|
+
*/
|
|
126
|
+
export class ParsingToolFunction<Args extends object> {
|
|
127
|
+
type: 'function';
|
|
128
|
+
function: RunnableFunctionWithParse<Args>;
|
|
129
|
+
|
|
130
|
+
constructor(input: RunnableFunctionWithParse<Args>) {
|
|
131
|
+
this.type = 'function';
|
|
132
|
+
this.function = input;
|
|
133
|
+
}
|
|
108
134
|
}
|
|
@@ -28,7 +28,9 @@ export interface SpeechCreateParams {
|
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* The voice to use when generating the audio. Supported voices are `alloy`,
|
|
31
|
-
* `echo`, `fable`, `onyx`, `nova`, and `shimmer`.
|
|
31
|
+
* `echo`, `fable`, `onyx`, `nova`, and `shimmer`. Previews of the voices are
|
|
32
|
+
* available in the
|
|
33
|
+
* [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech/voice-options).
|
|
32
34
|
*/
|
|
33
35
|
voice: 'alloy' | 'echo' | 'fable' | 'onyx' | 'nova' | 'shimmer';
|
|
34
36
|
|
|
@@ -19,6 +19,7 @@ export {
|
|
|
19
19
|
RunnableFunctionWithParse,
|
|
20
20
|
RunnableFunctionWithoutParse,
|
|
21
21
|
ParsingFunction,
|
|
22
|
+
ParsingToolFunction,
|
|
22
23
|
} from "../../../lib/RunnableFunction";
|
|
23
24
|
import { ChatCompletionToolRunnerParams } from "../../../lib/ChatCompletionRunner";
|
|
24
25
|
export { ChatCompletionToolRunnerParams } from "../../../lib/ChatCompletionRunner";
|
|
@@ -29,13 +30,7 @@ export { ChatCompletionStream, type ChatCompletionStreamParams } from "../../../
|
|
|
29
30
|
|
|
30
31
|
export class Completions extends APIResource {
|
|
31
32
|
/**
|
|
32
|
-
*
|
|
33
|
-
* endpoint which automatically calls the JavaScript functions you provide and
|
|
34
|
-
* sends their results back to the /chat/completions endpoint, looping as long as
|
|
35
|
-
* the model requests function calls.
|
|
36
|
-
*
|
|
37
|
-
* For more details and examples, see
|
|
38
|
-
* [the docs](https://github.com/openai/openai-node#automated-function-calls)
|
|
33
|
+
* @deprecated - use `runTools` instead.
|
|
39
34
|
*/
|
|
40
35
|
runFunctions<FunctionsArgs extends BaseFunctionsArgs>(
|
|
41
36
|
body: ChatCompletionFunctionRunnerParams<FunctionsArgs>,
|
|
@@ -105,14 +105,15 @@ export namespace ChatCompletion {
|
|
|
105
105
|
|
|
106
106
|
export interface ChatCompletionAssistantMessageParam {
|
|
107
107
|
/**
|
|
108
|
-
* The
|
|
108
|
+
* The role of the messages author, in this case `assistant`.
|
|
109
109
|
*/
|
|
110
|
-
|
|
110
|
+
role: 'assistant';
|
|
111
111
|
|
|
112
112
|
/**
|
|
113
|
-
* The
|
|
113
|
+
* The contents of the assistant message. Required unless `tool_calls` or
|
|
114
|
+
* `function_call` is specified.
|
|
114
115
|
*/
|
|
115
|
-
|
|
116
|
+
content?: string | null;
|
|
116
117
|
|
|
117
118
|
/**
|
|
118
119
|
* Deprecated and replaced by `tool_calls`. The name and arguments of a function
|
|
@@ -120,6 +121,12 @@ export interface ChatCompletionAssistantMessageParam {
|
|
|
120
121
|
*/
|
|
121
122
|
function_call?: ChatCompletionAssistantMessageParam.FunctionCall;
|
|
122
123
|
|
|
124
|
+
/**
|
|
125
|
+
* An optional name for the participant. Provides the model information to
|
|
126
|
+
* differentiate between participants of the same role.
|
|
127
|
+
*/
|
|
128
|
+
name?: string;
|
|
129
|
+
|
|
123
130
|
/**
|
|
124
131
|
* The tool calls generated by the model, such as function calls.
|
|
125
132
|
*/
|
|
@@ -309,7 +316,8 @@ export namespace ChatCompletionContentPartImage {
|
|
|
309
316
|
url: string;
|
|
310
317
|
|
|
311
318
|
/**
|
|
312
|
-
* Specifies the detail level of the image.
|
|
319
|
+
* Specifies the detail level of the image. Learn more in the
|
|
320
|
+
* [Vision guide](https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding).
|
|
313
321
|
*/
|
|
314
322
|
detail?: 'auto' | 'low' | 'high';
|
|
315
323
|
}
|
|
@@ -340,9 +348,9 @@ export interface ChatCompletionFunctionCallOption {
|
|
|
340
348
|
|
|
341
349
|
export interface ChatCompletionFunctionMessageParam {
|
|
342
350
|
/**
|
|
343
|
-
* The
|
|
351
|
+
* The contents of the function message.
|
|
344
352
|
*/
|
|
345
|
-
content: string
|
|
353
|
+
content: string;
|
|
346
354
|
|
|
347
355
|
/**
|
|
348
356
|
* The name of the function to call.
|
|
@@ -451,12 +459,12 @@ export namespace ChatCompletionMessageToolCall {
|
|
|
451
459
|
* function.
|
|
452
460
|
*/
|
|
453
461
|
export interface ChatCompletionNamedToolChoice {
|
|
454
|
-
function
|
|
462
|
+
function: ChatCompletionNamedToolChoice.Function;
|
|
455
463
|
|
|
456
464
|
/**
|
|
457
465
|
* The type of the tool. Currently, only `function` is supported.
|
|
458
466
|
*/
|
|
459
|
-
type
|
|
467
|
+
type: 'function';
|
|
460
468
|
}
|
|
461
469
|
|
|
462
470
|
export namespace ChatCompletionNamedToolChoice {
|
|
@@ -477,12 +485,18 @@ export interface ChatCompletionSystemMessageParam {
|
|
|
477
485
|
/**
|
|
478
486
|
* The contents of the system message.
|
|
479
487
|
*/
|
|
480
|
-
content: string
|
|
488
|
+
content: string;
|
|
481
489
|
|
|
482
490
|
/**
|
|
483
491
|
* The role of the messages author, in this case `system`.
|
|
484
492
|
*/
|
|
485
493
|
role: 'system';
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* An optional name for the participant. Provides the model information to
|
|
497
|
+
* differentiate between participants of the same role.
|
|
498
|
+
*/
|
|
499
|
+
name?: string;
|
|
486
500
|
}
|
|
487
501
|
|
|
488
502
|
export interface ChatCompletionTool {
|
|
@@ -511,7 +525,7 @@ export interface ChatCompletionToolMessageParam {
|
|
|
511
525
|
/**
|
|
512
526
|
* The contents of the tool message.
|
|
513
527
|
*/
|
|
514
|
-
content: string
|
|
528
|
+
content: string;
|
|
515
529
|
|
|
516
530
|
/**
|
|
517
531
|
* The role of the messages author, in this case `tool`.
|
|
@@ -528,12 +542,18 @@ export interface ChatCompletionUserMessageParam {
|
|
|
528
542
|
/**
|
|
529
543
|
* The contents of the user message.
|
|
530
544
|
*/
|
|
531
|
-
content: string | Array<ChatCompletionContentPart
|
|
545
|
+
content: string | Array<ChatCompletionContentPart>;
|
|
532
546
|
|
|
533
547
|
/**
|
|
534
548
|
* The role of the messages author, in this case `user`.
|
|
535
549
|
*/
|
|
536
550
|
role: 'user';
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* An optional name for the participant. Provides the model information to
|
|
554
|
+
* differentiate between participants of the same role.
|
|
555
|
+
*/
|
|
556
|
+
name?: string;
|
|
537
557
|
}
|
|
538
558
|
|
|
539
559
|
/**
|
|
@@ -567,11 +587,11 @@ export interface ChatCompletionCreateParamsBase {
|
|
|
567
587
|
| 'gpt-4-32k'
|
|
568
588
|
| 'gpt-4-32k-0314'
|
|
569
589
|
| 'gpt-4-32k-0613'
|
|
570
|
-
| 'gpt-3.5-turbo-1106'
|
|
571
590
|
| 'gpt-3.5-turbo'
|
|
572
591
|
| 'gpt-3.5-turbo-16k'
|
|
573
592
|
| 'gpt-3.5-turbo-0301'
|
|
574
593
|
| 'gpt-3.5-turbo-0613'
|
|
594
|
+
| 'gpt-3.5-turbo-1106'
|
|
575
595
|
| 'gpt-3.5-turbo-16k-0613';
|
|
576
596
|
|
|
577
597
|
/**
|
|
@@ -579,7 +599,7 @@ export interface ChatCompletionCreateParamsBase {
|
|
|
579
599
|
* existing frequency in the text so far, decreasing the model's likelihood to
|
|
580
600
|
* repeat the same line verbatim.
|
|
581
601
|
*
|
|
582
|
-
* [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/
|
|
602
|
+
* [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details)
|
|
583
603
|
*/
|
|
584
604
|
frequency_penalty?: number | null;
|
|
585
605
|
|
|
@@ -627,7 +647,9 @@ export interface ChatCompletionCreateParamsBase {
|
|
|
627
647
|
max_tokens?: number | null;
|
|
628
648
|
|
|
629
649
|
/**
|
|
630
|
-
* How many chat completion choices to generate for each input message.
|
|
650
|
+
* How many chat completion choices to generate for each input message. Note that
|
|
651
|
+
* you will be charged based on the number of generated tokens across all of the
|
|
652
|
+
* choices. Keep `n` as `1` to minimize costs.
|
|
631
653
|
*/
|
|
632
654
|
n?: number | null;
|
|
633
655
|
|
|
@@ -636,7 +658,7 @@ export interface ChatCompletionCreateParamsBase {
|
|
|
636
658
|
* whether they appear in the text so far, increasing the model's likelihood to
|
|
637
659
|
* talk about new topics.
|
|
638
660
|
*
|
|
639
|
-
* [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/
|
|
661
|
+
* [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details)
|
|
640
662
|
*/
|
|
641
663
|
presence_penalty?: number | null;
|
|
642
664
|
|
|
@@ -649,10 +671,10 @@ export interface ChatCompletionCreateParamsBase {
|
|
|
649
671
|
* **Important:** when using JSON mode, you **must** also instruct the model to
|
|
650
672
|
* produce JSON yourself via a system or user message. Without this, the model may
|
|
651
673
|
* generate an unending stream of whitespace until the generation reaches the token
|
|
652
|
-
* limit, resulting in
|
|
653
|
-
*
|
|
654
|
-
*
|
|
655
|
-
*
|
|
674
|
+
* limit, resulting in a long-running and seemingly "stuck" request. Also note that
|
|
675
|
+
* the message content may be partially cut off if `finish_reason="length"`, which
|
|
676
|
+
* indicates the generation exceeded `max_tokens` or the conversation exceeded the
|
|
677
|
+
* max context length.
|
|
656
678
|
*/
|
|
657
679
|
response_format?: ChatCompletionCreateParams.ResponseFormat;
|
|
658
680
|
|
|
@@ -734,23 +756,22 @@ export namespace ChatCompletionCreateParams {
|
|
|
734
756
|
*/
|
|
735
757
|
name: string;
|
|
736
758
|
|
|
759
|
+
/**
|
|
760
|
+
* A description of what the function does, used by the model to choose when and
|
|
761
|
+
* how to call the function.
|
|
762
|
+
*/
|
|
763
|
+
description?: string;
|
|
764
|
+
|
|
737
765
|
/**
|
|
738
766
|
* The parameters the functions accepts, described as a JSON Schema object. See the
|
|
739
|
-
* [guide](https://platform.openai.com/docs/guides/
|
|
740
|
-
* examples, and the
|
|
767
|
+
* [guide](https://platform.openai.com/docs/guides/text-generation/function-calling)
|
|
768
|
+
* for examples, and the
|
|
741
769
|
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
|
|
742
770
|
* documentation about the format.
|
|
743
771
|
*
|
|
744
|
-
*
|
|
745
|
-
* `{"type": "object", "properties": {}}`.
|
|
746
|
-
*/
|
|
747
|
-
parameters: Shared.FunctionParameters;
|
|
748
|
-
|
|
749
|
-
/**
|
|
750
|
-
* A description of what the function does, used by the model to choose when and
|
|
751
|
-
* how to call the function.
|
|
772
|
+
* Omitting `parameters` defines a function with an empty parameter list.
|
|
752
773
|
*/
|
|
753
|
-
|
|
774
|
+
parameters?: Shared.FunctionParameters;
|
|
754
775
|
}
|
|
755
776
|
|
|
756
777
|
/**
|
|
@@ -762,10 +783,10 @@ export namespace ChatCompletionCreateParams {
|
|
|
762
783
|
* **Important:** when using JSON mode, you **must** also instruct the model to
|
|
763
784
|
* produce JSON yourself via a system or user message. Without this, the model may
|
|
764
785
|
* generate an unending stream of whitespace until the generation reaches the token
|
|
765
|
-
* limit, resulting in
|
|
766
|
-
*
|
|
767
|
-
*
|
|
768
|
-
*
|
|
786
|
+
* limit, resulting in a long-running and seemingly "stuck" request. Also note that
|
|
787
|
+
* the message content may be partially cut off if `finish_reason="length"`, which
|
|
788
|
+
* indicates the generation exceeded `max_tokens` or the conversation exceeded the
|
|
789
|
+
* max context length.
|
|
769
790
|
*/
|
|
770
791
|
export interface ResponseFormat {
|
|
771
792
|
/**
|
|
@@ -177,7 +177,7 @@ export interface CompletionCreateParamsBase {
|
|
|
177
177
|
* existing frequency in the text so far, decreasing the model's likelihood to
|
|
178
178
|
* repeat the same line verbatim.
|
|
179
179
|
*
|
|
180
|
-
* [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/
|
|
180
|
+
* [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details)
|
|
181
181
|
*/
|
|
182
182
|
frequency_penalty?: number | null;
|
|
183
183
|
|
|
@@ -232,7 +232,7 @@ export interface CompletionCreateParamsBase {
|
|
|
232
232
|
* whether they appear in the text so far, increasing the model's likelihood to
|
|
233
233
|
* talk about new topics.
|
|
234
234
|
*
|
|
235
|
-
* [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/
|
|
235
|
+
* [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details)
|
|
236
236
|
*/
|
|
237
237
|
presence_penalty?: number | null;
|
|
238
238
|
|
|
@@ -82,7 +82,8 @@ export interface EmbeddingCreateParams {
|
|
|
82
82
|
* Input text to embed, encoded as a string or array of tokens. To embed multiple
|
|
83
83
|
* inputs in a single request, pass an array of strings or array of token arrays.
|
|
84
84
|
* The input must not exceed the max input tokens for the model (8192 tokens for
|
|
85
|
-
* `text-embedding-ada-002`)
|
|
85
|
+
* `text-embedding-ada-002`), cannot be an empty string, and any array must be 2048
|
|
86
|
+
* dimensions or less.
|
|
86
87
|
* [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken)
|
|
87
88
|
* for counting tokens.
|
|
88
89
|
*/
|
package/src/resources/files.ts
CHANGED
|
@@ -12,10 +12,10 @@ import { Page } from "../pagination";
|
|
|
12
12
|
|
|
13
13
|
export class Files extends APIResource {
|
|
14
14
|
/**
|
|
15
|
-
* Upload a file that can be used across various endpoints
|
|
16
|
-
*
|
|
15
|
+
* Upload a file that can be used across various endpoints. The size of all the
|
|
16
|
+
* files uploaded by one organization can be up to 100 GB.
|
|
17
17
|
*
|
|
18
|
-
* The size of individual files
|
|
18
|
+
* The size of individual files can be a maximum of 512 MB. See the
|
|
19
19
|
* [Assistants Tools guide](https://platform.openai.com/docs/assistants/tools) to
|
|
20
20
|
* learn more about the types of files supported. The Fine-tuning API only supports
|
|
21
21
|
* `.jsonl` files.
|
package/src/resources/shared.ts
CHANGED
|
@@ -7,33 +7,31 @@ export interface FunctionDefinition {
|
|
|
7
7
|
*/
|
|
8
8
|
name: string;
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* A description of what the function does, used by the model to choose when and
|
|
12
|
+
* how to call the function.
|
|
13
|
+
*/
|
|
14
|
+
description?: string;
|
|
15
|
+
|
|
10
16
|
/**
|
|
11
17
|
* The parameters the functions accepts, described as a JSON Schema object. See the
|
|
12
|
-
* [guide](https://platform.openai.com/docs/guides/
|
|
13
|
-
* examples, and the
|
|
18
|
+
* [guide](https://platform.openai.com/docs/guides/text-generation/function-calling)
|
|
19
|
+
* for examples, and the
|
|
14
20
|
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
|
|
15
21
|
* documentation about the format.
|
|
16
22
|
*
|
|
17
|
-
*
|
|
18
|
-
* `{"type": "object", "properties": {}}`.
|
|
23
|
+
* Omitting `parameters` defines a function with an empty parameter list.
|
|
19
24
|
*/
|
|
20
|
-
parameters
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* A description of what the function does, used by the model to choose when and
|
|
24
|
-
* how to call the function.
|
|
25
|
-
*/
|
|
26
|
-
description?: string;
|
|
25
|
+
parameters?: FunctionParameters;
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
/**
|
|
30
29
|
* The parameters the functions accepts, described as a JSON Schema object. See the
|
|
31
|
-
* [guide](https://platform.openai.com/docs/guides/
|
|
32
|
-
* examples, and the
|
|
30
|
+
* [guide](https://platform.openai.com/docs/guides/text-generation/function-calling)
|
|
31
|
+
* for examples, and the
|
|
33
32
|
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
|
|
34
33
|
* documentation about the format.
|
|
35
34
|
*
|
|
36
|
-
*
|
|
37
|
-
* `{"type": "object", "properties": {}}`.
|
|
35
|
+
* Omitting `parameters` defines a function with an empty parameter list.
|
|
38
36
|
*/
|
|
39
37
|
export type FunctionParameters = Record<string, unknown>;
|
package/src/streaming.ts
CHANGED
|
@@ -14,7 +14,10 @@ type ServerSentEvent = {
|
|
|
14
14
|
export class Stream<Item> implements AsyncIterable<Item> {
|
|
15
15
|
controller: AbortController;
|
|
16
16
|
|
|
17
|
-
constructor(
|
|
17
|
+
constructor(
|
|
18
|
+
private iterator: () => AsyncIterator<Item>,
|
|
19
|
+
controller: AbortController,
|
|
20
|
+
) {
|
|
18
21
|
this.controller = controller;
|
|
19
22
|
}
|
|
20
23
|
|
package/src/uploads.ts
CHANGED
|
@@ -146,9 +146,8 @@ async function getBytes(value: ToFileInput): Promise<Array<BlobPart>> {
|
|
|
146
146
|
}
|
|
147
147
|
} else {
|
|
148
148
|
throw new Error(
|
|
149
|
-
`Unexpected data type: ${typeof value}; constructor: ${
|
|
150
|
-
|
|
151
|
-
}; props: ${propsForError(value)}`,
|
|
149
|
+
`Unexpected data type: ${typeof value}; constructor: ${value?.constructor
|
|
150
|
+
?.name}; props: ${propsForError(value)}`,
|
|
152
151
|
);
|
|
153
152
|
}
|
|
154
153
|
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '4.
|
|
1
|
+
export const VERSION = '4.22.0'; // x-release-please-version
|
package/streaming.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAa/D,qBAAa,MAAM,CAAC,IAAI,CAAE,YAAW,aAAa,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAa/D,qBAAa,MAAM,CAAC,IAAI,CAAE,YAAW,aAAa,CAAC,IAAI,CAAC;IAIpD,OAAO,CAAC,QAAQ;IAHlB,UAAU,EAAE,eAAe,CAAC;gBAGlB,QAAQ,EAAE,MAAM,aAAa,CAAC,IAAI,CAAC,EAC3C,UAAU,EAAE,eAAe;IAK7B,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,eAAe;IAyE5E;;;OAGG;IACH,MAAM,CAAC,kBAAkB,CAAC,IAAI,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,eAAe;IA2C3F,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC;IAI7C;;;OAGG;IACH,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAwBnC;;;;OAIG;IACH,gBAAgB,IAAI,cAAc;CA0BnC"}
|
package/streaming.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streaming.js","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":";;;AAAA,6CAA+D;AAC/D,sCAAsC;AAEtC,wCAAwC;AAUxC,MAAa,MAAM;IAGjB,
|
|
1
|
+
{"version":3,"file":"streaming.js","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":";;;AAAA,6CAA+D;AAC/D,sCAAsC;AAEtC,wCAAwC;AAUxC,MAAa,MAAM;IAGjB,YACU,QAAmC,EAC3C,UAA2B;QADnB,aAAQ,GAAR,QAAQ,CAA2B;QAG3C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED,MAAM,CAAC,eAAe,CAAO,QAAkB,EAAE,UAA2B;QAC1E,IAAI,QAAQ,GAAG,KAAK,CAAC;QACrB,MAAM,OAAO,GAAG,IAAI,UAAU,EAAE,CAAC;QAEjC,KAAK,SAAS,CAAC,CAAC,YAAY;YAC1B,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;gBAClB,UAAU,CAAC,KAAK,EAAE,CAAC;gBACnB,MAAM,IAAI,mBAAW,CAAC,mDAAmD,CAAC,CAAC;aAC5E;YAED,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;YAEtC,MAAM,IAAI,GAAG,2BAA2B,CAAQ,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC/D,I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AAM,CAAC,WAAW,EAAE,CAAC,CAAC,2CAA2C;gBACjE,MAAM,CAAC,CAAC;aACT;QACH,CAAC;QACD,KAAK,CAAC,MAAM;YACV,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;YACtC,MAAM,CAAC,WAAW,EAAE,CAAC;YACrB,MAAM,aAAa,CAAC;YACpB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;QAC1C,CAAC;QACD,CAAC,MAAM,CAAC,aAAa,CAAC;YACpB,OAAO,IAAI,CAAC;QACd,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/streaming.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streaming.mjs","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":"OAAO,EAAE,cAAc,EAAiB;OACjC,EAAE,WAAW,EAAE;OAEf,EAAE,QAAQ,EAAE,MAAM,cAAc;AAUvC,MAAM,OAAO,MAAM;IAGjB,
|
|
1
|
+
{"version":3,"file":"streaming.mjs","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":"OAAO,EAAE,cAAc,EAAiB;OACjC,EAAE,WAAW,EAAE;OAEf,EAAE,QAAQ,EAAE,MAAM,cAAc;AAUvC,MAAM,OAAO,MAAM;IAGjB,YACU,QAAmC,EAC3C,UAA2B;QADnB,aAAQ,GAAR,QAAQ,CAA2B;QAG3C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED,MAAM,CAAC,eAAe,CAAO,QAAkB,EAAE,UAA2B;QAC1E,IAAI,QAAQ,GAAG,KAAK,CAAC;QACrB,MAAM,OAAO,GAAG,IAAI,UAAU,EAAE,CAAC;QAEjC,KAAK,SAAS,CAAC,CAAC,YAAY;YAC1B,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;gBAClB,UAAU,CAAC,KAAK,EAAE,CAAC;gBACnB,MAAM,IAAI,WAAW,CA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AAO,MAAM,cAAc,UAAW,GAAG,0BAIP,CAAC;AAEnC,eAAO,MAAM,UAAU,UAAW,GAAG,sBAKlB,CAAC;AAEpB;;;GAGG;AACH,eAAO,MAAM,UAAU,UAAW,GAAG;mBAAwC,QAAQ,WAAW,CAAC;CAOxD,CAAC;AAE1C,eAAO,MAAM,YAAY,UAAW,GAAG,wBAEtC,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC;AAEnG;;;;;;;;GAQG;AACH,wBAAsB,MAAM,CAC1B,KAAK,EAAE,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC,EAC7C,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAChC,OAAO,GAAE,eAAe,GAAG,SAAc,GACxC,OAAO,CAAC,QAAQ,CAAC,CAuBnB;AAmDD,eAAO,MAAM,eAAe,SAAU,GAAG,0BACsD,CAAC;AAEhG;;;GAGG;AACH,eAAO,MAAM,gCAAgC,iHAO5C,CAAC;AAEF,eAAO,MAAM,2BAA2B,iHAKvC,CAAC;AAEF,eAAO,MAAM,UAAU,wDAA6D,QAAQ,QAAQ,CAInG,CAAC"}
|
package/uploads.js
CHANGED
|
@@ -76,7 +76,8 @@ async function getBytes(value) {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
else {
|
|
79
|
-
throw new Error(`Unexpected data type: ${typeof value}; constructor: ${value?.constructor
|
|
79
|
+
throw new Error(`Unexpected data type: ${typeof value}; constructor: ${value?.constructor
|
|
80
|
+
?.name}; props: ${propsForError(value)}`);
|
|
80
81
|
}
|
|
81
82
|
return parts;
|
|
82
83
|
}
|