@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
package/esm/lib/config.d.ts
CHANGED
|
@@ -37,8 +37,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
37
37
|
export declare const SDK_METADATA: {
|
|
38
38
|
readonly language: "typescript";
|
|
39
39
|
readonly openapiDocVersion: "1.0.0";
|
|
40
|
-
readonly sdkVersion: "0.1.
|
|
41
|
-
readonly genVersion: "2.
|
|
42
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.1.
|
|
40
|
+
readonly sdkVersion: "0.1.17";
|
|
41
|
+
readonly genVersion: "2.755.9";
|
|
42
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.1.17 2.755.9 1.0.0 @openrouter/sdk";
|
|
43
43
|
};
|
|
44
44
|
//# sourceMappingURL=config.d.ts.map
|
package/esm/lib/config.js
CHANGED
|
@@ -25,8 +25,8 @@ export function serverURLFromOptions(options) {
|
|
|
25
25
|
export const SDK_METADATA = {
|
|
26
26
|
language: "typescript",
|
|
27
27
|
openapiDocVersion: "1.0.0",
|
|
28
|
-
sdkVersion: "0.1.
|
|
29
|
-
genVersion: "2.
|
|
30
|
-
userAgent: "speakeasy-sdk/typescript 0.1.
|
|
28
|
+
sdkVersion: "0.1.17",
|
|
29
|
+
genVersion: "2.755.9",
|
|
30
|
+
userAgent: "speakeasy-sdk/typescript 0.1.17 2.755.9 1.0.0 @openrouter/sdk",
|
|
31
31
|
};
|
|
32
32
|
//# sourceMappingURL=config.js.map
|
|
@@ -7,6 +7,7 @@ import { ResponseFormatJSONSchema, ResponseFormatJSONSchema$Outbound } from "./r
|
|
|
7
7
|
import { ResponseFormatTextGrammar, ResponseFormatTextGrammar$Outbound } from "./responseformattextgrammar.js";
|
|
8
8
|
import { ToolDefinitionJson, ToolDefinitionJson$Outbound } from "./tooldefinitionjson.js";
|
|
9
9
|
export declare const Effort: {
|
|
10
|
+
readonly None: "none";
|
|
10
11
|
readonly Minimal: "minimal";
|
|
11
12
|
readonly Low: "low";
|
|
12
13
|
readonly Medium: "medium";
|
|
@@ -11,6 +11,7 @@ import { ResponseFormatJSONSchema$outboundSchema, } from "./responseformatjsonsc
|
|
|
11
11
|
import { ResponseFormatTextGrammar$outboundSchema, } from "./responseformattextgrammar.js";
|
|
12
12
|
import { ToolDefinitionJson$outboundSchema, } from "./tooldefinitionjson.js";
|
|
13
13
|
export const Effort = {
|
|
14
|
+
None: "none",
|
|
14
15
|
Minimal: "minimal",
|
|
15
16
|
Low: "low",
|
|
16
17
|
Medium: "medium",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
3
|
import { ChatMessageContentItemAudio, ChatMessageContentItemAudio$Outbound } from "./chatmessagecontentitemaudio.js";
|
|
4
|
+
import { ChatMessageContentItemFile, ChatMessageContentItemFile$Outbound } from "./chatmessagecontentitemfile.js";
|
|
4
5
|
import { ChatMessageContentItemImage, ChatMessageContentItemImage$Outbound } from "./chatmessagecontentitemimage.js";
|
|
5
6
|
import { ChatMessageContentItemText, ChatMessageContentItemText$Outbound } from "./chatmessagecontentitemtext.js";
|
|
6
7
|
import { ChatMessageContentItemVideo, ChatMessageContentItemVideo$Outbound } from "./chatmessagecontentitemvideo.js";
|
|
@@ -11,8 +12,12 @@ export type ChatMessageContentItem = (ChatMessageContentItemText & {
|
|
|
11
12
|
type: "image_url";
|
|
12
13
|
}) | (ChatMessageContentItemAudio & {
|
|
13
14
|
type: "input_audio";
|
|
15
|
+
}) | (ChatMessageContentItemFile & {
|
|
16
|
+
type: "file";
|
|
14
17
|
}) | (ChatMessageContentItemVideo & {
|
|
15
18
|
type: "input_video";
|
|
19
|
+
}) | (ChatMessageContentItemVideo & {
|
|
20
|
+
type: "video_url";
|
|
16
21
|
});
|
|
17
22
|
/** @internal */
|
|
18
23
|
export declare const ChatMessageContentItem$inboundSchema: z.ZodType<ChatMessageContentItem, unknown>;
|
|
@@ -23,8 +28,12 @@ export type ChatMessageContentItem$Outbound = (ChatMessageContentItemText$Outbou
|
|
|
23
28
|
type: "image_url";
|
|
24
29
|
}) | (ChatMessageContentItemAudio$Outbound & {
|
|
25
30
|
type: "input_audio";
|
|
31
|
+
}) | (ChatMessageContentItemFile$Outbound & {
|
|
32
|
+
type: "file";
|
|
26
33
|
}) | (ChatMessageContentItemVideo$Outbound & {
|
|
27
34
|
type: "input_video";
|
|
35
|
+
}) | (ChatMessageContentItemVideo$Outbound & {
|
|
36
|
+
type: "video_url";
|
|
28
37
|
});
|
|
29
38
|
/** @internal */
|
|
30
39
|
export declare const ChatMessageContentItem$outboundSchema: z.ZodType<ChatMessageContentItem$Outbound, ChatMessageContentItem>;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import * as z from "zod/v4";
|
|
5
5
|
import { safeParse } from "../lib/schemas.js";
|
|
6
6
|
import { ChatMessageContentItemAudio$inboundSchema, ChatMessageContentItemAudio$outboundSchema, } from "./chatmessagecontentitemaudio.js";
|
|
7
|
+
import { ChatMessageContentItemFile$inboundSchema, ChatMessageContentItemFile$outboundSchema, } from "./chatmessagecontentitemfile.js";
|
|
7
8
|
import { ChatMessageContentItemImage$inboundSchema, ChatMessageContentItemImage$outboundSchema, } from "./chatmessagecontentitemimage.js";
|
|
8
9
|
import { ChatMessageContentItemText$inboundSchema, ChatMessageContentItemText$outboundSchema, } from "./chatmessagecontentitemtext.js";
|
|
9
10
|
import { ChatMessageContentItemVideo$inboundSchema, ChatMessageContentItemVideo$outboundSchema, } from "./chatmessagecontentitemvideo.js";
|
|
@@ -12,14 +13,18 @@ export const ChatMessageContentItem$inboundSchema = z.union([
|
|
|
12
13
|
ChatMessageContentItemText$inboundSchema.and(z.object({ type: z.literal("text") })),
|
|
13
14
|
ChatMessageContentItemImage$inboundSchema.and(z.object({ type: z.literal("image_url") })),
|
|
14
15
|
ChatMessageContentItemAudio$inboundSchema.and(z.object({ type: z.literal("input_audio") })),
|
|
16
|
+
ChatMessageContentItemFile$inboundSchema.and(z.object({ type: z.literal("file") })),
|
|
15
17
|
ChatMessageContentItemVideo$inboundSchema.and(z.object({ type: z.literal("input_video") })),
|
|
18
|
+
z.lazy(() => ChatMessageContentItemVideo$inboundSchema).and(z.object({ type: z.literal("video_url") })),
|
|
16
19
|
]);
|
|
17
20
|
/** @internal */
|
|
18
21
|
export const ChatMessageContentItem$outboundSchema = z.union([
|
|
19
22
|
ChatMessageContentItemText$outboundSchema.and(z.object({ type: z.literal("text") })),
|
|
20
23
|
ChatMessageContentItemImage$outboundSchema.and(z.object({ type: z.literal("image_url") })),
|
|
21
24
|
ChatMessageContentItemAudio$outboundSchema.and(z.object({ type: z.literal("input_audio") })),
|
|
25
|
+
ChatMessageContentItemFile$outboundSchema.and(z.object({ type: z.literal("file") })),
|
|
22
26
|
ChatMessageContentItemVideo$outboundSchema.and(z.object({ type: z.literal("input_video") })),
|
|
27
|
+
z.lazy(() => ChatMessageContentItemVideo$outboundSchema).and(z.object({ type: z.literal("video_url") })),
|
|
23
28
|
]);
|
|
24
29
|
export function chatMessageContentItemToJSON(chatMessageContentItem) {
|
|
25
30
|
return JSON.stringify(ChatMessageContentItem$outboundSchema.parse(chatMessageContentItem));
|
|
@@ -0,0 +1,36 @@
|
|
|
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 FileT = {
|
|
5
|
+
fileData: string;
|
|
6
|
+
fileId?: string | undefined;
|
|
7
|
+
filename?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
export type ChatMessageContentItemFile = {
|
|
10
|
+
type: "file";
|
|
11
|
+
file: FileT;
|
|
12
|
+
};
|
|
13
|
+
/** @internal */
|
|
14
|
+
export declare const FileT$inboundSchema: z.ZodType<FileT, unknown>;
|
|
15
|
+
/** @internal */
|
|
16
|
+
export type FileT$Outbound = {
|
|
17
|
+
file_data: string;
|
|
18
|
+
file_id?: string | undefined;
|
|
19
|
+
filename?: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
/** @internal */
|
|
22
|
+
export declare const FileT$outboundSchema: z.ZodType<FileT$Outbound, FileT>;
|
|
23
|
+
export declare function fileToJSON(fileT: FileT): string;
|
|
24
|
+
export declare function fileFromJSON(jsonString: string): SafeParseResult<FileT, SDKValidationError>;
|
|
25
|
+
/** @internal */
|
|
26
|
+
export declare const ChatMessageContentItemFile$inboundSchema: z.ZodType<ChatMessageContentItemFile, unknown>;
|
|
27
|
+
/** @internal */
|
|
28
|
+
export type ChatMessageContentItemFile$Outbound = {
|
|
29
|
+
type: "file";
|
|
30
|
+
file: FileT$Outbound;
|
|
31
|
+
};
|
|
32
|
+
/** @internal */
|
|
33
|
+
export declare const ChatMessageContentItemFile$outboundSchema: z.ZodType<ChatMessageContentItemFile$Outbound, ChatMessageContentItemFile>;
|
|
34
|
+
export declare function chatMessageContentItemFileToJSON(chatMessageContentItemFile: ChatMessageContentItemFile): string;
|
|
35
|
+
export declare function chatMessageContentItemFileFromJSON(jsonString: string): SafeParseResult<ChatMessageContentItemFile, SDKValidationError>;
|
|
36
|
+
//# sourceMappingURL=chatmessagecontentitemfile.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
/** @internal */
|
|
8
|
+
export const FileT$inboundSchema = z.object({
|
|
9
|
+
file_data: z.string(),
|
|
10
|
+
file_id: z.string().optional(),
|
|
11
|
+
filename: z.string().optional(),
|
|
12
|
+
}).transform((v) => {
|
|
13
|
+
return remap$(v, {
|
|
14
|
+
"file_data": "fileData",
|
|
15
|
+
"file_id": "fileId",
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const FileT$outboundSchema = z.object({
|
|
20
|
+
fileData: z.string(),
|
|
21
|
+
fileId: z.string().optional(),
|
|
22
|
+
filename: z.string().optional(),
|
|
23
|
+
}).transform((v) => {
|
|
24
|
+
return remap$(v, {
|
|
25
|
+
fileData: "file_data",
|
|
26
|
+
fileId: "file_id",
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
export function fileToJSON(fileT) {
|
|
30
|
+
return JSON.stringify(FileT$outboundSchema.parse(fileT));
|
|
31
|
+
}
|
|
32
|
+
export function fileFromJSON(jsonString) {
|
|
33
|
+
return safeParse(jsonString, (x) => FileT$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileT' from JSON`);
|
|
34
|
+
}
|
|
35
|
+
/** @internal */
|
|
36
|
+
export const ChatMessageContentItemFile$inboundSchema = z.object({
|
|
37
|
+
type: z.literal("file"),
|
|
38
|
+
file: z.lazy(() => FileT$inboundSchema),
|
|
39
|
+
});
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const ChatMessageContentItemFile$outboundSchema = z.object({
|
|
42
|
+
type: z.literal("file"),
|
|
43
|
+
file: z.lazy(() => FileT$outboundSchema),
|
|
44
|
+
});
|
|
45
|
+
export function chatMessageContentItemFileToJSON(chatMessageContentItemFile) {
|
|
46
|
+
return JSON.stringify(ChatMessageContentItemFile$outboundSchema.parse(chatMessageContentItemFile));
|
|
47
|
+
}
|
|
48
|
+
export function chatMessageContentItemFileFromJSON(jsonString) {
|
|
49
|
+
return safeParse(jsonString, (x) => ChatMessageContentItemFile$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChatMessageContentItemFile' from JSON`);
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=chatmessagecontentitemfile.js.map
|
|
@@ -1,31 +1,56 @@
|
|
|
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
|
-
|
|
4
|
+
import { VideoURL, VideoURL$Outbound } from "./videourl.js";
|
|
5
|
+
export type ChatMessageContentItemVideoVideoUrlVideoUrl = {
|
|
5
6
|
url: string;
|
|
6
7
|
};
|
|
7
|
-
export type
|
|
8
|
+
export type ChatMessageContentItemVideoVideoURL = {
|
|
9
|
+
type: "video_url";
|
|
10
|
+
videoUrl: ChatMessageContentItemVideoVideoUrlVideoUrl;
|
|
11
|
+
};
|
|
12
|
+
export type ChatMessageContentItemVideoInputVideo = {
|
|
8
13
|
type: "input_video";
|
|
9
|
-
videoUrl:
|
|
14
|
+
videoUrl: VideoURL;
|
|
10
15
|
};
|
|
16
|
+
export type ChatMessageContentItemVideo = ChatMessageContentItemVideoInputVideo | ChatMessageContentItemVideoVideoURL;
|
|
11
17
|
/** @internal */
|
|
12
|
-
export declare const
|
|
18
|
+
export declare const ChatMessageContentItemVideoVideoUrlVideoUrl$inboundSchema: z.ZodType<ChatMessageContentItemVideoVideoUrlVideoUrl, unknown>;
|
|
13
19
|
/** @internal */
|
|
14
|
-
export type
|
|
20
|
+
export type ChatMessageContentItemVideoVideoUrlVideoUrl$Outbound = {
|
|
15
21
|
url: string;
|
|
16
22
|
};
|
|
17
23
|
/** @internal */
|
|
18
|
-
export declare const
|
|
19
|
-
export declare function
|
|
20
|
-
export declare function
|
|
24
|
+
export declare const ChatMessageContentItemVideoVideoUrlVideoUrl$outboundSchema: z.ZodType<ChatMessageContentItemVideoVideoUrlVideoUrl$Outbound, ChatMessageContentItemVideoVideoUrlVideoUrl>;
|
|
25
|
+
export declare function chatMessageContentItemVideoVideoUrlVideoUrlToJSON(chatMessageContentItemVideoVideoUrlVideoUrl: ChatMessageContentItemVideoVideoUrlVideoUrl): string;
|
|
26
|
+
export declare function chatMessageContentItemVideoVideoUrlVideoUrlFromJSON(jsonString: string): SafeParseResult<ChatMessageContentItemVideoVideoUrlVideoUrl, SDKValidationError>;
|
|
21
27
|
/** @internal */
|
|
22
|
-
export declare const
|
|
28
|
+
export declare const ChatMessageContentItemVideoVideoURL$inboundSchema: z.ZodType<ChatMessageContentItemVideoVideoURL, unknown>;
|
|
29
|
+
/** @internal */
|
|
30
|
+
export type ChatMessageContentItemVideoVideoURL$Outbound = {
|
|
31
|
+
type: "video_url";
|
|
32
|
+
video_url: ChatMessageContentItemVideoVideoUrlVideoUrl$Outbound;
|
|
33
|
+
};
|
|
34
|
+
/** @internal */
|
|
35
|
+
export declare const ChatMessageContentItemVideoVideoURL$outboundSchema: z.ZodType<ChatMessageContentItemVideoVideoURL$Outbound, ChatMessageContentItemVideoVideoURL>;
|
|
36
|
+
export declare function chatMessageContentItemVideoVideoURLToJSON(chatMessageContentItemVideoVideoURL: ChatMessageContentItemVideoVideoURL): string;
|
|
37
|
+
export declare function chatMessageContentItemVideoVideoURLFromJSON(jsonString: string): SafeParseResult<ChatMessageContentItemVideoVideoURL, SDKValidationError>;
|
|
23
38
|
/** @internal */
|
|
24
|
-
export
|
|
39
|
+
export declare const ChatMessageContentItemVideoInputVideo$inboundSchema: z.ZodType<ChatMessageContentItemVideoInputVideo, unknown>;
|
|
40
|
+
/** @internal */
|
|
41
|
+
export type ChatMessageContentItemVideoInputVideo$Outbound = {
|
|
25
42
|
type: "input_video";
|
|
26
|
-
video_url:
|
|
43
|
+
video_url: VideoURL$Outbound;
|
|
27
44
|
};
|
|
28
45
|
/** @internal */
|
|
46
|
+
export declare const ChatMessageContentItemVideoInputVideo$outboundSchema: z.ZodType<ChatMessageContentItemVideoInputVideo$Outbound, ChatMessageContentItemVideoInputVideo>;
|
|
47
|
+
export declare function chatMessageContentItemVideoInputVideoToJSON(chatMessageContentItemVideoInputVideo: ChatMessageContentItemVideoInputVideo): string;
|
|
48
|
+
export declare function chatMessageContentItemVideoInputVideoFromJSON(jsonString: string): SafeParseResult<ChatMessageContentItemVideoInputVideo, SDKValidationError>;
|
|
49
|
+
/** @internal */
|
|
50
|
+
export declare const ChatMessageContentItemVideo$inboundSchema: z.ZodType<ChatMessageContentItemVideo, unknown>;
|
|
51
|
+
/** @internal */
|
|
52
|
+
export type ChatMessageContentItemVideo$Outbound = ChatMessageContentItemVideoInputVideo$Outbound | ChatMessageContentItemVideoVideoURL$Outbound;
|
|
53
|
+
/** @internal */
|
|
29
54
|
export declare const ChatMessageContentItemVideo$outboundSchema: z.ZodType<ChatMessageContentItemVideo$Outbound, ChatMessageContentItemVideo>;
|
|
30
55
|
export declare function chatMessageContentItemVideoToJSON(chatMessageContentItemVideo: ChatMessageContentItemVideo): string;
|
|
31
56
|
export declare function chatMessageContentItemVideoFromJSON(jsonString: string): SafeParseResult<ChatMessageContentItemVideo, SDKValidationError>;
|
|
@@ -4,39 +4,79 @@
|
|
|
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
|
+
import { VideoURL$inboundSchema, VideoURL$outboundSchema, } from "./videourl.js";
|
|
7
8
|
/** @internal */
|
|
8
|
-
export const
|
|
9
|
+
export const ChatMessageContentItemVideoVideoUrlVideoUrl$inboundSchema = z.object({
|
|
9
10
|
url: z.string(),
|
|
10
11
|
});
|
|
11
12
|
/** @internal */
|
|
12
|
-
export const
|
|
13
|
-
.object({
|
|
13
|
+
export const ChatMessageContentItemVideoVideoUrlVideoUrl$outboundSchema = z.object({
|
|
14
14
|
url: z.string(),
|
|
15
15
|
});
|
|
16
|
-
export function
|
|
17
|
-
return JSON.stringify(
|
|
16
|
+
export function chatMessageContentItemVideoVideoUrlVideoUrlToJSON(chatMessageContentItemVideoVideoUrlVideoUrl) {
|
|
17
|
+
return JSON.stringify(ChatMessageContentItemVideoVideoUrlVideoUrl$outboundSchema.parse(chatMessageContentItemVideoVideoUrlVideoUrl));
|
|
18
18
|
}
|
|
19
|
-
export function
|
|
20
|
-
return safeParse(jsonString, (x) =>
|
|
19
|
+
export function chatMessageContentItemVideoVideoUrlVideoUrlFromJSON(jsonString) {
|
|
20
|
+
return safeParse(jsonString, (x) => ChatMessageContentItemVideoVideoUrlVideoUrl$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChatMessageContentItemVideoVideoUrlVideoUrl' from JSON`);
|
|
21
21
|
}
|
|
22
22
|
/** @internal */
|
|
23
|
-
export const
|
|
23
|
+
export const ChatMessageContentItemVideoVideoURL$inboundSchema = z.object({
|
|
24
|
+
type: z.literal("video_url"),
|
|
25
|
+
video_url: z.lazy(() => ChatMessageContentItemVideoVideoUrlVideoUrl$inboundSchema),
|
|
26
|
+
}).transform((v) => {
|
|
27
|
+
return remap$(v, {
|
|
28
|
+
"video_url": "videoUrl",
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
/** @internal */
|
|
32
|
+
export const ChatMessageContentItemVideoVideoURL$outboundSchema = z.object({
|
|
33
|
+
type: z.literal("video_url"),
|
|
34
|
+
videoUrl: z.lazy(() => ChatMessageContentItemVideoVideoUrlVideoUrl$outboundSchema),
|
|
35
|
+
}).transform((v) => {
|
|
36
|
+
return remap$(v, {
|
|
37
|
+
videoUrl: "video_url",
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
export function chatMessageContentItemVideoVideoURLToJSON(chatMessageContentItemVideoVideoURL) {
|
|
41
|
+
return JSON.stringify(ChatMessageContentItemVideoVideoURL$outboundSchema.parse(chatMessageContentItemVideoVideoURL));
|
|
42
|
+
}
|
|
43
|
+
export function chatMessageContentItemVideoVideoURLFromJSON(jsonString) {
|
|
44
|
+
return safeParse(jsonString, (x) => ChatMessageContentItemVideoVideoURL$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChatMessageContentItemVideoVideoURL' from JSON`);
|
|
45
|
+
}
|
|
46
|
+
/** @internal */
|
|
47
|
+
export const ChatMessageContentItemVideoInputVideo$inboundSchema = z.object({
|
|
24
48
|
type: z.literal("input_video"),
|
|
25
|
-
video_url:
|
|
49
|
+
video_url: VideoURL$inboundSchema,
|
|
26
50
|
}).transform((v) => {
|
|
27
51
|
return remap$(v, {
|
|
28
52
|
"video_url": "videoUrl",
|
|
29
53
|
});
|
|
30
54
|
});
|
|
31
55
|
/** @internal */
|
|
32
|
-
export const
|
|
56
|
+
export const ChatMessageContentItemVideoInputVideo$outboundSchema = z.object({
|
|
33
57
|
type: z.literal("input_video"),
|
|
34
|
-
videoUrl:
|
|
58
|
+
videoUrl: VideoURL$outboundSchema,
|
|
35
59
|
}).transform((v) => {
|
|
36
60
|
return remap$(v, {
|
|
37
61
|
videoUrl: "video_url",
|
|
38
62
|
});
|
|
39
63
|
});
|
|
64
|
+
export function chatMessageContentItemVideoInputVideoToJSON(chatMessageContentItemVideoInputVideo) {
|
|
65
|
+
return JSON.stringify(ChatMessageContentItemVideoInputVideo$outboundSchema.parse(chatMessageContentItemVideoInputVideo));
|
|
66
|
+
}
|
|
67
|
+
export function chatMessageContentItemVideoInputVideoFromJSON(jsonString) {
|
|
68
|
+
return safeParse(jsonString, (x) => ChatMessageContentItemVideoInputVideo$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChatMessageContentItemVideoInputVideo' from JSON`);
|
|
69
|
+
}
|
|
70
|
+
/** @internal */
|
|
71
|
+
export const ChatMessageContentItemVideo$inboundSchema = z.union([
|
|
72
|
+
z.lazy(() => ChatMessageContentItemVideoInputVideo$inboundSchema),
|
|
73
|
+
z.lazy(() => ChatMessageContentItemVideoVideoURL$inboundSchema),
|
|
74
|
+
]);
|
|
75
|
+
/** @internal */
|
|
76
|
+
export const ChatMessageContentItemVideo$outboundSchema = z.union([
|
|
77
|
+
z.lazy(() => ChatMessageContentItemVideoInputVideo$outboundSchema),
|
|
78
|
+
z.lazy(() => ChatMessageContentItemVideoVideoURL$outboundSchema),
|
|
79
|
+
]);
|
|
40
80
|
export function chatMessageContentItemVideoToJSON(chatMessageContentItemVideo) {
|
|
41
81
|
return JSON.stringify(ChatMessageContentItemVideo$outboundSchema.parse(chatMessageContentItemVideo));
|
|
42
82
|
}
|
|
@@ -1,16 +1,36 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
2
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
4
|
import { AssistantMessage } from "./assistantmessage.js";
|
|
4
|
-
import { ChatCompletionFinishReason } from "./chatcompletionfinishreason.js";
|
|
5
5
|
import { ChatMessageTokenLogprobs } from "./chatmessagetokenlogprobs.js";
|
|
6
|
+
import { ChatStreamingMessageChunk } from "./chatstreamingmessagechunk.js";
|
|
6
7
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
8
|
+
export declare const ChatCompletionFinishReason: {
|
|
9
|
+
readonly ToolCalls: "tool_calls";
|
|
10
|
+
readonly Stop: "stop";
|
|
11
|
+
readonly Length: "length";
|
|
12
|
+
readonly ContentFilter: "content_filter";
|
|
13
|
+
readonly Error: "error";
|
|
14
|
+
};
|
|
15
|
+
export type ChatCompletionFinishReason = OpenEnum<typeof ChatCompletionFinishReason>;
|
|
7
16
|
export type ChatResponseChoice = {
|
|
8
17
|
finishReason: ChatCompletionFinishReason | null;
|
|
9
18
|
index: number;
|
|
10
19
|
message: AssistantMessage;
|
|
11
20
|
logprobs?: ChatMessageTokenLogprobs | null | undefined;
|
|
12
21
|
};
|
|
22
|
+
export type ChatStreamingChoice = {
|
|
23
|
+
delta: ChatStreamingMessageChunk;
|
|
24
|
+
finishReason: ChatCompletionFinishReason | null;
|
|
25
|
+
index: number;
|
|
26
|
+
logprobs?: ChatMessageTokenLogprobs | null | undefined;
|
|
27
|
+
};
|
|
28
|
+
/** @internal */
|
|
29
|
+
export declare const ChatCompletionFinishReason$inboundSchema: z.ZodType<ChatCompletionFinishReason, unknown>;
|
|
13
30
|
/** @internal */
|
|
14
31
|
export declare const ChatResponseChoice$inboundSchema: z.ZodType<ChatResponseChoice, unknown>;
|
|
15
32
|
export declare function chatResponseChoiceFromJSON(jsonString: string): SafeParseResult<ChatResponseChoice, SDKValidationError>;
|
|
33
|
+
/** @internal */
|
|
34
|
+
export declare const ChatStreamingChoice$inboundSchema: z.ZodType<ChatStreamingChoice, unknown>;
|
|
35
|
+
export declare function chatStreamingChoiceFromJSON(jsonString: string): SafeParseResult<ChatStreamingChoice, SDKValidationError>;
|
|
16
36
|
//# sourceMappingURL=chatresponsechoice.d.ts.map
|
|
@@ -4,9 +4,19 @@
|
|
|
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
|
+
import * as openEnums from "../types/enums.js";
|
|
7
8
|
import { AssistantMessage$inboundSchema, } from "./assistantmessage.js";
|
|
8
|
-
import { ChatCompletionFinishReason$inboundSchema, } from "./chatcompletionfinishreason.js";
|
|
9
9
|
import { ChatMessageTokenLogprobs$inboundSchema, } from "./chatmessagetokenlogprobs.js";
|
|
10
|
+
import { ChatStreamingMessageChunk$inboundSchema, } from "./chatstreamingmessagechunk.js";
|
|
11
|
+
export const ChatCompletionFinishReason = {
|
|
12
|
+
ToolCalls: "tool_calls",
|
|
13
|
+
Stop: "stop",
|
|
14
|
+
Length: "length",
|
|
15
|
+
ContentFilter: "content_filter",
|
|
16
|
+
Error: "error",
|
|
17
|
+
};
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const ChatCompletionFinishReason$inboundSchema = openEnums.inboundSchema(ChatCompletionFinishReason);
|
|
10
20
|
/** @internal */
|
|
11
21
|
export const ChatResponseChoice$inboundSchema = z.object({
|
|
12
22
|
finish_reason: z.nullable(ChatCompletionFinishReason$inboundSchema),
|
|
@@ -21,4 +31,18 @@ export const ChatResponseChoice$inboundSchema = z.object({
|
|
|
21
31
|
export function chatResponseChoiceFromJSON(jsonString) {
|
|
22
32
|
return safeParse(jsonString, (x) => ChatResponseChoice$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChatResponseChoice' from JSON`);
|
|
23
33
|
}
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const ChatStreamingChoice$inboundSchema = z.object({
|
|
36
|
+
delta: ChatStreamingMessageChunk$inboundSchema,
|
|
37
|
+
finish_reason: z.nullable(ChatCompletionFinishReason$inboundSchema),
|
|
38
|
+
index: z.number(),
|
|
39
|
+
logprobs: z.nullable(ChatMessageTokenLogprobs$inboundSchema).optional(),
|
|
40
|
+
}).transform((v) => {
|
|
41
|
+
return remap$(v, {
|
|
42
|
+
"finish_reason": "finishReason",
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
export function chatStreamingChoiceFromJSON(jsonString) {
|
|
46
|
+
return safeParse(jsonString, (x) => ChatStreamingChoice$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChatStreamingChoice' from JSON`);
|
|
47
|
+
}
|
|
24
48
|
//# sourceMappingURL=chatresponsechoice.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
3
|
import { ChatGenerationTokenUsage } from "./chatgenerationtokenusage.js";
|
|
4
|
-
import { ChatStreamingChoice } from "./
|
|
4
|
+
import { ChatStreamingChoice } from "./chatresponsechoice.js";
|
|
5
5
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
6
6
|
export type ChatStreamingResponseChunkError = {
|
|
7
7
|
message: string;
|
|
@@ -5,7 +5,7 @@ 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 { ChatGenerationTokenUsage$inboundSchema, } from "./chatgenerationtokenusage.js";
|
|
8
|
-
import { ChatStreamingChoice$inboundSchema, } from "./
|
|
8
|
+
import { ChatStreamingChoice$inboundSchema, } from "./chatresponsechoice.js";
|
|
9
9
|
/** @internal */
|
|
10
10
|
export const ChatStreamingResponseChunkError$inboundSchema = z.object({
|
|
11
11
|
message: z.string(),
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
/**
|
|
4
|
+
* Data collection setting. If no available model provider meets the requirement, your request will return an error.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* - allow: (default) allow providers which store user data non-transiently and may train on it
|
|
8
|
+
*
|
|
9
|
+
* - deny: use only providers which do not collect user data.
|
|
10
|
+
*/
|
|
11
|
+
export declare const DataCollection: {
|
|
12
|
+
readonly Deny: "deny";
|
|
13
|
+
readonly Allow: "allow";
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Data collection setting. If no available model provider meets the requirement, your request will return an error.
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* - allow: (default) allow providers which store user data non-transiently and may train on it
|
|
20
|
+
*
|
|
21
|
+
* - deny: use only providers which do not collect user data.
|
|
22
|
+
*/
|
|
23
|
+
export type DataCollection = OpenEnum<typeof DataCollection>;
|
|
24
|
+
/** @internal */
|
|
25
|
+
export declare const DataCollection$outboundSchema: z.ZodType<string, DataCollection>;
|
|
26
|
+
//# sourceMappingURL=datacollection.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as openEnums from "../types/enums.js";
|
|
5
|
+
/**
|
|
6
|
+
* Data collection setting. If no available model provider meets the requirement, your request will return an error.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* - allow: (default) allow providers which store user data non-transiently and may train on it
|
|
10
|
+
*
|
|
11
|
+
* - deny: use only providers which do not collect user data.
|
|
12
|
+
*/
|
|
13
|
+
export const DataCollection = {
|
|
14
|
+
Deny: "deny",
|
|
15
|
+
Allow: "allow",
|
|
16
|
+
};
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const DataCollection$outboundSchema = openEnums.outboundSchema(DataCollection);
|
|
19
|
+
//# sourceMappingURL=datacollection.js.map
|
package/esm/models/index.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ export * from "./activityitem.js";
|
|
|
2
2
|
export * from "./assistantmessage.js";
|
|
3
3
|
export * from "./badgatewayresponseerrordata.js";
|
|
4
4
|
export * from "./badrequestresponseerrordata.js";
|
|
5
|
-
export * from "./chatcompletionfinishreason.js";
|
|
6
5
|
export * from "./chaterror.js";
|
|
7
6
|
export * from "./chatgenerationparams.js";
|
|
8
7
|
export * from "./chatgenerationtokenusage.js";
|
|
9
8
|
export * from "./chatmessagecontentitem.js";
|
|
10
9
|
export * from "./chatmessagecontentitemaudio.js";
|
|
10
|
+
export * from "./chatmessagecontentitemfile.js";
|
|
11
11
|
export * from "./chatmessagecontentitemimage.js";
|
|
12
12
|
export * from "./chatmessagecontentitemtext.js";
|
|
13
13
|
export * from "./chatmessagecontentitemvideo.js";
|
|
@@ -16,7 +16,6 @@ export * from "./chatmessagetokenlogprobs.js";
|
|
|
16
16
|
export * from "./chatmessagetoolcall.js";
|
|
17
17
|
export * from "./chatresponse.js";
|
|
18
18
|
export * from "./chatresponsechoice.js";
|
|
19
|
-
export * from "./chatstreamingchoice.js";
|
|
20
19
|
export * from "./chatstreamingmessagechunk.js";
|
|
21
20
|
export * from "./chatstreamingmessagetoolcall.js";
|
|
22
21
|
export * from "./chatstreamingresponsechunk.js";
|
|
@@ -27,6 +26,7 @@ export * from "./completionlogprobs.js";
|
|
|
27
26
|
export * from "./completionresponse.js";
|
|
28
27
|
export * from "./completionusage.js";
|
|
29
28
|
export * from "./createchargerequest.js";
|
|
29
|
+
export * from "./datacollection.js";
|
|
30
30
|
export * from "./defaultparameters.js";
|
|
31
31
|
export * from "./edgenetworktimeoutresponseerrordata.js";
|
|
32
32
|
export * from "./endpointstatus.js";
|
|
@@ -96,6 +96,7 @@ export * from "./paymentrequiredresponseerrordata.js";
|
|
|
96
96
|
export * from "./perrequestlimits.js";
|
|
97
97
|
export * from "./providername.js";
|
|
98
98
|
export * from "./provideroverloadedresponseerrordata.js";
|
|
99
|
+
export * from "./providersort.js";
|
|
99
100
|
export * from "./publicendpoint.js";
|
|
100
101
|
export * from "./publicpricing.js";
|
|
101
102
|
export * from "./quantization.js";
|
|
@@ -137,6 +138,7 @@ export * from "./unauthorizedresponseerrordata.js";
|
|
|
137
138
|
export * from "./unprocessableentityresponseerrordata.js";
|
|
138
139
|
export * from "./urlcitation.js";
|
|
139
140
|
export * from "./usermessage.js";
|
|
141
|
+
export * from "./videourl.js";
|
|
140
142
|
export * from "./websearchpreviewtooluserlocation.js";
|
|
141
143
|
export * from "./websearchstatus.js";
|
|
142
144
|
//# sourceMappingURL=index.d.ts.map
|
package/esm/models/index.js
CHANGED
|
@@ -5,12 +5,12 @@ export * from "./activityitem.js";
|
|
|
5
5
|
export * from "./assistantmessage.js";
|
|
6
6
|
export * from "./badgatewayresponseerrordata.js";
|
|
7
7
|
export * from "./badrequestresponseerrordata.js";
|
|
8
|
-
export * from "./chatcompletionfinishreason.js";
|
|
9
8
|
export * from "./chaterror.js";
|
|
10
9
|
export * from "./chatgenerationparams.js";
|
|
11
10
|
export * from "./chatgenerationtokenusage.js";
|
|
12
11
|
export * from "./chatmessagecontentitem.js";
|
|
13
12
|
export * from "./chatmessagecontentitemaudio.js";
|
|
13
|
+
export * from "./chatmessagecontentitemfile.js";
|
|
14
14
|
export * from "./chatmessagecontentitemimage.js";
|
|
15
15
|
export * from "./chatmessagecontentitemtext.js";
|
|
16
16
|
export * from "./chatmessagecontentitemvideo.js";
|
|
@@ -19,7 +19,6 @@ export * from "./chatmessagetokenlogprobs.js";
|
|
|
19
19
|
export * from "./chatmessagetoolcall.js";
|
|
20
20
|
export * from "./chatresponse.js";
|
|
21
21
|
export * from "./chatresponsechoice.js";
|
|
22
|
-
export * from "./chatstreamingchoice.js";
|
|
23
22
|
export * from "./chatstreamingmessagechunk.js";
|
|
24
23
|
export * from "./chatstreamingmessagetoolcall.js";
|
|
25
24
|
export * from "./chatstreamingresponsechunk.js";
|
|
@@ -30,6 +29,7 @@ export * from "./completionlogprobs.js";
|
|
|
30
29
|
export * from "./completionresponse.js";
|
|
31
30
|
export * from "./completionusage.js";
|
|
32
31
|
export * from "./createchargerequest.js";
|
|
32
|
+
export * from "./datacollection.js";
|
|
33
33
|
export * from "./defaultparameters.js";
|
|
34
34
|
export * from "./edgenetworktimeoutresponseerrordata.js";
|
|
35
35
|
export * from "./endpointstatus.js";
|
|
@@ -99,6 +99,7 @@ export * from "./paymentrequiredresponseerrordata.js";
|
|
|
99
99
|
export * from "./perrequestlimits.js";
|
|
100
100
|
export * from "./providername.js";
|
|
101
101
|
export * from "./provideroverloadedresponseerrordata.js";
|
|
102
|
+
export * from "./providersort.js";
|
|
102
103
|
export * from "./publicendpoint.js";
|
|
103
104
|
export * from "./publicpricing.js";
|
|
104
105
|
export * from "./quantization.js";
|
|
@@ -140,6 +141,7 @@ export * from "./unauthorizedresponseerrordata.js";
|
|
|
140
141
|
export * from "./unprocessableentityresponseerrordata.js";
|
|
141
142
|
export * from "./urlcitation.js";
|
|
142
143
|
export * from "./usermessage.js";
|
|
144
|
+
export * from "./videourl.js";
|
|
143
145
|
export * from "./websearchpreviewtooluserlocation.js";
|
|
144
146
|
export * from "./websearchstatus.js";
|
|
145
147
|
//# sourceMappingURL=index.js.map
|
|
@@ -5,6 +5,7 @@ export declare const OpenAIResponsesReasoningEffort: {
|
|
|
5
5
|
readonly Medium: "medium";
|
|
6
6
|
readonly Low: "low";
|
|
7
7
|
readonly Minimal: "minimal";
|
|
8
|
+
readonly None: "none";
|
|
8
9
|
};
|
|
9
10
|
export type OpenAIResponsesReasoningEffort = OpenEnum<typeof OpenAIResponsesReasoningEffort>;
|
|
10
11
|
/** @internal */
|
|
@@ -24,6 +24,7 @@ export declare const OpenResponsesReasoningFormat: {
|
|
|
24
24
|
readonly OpenaiResponsesV1: "openai-responses-v1";
|
|
25
25
|
readonly XaiResponsesV1: "xai-responses-v1";
|
|
26
26
|
readonly AnthropicClaudeV1: "anthropic-claude-v1";
|
|
27
|
+
readonly GoogleGeminiV1: "google-gemini-v1";
|
|
27
28
|
};
|
|
28
29
|
export type OpenResponsesReasoningFormat = OpenEnum<typeof OpenResponsesReasoningFormat>;
|
|
29
30
|
/**
|
|
@@ -23,6 +23,7 @@ export const OpenResponsesReasoningFormat = {
|
|
|
23
23
|
OpenaiResponsesV1: "openai-responses-v1",
|
|
24
24
|
XaiResponsesV1: "xai-responses-v1",
|
|
25
25
|
AnthropicClaudeV1: "anthropic-claude-v1",
|
|
26
|
+
GoogleGeminiV1: "google-gemini-v1",
|
|
26
27
|
};
|
|
27
28
|
/** @internal */
|
|
28
29
|
export const OpenResponsesReasoningType$outboundSchema = z.enum(OpenResponsesReasoningType);
|