openai 4.16.2 → 4.17.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 +13 -0
- package/README.md +1 -1
- package/index.d.mts +2 -0
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/index.js.map +1 -1
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/beta/assistants/assistants.d.ts +4 -96
- package/resources/beta/assistants/assistants.d.ts.map +1 -1
- package/resources/beta/assistants/assistants.js.map +1 -1
- package/resources/beta/assistants/assistants.mjs.map +1 -1
- package/resources/beta/threads/runs/runs.d.ts +5 -66
- package/resources/beta/threads/runs/runs.d.ts.map +1 -1
- package/resources/beta/threads/runs/runs.js.map +1 -1
- package/resources/beta/threads/runs/runs.mjs.map +1 -1
- package/resources/beta/threads/runs/steps.d.ts +4 -4
- package/resources/beta/threads/runs/steps.d.ts.map +1 -1
- package/resources/beta/threads/threads.d.ts +2 -32
- package/resources/beta/threads/threads.d.ts.map +1 -1
- package/resources/beta/threads/threads.js.map +1 -1
- package/resources/beta/threads/threads.mjs.map +1 -1
- package/resources/chat/completions.d.ts +27 -42
- 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/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +1 -0
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/shared.d.ts +35 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +4 -0
- package/resources/shared.js.map +1 -0
- package/resources/shared.mjs +3 -0
- package/resources/shared.mjs.map +1 -0
- package/src/index.ts +3 -0
- package/src/resources/beta/assistants/assistants.ts +4 -105
- package/src/resources/beta/threads/runs/runs.ts +5 -72
- package/src/resources/beta/threads/runs/steps.ts +4 -4
- package/src/resources/beta/threads/threads.ts +2 -35
- package/src/resources/chat/completions.ts +27 -45
- package/src/resources/index.ts +1 -0
- package/src/resources/shared.ts +39 -0
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -5,6 +5,7 @@ import { APIPromise } from "../../core";
|
|
|
5
5
|
import { APIResource } from "../../resource";
|
|
6
6
|
import * as ChatCompletionsAPI from "./completions";
|
|
7
7
|
import * as CompletionsAPI from "../completions";
|
|
8
|
+
import * as Shared from "../shared";
|
|
8
9
|
import { Stream } from "../../streaming";
|
|
9
10
|
|
|
10
11
|
export class Completions extends APIResource {
|
|
@@ -180,7 +181,6 @@ export interface ChatCompletionChunk {
|
|
|
180
181
|
|
|
181
182
|
/**
|
|
182
183
|
* This fingerprint represents the backend configuration that the model runs with.
|
|
183
|
-
*
|
|
184
184
|
* Can be used in conjunction with the `seed` request parameter to understand when
|
|
185
185
|
* backend changes have been made that might impact determinism.
|
|
186
186
|
*/
|
|
@@ -486,7 +486,7 @@ export interface ChatCompletionSystemMessageParam {
|
|
|
486
486
|
}
|
|
487
487
|
|
|
488
488
|
export interface ChatCompletionTool {
|
|
489
|
-
function:
|
|
489
|
+
function: Shared.FunctionDefinition;
|
|
490
490
|
|
|
491
491
|
/**
|
|
492
492
|
* The type of the tool. Currently, only `function` is supported.
|
|
@@ -494,34 +494,6 @@ export interface ChatCompletionTool {
|
|
|
494
494
|
type: 'function';
|
|
495
495
|
}
|
|
496
496
|
|
|
497
|
-
export namespace ChatCompletionTool {
|
|
498
|
-
export interface Function {
|
|
499
|
-
/**
|
|
500
|
-
* The name of the function to be called. Must be a-z, A-Z, 0-9, or contain
|
|
501
|
-
* underscores and dashes, with a maximum length of 64.
|
|
502
|
-
*/
|
|
503
|
-
name: string;
|
|
504
|
-
|
|
505
|
-
/**
|
|
506
|
-
* The parameters the functions accepts, described as a JSON Schema object. See the
|
|
507
|
-
* [guide](https://platform.openai.com/docs/guides/gpt/function-calling) for
|
|
508
|
-
* examples, and the
|
|
509
|
-
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
|
|
510
|
-
* documentation about the format.
|
|
511
|
-
*
|
|
512
|
-
* To describe a function that accepts no parameters, provide the value
|
|
513
|
-
* `{"type": "object", "properties": {}}`.
|
|
514
|
-
*/
|
|
515
|
-
parameters: Record<string, unknown>;
|
|
516
|
-
|
|
517
|
-
/**
|
|
518
|
-
* A description of what the function does, used by the model to choose when and
|
|
519
|
-
* how to call the function.
|
|
520
|
-
*/
|
|
521
|
-
description?: string;
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
|
|
525
497
|
/**
|
|
526
498
|
* Controls which (if any) function is called by the model. `none` means the model
|
|
527
499
|
* will not call a function and instead generates a message. `auto` means the model
|
|
@@ -668,8 +640,18 @@ export interface ChatCompletionCreateParamsBase {
|
|
|
668
640
|
presence_penalty?: number | null;
|
|
669
641
|
|
|
670
642
|
/**
|
|
671
|
-
* An object specifying the format that the model must output.
|
|
672
|
-
*
|
|
643
|
+
* An object specifying the format that the model must output.
|
|
644
|
+
*
|
|
645
|
+
* Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the
|
|
646
|
+
* message the model generates is valid JSON.
|
|
647
|
+
*
|
|
648
|
+
* **Important:** when using JSON mode, you **must** also instruct the model to
|
|
649
|
+
* produce JSON yourself via a system or user message. Without this, the model may
|
|
650
|
+
* generate an unending stream of whitespace until the generation reaches the token
|
|
651
|
+
* limit, resulting in increased latency and appearance of a "stuck" request. Also
|
|
652
|
+
* note that the message content may be partially cut off if
|
|
653
|
+
* `finish_reason="length"`, which indicates the generation exceeded `max_tokens`
|
|
654
|
+
* or the conversation exceeded the max context length.
|
|
673
655
|
*/
|
|
674
656
|
response_format?: ChatCompletionCreateParams.ResponseFormat;
|
|
675
657
|
|
|
@@ -761,7 +743,7 @@ export namespace ChatCompletionCreateParams {
|
|
|
761
743
|
* To describe a function that accepts no parameters, provide the value
|
|
762
744
|
* `{"type": "object", "properties": {}}`.
|
|
763
745
|
*/
|
|
764
|
-
parameters:
|
|
746
|
+
parameters: Shared.FunctionParameters;
|
|
765
747
|
|
|
766
748
|
/**
|
|
767
749
|
* A description of what the function does, used by the model to choose when and
|
|
@@ -771,21 +753,21 @@ export namespace ChatCompletionCreateParams {
|
|
|
771
753
|
}
|
|
772
754
|
|
|
773
755
|
/**
|
|
774
|
-
* An object specifying the format that the model must output.
|
|
775
|
-
*
|
|
756
|
+
* An object specifying the format that the model must output.
|
|
757
|
+
*
|
|
758
|
+
* Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the
|
|
759
|
+
* message the model generates is valid JSON.
|
|
760
|
+
*
|
|
761
|
+
* **Important:** when using JSON mode, you **must** also instruct the model to
|
|
762
|
+
* produce JSON yourself via a system or user message. Without this, the model may
|
|
763
|
+
* generate an unending stream of whitespace until the generation reaches the token
|
|
764
|
+
* limit, resulting in increased latency and appearance of a "stuck" request. Also
|
|
765
|
+
* note that the message content may be partially cut off if
|
|
766
|
+
* `finish_reason="length"`, which indicates the generation exceeded `max_tokens`
|
|
767
|
+
* or the conversation exceeded the max context length.
|
|
776
768
|
*/
|
|
777
769
|
export interface ResponseFormat {
|
|
778
770
|
/**
|
|
779
|
-
* Setting to `json_object` enables JSON mode. This guarantees that the message the
|
|
780
|
-
* model generates is valid JSON.
|
|
781
|
-
*
|
|
782
|
-
* Note that your system prompt must still instruct the model to produce JSON, and
|
|
783
|
-
* to help ensure you don't forget, the API will throw an error if the string
|
|
784
|
-
* `JSON` does not appear in your system message. Also note that the message
|
|
785
|
-
* content may be partial (i.e. cut off) if `finish_reason="length"`, which
|
|
786
|
-
* indicates the generation exceeded `max_tokens` or the conversation exceeded the
|
|
787
|
-
* max context length.
|
|
788
|
-
*
|
|
789
771
|
* Must be one of `text` or `json_object`.
|
|
790
772
|
*/
|
|
791
773
|
type?: 'text' | 'json_object';
|
package/src/resources/index.ts
CHANGED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
+
|
|
3
|
+
export interface FunctionDefinition {
|
|
4
|
+
/**
|
|
5
|
+
* The name of the function to be called. Must be a-z, A-Z, 0-9, or contain
|
|
6
|
+
* underscores and dashes, with a maximum length of 64.
|
|
7
|
+
*/
|
|
8
|
+
name: string;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The parameters the functions accepts, described as a JSON Schema object. See the
|
|
12
|
+
* [guide](https://platform.openai.com/docs/guides/gpt/function-calling) for
|
|
13
|
+
* examples, and the
|
|
14
|
+
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
|
|
15
|
+
* documentation about the format.
|
|
16
|
+
*
|
|
17
|
+
* To describe a function that accepts no parameters, provide the value
|
|
18
|
+
* `{"type": "object", "properties": {}}`.
|
|
19
|
+
*/
|
|
20
|
+
parameters: FunctionParameters;
|
|
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;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The parameters the functions accepts, described as a JSON Schema object. See the
|
|
31
|
+
* [guide](https://platform.openai.com/docs/guides/gpt/function-calling) for
|
|
32
|
+
* examples, and the
|
|
33
|
+
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
|
|
34
|
+
* documentation about the format.
|
|
35
|
+
*
|
|
36
|
+
* To describe a function that accepts no parameters, provide the value
|
|
37
|
+
* `{"type": "object", "properties": {}}`.
|
|
38
|
+
*/
|
|
39
|
+
export type FunctionParameters = Record<string, unknown>;
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '4.
|
|
1
|
+
export const VERSION = '4.17.0'; // x-release-please-version
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "4.
|
|
1
|
+
export declare const VERSION = "4.17.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '4.
|
|
1
|
+
export const VERSION = '4.17.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|