@openrouter/sdk 0.1.25 → 0.2.6
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/biome.json +171 -0
- package/esm/funcs/callModel.d.ts +7 -7
- package/esm/funcs/callModel.js +35 -23
- package/esm/funcs/oAuthCreateAuthorizationUrl.d.ts +3 -3
- package/esm/funcs/oAuthCreateAuthorizationUrl.js +30 -14
- package/esm/funcs/oAuthCreateSHA256CodeChallenge.d.ts +2 -2
- package/esm/funcs/oAuthCreateSHA256CodeChallenge.js +13 -12
- package/esm/hooks/registration.d.ts +2 -2
- package/esm/hooks/registration.js +1 -2
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/lib/encodings.d.ts +1 -0
- package/esm/lib/encodings.js +12 -1
- package/esm/lib/response-wrapper.d.ts +5 -5
- package/esm/lib/response-wrapper.js +76 -55
- package/esm/lib/reusable-stream.js +26 -7
- package/esm/lib/stream-transformers.d.ts +3 -3
- package/esm/lib/stream-transformers.js +43 -41
- package/esm/lib/tool-executor.d.ts +9 -9
- package/esm/lib/tool-executor.js +9 -9
- package/esm/lib/tool-orchestrator.d.ts +3 -3
- package/esm/lib/tool-orchestrator.js +6 -8
- package/esm/lib/tool-types.d.ts +26 -25
- package/esm/lib/tool-types.js +3 -3
- package/esm/models/chatcompletionfinishreason.d.ts +13 -0
- package/esm/models/chatcompletionfinishreason.js +14 -0
- package/esm/models/chatgenerationparams.d.ts +4 -4
- package/esm/models/chatgenerationparams.js +4 -4
- package/esm/models/chatmessagecontentitem.d.ts +2 -19
- package/esm/models/chatmessagecontentitem.js +6 -9
- package/esm/models/chatmessagecontentitemcachecontrol.d.ts +29 -0
- package/esm/models/chatmessagecontentitemcachecontrol.js +33 -0
- package/esm/models/chatmessagecontentitemtext.d.ts +3 -0
- package/esm/models/chatmessagecontentitemtext.js +12 -0
- package/esm/models/chatmessagecontentitemvideo.d.ts +23 -11
- package/esm/models/chatmessagecontentitemvideo.js +24 -11
- package/esm/models/chatresponsechoice.d.ts +1 -21
- package/esm/models/chatresponsechoice.js +1 -25
- package/esm/models/chatstreamingchoice.d.ts +16 -0
- package/esm/models/chatstreamingchoice.js +24 -0
- package/esm/models/chatstreamingresponsechunk.d.ts +1 -1
- package/esm/models/chatstreamingresponsechunk.js +1 -1
- package/esm/models/completionchoice.d.ts +2 -0
- package/esm/models/completionchoice.js +3 -0
- package/esm/models/completioncreateparams.d.ts +4 -4
- package/esm/models/completioncreateparams.js +4 -4
- package/esm/models/completionresponse.d.ts +1 -0
- package/esm/models/completionresponse.js +1 -0
- package/esm/models/filecitation.d.ts +2 -11
- package/esm/models/filecitation.js +2 -9
- package/esm/models/filepath.d.ts +2 -11
- package/esm/models/filepath.js +2 -10
- package/esm/models/index.d.ts +3 -2
- package/esm/models/index.js +3 -2
- package/esm/models/message.d.ts +2 -2
- package/esm/models/message.js +1 -1
- package/esm/models/openairesponsesannotation.d.ts +2 -2
- package/esm/models/openairesponsesannotation.js +2 -2
- package/esm/models/openairesponsesinputunion.d.ts +5 -45
- package/esm/models/openairesponsesinputunion.js +20 -20
- package/esm/models/openairesponsesrefusalcontent.d.ts +2 -11
- package/esm/models/openairesponsesrefusalcontent.js +2 -9
- package/esm/models/openresponseseasyinputmessage.d.ts +6 -54
- package/esm/models/openresponseseasyinputmessage.js +12 -12
- package/esm/models/openresponseserrorevent.d.ts +1 -8
- package/esm/models/openresponseserrorevent.js +1 -6
- package/esm/models/openresponsesimagegencallcompleted.d.ts +1 -8
- package/esm/models/openresponsesimagegencallcompleted.js +1 -6
- package/esm/models/openresponsesimagegencallgenerating.d.ts +1 -8
- package/esm/models/openresponsesimagegencallgenerating.js +1 -6
- package/esm/models/openresponsesimagegencallinprogress.d.ts +1 -8
- package/esm/models/openresponsesimagegencallinprogress.js +1 -6
- package/esm/models/openresponsesimagegencallpartialimage.d.ts +1 -8
- package/esm/models/openresponsesimagegencallpartialimage.js +1 -6
- package/esm/models/openresponsesinputmessageitem.d.ts +4 -36
- package/esm/models/openresponsesinputmessageitem.js +8 -8
- package/esm/models/openresponsesnonstreamingresponse.d.ts +1 -7
- package/esm/models/openresponsesnonstreamingresponse.js +1 -6
- package/esm/models/openresponsesreasoningdeltaevent.d.ts +1 -8
- package/esm/models/openresponsesreasoningdeltaevent.js +1 -6
- package/esm/models/openresponsesreasoningdoneevent.d.ts +1 -8
- package/esm/models/openresponsesreasoningdoneevent.js +1 -6
- package/esm/models/openresponsesreasoningsummarypartaddedevent.d.ts +1 -8
- package/esm/models/openresponsesreasoningsummarypartaddedevent.js +1 -6
- package/esm/models/openresponsesreasoningsummarytextdeltaevent.d.ts +1 -8
- package/esm/models/openresponsesreasoningsummarytextdeltaevent.js +1 -6
- package/esm/models/openresponsesreasoningsummarytextdoneevent.d.ts +1 -8
- package/esm/models/openresponsesreasoningsummarytextdoneevent.js +1 -6
- package/esm/models/openresponsesrequest.d.ts +26 -44
- package/esm/models/openresponsesrequest.js +15 -32
- package/esm/models/openresponsesstreamevent.d.ts +30 -125
- package/esm/models/openresponsesstreamevent.js +34 -119
- package/esm/models/openresponseswebsearch20250826tool.d.ts +2 -11
- package/esm/models/openresponseswebsearch20250826tool.js +2 -9
- package/esm/models/openresponseswebsearchpreview20250311tool.d.ts +2 -11
- package/esm/models/openresponseswebsearchpreview20250311tool.js +2 -9
- package/esm/models/openresponseswebsearchpreviewtool.d.ts +2 -11
- package/esm/models/openresponseswebsearchpreviewtool.js +2 -9
- package/esm/models/openresponseswebsearchtool.d.ts +2 -11
- package/esm/models/openresponseswebsearchtool.js +2 -9
- package/esm/models/operations/createembeddings.d.ts +4 -16
- package/esm/models/operations/createembeddings.js +2 -13
- package/esm/models/operations/getcredits.d.ts +16 -1
- package/esm/models/operations/getcredits.js +17 -1
- package/esm/models/operations/getparameters.d.ts +5 -1
- package/esm/models/operations/getparameters.js +5 -1
- package/esm/models/providername.d.ts +5 -1
- package/esm/models/providername.js +5 -1
- package/esm/models/responseformattextconfig.d.ts +2 -2
- package/esm/models/responseformattextconfig.js +2 -2
- package/esm/models/responseinputaudio.d.ts +3 -11
- package/esm/models/responseinputaudio.js +2 -9
- package/esm/models/responseinputfile.d.ts +2 -11
- package/esm/models/responseinputfile.js +2 -9
- package/esm/models/responseinputimage.d.ts +3 -11
- package/esm/models/responseinputimage.js +2 -9
- package/esm/models/responseinputtext.d.ts +2 -11
- package/esm/models/responseinputtext.js +2 -9
- package/esm/models/responseoutputtext.d.ts +2 -11
- package/esm/models/responseoutputtext.js +2 -9
- package/esm/models/responsesformatjsonobject.d.ts +2 -11
- package/esm/models/responsesformatjsonobject.js +2 -9
- package/esm/models/responsesformattext.d.ts +2 -11
- package/esm/models/responsesformattext.js +2 -9
- package/esm/models/responsesformattextjsonschemaconfig.d.ts +2 -11
- package/esm/models/responsesformattextjsonschemaconfig.js +2 -9
- package/esm/models/responsesoutputitem.d.ts +13 -1
- package/esm/models/responsesoutputitem.js +6 -6
- package/esm/models/urlcitation.d.ts +2 -11
- package/esm/models/urlcitation.js +2 -9
- package/esm/sdk/oauth.d.ts +2 -2
- package/esm/sdk/oauth.js +2 -3
- package/esm/sdk/sdk.d.ts +9 -8
- package/esm/types/unrecognized.d.ts +7 -1
- package/esm/types/unrecognized.js +9 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/tsconfig.json +0 -1
- package/vitest.config.ts +14 -8
- package/esm/models/chatmessagecontentitemfile.d.ts +0 -36
- package/esm/models/chatmessagecontentitemfile.js +0 -51
- package/esm/models/videourl.d.ts +0 -17
- package/esm/models/videourl.js +0 -21
|
@@ -3,23 +3,15 @@ import { ClosedEnum, OpenEnum } from "../../types/enums.js";
|
|
|
3
3
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
5
5
|
import * as models from "../index.js";
|
|
6
|
-
export declare const TypeImageURL: {
|
|
7
|
-
readonly ImageUrl: "image_url";
|
|
8
|
-
};
|
|
9
|
-
export type TypeImageURL = ClosedEnum<typeof TypeImageURL>;
|
|
10
6
|
export type ImageUrl = {
|
|
11
7
|
url: string;
|
|
12
8
|
};
|
|
13
9
|
export type ContentImageURL = {
|
|
14
|
-
type:
|
|
10
|
+
type: "image_url";
|
|
15
11
|
imageUrl: ImageUrl;
|
|
16
12
|
};
|
|
17
|
-
export declare const TypeText: {
|
|
18
|
-
readonly Text: "text";
|
|
19
|
-
};
|
|
20
|
-
export type TypeText = ClosedEnum<typeof TypeText>;
|
|
21
13
|
export type ContentText = {
|
|
22
|
-
type:
|
|
14
|
+
type: "text";
|
|
23
15
|
text: string;
|
|
24
16
|
};
|
|
25
17
|
export type Content = ContentText | ContentImageURL;
|
|
@@ -155,8 +147,6 @@ export type CreateEmbeddingsResponseBody = {
|
|
|
155
147
|
};
|
|
156
148
|
export type CreateEmbeddingsResponse = CreateEmbeddingsResponseBody | string;
|
|
157
149
|
/** @internal */
|
|
158
|
-
export declare const TypeImageURL$outboundSchema: z.ZodEnum<typeof TypeImageURL>;
|
|
159
|
-
/** @internal */
|
|
160
150
|
export type ImageUrl$Outbound = {
|
|
161
151
|
url: string;
|
|
162
152
|
};
|
|
@@ -165,17 +155,15 @@ export declare const ImageUrl$outboundSchema: z.ZodType<ImageUrl$Outbound, Image
|
|
|
165
155
|
export declare function imageUrlToJSON(imageUrl: ImageUrl): string;
|
|
166
156
|
/** @internal */
|
|
167
157
|
export type ContentImageURL$Outbound = {
|
|
168
|
-
type:
|
|
158
|
+
type: "image_url";
|
|
169
159
|
image_url: ImageUrl$Outbound;
|
|
170
160
|
};
|
|
171
161
|
/** @internal */
|
|
172
162
|
export declare const ContentImageURL$outboundSchema: z.ZodType<ContentImageURL$Outbound, ContentImageURL>;
|
|
173
163
|
export declare function contentImageURLToJSON(contentImageURL: ContentImageURL): string;
|
|
174
164
|
/** @internal */
|
|
175
|
-
export declare const TypeText$outboundSchema: z.ZodEnum<typeof TypeText>;
|
|
176
|
-
/** @internal */
|
|
177
165
|
export type ContentText$Outbound = {
|
|
178
|
-
type:
|
|
166
|
+
type: "text";
|
|
179
167
|
text: string;
|
|
180
168
|
};
|
|
181
169
|
/** @internal */
|
|
@@ -6,12 +6,6 @@ import { remap as remap$ } from "../../lib/primitives.js";
|
|
|
6
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
7
|
import * as openEnums from "../../types/enums.js";
|
|
8
8
|
import * as models from "../index.js";
|
|
9
|
-
export const TypeImageURL = {
|
|
10
|
-
ImageUrl: "image_url",
|
|
11
|
-
};
|
|
12
|
-
export const TypeText = {
|
|
13
|
-
Text: "text",
|
|
14
|
-
};
|
|
15
9
|
export const EncodingFormat = {
|
|
16
10
|
Float: "float",
|
|
17
11
|
Base64: "base64",
|
|
@@ -23,9 +17,6 @@ export const ObjectEmbedding = {
|
|
|
23
17
|
Embedding: "embedding",
|
|
24
18
|
};
|
|
25
19
|
/** @internal */
|
|
26
|
-
export const TypeImageURL$outboundSchema = z
|
|
27
|
-
.enum(TypeImageURL);
|
|
28
|
-
/** @internal */
|
|
29
20
|
export const ImageUrl$outboundSchema = z
|
|
30
21
|
.object({
|
|
31
22
|
url: z.string(),
|
|
@@ -35,7 +26,7 @@ export function imageUrlToJSON(imageUrl) {
|
|
|
35
26
|
}
|
|
36
27
|
/** @internal */
|
|
37
28
|
export const ContentImageURL$outboundSchema = z.object({
|
|
38
|
-
type:
|
|
29
|
+
type: z.literal("image_url"),
|
|
39
30
|
imageUrl: z.lazy(() => ImageUrl$outboundSchema),
|
|
40
31
|
}).transform((v) => {
|
|
41
32
|
return remap$(v, {
|
|
@@ -46,10 +37,8 @@ export function contentImageURLToJSON(contentImageURL) {
|
|
|
46
37
|
return JSON.stringify(ContentImageURL$outboundSchema.parse(contentImageURL));
|
|
47
38
|
}
|
|
48
39
|
/** @internal */
|
|
49
|
-
export const TypeText$outboundSchema = z.enum(TypeText);
|
|
50
|
-
/** @internal */
|
|
51
40
|
export const ContentText$outboundSchema = z.object({
|
|
52
|
-
type:
|
|
41
|
+
type: z.literal("text"),
|
|
53
42
|
text: z.string(),
|
|
54
43
|
});
|
|
55
44
|
export function contentTextToJSON(contentText) {
|
|
@@ -1,10 +1,25 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
3
3
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
4
|
+
export type GetCreditsData = {
|
|
5
|
+
/**
|
|
6
|
+
* Total credits purchased
|
|
7
|
+
*/
|
|
8
|
+
totalCredits: number;
|
|
9
|
+
/**
|
|
10
|
+
* Total credits used
|
|
11
|
+
*/
|
|
12
|
+
totalUsage: number;
|
|
13
|
+
};
|
|
4
14
|
/**
|
|
5
15
|
* Total credits purchased and used
|
|
6
16
|
*/
|
|
7
|
-
export type GetCreditsResponse = {
|
|
17
|
+
export type GetCreditsResponse = {
|
|
18
|
+
data: GetCreditsData;
|
|
19
|
+
};
|
|
20
|
+
/** @internal */
|
|
21
|
+
export declare const GetCreditsData$inboundSchema: z.ZodType<GetCreditsData, unknown>;
|
|
22
|
+
export declare function getCreditsDataFromJSON(jsonString: string): SafeParseResult<GetCreditsData, SDKValidationError>;
|
|
8
23
|
/** @internal */
|
|
9
24
|
export declare const GetCreditsResponse$inboundSchema: z.ZodType<GetCreditsResponse, unknown>;
|
|
10
25
|
export declare function getCreditsResponseFromJSON(jsonString: string): SafeParseResult<GetCreditsResponse, SDKValidationError>;
|
|
@@ -2,9 +2,25 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
import * as z from "zod/v4";
|
|
5
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
5
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
6
7
|
/** @internal */
|
|
7
|
-
export const
|
|
8
|
+
export const GetCreditsData$inboundSchema = z.object({
|
|
9
|
+
total_credits: z.number(),
|
|
10
|
+
total_usage: z.number(),
|
|
11
|
+
}).transform((v) => {
|
|
12
|
+
return remap$(v, {
|
|
13
|
+
"total_credits": "totalCredits",
|
|
14
|
+
"total_usage": "totalUsage",
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
export function getCreditsDataFromJSON(jsonString) {
|
|
18
|
+
return safeParse(jsonString, (x) => GetCreditsData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetCreditsData' from JSON`);
|
|
19
|
+
}
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const GetCreditsResponse$inboundSchema = z.object({
|
|
22
|
+
data: z.lazy(() => GetCreditsData$inboundSchema),
|
|
23
|
+
});
|
|
8
24
|
export function getCreditsResponseFromJSON(jsonString) {
|
|
9
25
|
return safeParse(jsonString, (x) => GetCreditsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetCreditsResponse' from JSON`);
|
|
10
26
|
}
|
|
@@ -10,12 +10,14 @@ export declare const GetParametersProvider: {
|
|
|
10
10
|
readonly AionLabs: "AionLabs";
|
|
11
11
|
readonly Alibaba: "Alibaba";
|
|
12
12
|
readonly AmazonBedrock: "Amazon Bedrock";
|
|
13
|
+
readonly AmazonNova: "Amazon Nova";
|
|
13
14
|
readonly Anthropic: "Anthropic";
|
|
14
|
-
readonly
|
|
15
|
+
readonly ArceeAI: "Arcee AI";
|
|
15
16
|
readonly AtlasCloud: "AtlasCloud";
|
|
16
17
|
readonly Avian: "Avian";
|
|
17
18
|
readonly Azure: "Azure";
|
|
18
19
|
readonly BaseTen: "BaseTen";
|
|
20
|
+
readonly BytePlus: "BytePlus";
|
|
19
21
|
readonly BlackForestLabs: "Black Forest Labs";
|
|
20
22
|
readonly Cerebras: "Cerebras";
|
|
21
23
|
readonly Chutes: "Chutes";
|
|
@@ -30,6 +32,7 @@ export declare const GetParametersProvider: {
|
|
|
30
32
|
readonly Fireworks: "Fireworks";
|
|
31
33
|
readonly Friendli: "Friendli";
|
|
32
34
|
readonly GMICloud: "GMICloud";
|
|
35
|
+
readonly GoPomelo: "GoPomelo";
|
|
33
36
|
readonly Google: "Google";
|
|
34
37
|
readonly GoogleAIStudio: "Google AI Studio";
|
|
35
38
|
readonly Groq: "Groq";
|
|
@@ -60,6 +63,7 @@ export declare const GetParametersProvider: {
|
|
|
60
63
|
readonly SambaNova: "SambaNova";
|
|
61
64
|
readonly SiliconFlow: "SiliconFlow";
|
|
62
65
|
readonly Stealth: "Stealth";
|
|
66
|
+
readonly StreamLake: "StreamLake";
|
|
63
67
|
readonly Switchpoint: "Switchpoint";
|
|
64
68
|
readonly Targon: "Targon";
|
|
65
69
|
readonly Together: "Together";
|
|
@@ -10,12 +10,14 @@ export const GetParametersProvider = {
|
|
|
10
10
|
AionLabs: "AionLabs",
|
|
11
11
|
Alibaba: "Alibaba",
|
|
12
12
|
AmazonBedrock: "Amazon Bedrock",
|
|
13
|
+
AmazonNova: "Amazon Nova",
|
|
13
14
|
Anthropic: "Anthropic",
|
|
14
|
-
|
|
15
|
+
ArceeAI: "Arcee AI",
|
|
15
16
|
AtlasCloud: "AtlasCloud",
|
|
16
17
|
Avian: "Avian",
|
|
17
18
|
Azure: "Azure",
|
|
18
19
|
BaseTen: "BaseTen",
|
|
20
|
+
BytePlus: "BytePlus",
|
|
19
21
|
BlackForestLabs: "Black Forest Labs",
|
|
20
22
|
Cerebras: "Cerebras",
|
|
21
23
|
Chutes: "Chutes",
|
|
@@ -30,6 +32,7 @@ export const GetParametersProvider = {
|
|
|
30
32
|
Fireworks: "Fireworks",
|
|
31
33
|
Friendli: "Friendli",
|
|
32
34
|
GMICloud: "GMICloud",
|
|
35
|
+
GoPomelo: "GoPomelo",
|
|
33
36
|
Google: "Google",
|
|
34
37
|
GoogleAIStudio: "Google AI Studio",
|
|
35
38
|
Groq: "Groq",
|
|
@@ -60,6 +63,7 @@ export const GetParametersProvider = {
|
|
|
60
63
|
SambaNova: "SambaNova",
|
|
61
64
|
SiliconFlow: "SiliconFlow",
|
|
62
65
|
Stealth: "Stealth",
|
|
66
|
+
StreamLake: "StreamLake",
|
|
63
67
|
Switchpoint: "Switchpoint",
|
|
64
68
|
Targon: "Targon",
|
|
65
69
|
Together: "Together",
|
|
@@ -5,12 +5,14 @@ export declare const ProviderName: {
|
|
|
5
5
|
readonly AionLabs: "AionLabs";
|
|
6
6
|
readonly Alibaba: "Alibaba";
|
|
7
7
|
readonly AmazonBedrock: "Amazon Bedrock";
|
|
8
|
+
readonly AmazonNova: "Amazon Nova";
|
|
8
9
|
readonly Anthropic: "Anthropic";
|
|
9
|
-
readonly
|
|
10
|
+
readonly ArceeAI: "Arcee AI";
|
|
10
11
|
readonly AtlasCloud: "AtlasCloud";
|
|
11
12
|
readonly Avian: "Avian";
|
|
12
13
|
readonly Azure: "Azure";
|
|
13
14
|
readonly BaseTen: "BaseTen";
|
|
15
|
+
readonly BytePlus: "BytePlus";
|
|
14
16
|
readonly BlackForestLabs: "Black Forest Labs";
|
|
15
17
|
readonly Cerebras: "Cerebras";
|
|
16
18
|
readonly Chutes: "Chutes";
|
|
@@ -25,6 +27,7 @@ export declare const ProviderName: {
|
|
|
25
27
|
readonly Fireworks: "Fireworks";
|
|
26
28
|
readonly Friendli: "Friendli";
|
|
27
29
|
readonly GMICloud: "GMICloud";
|
|
30
|
+
readonly GoPomelo: "GoPomelo";
|
|
28
31
|
readonly Google: "Google";
|
|
29
32
|
readonly GoogleAIStudio: "Google AI Studio";
|
|
30
33
|
readonly Groq: "Groq";
|
|
@@ -55,6 +58,7 @@ export declare const ProviderName: {
|
|
|
55
58
|
readonly SambaNova: "SambaNova";
|
|
56
59
|
readonly SiliconFlow: "SiliconFlow";
|
|
57
60
|
readonly Stealth: "Stealth";
|
|
61
|
+
readonly StreamLake: "StreamLake";
|
|
58
62
|
readonly Switchpoint: "Switchpoint";
|
|
59
63
|
readonly Targon: "Targon";
|
|
60
64
|
readonly Together: "Together";
|
|
@@ -7,12 +7,14 @@ export const ProviderName = {
|
|
|
7
7
|
AionLabs: "AionLabs",
|
|
8
8
|
Alibaba: "Alibaba",
|
|
9
9
|
AmazonBedrock: "Amazon Bedrock",
|
|
10
|
+
AmazonNova: "Amazon Nova",
|
|
10
11
|
Anthropic: "Anthropic",
|
|
11
|
-
|
|
12
|
+
ArceeAI: "Arcee AI",
|
|
12
13
|
AtlasCloud: "AtlasCloud",
|
|
13
14
|
Avian: "Avian",
|
|
14
15
|
Azure: "Azure",
|
|
15
16
|
BaseTen: "BaseTen",
|
|
17
|
+
BytePlus: "BytePlus",
|
|
16
18
|
BlackForestLabs: "Black Forest Labs",
|
|
17
19
|
Cerebras: "Cerebras",
|
|
18
20
|
Chutes: "Chutes",
|
|
@@ -27,6 +29,7 @@ export const ProviderName = {
|
|
|
27
29
|
Fireworks: "Fireworks",
|
|
28
30
|
Friendli: "Friendli",
|
|
29
31
|
GMICloud: "GMICloud",
|
|
32
|
+
GoPomelo: "GoPomelo",
|
|
30
33
|
Google: "Google",
|
|
31
34
|
GoogleAIStudio: "Google AI Studio",
|
|
32
35
|
Groq: "Groq",
|
|
@@ -57,6 +60,7 @@ export const ProviderName = {
|
|
|
57
60
|
SambaNova: "SambaNova",
|
|
58
61
|
SiliconFlow: "SiliconFlow",
|
|
59
62
|
Stealth: "Stealth",
|
|
63
|
+
StreamLake: "StreamLake",
|
|
60
64
|
Switchpoint: "Switchpoint",
|
|
61
65
|
Targon: "Targon",
|
|
62
66
|
Together: "Together",
|
|
@@ -7,11 +7,11 @@ import { ResponsesFormatTextJSONSchemaConfig, ResponsesFormatTextJSONSchemaConfi
|
|
|
7
7
|
/**
|
|
8
8
|
* Text response format configuration
|
|
9
9
|
*/
|
|
10
|
-
export type ResponseFormatTextConfig =
|
|
10
|
+
export type ResponseFormatTextConfig = ResponsesFormatText | ResponsesFormatJSONObject | ResponsesFormatTextJSONSchemaConfig;
|
|
11
11
|
/** @internal */
|
|
12
12
|
export declare const ResponseFormatTextConfig$inboundSchema: z.ZodType<ResponseFormatTextConfig, unknown>;
|
|
13
13
|
/** @internal */
|
|
14
|
-
export type ResponseFormatTextConfig$Outbound =
|
|
14
|
+
export type ResponseFormatTextConfig$Outbound = ResponsesFormatText$Outbound | ResponsesFormatJSONObject$Outbound | ResponsesFormatTextJSONSchemaConfig$Outbound;
|
|
15
15
|
/** @internal */
|
|
16
16
|
export declare const ResponseFormatTextConfig$outboundSchema: z.ZodType<ResponseFormatTextConfig$Outbound, ResponseFormatTextConfig>;
|
|
17
17
|
export declare function responseFormatTextConfigToJSON(responseFormatTextConfig: ResponseFormatTextConfig): string;
|
|
@@ -8,15 +8,15 @@ import { ResponsesFormatText$inboundSchema, ResponsesFormatText$outboundSchema,
|
|
|
8
8
|
import { ResponsesFormatTextJSONSchemaConfig$inboundSchema, ResponsesFormatTextJSONSchemaConfig$outboundSchema, } from "./responsesformattextjsonschemaconfig.js";
|
|
9
9
|
/** @internal */
|
|
10
10
|
export const ResponseFormatTextConfig$inboundSchema = z.union([
|
|
11
|
-
ResponsesFormatTextJSONSchemaConfig$inboundSchema,
|
|
12
11
|
ResponsesFormatText$inboundSchema,
|
|
13
12
|
ResponsesFormatJSONObject$inboundSchema,
|
|
13
|
+
ResponsesFormatTextJSONSchemaConfig$inboundSchema,
|
|
14
14
|
]);
|
|
15
15
|
/** @internal */
|
|
16
16
|
export const ResponseFormatTextConfig$outboundSchema = z.union([
|
|
17
|
-
ResponsesFormatTextJSONSchemaConfig$outboundSchema,
|
|
18
17
|
ResponsesFormatText$outboundSchema,
|
|
19
18
|
ResponsesFormatJSONObject$outboundSchema,
|
|
19
|
+
ResponsesFormatTextJSONSchemaConfig$outboundSchema,
|
|
20
20
|
]);
|
|
21
21
|
export function responseFormatTextConfigToJSON(responseFormatTextConfig) {
|
|
22
22
|
return JSON.stringify(ResponseFormatTextConfig$outboundSchema.parse(responseFormatTextConfig));
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
-
import {
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
-
export declare const ResponseInputAudioType: {
|
|
6
|
-
readonly InputAudio: "input_audio";
|
|
7
|
-
};
|
|
8
|
-
export type ResponseInputAudioType = ClosedEnum<typeof ResponseInputAudioType>;
|
|
9
5
|
export declare const ResponseInputAudioFormat: {
|
|
10
6
|
readonly Mp3: "mp3";
|
|
11
7
|
readonly Wav: "wav";
|
|
@@ -19,14 +15,10 @@ export type ResponseInputAudioInputAudio = {
|
|
|
19
15
|
* Audio input content item
|
|
20
16
|
*/
|
|
21
17
|
export type ResponseInputAudio = {
|
|
22
|
-
type:
|
|
18
|
+
type: "input_audio";
|
|
23
19
|
inputAudio: ResponseInputAudioInputAudio;
|
|
24
20
|
};
|
|
25
21
|
/** @internal */
|
|
26
|
-
export declare const ResponseInputAudioType$inboundSchema: z.ZodEnum<typeof ResponseInputAudioType>;
|
|
27
|
-
/** @internal */
|
|
28
|
-
export declare const ResponseInputAudioType$outboundSchema: z.ZodEnum<typeof ResponseInputAudioType>;
|
|
29
|
-
/** @internal */
|
|
30
22
|
export declare const ResponseInputAudioFormat$inboundSchema: z.ZodType<ResponseInputAudioFormat, unknown>;
|
|
31
23
|
/** @internal */
|
|
32
24
|
export declare const ResponseInputAudioFormat$outboundSchema: z.ZodType<string, ResponseInputAudioFormat>;
|
|
@@ -45,7 +37,7 @@ export declare function responseInputAudioInputAudioFromJSON(jsonString: string)
|
|
|
45
37
|
export declare const ResponseInputAudio$inboundSchema: z.ZodType<ResponseInputAudio, unknown>;
|
|
46
38
|
/** @internal */
|
|
47
39
|
export type ResponseInputAudio$Outbound = {
|
|
48
|
-
type:
|
|
40
|
+
type: "input_audio";
|
|
49
41
|
input_audio: ResponseInputAudioInputAudio$Outbound;
|
|
50
42
|
};
|
|
51
43
|
/** @internal */
|
|
@@ -5,18 +5,11 @@ import * as z from "zod/v4";
|
|
|
5
5
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
7
|
import * as openEnums from "../types/enums.js";
|
|
8
|
-
export const ResponseInputAudioType = {
|
|
9
|
-
InputAudio: "input_audio",
|
|
10
|
-
};
|
|
11
8
|
export const ResponseInputAudioFormat = {
|
|
12
9
|
Mp3: "mp3",
|
|
13
10
|
Wav: "wav",
|
|
14
11
|
};
|
|
15
12
|
/** @internal */
|
|
16
|
-
export const ResponseInputAudioType$inboundSchema = z.enum(ResponseInputAudioType);
|
|
17
|
-
/** @internal */
|
|
18
|
-
export const ResponseInputAudioType$outboundSchema = ResponseInputAudioType$inboundSchema;
|
|
19
|
-
/** @internal */
|
|
20
13
|
export const ResponseInputAudioFormat$inboundSchema = openEnums.inboundSchema(ResponseInputAudioFormat);
|
|
21
14
|
/** @internal */
|
|
22
15
|
export const ResponseInputAudioFormat$outboundSchema = openEnums.outboundSchema(ResponseInputAudioFormat);
|
|
@@ -38,7 +31,7 @@ export function responseInputAudioInputAudioFromJSON(jsonString) {
|
|
|
38
31
|
}
|
|
39
32
|
/** @internal */
|
|
40
33
|
export const ResponseInputAudio$inboundSchema = z.object({
|
|
41
|
-
type:
|
|
34
|
+
type: z.literal("input_audio"),
|
|
42
35
|
input_audio: z.lazy(() => ResponseInputAudioInputAudio$inboundSchema),
|
|
43
36
|
}).transform((v) => {
|
|
44
37
|
return remap$(v, {
|
|
@@ -47,7 +40,7 @@ export const ResponseInputAudio$inboundSchema = z.object({
|
|
|
47
40
|
});
|
|
48
41
|
/** @internal */
|
|
49
42
|
export const ResponseInputAudio$outboundSchema = z.object({
|
|
50
|
-
type:
|
|
43
|
+
type: z.literal("input_audio"),
|
|
51
44
|
inputAudio: z.lazy(() => ResponseInputAudioInputAudio$outboundSchema),
|
|
52
45
|
}).transform((v) => {
|
|
53
46
|
return remap$(v, {
|
|
@@ -1,30 +1,21 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
-
import { ClosedEnum } from "../types/enums.js";
|
|
3
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
3
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
-
export declare const ResponseInputFileType: {
|
|
6
|
-
readonly InputFile: "input_file";
|
|
7
|
-
};
|
|
8
|
-
export type ResponseInputFileType = ClosedEnum<typeof ResponseInputFileType>;
|
|
9
4
|
/**
|
|
10
5
|
* File input content item
|
|
11
6
|
*/
|
|
12
7
|
export type ResponseInputFile = {
|
|
13
|
-
type:
|
|
8
|
+
type: "input_file";
|
|
14
9
|
fileId?: string | null | undefined;
|
|
15
10
|
fileData?: string | undefined;
|
|
16
11
|
filename?: string | undefined;
|
|
17
12
|
fileUrl?: string | undefined;
|
|
18
13
|
};
|
|
19
14
|
/** @internal */
|
|
20
|
-
export declare const ResponseInputFileType$inboundSchema: z.ZodEnum<typeof ResponseInputFileType>;
|
|
21
|
-
/** @internal */
|
|
22
|
-
export declare const ResponseInputFileType$outboundSchema: z.ZodEnum<typeof ResponseInputFileType>;
|
|
23
|
-
/** @internal */
|
|
24
15
|
export declare const ResponseInputFile$inboundSchema: z.ZodType<ResponseInputFile, unknown>;
|
|
25
16
|
/** @internal */
|
|
26
17
|
export type ResponseInputFile$Outbound = {
|
|
27
|
-
type:
|
|
18
|
+
type: "input_file";
|
|
28
19
|
file_id?: string | null | undefined;
|
|
29
20
|
file_data?: string | undefined;
|
|
30
21
|
filename?: string | undefined;
|
|
@@ -4,16 +4,9 @@
|
|
|
4
4
|
import * as z from "zod/v4";
|
|
5
5
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
|
-
export const ResponseInputFileType = {
|
|
8
|
-
InputFile: "input_file",
|
|
9
|
-
};
|
|
10
|
-
/** @internal */
|
|
11
|
-
export const ResponseInputFileType$inboundSchema = z.enum(ResponseInputFileType);
|
|
12
|
-
/** @internal */
|
|
13
|
-
export const ResponseInputFileType$outboundSchema = ResponseInputFileType$inboundSchema;
|
|
14
7
|
/** @internal */
|
|
15
8
|
export const ResponseInputFile$inboundSchema = z.object({
|
|
16
|
-
type:
|
|
9
|
+
type: z.literal("input_file"),
|
|
17
10
|
file_id: z.nullable(z.string()).optional(),
|
|
18
11
|
file_data: z.string().optional(),
|
|
19
12
|
filename: z.string().optional(),
|
|
@@ -27,7 +20,7 @@ export const ResponseInputFile$inboundSchema = z.object({
|
|
|
27
20
|
});
|
|
28
21
|
/** @internal */
|
|
29
22
|
export const ResponseInputFile$outboundSchema = z.object({
|
|
30
|
-
type:
|
|
23
|
+
type: z.literal("input_file"),
|
|
31
24
|
fileId: z.nullable(z.string()).optional(),
|
|
32
25
|
fileData: z.string().optional(),
|
|
33
26
|
filename: z.string().optional(),
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
-
import {
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
-
export declare const ResponseInputImageType: {
|
|
6
|
-
readonly InputImage: "input_image";
|
|
7
|
-
};
|
|
8
|
-
export type ResponseInputImageType = ClosedEnum<typeof ResponseInputImageType>;
|
|
9
5
|
export declare const ResponseInputImageDetail: {
|
|
10
6
|
readonly Auto: "auto";
|
|
11
7
|
readonly High: "high";
|
|
@@ -16,15 +12,11 @@ export type ResponseInputImageDetail = OpenEnum<typeof ResponseInputImageDetail>
|
|
|
16
12
|
* Image input content item
|
|
17
13
|
*/
|
|
18
14
|
export type ResponseInputImage = {
|
|
19
|
-
type:
|
|
15
|
+
type: "input_image";
|
|
20
16
|
detail: ResponseInputImageDetail;
|
|
21
17
|
imageUrl?: string | null | undefined;
|
|
22
18
|
};
|
|
23
19
|
/** @internal */
|
|
24
|
-
export declare const ResponseInputImageType$inboundSchema: z.ZodEnum<typeof ResponseInputImageType>;
|
|
25
|
-
/** @internal */
|
|
26
|
-
export declare const ResponseInputImageType$outboundSchema: z.ZodEnum<typeof ResponseInputImageType>;
|
|
27
|
-
/** @internal */
|
|
28
20
|
export declare const ResponseInputImageDetail$inboundSchema: z.ZodType<ResponseInputImageDetail, unknown>;
|
|
29
21
|
/** @internal */
|
|
30
22
|
export declare const ResponseInputImageDetail$outboundSchema: z.ZodType<string, ResponseInputImageDetail>;
|
|
@@ -32,7 +24,7 @@ export declare const ResponseInputImageDetail$outboundSchema: z.ZodType<string,
|
|
|
32
24
|
export declare const ResponseInputImage$inboundSchema: z.ZodType<ResponseInputImage, unknown>;
|
|
33
25
|
/** @internal */
|
|
34
26
|
export type ResponseInputImage$Outbound = {
|
|
35
|
-
type:
|
|
27
|
+
type: "input_image";
|
|
36
28
|
detail: string;
|
|
37
29
|
image_url?: string | null | undefined;
|
|
38
30
|
};
|
|
@@ -5,25 +5,18 @@ import * as z from "zod/v4";
|
|
|
5
5
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
7
|
import * as openEnums from "../types/enums.js";
|
|
8
|
-
export const ResponseInputImageType = {
|
|
9
|
-
InputImage: "input_image",
|
|
10
|
-
};
|
|
11
8
|
export const ResponseInputImageDetail = {
|
|
12
9
|
Auto: "auto",
|
|
13
10
|
High: "high",
|
|
14
11
|
Low: "low",
|
|
15
12
|
};
|
|
16
13
|
/** @internal */
|
|
17
|
-
export const ResponseInputImageType$inboundSchema = z.enum(ResponseInputImageType);
|
|
18
|
-
/** @internal */
|
|
19
|
-
export const ResponseInputImageType$outboundSchema = ResponseInputImageType$inboundSchema;
|
|
20
|
-
/** @internal */
|
|
21
14
|
export const ResponseInputImageDetail$inboundSchema = openEnums.inboundSchema(ResponseInputImageDetail);
|
|
22
15
|
/** @internal */
|
|
23
16
|
export const ResponseInputImageDetail$outboundSchema = openEnums.outboundSchema(ResponseInputImageDetail);
|
|
24
17
|
/** @internal */
|
|
25
18
|
export const ResponseInputImage$inboundSchema = z.object({
|
|
26
|
-
type:
|
|
19
|
+
type: z.literal("input_image"),
|
|
27
20
|
detail: ResponseInputImageDetail$inboundSchema,
|
|
28
21
|
image_url: z.nullable(z.string()).optional(),
|
|
29
22
|
}).transform((v) => {
|
|
@@ -33,7 +26,7 @@ export const ResponseInputImage$inboundSchema = z.object({
|
|
|
33
26
|
});
|
|
34
27
|
/** @internal */
|
|
35
28
|
export const ResponseInputImage$outboundSchema = z.object({
|
|
36
|
-
type:
|
|
29
|
+
type: z.literal("input_image"),
|
|
37
30
|
detail: ResponseInputImageDetail$outboundSchema,
|
|
38
31
|
imageUrl: z.nullable(z.string()).optional(),
|
|
39
32
|
}).transform((v) => {
|
|
@@ -1,27 +1,18 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
-
import { ClosedEnum } from "../types/enums.js";
|
|
3
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
3
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
-
export declare const ResponseInputTextType: {
|
|
6
|
-
readonly InputText: "input_text";
|
|
7
|
-
};
|
|
8
|
-
export type ResponseInputTextType = ClosedEnum<typeof ResponseInputTextType>;
|
|
9
4
|
/**
|
|
10
5
|
* Text input content item
|
|
11
6
|
*/
|
|
12
7
|
export type ResponseInputText = {
|
|
13
|
-
type:
|
|
8
|
+
type: "input_text";
|
|
14
9
|
text: string;
|
|
15
10
|
};
|
|
16
11
|
/** @internal */
|
|
17
|
-
export declare const ResponseInputTextType$inboundSchema: z.ZodEnum<typeof ResponseInputTextType>;
|
|
18
|
-
/** @internal */
|
|
19
|
-
export declare const ResponseInputTextType$outboundSchema: z.ZodEnum<typeof ResponseInputTextType>;
|
|
20
|
-
/** @internal */
|
|
21
12
|
export declare const ResponseInputText$inboundSchema: z.ZodType<ResponseInputText, unknown>;
|
|
22
13
|
/** @internal */
|
|
23
14
|
export type ResponseInputText$Outbound = {
|
|
24
|
-
type:
|
|
15
|
+
type: "input_text";
|
|
25
16
|
text: string;
|
|
26
17
|
};
|
|
27
18
|
/** @internal */
|
|
@@ -3,21 +3,14 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as z from "zod/v4";
|
|
5
5
|
import { safeParse } from "../lib/schemas.js";
|
|
6
|
-
export const ResponseInputTextType = {
|
|
7
|
-
InputText: "input_text",
|
|
8
|
-
};
|
|
9
|
-
/** @internal */
|
|
10
|
-
export const ResponseInputTextType$inboundSchema = z.enum(ResponseInputTextType);
|
|
11
|
-
/** @internal */
|
|
12
|
-
export const ResponseInputTextType$outboundSchema = ResponseInputTextType$inboundSchema;
|
|
13
6
|
/** @internal */
|
|
14
7
|
export const ResponseInputText$inboundSchema = z.object({
|
|
15
|
-
type:
|
|
8
|
+
type: z.literal("input_text"),
|
|
16
9
|
text: z.string(),
|
|
17
10
|
});
|
|
18
11
|
/** @internal */
|
|
19
12
|
export const ResponseInputText$outboundSchema = z.object({
|
|
20
|
-
type:
|
|
13
|
+
type: z.literal("input_text"),
|
|
21
14
|
text: z.string(),
|
|
22
15
|
});
|
|
23
16
|
export function responseInputTextToJSON(responseInputText) {
|
|
@@ -1,26 +1,17 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
-
import { ClosedEnum } from "../types/enums.js";
|
|
3
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
3
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
4
|
import { OpenAIResponsesAnnotation, OpenAIResponsesAnnotation$Outbound } from "./openairesponsesannotation.js";
|
|
6
|
-
export declare const ResponseOutputTextType: {
|
|
7
|
-
readonly OutputText: "output_text";
|
|
8
|
-
};
|
|
9
|
-
export type ResponseOutputTextType = ClosedEnum<typeof ResponseOutputTextType>;
|
|
10
5
|
export type ResponseOutputText = {
|
|
11
|
-
type:
|
|
6
|
+
type: "output_text";
|
|
12
7
|
text: string;
|
|
13
8
|
annotations?: Array<OpenAIResponsesAnnotation> | undefined;
|
|
14
9
|
};
|
|
15
10
|
/** @internal */
|
|
16
|
-
export declare const ResponseOutputTextType$inboundSchema: z.ZodEnum<typeof ResponseOutputTextType>;
|
|
17
|
-
/** @internal */
|
|
18
|
-
export declare const ResponseOutputTextType$outboundSchema: z.ZodEnum<typeof ResponseOutputTextType>;
|
|
19
|
-
/** @internal */
|
|
20
11
|
export declare const ResponseOutputText$inboundSchema: z.ZodType<ResponseOutputText, unknown>;
|
|
21
12
|
/** @internal */
|
|
22
13
|
export type ResponseOutputText$Outbound = {
|
|
23
|
-
type:
|
|
14
|
+
type: "output_text";
|
|
24
15
|
text: string;
|
|
25
16
|
annotations?: Array<OpenAIResponsesAnnotation$Outbound> | undefined;
|
|
26
17
|
};
|
|
@@ -4,22 +4,15 @@
|
|
|
4
4
|
import * as z from "zod/v4";
|
|
5
5
|
import { safeParse } from "../lib/schemas.js";
|
|
6
6
|
import { OpenAIResponsesAnnotation$inboundSchema, OpenAIResponsesAnnotation$outboundSchema, } from "./openairesponsesannotation.js";
|
|
7
|
-
export const ResponseOutputTextType = {
|
|
8
|
-
OutputText: "output_text",
|
|
9
|
-
};
|
|
10
|
-
/** @internal */
|
|
11
|
-
export const ResponseOutputTextType$inboundSchema = z.enum(ResponseOutputTextType);
|
|
12
|
-
/** @internal */
|
|
13
|
-
export const ResponseOutputTextType$outboundSchema = ResponseOutputTextType$inboundSchema;
|
|
14
7
|
/** @internal */
|
|
15
8
|
export const ResponseOutputText$inboundSchema = z.object({
|
|
16
|
-
type:
|
|
9
|
+
type: z.literal("output_text"),
|
|
17
10
|
text: z.string(),
|
|
18
11
|
annotations: z.array(OpenAIResponsesAnnotation$inboundSchema).optional(),
|
|
19
12
|
});
|
|
20
13
|
/** @internal */
|
|
21
14
|
export const ResponseOutputText$outboundSchema = z.object({
|
|
22
|
-
type:
|
|
15
|
+
type: z.literal("output_text"),
|
|
23
16
|
text: z.string(),
|
|
24
17
|
annotations: z.array(OpenAIResponsesAnnotation$outboundSchema).optional(),
|
|
25
18
|
});
|