@openrouter/sdk 0.1.27 → 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
|
@@ -51,10 +51,10 @@ export function chatGenerationParamsResponseFormatTextToJSON(chatGenerationParam
|
|
|
51
51
|
}
|
|
52
52
|
/** @internal */
|
|
53
53
|
export const ChatGenerationParamsResponseFormatUnion$outboundSchema = z.union([
|
|
54
|
-
ResponseFormatJSONSchema$outboundSchema,
|
|
55
|
-
ResponseFormatTextGrammar$outboundSchema,
|
|
56
54
|
z.lazy(() => ChatGenerationParamsResponseFormatText$outboundSchema),
|
|
57
55
|
z.lazy(() => ChatGenerationParamsResponseFormatJSONObject$outboundSchema),
|
|
56
|
+
ResponseFormatJSONSchema$outboundSchema,
|
|
57
|
+
ResponseFormatTextGrammar$outboundSchema,
|
|
58
58
|
z.lazy(() => ChatGenerationParamsResponseFormatPython$outboundSchema),
|
|
59
59
|
]);
|
|
60
60
|
export function chatGenerationParamsResponseFormatUnionToJSON(chatGenerationParamsResponseFormatUnion) {
|
|
@@ -80,10 +80,10 @@ export const ChatGenerationParams$outboundSchema = z.object({
|
|
|
80
80
|
presencePenalty: z.nullable(z.number()).optional(),
|
|
81
81
|
reasoning: z.lazy(() => Reasoning$outboundSchema).optional(),
|
|
82
82
|
responseFormat: z.union([
|
|
83
|
-
ResponseFormatJSONSchema$outboundSchema,
|
|
84
|
-
ResponseFormatTextGrammar$outboundSchema,
|
|
85
83
|
z.lazy(() => ChatGenerationParamsResponseFormatText$outboundSchema),
|
|
86
84
|
z.lazy(() => ChatGenerationParamsResponseFormatJSONObject$outboundSchema),
|
|
85
|
+
ResponseFormatJSONSchema$outboundSchema,
|
|
86
|
+
ResponseFormatTextGrammar$outboundSchema,
|
|
87
87
|
z.lazy(() => ChatGenerationParamsResponseFormatPython$outboundSchema),
|
|
88
88
|
]).optional(),
|
|
89
89
|
seed: z.nullable(z.int()).optional(),
|
|
@@ -1,20 +1,11 @@
|
|
|
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";
|
|
5
4
|
import { ChatMessageContentItemImage, ChatMessageContentItemImage$Outbound } from "./chatmessagecontentitemimage.js";
|
|
6
5
|
import { ChatMessageContentItemText, ChatMessageContentItemText$Outbound } from "./chatmessagecontentitemtext.js";
|
|
7
6
|
import { ChatMessageContentItemVideo, ChatMessageContentItemVideo$Outbound } from "./chatmessagecontentitemvideo.js";
|
|
8
7
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
|
-
export type ChatMessageContentItem =
|
|
10
|
-
type: "text";
|
|
11
|
-
}) | (ChatMessageContentItemImage & {
|
|
12
|
-
type: "image_url";
|
|
13
|
-
}) | (ChatMessageContentItemAudio & {
|
|
14
|
-
type: "input_audio";
|
|
15
|
-
}) | (ChatMessageContentItemFile & {
|
|
16
|
-
type: "file";
|
|
17
|
-
}) | (ChatMessageContentItemVideo & {
|
|
8
|
+
export type ChatMessageContentItem = ChatMessageContentItemText | ChatMessageContentItemImage | ChatMessageContentItemAudio | (ChatMessageContentItemVideo & {
|
|
18
9
|
type: "input_video";
|
|
19
10
|
}) | (ChatMessageContentItemVideo & {
|
|
20
11
|
type: "video_url";
|
|
@@ -22,15 +13,7 @@ export type ChatMessageContentItem = (ChatMessageContentItemText & {
|
|
|
22
13
|
/** @internal */
|
|
23
14
|
export declare const ChatMessageContentItem$inboundSchema: z.ZodType<ChatMessageContentItem, unknown>;
|
|
24
15
|
/** @internal */
|
|
25
|
-
export type ChatMessageContentItem$Outbound =
|
|
26
|
-
type: "text";
|
|
27
|
-
}) | (ChatMessageContentItemImage$Outbound & {
|
|
28
|
-
type: "image_url";
|
|
29
|
-
}) | (ChatMessageContentItemAudio$Outbound & {
|
|
30
|
-
type: "input_audio";
|
|
31
|
-
}) | (ChatMessageContentItemFile$Outbound & {
|
|
32
|
-
type: "file";
|
|
33
|
-
}) | (ChatMessageContentItemVideo$Outbound & {
|
|
16
|
+
export type ChatMessageContentItem$Outbound = ChatMessageContentItemText$Outbound | ChatMessageContentItemImage$Outbound | ChatMessageContentItemAudio$Outbound | (ChatMessageContentItemVideo$Outbound & {
|
|
34
17
|
type: "input_video";
|
|
35
18
|
}) | (ChatMessageContentItemVideo$Outbound & {
|
|
36
19
|
type: "video_url";
|
|
@@ -4,25 +4,22 @@
|
|
|
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";
|
|
8
7
|
import { ChatMessageContentItemImage$inboundSchema, ChatMessageContentItemImage$outboundSchema, } from "./chatmessagecontentitemimage.js";
|
|
9
8
|
import { ChatMessageContentItemText$inboundSchema, ChatMessageContentItemText$outboundSchema, } from "./chatmessagecontentitemtext.js";
|
|
10
9
|
import { ChatMessageContentItemVideo$inboundSchema, ChatMessageContentItemVideo$outboundSchema, } from "./chatmessagecontentitemvideo.js";
|
|
11
10
|
/** @internal */
|
|
12
11
|
export const ChatMessageContentItem$inboundSchema = z.union([
|
|
13
|
-
ChatMessageContentItemText$inboundSchema
|
|
14
|
-
ChatMessageContentItemImage$inboundSchema
|
|
15
|
-
ChatMessageContentItemAudio$inboundSchema
|
|
16
|
-
ChatMessageContentItemFile$inboundSchema.and(z.object({ type: z.literal("file") })),
|
|
12
|
+
ChatMessageContentItemText$inboundSchema,
|
|
13
|
+
ChatMessageContentItemImage$inboundSchema,
|
|
14
|
+
ChatMessageContentItemAudio$inboundSchema,
|
|
17
15
|
ChatMessageContentItemVideo$inboundSchema.and(z.object({ type: z.literal("input_video") })),
|
|
18
16
|
z.lazy(() => ChatMessageContentItemVideo$inboundSchema).and(z.object({ type: z.literal("video_url") })),
|
|
19
17
|
]);
|
|
20
18
|
/** @internal */
|
|
21
19
|
export const ChatMessageContentItem$outboundSchema = z.union([
|
|
22
|
-
ChatMessageContentItemText$outboundSchema
|
|
23
|
-
ChatMessageContentItemImage$outboundSchema
|
|
24
|
-
ChatMessageContentItemAudio$outboundSchema
|
|
25
|
-
ChatMessageContentItemFile$outboundSchema.and(z.object({ type: z.literal("file") })),
|
|
20
|
+
ChatMessageContentItemText$outboundSchema,
|
|
21
|
+
ChatMessageContentItemImage$outboundSchema,
|
|
22
|
+
ChatMessageContentItemAudio$outboundSchema,
|
|
26
23
|
ChatMessageContentItemVideo$outboundSchema.and(z.object({ type: z.literal("input_video") })),
|
|
27
24
|
z.lazy(() => ChatMessageContentItemVideo$outboundSchema).and(z.object({ type: z.literal("video_url") })),
|
|
28
25
|
]);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
export declare const Ttl: {
|
|
6
|
+
readonly Fivem: "5m";
|
|
7
|
+
readonly Oneh: "1h";
|
|
8
|
+
};
|
|
9
|
+
export type Ttl = OpenEnum<typeof Ttl>;
|
|
10
|
+
export type ChatMessageContentItemCacheControl = {
|
|
11
|
+
type: "ephemeral";
|
|
12
|
+
ttl?: Ttl | undefined;
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export declare const Ttl$inboundSchema: z.ZodType<Ttl, unknown>;
|
|
16
|
+
/** @internal */
|
|
17
|
+
export declare const Ttl$outboundSchema: z.ZodType<string, Ttl>;
|
|
18
|
+
/** @internal */
|
|
19
|
+
export declare const ChatMessageContentItemCacheControl$inboundSchema: z.ZodType<ChatMessageContentItemCacheControl, unknown>;
|
|
20
|
+
/** @internal */
|
|
21
|
+
export type ChatMessageContentItemCacheControl$Outbound = {
|
|
22
|
+
type: "ephemeral";
|
|
23
|
+
ttl?: string | undefined;
|
|
24
|
+
};
|
|
25
|
+
/** @internal */
|
|
26
|
+
export declare const ChatMessageContentItemCacheControl$outboundSchema: z.ZodType<ChatMessageContentItemCacheControl$Outbound, ChatMessageContentItemCacheControl>;
|
|
27
|
+
export declare function chatMessageContentItemCacheControlToJSON(chatMessageContentItemCacheControl: ChatMessageContentItemCacheControl): string;
|
|
28
|
+
export declare function chatMessageContentItemCacheControlFromJSON(jsonString: string): SafeParseResult<ChatMessageContentItemCacheControl, SDKValidationError>;
|
|
29
|
+
//# sourceMappingURL=chatmessagecontentitemcachecontrol.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
import * as openEnums from "../types/enums.js";
|
|
7
|
+
export const Ttl = {
|
|
8
|
+
Fivem: "5m",
|
|
9
|
+
Oneh: "1h",
|
|
10
|
+
};
|
|
11
|
+
/** @internal */
|
|
12
|
+
export const Ttl$inboundSchema = openEnums
|
|
13
|
+
.inboundSchema(Ttl);
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const Ttl$outboundSchema = openEnums
|
|
16
|
+
.outboundSchema(Ttl);
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const ChatMessageContentItemCacheControl$inboundSchema = z.object({
|
|
19
|
+
type: z.literal("ephemeral"),
|
|
20
|
+
ttl: Ttl$inboundSchema.optional(),
|
|
21
|
+
});
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const ChatMessageContentItemCacheControl$outboundSchema = z.object({
|
|
24
|
+
type: z.literal("ephemeral"),
|
|
25
|
+
ttl: Ttl$outboundSchema.optional(),
|
|
26
|
+
});
|
|
27
|
+
export function chatMessageContentItemCacheControlToJSON(chatMessageContentItemCacheControl) {
|
|
28
|
+
return JSON.stringify(ChatMessageContentItemCacheControl$outboundSchema.parse(chatMessageContentItemCacheControl));
|
|
29
|
+
}
|
|
30
|
+
export function chatMessageContentItemCacheControlFromJSON(jsonString) {
|
|
31
|
+
return safeParse(jsonString, (x) => ChatMessageContentItemCacheControl$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChatMessageContentItemCacheControl' from JSON`);
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=chatmessagecontentitemcachecontrol.js.map
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { ChatMessageContentItemCacheControl, ChatMessageContentItemCacheControl$Outbound } from "./chatmessagecontentitemcachecontrol.js";
|
|
3
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
5
|
export type ChatMessageContentItemText = {
|
|
5
6
|
type: "text";
|
|
6
7
|
text: string;
|
|
8
|
+
cacheControl?: ChatMessageContentItemCacheControl | undefined;
|
|
7
9
|
};
|
|
8
10
|
/** @internal */
|
|
9
11
|
export declare const ChatMessageContentItemText$inboundSchema: z.ZodType<ChatMessageContentItemText, unknown>;
|
|
@@ -11,6 +13,7 @@ export declare const ChatMessageContentItemText$inboundSchema: z.ZodType<ChatMes
|
|
|
11
13
|
export type ChatMessageContentItemText$Outbound = {
|
|
12
14
|
type: "text";
|
|
13
15
|
text: string;
|
|
16
|
+
cache_control?: ChatMessageContentItemCacheControl$Outbound | undefined;
|
|
14
17
|
};
|
|
15
18
|
/** @internal */
|
|
16
19
|
export declare const ChatMessageContentItemText$outboundSchema: z.ZodType<ChatMessageContentItemText$Outbound, ChatMessageContentItemText>;
|
|
@@ -2,16 +2,28 @@
|
|
|
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";
|
|
7
|
+
import { ChatMessageContentItemCacheControl$inboundSchema, ChatMessageContentItemCacheControl$outboundSchema, } from "./chatmessagecontentitemcachecontrol.js";
|
|
6
8
|
/** @internal */
|
|
7
9
|
export const ChatMessageContentItemText$inboundSchema = z.object({
|
|
8
10
|
type: z.literal("text"),
|
|
9
11
|
text: z.string(),
|
|
12
|
+
cache_control: ChatMessageContentItemCacheControl$inboundSchema.optional(),
|
|
13
|
+
}).transform((v) => {
|
|
14
|
+
return remap$(v, {
|
|
15
|
+
"cache_control": "cacheControl",
|
|
16
|
+
});
|
|
10
17
|
});
|
|
11
18
|
/** @internal */
|
|
12
19
|
export const ChatMessageContentItemText$outboundSchema = z.object({
|
|
13
20
|
type: z.literal("text"),
|
|
14
21
|
text: z.string(),
|
|
22
|
+
cacheControl: ChatMessageContentItemCacheControl$outboundSchema.optional(),
|
|
23
|
+
}).transform((v) => {
|
|
24
|
+
return remap$(v, {
|
|
25
|
+
cacheControl: "cache_control",
|
|
26
|
+
});
|
|
15
27
|
});
|
|
16
28
|
export function chatMessageContentItemTextToJSON(chatMessageContentItemText) {
|
|
17
29
|
return JSON.stringify(ChatMessageContentItemText$outboundSchema.parse(chatMessageContentItemText));
|
|
@@ -1,46 +1,58 @@
|
|
|
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
|
-
|
|
5
|
-
export type ChatMessageContentItemVideoVideoUrlVideoUrl = {
|
|
4
|
+
export type VideoUrl2 = {
|
|
6
5
|
url: string;
|
|
7
6
|
};
|
|
8
7
|
export type ChatMessageContentItemVideoVideoURL = {
|
|
9
8
|
type: "video_url";
|
|
10
|
-
videoUrl:
|
|
9
|
+
videoUrl: VideoUrl2;
|
|
10
|
+
};
|
|
11
|
+
export type VideoUrl1 = {
|
|
12
|
+
url: string;
|
|
11
13
|
};
|
|
12
14
|
export type ChatMessageContentItemVideoInputVideo = {
|
|
13
15
|
type: "input_video";
|
|
14
|
-
videoUrl:
|
|
16
|
+
videoUrl: VideoUrl1;
|
|
15
17
|
};
|
|
16
18
|
export type ChatMessageContentItemVideo = ChatMessageContentItemVideoInputVideo | ChatMessageContentItemVideoVideoURL;
|
|
17
19
|
/** @internal */
|
|
18
|
-
export declare const
|
|
20
|
+
export declare const VideoUrl2$inboundSchema: z.ZodType<VideoUrl2, unknown>;
|
|
19
21
|
/** @internal */
|
|
20
|
-
export type
|
|
22
|
+
export type VideoUrl2$Outbound = {
|
|
21
23
|
url: string;
|
|
22
24
|
};
|
|
23
25
|
/** @internal */
|
|
24
|
-
export declare const
|
|
25
|
-
export declare function
|
|
26
|
-
export declare function
|
|
26
|
+
export declare const VideoUrl2$outboundSchema: z.ZodType<VideoUrl2$Outbound, VideoUrl2>;
|
|
27
|
+
export declare function videoUrl2ToJSON(videoUrl2: VideoUrl2): string;
|
|
28
|
+
export declare function videoUrl2FromJSON(jsonString: string): SafeParseResult<VideoUrl2, SDKValidationError>;
|
|
27
29
|
/** @internal */
|
|
28
30
|
export declare const ChatMessageContentItemVideoVideoURL$inboundSchema: z.ZodType<ChatMessageContentItemVideoVideoURL, unknown>;
|
|
29
31
|
/** @internal */
|
|
30
32
|
export type ChatMessageContentItemVideoVideoURL$Outbound = {
|
|
31
33
|
type: "video_url";
|
|
32
|
-
video_url:
|
|
34
|
+
video_url: VideoUrl2$Outbound;
|
|
33
35
|
};
|
|
34
36
|
/** @internal */
|
|
35
37
|
export declare const ChatMessageContentItemVideoVideoURL$outboundSchema: z.ZodType<ChatMessageContentItemVideoVideoURL$Outbound, ChatMessageContentItemVideoVideoURL>;
|
|
36
38
|
export declare function chatMessageContentItemVideoVideoURLToJSON(chatMessageContentItemVideoVideoURL: ChatMessageContentItemVideoVideoURL): string;
|
|
37
39
|
export declare function chatMessageContentItemVideoVideoURLFromJSON(jsonString: string): SafeParseResult<ChatMessageContentItemVideoVideoURL, SDKValidationError>;
|
|
38
40
|
/** @internal */
|
|
41
|
+
export declare const VideoUrl1$inboundSchema: z.ZodType<VideoUrl1, unknown>;
|
|
42
|
+
/** @internal */
|
|
43
|
+
export type VideoUrl1$Outbound = {
|
|
44
|
+
url: string;
|
|
45
|
+
};
|
|
46
|
+
/** @internal */
|
|
47
|
+
export declare const VideoUrl1$outboundSchema: z.ZodType<VideoUrl1$Outbound, VideoUrl1>;
|
|
48
|
+
export declare function videoUrl1ToJSON(videoUrl1: VideoUrl1): string;
|
|
49
|
+
export declare function videoUrl1FromJSON(jsonString: string): SafeParseResult<VideoUrl1, SDKValidationError>;
|
|
50
|
+
/** @internal */
|
|
39
51
|
export declare const ChatMessageContentItemVideoInputVideo$inboundSchema: z.ZodType<ChatMessageContentItemVideoInputVideo, unknown>;
|
|
40
52
|
/** @internal */
|
|
41
53
|
export type ChatMessageContentItemVideoInputVideo$Outbound = {
|
|
42
54
|
type: "input_video";
|
|
43
|
-
video_url:
|
|
55
|
+
video_url: VideoUrl1$Outbound;
|
|
44
56
|
};
|
|
45
57
|
/** @internal */
|
|
46
58
|
export declare const ChatMessageContentItemVideoInputVideo$outboundSchema: z.ZodType<ChatMessageContentItemVideoInputVideo$Outbound, ChatMessageContentItemVideoInputVideo>;
|
|
@@ -4,25 +4,24 @@
|
|
|
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";
|
|
8
7
|
/** @internal */
|
|
9
|
-
export const
|
|
8
|
+
export const VideoUrl2$inboundSchema = z.object({
|
|
10
9
|
url: z.string(),
|
|
11
10
|
});
|
|
12
11
|
/** @internal */
|
|
13
|
-
export const
|
|
12
|
+
export const VideoUrl2$outboundSchema = z.object({
|
|
14
13
|
url: z.string(),
|
|
15
14
|
});
|
|
16
|
-
export function
|
|
17
|
-
return JSON.stringify(
|
|
15
|
+
export function videoUrl2ToJSON(videoUrl2) {
|
|
16
|
+
return JSON.stringify(VideoUrl2$outboundSchema.parse(videoUrl2));
|
|
18
17
|
}
|
|
19
|
-
export function
|
|
20
|
-
return safeParse(jsonString, (x) =>
|
|
18
|
+
export function videoUrl2FromJSON(jsonString) {
|
|
19
|
+
return safeParse(jsonString, (x) => VideoUrl2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VideoUrl2' from JSON`);
|
|
21
20
|
}
|
|
22
21
|
/** @internal */
|
|
23
22
|
export const ChatMessageContentItemVideoVideoURL$inboundSchema = z.object({
|
|
24
23
|
type: z.literal("video_url"),
|
|
25
|
-
video_url: z.lazy(() =>
|
|
24
|
+
video_url: z.lazy(() => VideoUrl2$inboundSchema),
|
|
26
25
|
}).transform((v) => {
|
|
27
26
|
return remap$(v, {
|
|
28
27
|
"video_url": "videoUrl",
|
|
@@ -31,7 +30,7 @@ export const ChatMessageContentItemVideoVideoURL$inboundSchema = z.object({
|
|
|
31
30
|
/** @internal */
|
|
32
31
|
export const ChatMessageContentItemVideoVideoURL$outboundSchema = z.object({
|
|
33
32
|
type: z.literal("video_url"),
|
|
34
|
-
videoUrl: z.lazy(() =>
|
|
33
|
+
videoUrl: z.lazy(() => VideoUrl2$outboundSchema),
|
|
35
34
|
}).transform((v) => {
|
|
36
35
|
return remap$(v, {
|
|
37
36
|
videoUrl: "video_url",
|
|
@@ -44,9 +43,23 @@ export function chatMessageContentItemVideoVideoURLFromJSON(jsonString) {
|
|
|
44
43
|
return safeParse(jsonString, (x) => ChatMessageContentItemVideoVideoURL$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChatMessageContentItemVideoVideoURL' from JSON`);
|
|
45
44
|
}
|
|
46
45
|
/** @internal */
|
|
46
|
+
export const VideoUrl1$inboundSchema = z.object({
|
|
47
|
+
url: z.string(),
|
|
48
|
+
});
|
|
49
|
+
/** @internal */
|
|
50
|
+
export const VideoUrl1$outboundSchema = z.object({
|
|
51
|
+
url: z.string(),
|
|
52
|
+
});
|
|
53
|
+
export function videoUrl1ToJSON(videoUrl1) {
|
|
54
|
+
return JSON.stringify(VideoUrl1$outboundSchema.parse(videoUrl1));
|
|
55
|
+
}
|
|
56
|
+
export function videoUrl1FromJSON(jsonString) {
|
|
57
|
+
return safeParse(jsonString, (x) => VideoUrl1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VideoUrl1' from JSON`);
|
|
58
|
+
}
|
|
59
|
+
/** @internal */
|
|
47
60
|
export const ChatMessageContentItemVideoInputVideo$inboundSchema = z.object({
|
|
48
61
|
type: z.literal("input_video"),
|
|
49
|
-
video_url:
|
|
62
|
+
video_url: z.lazy(() => VideoUrl1$inboundSchema),
|
|
50
63
|
}).transform((v) => {
|
|
51
64
|
return remap$(v, {
|
|
52
65
|
"video_url": "videoUrl",
|
|
@@ -55,7 +68,7 @@ export const ChatMessageContentItemVideoInputVideo$inboundSchema = z.object({
|
|
|
55
68
|
/** @internal */
|
|
56
69
|
export const ChatMessageContentItemVideoInputVideo$outboundSchema = z.object({
|
|
57
70
|
type: z.literal("input_video"),
|
|
58
|
-
videoUrl:
|
|
71
|
+
videoUrl: z.lazy(() => VideoUrl1$outboundSchema),
|
|
59
72
|
}).transform((v) => {
|
|
60
73
|
return remap$(v, {
|
|
61
74
|
videoUrl: "video_url",
|
|
@@ -1,36 +1,16 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
-
import { OpenEnum } from "../types/enums.js";
|
|
3
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
3
|
import { AssistantMessage } from "./assistantmessage.js";
|
|
4
|
+
import { ChatCompletionFinishReason } from "./chatcompletionfinishreason.js";
|
|
5
5
|
import { ChatMessageTokenLogprobs } from "./chatmessagetokenlogprobs.js";
|
|
6
|
-
import { ChatStreamingMessageChunk } from "./chatstreamingmessagechunk.js";
|
|
7
6
|
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>;
|
|
16
7
|
export type ChatResponseChoice = {
|
|
17
8
|
finishReason: ChatCompletionFinishReason | null;
|
|
18
9
|
index: number;
|
|
19
10
|
message: AssistantMessage;
|
|
20
11
|
logprobs?: ChatMessageTokenLogprobs | null | undefined;
|
|
21
12
|
};
|
|
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>;
|
|
30
13
|
/** @internal */
|
|
31
14
|
export declare const ChatResponseChoice$inboundSchema: z.ZodType<ChatResponseChoice, unknown>;
|
|
32
15
|
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>;
|
|
36
16
|
//# sourceMappingURL=chatresponsechoice.d.ts.map
|
|
@@ -4,19 +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
|
-
import * as openEnums from "../types/enums.js";
|
|
8
7
|
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);
|
|
20
10
|
/** @internal */
|
|
21
11
|
export const ChatResponseChoice$inboundSchema = z.object({
|
|
22
12
|
finish_reason: z.nullable(ChatCompletionFinishReason$inboundSchema),
|
|
@@ -31,18 +21,4 @@ export const ChatResponseChoice$inboundSchema = z.object({
|
|
|
31
21
|
export function chatResponseChoiceFromJSON(jsonString) {
|
|
32
22
|
return safeParse(jsonString, (x) => ChatResponseChoice$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChatResponseChoice' from JSON`);
|
|
33
23
|
}
|
|
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
|
-
}
|
|
48
24
|
//# sourceMappingURL=chatresponsechoice.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
|
@@ -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 "./chatstreamingchoice.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 "./chatstreamingchoice.js";
|
|
9
9
|
/** @internal */
|
|
10
10
|
export const ChatStreamingResponseChunkError$inboundSchema = z.object({
|
|
11
11
|
message: z.string(),
|
|
@@ -14,6 +14,8 @@ export type CompletionChoice = {
|
|
|
14
14
|
index: number;
|
|
15
15
|
logprobs: CompletionLogprobs | null;
|
|
16
16
|
finishReason: CompletionFinishReason | null;
|
|
17
|
+
nativeFinishReason?: string | undefined;
|
|
18
|
+
reasoning?: string | null | undefined;
|
|
17
19
|
};
|
|
18
20
|
/** @internal */
|
|
19
21
|
export declare const CompletionFinishReason$inboundSchema: z.ZodType<CompletionFinishReason, unknown>;
|
|
@@ -19,9 +19,12 @@ export const CompletionChoice$inboundSchema = z.object({
|
|
|
19
19
|
index: z.number(),
|
|
20
20
|
logprobs: z.nullable(CompletionLogprobs$inboundSchema),
|
|
21
21
|
finish_reason: z.nullable(CompletionFinishReason$inboundSchema),
|
|
22
|
+
native_finish_reason: z.string().optional(),
|
|
23
|
+
reasoning: z.nullable(z.string()).optional(),
|
|
22
24
|
}).transform((v) => {
|
|
23
25
|
return remap$(v, {
|
|
24
26
|
"finish_reason": "finishReason",
|
|
27
|
+
"native_finish_reason": "nativeFinishReason",
|
|
25
28
|
});
|
|
26
29
|
});
|
|
27
30
|
export function completionChoiceFromJSON(jsonString) {
|
|
@@ -15,7 +15,7 @@ export type CompletionCreateParamsResponseFormatJSONObject = {
|
|
|
15
15
|
export type CompletionCreateParamsResponseFormatText = {
|
|
16
16
|
type: "text";
|
|
17
17
|
};
|
|
18
|
-
export type CompletionCreateParamsResponseFormatUnion =
|
|
18
|
+
export type CompletionCreateParamsResponseFormatUnion = CompletionCreateParamsResponseFormatText | CompletionCreateParamsResponseFormatJSONObject | ResponseFormatJSONSchema | ResponseFormatTextGrammar | CompletionCreateParamsResponseFormatPython;
|
|
19
19
|
export type CompletionCreateParams = {
|
|
20
20
|
model?: string | undefined;
|
|
21
21
|
models?: Array<string> | undefined;
|
|
@@ -41,7 +41,7 @@ export type CompletionCreateParams = {
|
|
|
41
41
|
metadata?: {
|
|
42
42
|
[k: string]: string;
|
|
43
43
|
} | null | undefined;
|
|
44
|
-
responseFormat?:
|
|
44
|
+
responseFormat?: CompletionCreateParamsResponseFormatText | CompletionCreateParamsResponseFormatJSONObject | ResponseFormatJSONSchema | ResponseFormatTextGrammar | CompletionCreateParamsResponseFormatPython | null | undefined;
|
|
45
45
|
};
|
|
46
46
|
/** @internal */
|
|
47
47
|
export type Prompt$Outbound = string | Array<string> | Array<number> | Array<Array<number>>;
|
|
@@ -82,7 +82,7 @@ export type CompletionCreateParamsResponseFormatText$Outbound = {
|
|
|
82
82
|
export declare const CompletionCreateParamsResponseFormatText$outboundSchema: z.ZodType<CompletionCreateParamsResponseFormatText$Outbound, CompletionCreateParamsResponseFormatText>;
|
|
83
83
|
export declare function completionCreateParamsResponseFormatTextToJSON(completionCreateParamsResponseFormatText: CompletionCreateParamsResponseFormatText): string;
|
|
84
84
|
/** @internal */
|
|
85
|
-
export type CompletionCreateParamsResponseFormatUnion$Outbound =
|
|
85
|
+
export type CompletionCreateParamsResponseFormatUnion$Outbound = CompletionCreateParamsResponseFormatText$Outbound | CompletionCreateParamsResponseFormatJSONObject$Outbound | ResponseFormatJSONSchema$Outbound | ResponseFormatTextGrammar$Outbound | CompletionCreateParamsResponseFormatPython$Outbound;
|
|
86
86
|
/** @internal */
|
|
87
87
|
export declare const CompletionCreateParamsResponseFormatUnion$outboundSchema: z.ZodType<CompletionCreateParamsResponseFormatUnion$Outbound, CompletionCreateParamsResponseFormatUnion>;
|
|
88
88
|
export declare function completionCreateParamsResponseFormatUnionToJSON(completionCreateParamsResponseFormatUnion: CompletionCreateParamsResponseFormatUnion): string;
|
|
@@ -112,7 +112,7 @@ export type CompletionCreateParams$Outbound = {
|
|
|
112
112
|
metadata?: {
|
|
113
113
|
[k: string]: string;
|
|
114
114
|
} | null | undefined;
|
|
115
|
-
response_format?:
|
|
115
|
+
response_format?: CompletionCreateParamsResponseFormatText$Outbound | CompletionCreateParamsResponseFormatJSONObject$Outbound | ResponseFormatJSONSchema$Outbound | ResponseFormatTextGrammar$Outbound | CompletionCreateParamsResponseFormatPython$Outbound | null | undefined;
|
|
116
116
|
};
|
|
117
117
|
/** @internal */
|
|
118
118
|
export declare const CompletionCreateParams$outboundSchema: z.ZodType<CompletionCreateParams$Outbound, CompletionCreateParams>;
|
|
@@ -55,10 +55,10 @@ export function completionCreateParamsResponseFormatTextToJSON(completionCreateP
|
|
|
55
55
|
}
|
|
56
56
|
/** @internal */
|
|
57
57
|
export const CompletionCreateParamsResponseFormatUnion$outboundSchema = z.union([
|
|
58
|
-
ResponseFormatJSONSchema$outboundSchema,
|
|
59
|
-
ResponseFormatTextGrammar$outboundSchema,
|
|
60
58
|
z.lazy(() => CompletionCreateParamsResponseFormatText$outboundSchema),
|
|
61
59
|
z.lazy(() => CompletionCreateParamsResponseFormatJSONObject$outboundSchema),
|
|
60
|
+
ResponseFormatJSONSchema$outboundSchema,
|
|
61
|
+
ResponseFormatTextGrammar$outboundSchema,
|
|
62
62
|
z.lazy(() => CompletionCreateParamsResponseFormatPython$outboundSchema),
|
|
63
63
|
]);
|
|
64
64
|
export function completionCreateParamsResponseFormatUnionToJSON(completionCreateParamsResponseFormatUnion) {
|
|
@@ -93,10 +93,10 @@ export const CompletionCreateParams$outboundSchema = z.object({
|
|
|
93
93
|
user: z.string().optional(),
|
|
94
94
|
metadata: z.nullable(z.record(z.string(), z.string())).optional(),
|
|
95
95
|
responseFormat: z.nullable(z.union([
|
|
96
|
-
ResponseFormatJSONSchema$outboundSchema,
|
|
97
|
-
ResponseFormatTextGrammar$outboundSchema,
|
|
98
96
|
z.lazy(() => CompletionCreateParamsResponseFormatText$outboundSchema),
|
|
99
97
|
z.lazy(() => CompletionCreateParamsResponseFormatJSONObject$outboundSchema),
|
|
98
|
+
ResponseFormatJSONSchema$outboundSchema,
|
|
99
|
+
ResponseFormatTextGrammar$outboundSchema,
|
|
100
100
|
z.lazy(() => CompletionCreateParamsResponseFormatPython$outboundSchema),
|
|
101
101
|
])).optional(),
|
|
102
102
|
}).transform((v) => {
|
|
@@ -12,6 +12,7 @@ export const CompletionResponse$inboundSchema = z.object({
|
|
|
12
12
|
object: z.literal("text_completion"),
|
|
13
13
|
created: z.number(),
|
|
14
14
|
model: z.string(),
|
|
15
|
+
provider: z.string().optional(),
|
|
15
16
|
system_fingerprint: z.string().optional(),
|
|
16
17
|
choices: z.array(CompletionChoice$inboundSchema),
|
|
17
18
|
usage: CompletionUsage$inboundSchema.optional(),
|
|
@@ -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
|
-
export declare const FileCitationType: {
|
|
6
|
-
readonly FileCitation: "file_citation";
|
|
7
|
-
};
|
|
8
|
-
export type FileCitationType = ClosedEnum<typeof FileCitationType>;
|
|
9
4
|
export type FileCitation = {
|
|
10
|
-
type:
|
|
5
|
+
type: "file_citation";
|
|
11
6
|
fileId: string;
|
|
12
7
|
filename: string;
|
|
13
8
|
index: number;
|
|
14
9
|
};
|
|
15
10
|
/** @internal */
|
|
16
|
-
export declare const FileCitationType$inboundSchema: z.ZodEnum<typeof FileCitationType>;
|
|
17
|
-
/** @internal */
|
|
18
|
-
export declare const FileCitationType$outboundSchema: z.ZodEnum<typeof FileCitationType>;
|
|
19
|
-
/** @internal */
|
|
20
11
|
export declare const FileCitation$inboundSchema: z.ZodType<FileCitation, unknown>;
|
|
21
12
|
/** @internal */
|
|
22
13
|
export type FileCitation$Outbound = {
|
|
23
|
-
type:
|
|
14
|
+
type: "file_citation";
|
|
24
15
|
file_id: string;
|
|
25
16
|
filename: string;
|
|
26
17
|
index: number;
|