@openrouter/sdk 0.1.11 → 0.1.17
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/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/models/chatgenerationparams.d.ts +1 -0
- package/esm/models/chatgenerationparams.js +1 -0
- package/esm/models/chatmessagecontentitem.d.ts +9 -0
- package/esm/models/chatmessagecontentitem.js +5 -0
- package/esm/models/chatmessagecontentitemfile.d.ts +36 -0
- package/esm/models/chatmessagecontentitemfile.js +51 -0
- package/esm/models/chatmessagecontentitemvideo.d.ts +36 -11
- package/esm/models/chatmessagecontentitemvideo.js +51 -11
- package/esm/models/chatresponsechoice.d.ts +21 -1
- package/esm/models/chatresponsechoice.js +25 -1
- package/esm/models/chatstreamingresponsechunk.d.ts +1 -1
- package/esm/models/chatstreamingresponsechunk.js +1 -1
- package/esm/models/datacollection.d.ts +26 -0
- package/esm/models/datacollection.js +19 -0
- package/esm/models/index.d.ts +4 -2
- package/esm/models/index.js +4 -2
- package/esm/models/openairesponsesreasoningeffort.d.ts +1 -0
- package/esm/models/openairesponsesreasoningeffort.js +1 -0
- package/esm/models/openresponsesreasoning.d.ts +1 -0
- package/esm/models/openresponsesreasoning.js +1 -0
- package/esm/models/openresponsesrequest.d.ts +4 -36
- package/esm/models/openresponsesrequest.js +3 -25
- package/esm/models/operations/createembeddings.d.ts +82 -61
- package/esm/models/operations/createembeddings.js +71 -47
- package/esm/models/operations/createkeys.js +1 -1
- package/esm/models/operations/getcurrentkey.js +1 -1
- package/esm/models/operations/getkey.js +1 -1
- package/esm/models/operations/getparameters.d.ts +2 -8
- package/esm/models/operations/getparameters.js +2 -8
- package/esm/models/operations/list.js +1 -1
- package/esm/models/operations/updatekeys.js +1 -1
- package/esm/models/providername.d.ts +2 -26
- package/esm/models/providername.js +2 -26
- package/esm/models/providersort.d.ts +17 -0
- package/esm/models/providersort.js +15 -0
- package/esm/models/publicendpoint.d.ts +4 -0
- package/esm/models/publicendpoint.js +2 -0
- package/esm/models/publicpricing.d.ts +4 -0
- package/esm/models/publicpricing.js +2 -0
- package/esm/models/videourl.d.ts +17 -0
- package/esm/models/videourl.js +21 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/esm/models/chatcompletionfinishreason.d.ts +0 -13
- package/esm/models/chatcompletionfinishreason.js +0 -14
- package/esm/models/chatstreamingchoice.d.ts +0 -16
- package/esm/models/chatstreamingchoice.js +0 -24
|
@@ -11,22 +11,21 @@ export const GetParametersProvider = {
|
|
|
11
11
|
Alibaba: "Alibaba",
|
|
12
12
|
AmazonBedrock: "Amazon Bedrock",
|
|
13
13
|
Anthropic: "Anthropic",
|
|
14
|
+
Arcee: "Arcee",
|
|
14
15
|
AtlasCloud: "AtlasCloud",
|
|
15
|
-
Atoma: "Atoma",
|
|
16
16
|
Avian: "Avian",
|
|
17
17
|
Azure: "Azure",
|
|
18
18
|
BaseTen: "BaseTen",
|
|
19
|
+
BlackForestLabs: "Black Forest Labs",
|
|
19
20
|
Cerebras: "Cerebras",
|
|
20
21
|
Chutes: "Chutes",
|
|
21
22
|
Cirrascale: "Cirrascale",
|
|
22
23
|
Clarifai: "Clarifai",
|
|
23
24
|
Cloudflare: "Cloudflare",
|
|
24
25
|
Cohere: "Cohere",
|
|
25
|
-
CrofAI: "CrofAI",
|
|
26
26
|
Crusoe: "Crusoe",
|
|
27
27
|
DeepInfra: "DeepInfra",
|
|
28
28
|
DeepSeek: "DeepSeek",
|
|
29
|
-
Enfer: "Enfer",
|
|
30
29
|
Featherless: "Featherless",
|
|
31
30
|
Fireworks: "Fireworks",
|
|
32
31
|
Friendli: "Friendli",
|
|
@@ -39,11 +38,8 @@ export const GetParametersProvider = {
|
|
|
39
38
|
InferenceNet: "InferenceNet",
|
|
40
39
|
Infermatic: "Infermatic",
|
|
41
40
|
Inflection: "Inflection",
|
|
42
|
-
Kluster: "Kluster",
|
|
43
|
-
Lambda: "Lambda",
|
|
44
41
|
Liquid: "Liquid",
|
|
45
42
|
Mancer2: "Mancer 2",
|
|
46
|
-
Meta: "Meta",
|
|
47
43
|
Minimax: "Minimax",
|
|
48
44
|
ModelRun: "ModelRun",
|
|
49
45
|
Mistral: "Mistral",
|
|
@@ -53,7 +49,6 @@ export const GetParametersProvider = {
|
|
|
53
49
|
NCompass: "NCompass",
|
|
54
50
|
Nebius: "Nebius",
|
|
55
51
|
NextBit: "NextBit",
|
|
56
|
-
Nineteen: "Nineteen",
|
|
57
52
|
Novita: "Novita",
|
|
58
53
|
Nvidia: "Nvidia",
|
|
59
54
|
OpenAI: "OpenAI",
|
|
@@ -68,7 +63,6 @@ export const GetParametersProvider = {
|
|
|
68
63
|
Switchpoint: "Switchpoint",
|
|
69
64
|
Targon: "Targon",
|
|
70
65
|
Together: "Together",
|
|
71
|
-
Ubicloud: "Ubicloud",
|
|
72
66
|
Venice: "Venice",
|
|
73
67
|
WandB: "WandB",
|
|
74
68
|
XAI: "xAI",
|
|
@@ -36,7 +36,7 @@ export const ListData$inboundSchema = z.object({
|
|
|
36
36
|
byok_usage_monthly: z.number(),
|
|
37
37
|
created_at: z.string(),
|
|
38
38
|
updated_at: z.nullable(z.string()),
|
|
39
|
-
expires_at: z.nullable(z.
|
|
39
|
+
expires_at: z.nullable(z.iso.datetime({ offset: true }).transform(v => new Date(v))).optional(),
|
|
40
40
|
}).transform((v) => {
|
|
41
41
|
return remap$(v, {
|
|
42
42
|
"limit_remaining": "limitRemaining",
|
|
@@ -63,7 +63,7 @@ export const UpdateKeysData$inboundSchema = z.object({
|
|
|
63
63
|
byok_usage_monthly: z.number(),
|
|
64
64
|
created_at: z.string(),
|
|
65
65
|
updated_at: z.nullable(z.string()),
|
|
66
|
-
expires_at: z.nullable(z.
|
|
66
|
+
expires_at: z.nullable(z.iso.datetime({ offset: true }).transform(v => new Date(v))).optional(),
|
|
67
67
|
}).transform((v) => {
|
|
68
68
|
return remap$(v, {
|
|
69
69
|
"limit_remaining": "limitRemaining",
|
|
@@ -1,44 +1,26 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { OpenEnum } from "../types/enums.js";
|
|
3
3
|
export declare const ProviderName: {
|
|
4
|
-
readonly AnyScale: "AnyScale";
|
|
5
|
-
readonly CentML: "Cent-ML";
|
|
6
|
-
readonly HuggingFace: "HuggingFace";
|
|
7
|
-
readonly Hyperbolic2: "Hyperbolic 2";
|
|
8
|
-
readonly Lepton: "Lepton";
|
|
9
|
-
readonly Lynn2: "Lynn 2";
|
|
10
|
-
readonly Lynn: "Lynn";
|
|
11
|
-
readonly Mancer: "Mancer";
|
|
12
|
-
readonly Modal: "Modal";
|
|
13
|
-
readonly OctoAI: "OctoAI";
|
|
14
|
-
readonly Recursal: "Recursal";
|
|
15
|
-
readonly Reflection: "Reflection";
|
|
16
|
-
readonly Replicate: "Replicate";
|
|
17
|
-
readonly SambaNova2: "SambaNova 2";
|
|
18
|
-
readonly SFCompute: "SF Compute";
|
|
19
|
-
readonly Together2: "Together 2";
|
|
20
|
-
readonly OneDotAI: "01.AI";
|
|
21
4
|
readonly Ai21: "AI21";
|
|
22
5
|
readonly AionLabs: "AionLabs";
|
|
23
6
|
readonly Alibaba: "Alibaba";
|
|
24
7
|
readonly AmazonBedrock: "Amazon Bedrock";
|
|
25
8
|
readonly Anthropic: "Anthropic";
|
|
9
|
+
readonly Arcee: "Arcee";
|
|
26
10
|
readonly AtlasCloud: "AtlasCloud";
|
|
27
|
-
readonly Atoma: "Atoma";
|
|
28
11
|
readonly Avian: "Avian";
|
|
29
12
|
readonly Azure: "Azure";
|
|
30
13
|
readonly BaseTen: "BaseTen";
|
|
14
|
+
readonly BlackForestLabs: "Black Forest Labs";
|
|
31
15
|
readonly Cerebras: "Cerebras";
|
|
32
16
|
readonly Chutes: "Chutes";
|
|
33
17
|
readonly Cirrascale: "Cirrascale";
|
|
34
18
|
readonly Clarifai: "Clarifai";
|
|
35
19
|
readonly Cloudflare: "Cloudflare";
|
|
36
20
|
readonly Cohere: "Cohere";
|
|
37
|
-
readonly CrofAI: "CrofAI";
|
|
38
21
|
readonly Crusoe: "Crusoe";
|
|
39
22
|
readonly DeepInfra: "DeepInfra";
|
|
40
23
|
readonly DeepSeek: "DeepSeek";
|
|
41
|
-
readonly Enfer: "Enfer";
|
|
42
24
|
readonly Featherless: "Featherless";
|
|
43
25
|
readonly Fireworks: "Fireworks";
|
|
44
26
|
readonly Friendli: "Friendli";
|
|
@@ -51,12 +33,8 @@ export declare const ProviderName: {
|
|
|
51
33
|
readonly InferenceNet: "InferenceNet";
|
|
52
34
|
readonly Infermatic: "Infermatic";
|
|
53
35
|
readonly Inflection: "Inflection";
|
|
54
|
-
readonly InoCloud: "InoCloud";
|
|
55
|
-
readonly Kluster: "Kluster";
|
|
56
|
-
readonly Lambda: "Lambda";
|
|
57
36
|
readonly Liquid: "Liquid";
|
|
58
37
|
readonly Mancer2: "Mancer 2";
|
|
59
|
-
readonly Meta: "Meta";
|
|
60
38
|
readonly Minimax: "Minimax";
|
|
61
39
|
readonly ModelRun: "ModelRun";
|
|
62
40
|
readonly Mistral: "Mistral";
|
|
@@ -66,7 +44,6 @@ export declare const ProviderName: {
|
|
|
66
44
|
readonly NCompass: "NCompass";
|
|
67
45
|
readonly Nebius: "Nebius";
|
|
68
46
|
readonly NextBit: "NextBit";
|
|
69
|
-
readonly Nineteen: "Nineteen";
|
|
70
47
|
readonly Novita: "Novita";
|
|
71
48
|
readonly Nvidia: "Nvidia";
|
|
72
49
|
readonly OpenAI: "OpenAI";
|
|
@@ -81,7 +58,6 @@ export declare const ProviderName: {
|
|
|
81
58
|
readonly Switchpoint: "Switchpoint";
|
|
82
59
|
readonly Targon: "Targon";
|
|
83
60
|
readonly Together: "Together";
|
|
84
|
-
readonly Ubicloud: "Ubicloud";
|
|
85
61
|
readonly Venice: "Venice";
|
|
86
62
|
readonly WandB: "WandB";
|
|
87
63
|
readonly XAI: "xAI";
|
|
@@ -3,44 +3,26 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as openEnums from "../types/enums.js";
|
|
5
5
|
export const ProviderName = {
|
|
6
|
-
AnyScale: "AnyScale",
|
|
7
|
-
CentML: "Cent-ML",
|
|
8
|
-
HuggingFace: "HuggingFace",
|
|
9
|
-
Hyperbolic2: "Hyperbolic 2",
|
|
10
|
-
Lepton: "Lepton",
|
|
11
|
-
Lynn2: "Lynn 2",
|
|
12
|
-
Lynn: "Lynn",
|
|
13
|
-
Mancer: "Mancer",
|
|
14
|
-
Modal: "Modal",
|
|
15
|
-
OctoAI: "OctoAI",
|
|
16
|
-
Recursal: "Recursal",
|
|
17
|
-
Reflection: "Reflection",
|
|
18
|
-
Replicate: "Replicate",
|
|
19
|
-
SambaNova2: "SambaNova 2",
|
|
20
|
-
SFCompute: "SF Compute",
|
|
21
|
-
Together2: "Together 2",
|
|
22
|
-
OneDotAI: "01.AI",
|
|
23
6
|
Ai21: "AI21",
|
|
24
7
|
AionLabs: "AionLabs",
|
|
25
8
|
Alibaba: "Alibaba",
|
|
26
9
|
AmazonBedrock: "Amazon Bedrock",
|
|
27
10
|
Anthropic: "Anthropic",
|
|
11
|
+
Arcee: "Arcee",
|
|
28
12
|
AtlasCloud: "AtlasCloud",
|
|
29
|
-
Atoma: "Atoma",
|
|
30
13
|
Avian: "Avian",
|
|
31
14
|
Azure: "Azure",
|
|
32
15
|
BaseTen: "BaseTen",
|
|
16
|
+
BlackForestLabs: "Black Forest Labs",
|
|
33
17
|
Cerebras: "Cerebras",
|
|
34
18
|
Chutes: "Chutes",
|
|
35
19
|
Cirrascale: "Cirrascale",
|
|
36
20
|
Clarifai: "Clarifai",
|
|
37
21
|
Cloudflare: "Cloudflare",
|
|
38
22
|
Cohere: "Cohere",
|
|
39
|
-
CrofAI: "CrofAI",
|
|
40
23
|
Crusoe: "Crusoe",
|
|
41
24
|
DeepInfra: "DeepInfra",
|
|
42
25
|
DeepSeek: "DeepSeek",
|
|
43
|
-
Enfer: "Enfer",
|
|
44
26
|
Featherless: "Featherless",
|
|
45
27
|
Fireworks: "Fireworks",
|
|
46
28
|
Friendli: "Friendli",
|
|
@@ -53,12 +35,8 @@ export const ProviderName = {
|
|
|
53
35
|
InferenceNet: "InferenceNet",
|
|
54
36
|
Infermatic: "Infermatic",
|
|
55
37
|
Inflection: "Inflection",
|
|
56
|
-
InoCloud: "InoCloud",
|
|
57
|
-
Kluster: "Kluster",
|
|
58
|
-
Lambda: "Lambda",
|
|
59
38
|
Liquid: "Liquid",
|
|
60
39
|
Mancer2: "Mancer 2",
|
|
61
|
-
Meta: "Meta",
|
|
62
40
|
Minimax: "Minimax",
|
|
63
41
|
ModelRun: "ModelRun",
|
|
64
42
|
Mistral: "Mistral",
|
|
@@ -68,7 +46,6 @@ export const ProviderName = {
|
|
|
68
46
|
NCompass: "NCompass",
|
|
69
47
|
Nebius: "Nebius",
|
|
70
48
|
NextBit: "NextBit",
|
|
71
|
-
Nineteen: "Nineteen",
|
|
72
49
|
Novita: "Novita",
|
|
73
50
|
Nvidia: "Nvidia",
|
|
74
51
|
OpenAI: "OpenAI",
|
|
@@ -83,7 +60,6 @@ export const ProviderName = {
|
|
|
83
60
|
Switchpoint: "Switchpoint",
|
|
84
61
|
Targon: "Targon",
|
|
85
62
|
Together: "Together",
|
|
86
|
-
Ubicloud: "Ubicloud",
|
|
87
63
|
Venice: "Venice",
|
|
88
64
|
WandB: "WandB",
|
|
89
65
|
XAI: "xAI",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
/**
|
|
4
|
+
* The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
|
|
5
|
+
*/
|
|
6
|
+
export declare const ProviderSort: {
|
|
7
|
+
readonly Price: "price";
|
|
8
|
+
readonly Throughput: "throughput";
|
|
9
|
+
readonly Latency: "latency";
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
|
|
13
|
+
*/
|
|
14
|
+
export type ProviderSort = OpenEnum<typeof ProviderSort>;
|
|
15
|
+
/** @internal */
|
|
16
|
+
export declare const ProviderSort$outboundSchema: z.ZodType<string, ProviderSort>;
|
|
17
|
+
//# sourceMappingURL=providersort.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as openEnums from "../types/enums.js";
|
|
5
|
+
/**
|
|
6
|
+
* The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
|
|
7
|
+
*/
|
|
8
|
+
export const ProviderSort = {
|
|
9
|
+
Price: "price",
|
|
10
|
+
Throughput: "throughput",
|
|
11
|
+
Latency: "latency",
|
|
12
|
+
};
|
|
13
|
+
/** @internal */
|
|
14
|
+
export const ProviderSort$outboundSchema = openEnums.outboundSchema(ProviderSort);
|
|
15
|
+
//# sourceMappingURL=providersort.js.map
|
|
@@ -22,6 +22,10 @@ export type Pricing = {
|
|
|
22
22
|
* A value in string or number format that is a large number
|
|
23
23
|
*/
|
|
24
24
|
image?: any | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* A value in string or number format that is a large number
|
|
27
|
+
*/
|
|
28
|
+
imageToken?: any | undefined;
|
|
25
29
|
/**
|
|
26
30
|
* A value in string or number format that is a large number
|
|
27
31
|
*/
|
|
@@ -25,6 +25,7 @@ export const Pricing$inboundSchema = z.object({
|
|
|
25
25
|
completion: z.any().optional(),
|
|
26
26
|
request: z.any().optional(),
|
|
27
27
|
image: z.any().optional(),
|
|
28
|
+
image_token: z.any().optional(),
|
|
28
29
|
image_output: z.any().optional(),
|
|
29
30
|
audio: z.any().optional(),
|
|
30
31
|
input_audio_cache: z.any().optional(),
|
|
@@ -35,6 +36,7 @@ export const Pricing$inboundSchema = z.object({
|
|
|
35
36
|
discount: z.number().optional(),
|
|
36
37
|
}).transform((v) => {
|
|
37
38
|
return remap$(v, {
|
|
39
|
+
"image_token": "imageToken",
|
|
38
40
|
"image_output": "imageOutput",
|
|
39
41
|
"input_audio_cache": "inputAudioCache",
|
|
40
42
|
"web_search": "webSearch",
|
|
@@ -21,6 +21,10 @@ export type PublicPricing = {
|
|
|
21
21
|
* A value in string or number format that is a large number
|
|
22
22
|
*/
|
|
23
23
|
image?: any | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* A value in string or number format that is a large number
|
|
26
|
+
*/
|
|
27
|
+
imageToken?: any | undefined;
|
|
24
28
|
/**
|
|
25
29
|
* A value in string or number format that is a large number
|
|
26
30
|
*/
|
|
@@ -11,6 +11,7 @@ export const PublicPricing$inboundSchema = z
|
|
|
11
11
|
completion: z.any().optional(),
|
|
12
12
|
request: z.any().optional(),
|
|
13
13
|
image: z.any().optional(),
|
|
14
|
+
image_token: z.any().optional(),
|
|
14
15
|
image_output: z.any().optional(),
|
|
15
16
|
audio: z.any().optional(),
|
|
16
17
|
input_audio_cache: z.any().optional(),
|
|
@@ -21,6 +22,7 @@ export const PublicPricing$inboundSchema = z
|
|
|
21
22
|
discount: z.number().optional(),
|
|
22
23
|
}).transform((v) => {
|
|
23
24
|
return remap$(v, {
|
|
25
|
+
"image_token": "imageToken",
|
|
24
26
|
"image_output": "imageOutput",
|
|
25
27
|
"input_audio_cache": "inputAudioCache",
|
|
26
28
|
"web_search": "webSearch",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
export type VideoURL = {
|
|
5
|
+
url: string;
|
|
6
|
+
};
|
|
7
|
+
/** @internal */
|
|
8
|
+
export declare const VideoURL$inboundSchema: z.ZodType<VideoURL, unknown>;
|
|
9
|
+
/** @internal */
|
|
10
|
+
export type VideoURL$Outbound = {
|
|
11
|
+
url: string;
|
|
12
|
+
};
|
|
13
|
+
/** @internal */
|
|
14
|
+
export declare const VideoURL$outboundSchema: z.ZodType<VideoURL$Outbound, VideoURL>;
|
|
15
|
+
export declare function videoURLToJSON(videoURL: VideoURL): string;
|
|
16
|
+
export declare function videoURLFromJSON(jsonString: string): SafeParseResult<VideoURL, SDKValidationError>;
|
|
17
|
+
//# sourceMappingURL=videourl.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4";
|
|
5
|
+
import { safeParse } from "../lib/schemas.js";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export const VideoURL$inboundSchema = z.object({
|
|
8
|
+
url: z.string(),
|
|
9
|
+
});
|
|
10
|
+
/** @internal */
|
|
11
|
+
export const VideoURL$outboundSchema = z
|
|
12
|
+
.object({
|
|
13
|
+
url: z.string(),
|
|
14
|
+
});
|
|
15
|
+
export function videoURLToJSON(videoURL) {
|
|
16
|
+
return JSON.stringify(VideoURL$outboundSchema.parse(videoURL));
|
|
17
|
+
}
|
|
18
|
+
export function videoURLFromJSON(jsonString) {
|
|
19
|
+
return safeParse(jsonString, (x) => VideoURL$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VideoURL' from JSON`);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=videourl.js.map
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17",
|
|
4
4
|
"author": "OpenRouter",
|
|
5
5
|
"description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 300+ language models through a unified API.",
|
|
6
6
|
"keywords": [
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as z from "zod/v4";
|
|
2
|
-
import { OpenEnum } from "../types/enums.js";
|
|
3
|
-
export declare const ChatCompletionFinishReason: {
|
|
4
|
-
readonly ToolCalls: "tool_calls";
|
|
5
|
-
readonly Stop: "stop";
|
|
6
|
-
readonly Length: "length";
|
|
7
|
-
readonly ContentFilter: "content_filter";
|
|
8
|
-
readonly Error: "error";
|
|
9
|
-
};
|
|
10
|
-
export type ChatCompletionFinishReason = OpenEnum<typeof ChatCompletionFinishReason>;
|
|
11
|
-
/** @internal */
|
|
12
|
-
export declare const ChatCompletionFinishReason$inboundSchema: z.ZodType<ChatCompletionFinishReason, unknown>;
|
|
13
|
-
//# sourceMappingURL=chatcompletionfinishreason.d.ts.map
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
import * as openEnums from "../types/enums.js";
|
|
5
|
-
export const ChatCompletionFinishReason = {
|
|
6
|
-
ToolCalls: "tool_calls",
|
|
7
|
-
Stop: "stop",
|
|
8
|
-
Length: "length",
|
|
9
|
-
ContentFilter: "content_filter",
|
|
10
|
-
Error: "error",
|
|
11
|
-
};
|
|
12
|
-
/** @internal */
|
|
13
|
-
export const ChatCompletionFinishReason$inboundSchema = openEnums.inboundSchema(ChatCompletionFinishReason);
|
|
14
|
-
//# sourceMappingURL=chatcompletionfinishreason.js.map
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as z from "zod/v4";
|
|
2
|
-
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
-
import { ChatCompletionFinishReason } from "./chatcompletionfinishreason.js";
|
|
4
|
-
import { ChatMessageTokenLogprobs } from "./chatmessagetokenlogprobs.js";
|
|
5
|
-
import { ChatStreamingMessageChunk } from "./chatstreamingmessagechunk.js";
|
|
6
|
-
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
7
|
-
export type ChatStreamingChoice = {
|
|
8
|
-
delta: ChatStreamingMessageChunk;
|
|
9
|
-
finishReason: ChatCompletionFinishReason | null;
|
|
10
|
-
index: number;
|
|
11
|
-
logprobs?: ChatMessageTokenLogprobs | null | undefined;
|
|
12
|
-
};
|
|
13
|
-
/** @internal */
|
|
14
|
-
export declare const ChatStreamingChoice$inboundSchema: z.ZodType<ChatStreamingChoice, unknown>;
|
|
15
|
-
export declare function chatStreamingChoiceFromJSON(jsonString: string): SafeParseResult<ChatStreamingChoice, SDKValidationError>;
|
|
16
|
-
//# sourceMappingURL=chatstreamingchoice.d.ts.map
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
import * as z from "zod/v4";
|
|
5
|
-
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
|
-
import { safeParse } from "../lib/schemas.js";
|
|
7
|
-
import { ChatCompletionFinishReason$inboundSchema, } from "./chatcompletionfinishreason.js";
|
|
8
|
-
import { ChatMessageTokenLogprobs$inboundSchema, } from "./chatmessagetokenlogprobs.js";
|
|
9
|
-
import { ChatStreamingMessageChunk$inboundSchema, } from "./chatstreamingmessagechunk.js";
|
|
10
|
-
/** @internal */
|
|
11
|
-
export const ChatStreamingChoice$inboundSchema = z.object({
|
|
12
|
-
delta: ChatStreamingMessageChunk$inboundSchema,
|
|
13
|
-
finish_reason: z.nullable(ChatCompletionFinishReason$inboundSchema),
|
|
14
|
-
index: z.number(),
|
|
15
|
-
logprobs: z.nullable(ChatMessageTokenLogprobs$inboundSchema).optional(),
|
|
16
|
-
}).transform((v) => {
|
|
17
|
-
return remap$(v, {
|
|
18
|
-
"finish_reason": "finishReason",
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
export function chatStreamingChoiceFromJSON(jsonString) {
|
|
22
|
-
return safeParse(jsonString, (x) => ChatStreamingChoice$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChatStreamingChoice' from JSON`);
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=chatstreamingchoice.js.map
|