@openrouter/sdk 0.12.16 → 0.12.18
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/funcs/generationsGetGeneration.d.ts +2 -1
- package/esm/funcs/generationsGetGeneration.js +2 -1
- package/esm/funcs/generationsListGenerationContent.d.ts +16 -0
- package/esm/funcs/generationsListGenerationContent.js +108 -0
- package/esm/funcs/ttsCreateSpeech.d.ts +1 -1
- package/esm/funcs/ttsCreateSpeech.js +6 -6
- package/esm/funcs/workspacesBulkAddMembers.d.ts +19 -0
- package/esm/funcs/workspacesBulkAddMembers.js +105 -0
- package/esm/funcs/workspacesBulkRemoveMembers.d.ts +19 -0
- package/esm/funcs/workspacesBulkRemoveMembers.js +105 -0
- package/esm/funcs/workspacesCreate.d.ts +19 -0
- package/esm/funcs/workspacesCreate.js +99 -0
- package/esm/funcs/workspacesDelete.d.ts +19 -0
- package/esm/funcs/workspacesDelete.js +102 -0
- package/esm/funcs/workspacesGet.d.ts +19 -0
- package/esm/funcs/workspacesGet.js +102 -0
- package/esm/funcs/workspacesList.d.ts +21 -0
- package/esm/funcs/workspacesList.js +133 -0
- package/esm/funcs/workspacesUpdate.d.ts +19 -0
- package/esm/funcs/workspacesUpdate.js +105 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/bulkaddworkspacemembersrequest.d.ts +15 -0
- package/esm/models/bulkaddworkspacemembersrequest.js +18 -0
- package/esm/models/bulkaddworkspacemembersresponse.d.ts +18 -0
- package/esm/models/bulkaddworkspacemembersresponse.js +21 -0
- package/esm/models/bulkremoveworkspacemembersrequest.d.ts +15 -0
- package/esm/models/bulkremoveworkspacemembersrequest.js +18 -0
- package/esm/models/bulkremoveworkspacemembersresponse.d.ts +13 -0
- package/esm/models/bulkremoveworkspacemembersresponse.js +19 -0
- package/esm/models/chatrequest.d.ts +5 -4
- package/esm/models/chatrequest.js +3 -0
- package/esm/models/createworkspacerequest.d.ts +55 -0
- package/esm/models/createworkspacerequest.js +31 -0
- package/esm/models/createworkspaceresponse.d.ts +11 -0
- package/esm/models/createworkspaceresponse.js +15 -0
- package/esm/models/deleteworkspaceresponse.d.ts +13 -0
- package/esm/models/deleteworkspaceresponse.js +14 -0
- package/esm/models/generationcontentdata.d.ts +55 -0
- package/esm/models/generationcontentdata.js +45 -0
- package/esm/models/generationcontentresponse.d.ts +17 -0
- package/esm/models/generationcontentresponse.js +15 -0
- package/esm/models/generationresponse.d.ts +198 -0
- package/esm/models/generationresponse.js +109 -0
- package/esm/models/getworkspaceresponse.d.ts +11 -0
- package/esm/models/getworkspaceresponse.js +15 -0
- package/esm/models/index.d.ts +18 -0
- package/esm/models/index.js +18 -0
- package/esm/models/listworkspacesresponse.d.ts +18 -0
- package/esm/models/listworkspacesresponse.js +21 -0
- package/esm/models/modelscountresponse.d.ts +4 -4
- package/esm/models/modelscountresponse.js +4 -4
- package/esm/models/operations/bulkaddworkspacemembers.d.ts +61 -0
- package/esm/models/operations/bulkaddworkspacemembers.js +24 -0
- package/esm/models/operations/bulkremoveworkspacemembers.d.ts +61 -0
- package/esm/models/operations/bulkremoveworkspacemembers.js +24 -0
- package/esm/models/operations/createaudiospeech.d.ts +56 -0
- package/esm/models/operations/createaudiospeech.js +23 -0
- package/esm/models/operations/createworkspace.d.ts +56 -0
- package/esm/models/operations/createworkspace.js +23 -0
- package/esm/models/operations/deleteworkspace.d.ts +58 -0
- package/esm/models/operations/deleteworkspace.js +21 -0
- package/esm/models/operations/getgeneration.d.ts +0 -196
- package/esm/models/operations/getgeneration.js +0 -102
- package/esm/models/operations/getworkspace.d.ts +58 -0
- package/esm/models/operations/getworkspace.js +21 -0
- package/esm/models/operations/index.d.ts +9 -1
- package/esm/models/operations/index.js +9 -1
- package/esm/models/operations/listgenerationcontent.d.ts +58 -0
- package/esm/models/operations/listgenerationcontent.js +21 -0
- package/esm/models/operations/listworkspaces.d.ts +72 -0
- package/esm/models/operations/listworkspaces.js +35 -0
- package/esm/models/operations/updateworkspace.d.ts +61 -0
- package/esm/models/operations/updateworkspace.js +24 -0
- package/esm/models/paretorouterplugin.d.ts +22 -0
- package/esm/models/paretorouterplugin.js +20 -0
- package/esm/models/responsesrequest.d.ts +5 -4
- package/esm/models/responsesrequest.js +3 -0
- package/esm/models/{operations/createtts.d.ts → speechrequest.d.ts} +23 -76
- package/esm/models/{operations/createtts.js → speechrequest.js} +18 -35
- package/esm/models/updateworkspacerequest.d.ts +55 -0
- package/esm/models/updateworkspacerequest.js +31 -0
- package/esm/models/updateworkspaceresponse.d.ts +11 -0
- package/esm/models/updateworkspaceresponse.js +15 -0
- package/esm/models/videogenerationrequest.d.ts +12 -12
- package/esm/models/videogenerationrequest.js +10 -10
- package/esm/models/workspace.d.ts +61 -0
- package/esm/models/workspace.js +39 -0
- package/esm/models/workspacemember.d.ts +43 -0
- package/esm/models/workspacemember.js +35 -0
- package/esm/sdk/generations.d.ts +6 -1
- package/esm/sdk/generations.js +7 -0
- package/esm/sdk/sdk.d.ts +5 -2
- package/esm/sdk/sdk.js +7 -3
- package/esm/sdk/tts.d.ts +1 -1
- package/esm/sdk/workspaces.d.ts +58 -0
- package/esm/sdk/workspaces.js +80 -0
- package/jsr.json +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 3786454b94f8
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const BulkRemoveWorkspaceMembersResponse$inboundSchema = z.object({
|
|
10
|
+
removed_count: z.int(),
|
|
11
|
+
}).transform((v) => {
|
|
12
|
+
return remap$(v, {
|
|
13
|
+
"removed_count": "removedCount",
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
export function bulkRemoveWorkspaceMembersResponseFromJSON(jsonString) {
|
|
17
|
+
return safeParse(jsonString, (x) => BulkRemoveWorkspaceMembersResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BulkRemoveWorkspaceMembersResponse' from JSON`);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=bulkremoveworkspacemembersresponse.js.map
|
|
@@ -17,6 +17,7 @@ import { FileParserPlugin, FileParserPlugin$Outbound } from "./fileparserplugin.
|
|
|
17
17
|
import { FormatJsonObjectConfig, FormatJsonObjectConfig$Outbound } from "./formatjsonobjectconfig.js";
|
|
18
18
|
import { ImageConfig, ImageConfig$Outbound } from "./imageconfig.js";
|
|
19
19
|
import { ModerationPlugin, ModerationPlugin$Outbound } from "./moderationplugin.js";
|
|
20
|
+
import { ParetoRouterPlugin, ParetoRouterPlugin$Outbound } from "./paretorouterplugin.js";
|
|
20
21
|
import { ProviderPreferences, ProviderPreferences$Outbound } from "./providerpreferences.js";
|
|
21
22
|
import { ResponseHealingPlugin, ResponseHealingPlugin$Outbound } from "./responsehealingplugin.js";
|
|
22
23
|
import { TraceConfig, TraceConfig$Outbound } from "./traceconfig.js";
|
|
@@ -27,7 +28,7 @@ export declare const Modality: {
|
|
|
27
28
|
readonly Audio: "audio";
|
|
28
29
|
};
|
|
29
30
|
export type Modality = OpenEnum<typeof Modality>;
|
|
30
|
-
export type ChatRequestPlugin = AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | ModerationPlugin | ResponseHealingPlugin | WebSearchPlugin;
|
|
31
|
+
export type ChatRequestPlugin = AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | WebSearchPlugin;
|
|
31
32
|
/**
|
|
32
33
|
* Constrains effort on reasoning for reasoning models
|
|
33
34
|
*/
|
|
@@ -141,7 +142,7 @@ export type ChatRequest = {
|
|
|
141
142
|
/**
|
|
142
143
|
* Plugins you want to enable for this request, including their settings.
|
|
143
144
|
*/
|
|
144
|
-
plugins?: Array<AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | ModerationPlugin | ResponseHealingPlugin | WebSearchPlugin> | undefined;
|
|
145
|
+
plugins?: Array<AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | WebSearchPlugin> | undefined;
|
|
145
146
|
/**
|
|
146
147
|
* Presence penalty (-2.0 to 2.0)
|
|
147
148
|
*/
|
|
@@ -214,7 +215,7 @@ export type ChatRequest = {
|
|
|
214
215
|
/** @internal */
|
|
215
216
|
export declare const Modality$outboundSchema: z.ZodType<string, Modality>;
|
|
216
217
|
/** @internal */
|
|
217
|
-
export type ChatRequestPlugin$Outbound = AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | ModerationPlugin$Outbound | ResponseHealingPlugin$Outbound | WebSearchPlugin$Outbound;
|
|
218
|
+
export type ChatRequestPlugin$Outbound = AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | WebSearchPlugin$Outbound;
|
|
218
219
|
/** @internal */
|
|
219
220
|
export declare const ChatRequestPlugin$outboundSchema: z.ZodType<ChatRequestPlugin$Outbound, ChatRequestPlugin>;
|
|
220
221
|
export declare function chatRequestPluginToJSON(chatRequestPlugin: ChatRequestPlugin): string;
|
|
@@ -262,7 +263,7 @@ export type ChatRequest$Outbound = {
|
|
|
262
263
|
model?: string | undefined;
|
|
263
264
|
models?: Array<string> | undefined;
|
|
264
265
|
parallel_tool_calls?: boolean | null | undefined;
|
|
265
|
-
plugins?: Array<AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | ModerationPlugin$Outbound | ResponseHealingPlugin$Outbound | WebSearchPlugin$Outbound> | undefined;
|
|
266
|
+
plugins?: Array<AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | WebSearchPlugin$Outbound> | undefined;
|
|
266
267
|
presence_penalty?: number | null | undefined;
|
|
267
268
|
provider?: ProviderPreferences$Outbound | null | undefined;
|
|
268
269
|
reasoning?: Reasoning$Outbound | undefined;
|
|
@@ -22,6 +22,7 @@ import { FileParserPlugin$outboundSchema, } from "./fileparserplugin.js";
|
|
|
22
22
|
import { FormatJsonObjectConfig$outboundSchema, } from "./formatjsonobjectconfig.js";
|
|
23
23
|
import { ImageConfig$outboundSchema, } from "./imageconfig.js";
|
|
24
24
|
import { ModerationPlugin$outboundSchema, } from "./moderationplugin.js";
|
|
25
|
+
import { ParetoRouterPlugin$outboundSchema, } from "./paretorouterplugin.js";
|
|
25
26
|
import { ProviderPreferences$outboundSchema, } from "./providerpreferences.js";
|
|
26
27
|
import { ResponseHealingPlugin$outboundSchema, } from "./responsehealingplugin.js";
|
|
27
28
|
import { TraceConfig$outboundSchema, } from "./traceconfig.js";
|
|
@@ -61,6 +62,7 @@ export const ChatRequestPlugin$outboundSchema = z.union([
|
|
|
61
62
|
ContextCompressionPlugin$outboundSchema,
|
|
62
63
|
FileParserPlugin$outboundSchema,
|
|
63
64
|
ModerationPlugin$outboundSchema,
|
|
65
|
+
ParetoRouterPlugin$outboundSchema,
|
|
64
66
|
ResponseHealingPlugin$outboundSchema,
|
|
65
67
|
WebSearchPlugin$outboundSchema,
|
|
66
68
|
]);
|
|
@@ -122,6 +124,7 @@ export const ChatRequest$outboundSchema = z.object({
|
|
|
122
124
|
ContextCompressionPlugin$outboundSchema,
|
|
123
125
|
FileParserPlugin$outboundSchema,
|
|
124
126
|
ModerationPlugin$outboundSchema,
|
|
127
|
+
ParetoRouterPlugin$outboundSchema,
|
|
125
128
|
ResponseHealingPlugin$outboundSchema,
|
|
126
129
|
WebSearchPlugin$outboundSchema,
|
|
127
130
|
])).optional(),
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
export type CreateWorkspaceRequest = {
|
|
3
|
+
/**
|
|
4
|
+
* Default image model for this workspace
|
|
5
|
+
*/
|
|
6
|
+
defaultImageModel?: string | null | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Default provider sort preference (price, throughput, latency, exacto)
|
|
9
|
+
*/
|
|
10
|
+
defaultProviderSort?: string | null | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Default text model for this workspace
|
|
13
|
+
*/
|
|
14
|
+
defaultTextModel?: string | null | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Description of the workspace
|
|
17
|
+
*/
|
|
18
|
+
description?: string | null | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Whether data discount logging is enabled
|
|
21
|
+
*/
|
|
22
|
+
isDataDiscountLoggingEnabled?: boolean | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Whether broadcast is enabled
|
|
25
|
+
*/
|
|
26
|
+
isObservabilityBroadcastEnabled?: boolean | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Whether private logging is enabled
|
|
29
|
+
*/
|
|
30
|
+
isObservabilityIoLoggingEnabled?: boolean | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Name for the new workspace
|
|
33
|
+
*/
|
|
34
|
+
name: string;
|
|
35
|
+
/**
|
|
36
|
+
* URL-friendly slug (lowercase alphanumeric and hyphens only)
|
|
37
|
+
*/
|
|
38
|
+
slug: string;
|
|
39
|
+
};
|
|
40
|
+
/** @internal */
|
|
41
|
+
export type CreateWorkspaceRequest$Outbound = {
|
|
42
|
+
default_image_model?: string | null | undefined;
|
|
43
|
+
default_provider_sort?: string | null | undefined;
|
|
44
|
+
default_text_model?: string | null | undefined;
|
|
45
|
+
description?: string | null | undefined;
|
|
46
|
+
is_data_discount_logging_enabled?: boolean | undefined;
|
|
47
|
+
is_observability_broadcast_enabled?: boolean | undefined;
|
|
48
|
+
is_observability_io_logging_enabled?: boolean | undefined;
|
|
49
|
+
name: string;
|
|
50
|
+
slug: string;
|
|
51
|
+
};
|
|
52
|
+
/** @internal */
|
|
53
|
+
export declare const CreateWorkspaceRequest$outboundSchema: z.ZodType<CreateWorkspaceRequest$Outbound, CreateWorkspaceRequest>;
|
|
54
|
+
export declare function createWorkspaceRequestToJSON(createWorkspaceRequest: CreateWorkspaceRequest): string;
|
|
55
|
+
//# sourceMappingURL=createworkspacerequest.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 729716a42b74
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const CreateWorkspaceRequest$outboundSchema = z.object({
|
|
9
|
+
defaultImageModel: z.nullable(z.string()).optional(),
|
|
10
|
+
defaultProviderSort: z.nullable(z.string()).optional(),
|
|
11
|
+
defaultTextModel: z.nullable(z.string()).optional(),
|
|
12
|
+
description: z.nullable(z.string()).optional(),
|
|
13
|
+
isDataDiscountLoggingEnabled: z.boolean().optional(),
|
|
14
|
+
isObservabilityBroadcastEnabled: z.boolean().optional(),
|
|
15
|
+
isObservabilityIoLoggingEnabled: z.boolean().optional(),
|
|
16
|
+
name: z.string(),
|
|
17
|
+
slug: z.string(),
|
|
18
|
+
}).transform((v) => {
|
|
19
|
+
return remap$(v, {
|
|
20
|
+
defaultImageModel: "default_image_model",
|
|
21
|
+
defaultProviderSort: "default_provider_sort",
|
|
22
|
+
defaultTextModel: "default_text_model",
|
|
23
|
+
isDataDiscountLoggingEnabled: "is_data_discount_logging_enabled",
|
|
24
|
+
isObservabilityBroadcastEnabled: "is_observability_broadcast_enabled",
|
|
25
|
+
isObservabilityIoLoggingEnabled: "is_observability_io_logging_enabled",
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
export function createWorkspaceRequestToJSON(createWorkspaceRequest) {
|
|
29
|
+
return JSON.stringify(CreateWorkspaceRequest$outboundSchema.parse(createWorkspaceRequest));
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=createworkspacerequest.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
import { Workspace } from "./workspace.js";
|
|
5
|
+
export type CreateWorkspaceResponse = {
|
|
6
|
+
data: Workspace;
|
|
7
|
+
};
|
|
8
|
+
/** @internal */
|
|
9
|
+
export declare const CreateWorkspaceResponse$inboundSchema: z.ZodType<CreateWorkspaceResponse, unknown>;
|
|
10
|
+
export declare function createWorkspaceResponseFromJSON(jsonString: string): SafeParseResult<CreateWorkspaceResponse, SDKValidationError>;
|
|
11
|
+
//# sourceMappingURL=createworkspaceresponse.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 8cdd42874330
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Workspace$inboundSchema } from "./workspace.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const CreateWorkspaceResponse$inboundSchema = z.object({
|
|
10
|
+
data: Workspace$inboundSchema,
|
|
11
|
+
});
|
|
12
|
+
export function createWorkspaceResponseFromJSON(jsonString) {
|
|
13
|
+
return safeParse(jsonString, (x) => CreateWorkspaceResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateWorkspaceResponse' from JSON`);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=createworkspaceresponse.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
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 DeleteWorkspaceResponse = {
|
|
5
|
+
/**
|
|
6
|
+
* Confirmation that the workspace was deleted
|
|
7
|
+
*/
|
|
8
|
+
deleted: true;
|
|
9
|
+
};
|
|
10
|
+
/** @internal */
|
|
11
|
+
export declare const DeleteWorkspaceResponse$inboundSchema: z.ZodType<DeleteWorkspaceResponse, unknown>;
|
|
12
|
+
export declare function deleteWorkspaceResponseFromJSON(jsonString: string): SafeParseResult<DeleteWorkspaceResponse, SDKValidationError>;
|
|
13
|
+
//# sourceMappingURL=deleteworkspaceresponse.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 5ff5aed380bc
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const DeleteWorkspaceResponse$inboundSchema = z.object({
|
|
9
|
+
deleted: z.literal(true),
|
|
10
|
+
});
|
|
11
|
+
export function deleteWorkspaceResponseFromJSON(jsonString) {
|
|
12
|
+
return safeParse(jsonString, (x) => DeleteWorkspaceResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeleteWorkspaceResponse' from JSON`);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=deleteworkspaceresponse.js.map
|
|
@@ -0,0 +1,55 @@
|
|
|
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 Input2 = {
|
|
5
|
+
messages: Array<any | null>;
|
|
6
|
+
};
|
|
7
|
+
export type Input1 = {
|
|
8
|
+
prompt: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The input to the generation — either a prompt string or an array of messages
|
|
12
|
+
*/
|
|
13
|
+
export type InputUnion = Input1 | Input2;
|
|
14
|
+
/**
|
|
15
|
+
* The output from the generation
|
|
16
|
+
*/
|
|
17
|
+
export type GenerationContentDataOutput = {
|
|
18
|
+
/**
|
|
19
|
+
* The completion output
|
|
20
|
+
*/
|
|
21
|
+
completion: string | null;
|
|
22
|
+
/**
|
|
23
|
+
* Reasoning/thinking output, if any
|
|
24
|
+
*/
|
|
25
|
+
reasoning: string | null;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Stored prompt and completion content
|
|
29
|
+
*/
|
|
30
|
+
export type GenerationContentData = {
|
|
31
|
+
/**
|
|
32
|
+
* The input to the generation — either a prompt string or an array of messages
|
|
33
|
+
*/
|
|
34
|
+
input: Input1 | Input2;
|
|
35
|
+
/**
|
|
36
|
+
* The output from the generation
|
|
37
|
+
*/
|
|
38
|
+
output: GenerationContentDataOutput;
|
|
39
|
+
};
|
|
40
|
+
/** @internal */
|
|
41
|
+
export declare const Input2$inboundSchema: z.ZodType<Input2, unknown>;
|
|
42
|
+
export declare function input2FromJSON(jsonString: string): SafeParseResult<Input2, SDKValidationError>;
|
|
43
|
+
/** @internal */
|
|
44
|
+
export declare const Input1$inboundSchema: z.ZodType<Input1, unknown>;
|
|
45
|
+
export declare function input1FromJSON(jsonString: string): SafeParseResult<Input1, SDKValidationError>;
|
|
46
|
+
/** @internal */
|
|
47
|
+
export declare const InputUnion$inboundSchema: z.ZodType<InputUnion, unknown>;
|
|
48
|
+
export declare function inputUnionFromJSON(jsonString: string): SafeParseResult<InputUnion, SDKValidationError>;
|
|
49
|
+
/** @internal */
|
|
50
|
+
export declare const GenerationContentDataOutput$inboundSchema: z.ZodType<GenerationContentDataOutput, unknown>;
|
|
51
|
+
export declare function generationContentDataOutputFromJSON(jsonString: string): SafeParseResult<GenerationContentDataOutput, SDKValidationError>;
|
|
52
|
+
/** @internal */
|
|
53
|
+
export declare const GenerationContentData$inboundSchema: z.ZodType<GenerationContentData, unknown>;
|
|
54
|
+
export declare function generationContentDataFromJSON(jsonString: string): SafeParseResult<GenerationContentData, SDKValidationError>;
|
|
55
|
+
//# sourceMappingURL=generationcontentdata.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: f55aeaffdbd5
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const Input2$inboundSchema = z.object({
|
|
9
|
+
messages: z.array(z.nullable(z.any())),
|
|
10
|
+
});
|
|
11
|
+
export function input2FromJSON(jsonString) {
|
|
12
|
+
return safeParse(jsonString, (x) => Input2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Input2' from JSON`);
|
|
13
|
+
}
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const Input1$inboundSchema = z.object({
|
|
16
|
+
prompt: z.string(),
|
|
17
|
+
});
|
|
18
|
+
export function input1FromJSON(jsonString) {
|
|
19
|
+
return safeParse(jsonString, (x) => Input1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Input1' from JSON`);
|
|
20
|
+
}
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const InputUnion$inboundSchema = z.union([z.lazy(() => Input1$inboundSchema), z.lazy(() => Input2$inboundSchema)]);
|
|
23
|
+
export function inputUnionFromJSON(jsonString) {
|
|
24
|
+
return safeParse(jsonString, (x) => InputUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InputUnion' from JSON`);
|
|
25
|
+
}
|
|
26
|
+
/** @internal */
|
|
27
|
+
export const GenerationContentDataOutput$inboundSchema = z.object({
|
|
28
|
+
completion: z.nullable(z.string()),
|
|
29
|
+
reasoning: z.nullable(z.string()),
|
|
30
|
+
});
|
|
31
|
+
export function generationContentDataOutputFromJSON(jsonString) {
|
|
32
|
+
return safeParse(jsonString, (x) => GenerationContentDataOutput$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GenerationContentDataOutput' from JSON`);
|
|
33
|
+
}
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const GenerationContentData$inboundSchema = z.object({
|
|
36
|
+
input: z.union([
|
|
37
|
+
z.lazy(() => Input1$inboundSchema),
|
|
38
|
+
z.lazy(() => Input2$inboundSchema),
|
|
39
|
+
]),
|
|
40
|
+
output: z.lazy(() => GenerationContentDataOutput$inboundSchema),
|
|
41
|
+
});
|
|
42
|
+
export function generationContentDataFromJSON(jsonString) {
|
|
43
|
+
return safeParse(jsonString, (x) => GenerationContentData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GenerationContentData' from JSON`);
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=generationcontentdata.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
import { GenerationContentData } from "./generationcontentdata.js";
|
|
5
|
+
/**
|
|
6
|
+
* Stored prompt and completion content for a generation
|
|
7
|
+
*/
|
|
8
|
+
export type GenerationContentResponse = {
|
|
9
|
+
/**
|
|
10
|
+
* Stored prompt and completion content
|
|
11
|
+
*/
|
|
12
|
+
data: GenerationContentData;
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export declare const GenerationContentResponse$inboundSchema: z.ZodType<GenerationContentResponse, unknown>;
|
|
16
|
+
export declare function generationContentResponseFromJSON(jsonString: string): SafeParseResult<GenerationContentResponse, SDKValidationError>;
|
|
17
|
+
//# sourceMappingURL=generationcontentresponse.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 88f85adb1a59
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { GenerationContentData$inboundSchema, } from "./generationcontentdata.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const GenerationContentResponse$inboundSchema = z.object({
|
|
10
|
+
data: GenerationContentData$inboundSchema,
|
|
11
|
+
});
|
|
12
|
+
export function generationContentResponseFromJSON(jsonString) {
|
|
13
|
+
return safeParse(jsonString, (x) => GenerationContentResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GenerationContentResponse' from JSON`);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=generationcontentresponse.js.map
|
|
@@ -0,0 +1,198 @@
|
|
|
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
|
+
import { ProviderResponse } from "./providerresponse.js";
|
|
6
|
+
/**
|
|
7
|
+
* Type of API used for the generation
|
|
8
|
+
*/
|
|
9
|
+
export declare const ApiType: {
|
|
10
|
+
readonly Completions: "completions";
|
|
11
|
+
readonly Embeddings: "embeddings";
|
|
12
|
+
readonly Rerank: "rerank";
|
|
13
|
+
readonly Tts: "tts";
|
|
14
|
+
readonly Video: "video";
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Type of API used for the generation
|
|
18
|
+
*/
|
|
19
|
+
export type ApiType = OpenEnum<typeof ApiType>;
|
|
20
|
+
/**
|
|
21
|
+
* Generation data
|
|
22
|
+
*/
|
|
23
|
+
export type GenerationResponseData = {
|
|
24
|
+
/**
|
|
25
|
+
* Type of API used for the generation
|
|
26
|
+
*/
|
|
27
|
+
apiType: ApiType | null;
|
|
28
|
+
/**
|
|
29
|
+
* ID of the app that made the request
|
|
30
|
+
*/
|
|
31
|
+
appId: number | null;
|
|
32
|
+
/**
|
|
33
|
+
* Discount applied due to caching
|
|
34
|
+
*/
|
|
35
|
+
cacheDiscount: number | null;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the generation was cancelled
|
|
38
|
+
*/
|
|
39
|
+
cancelled: boolean | null;
|
|
40
|
+
/**
|
|
41
|
+
* ISO 8601 timestamp of when the generation was created
|
|
42
|
+
*/
|
|
43
|
+
createdAt: string;
|
|
44
|
+
/**
|
|
45
|
+
* External user identifier
|
|
46
|
+
*/
|
|
47
|
+
externalUser: string | null;
|
|
48
|
+
/**
|
|
49
|
+
* Reason the generation finished
|
|
50
|
+
*/
|
|
51
|
+
finishReason: string | null;
|
|
52
|
+
/**
|
|
53
|
+
* Time taken for generation in milliseconds
|
|
54
|
+
*/
|
|
55
|
+
generationTime: number | null;
|
|
56
|
+
/**
|
|
57
|
+
* Referer header from the request
|
|
58
|
+
*/
|
|
59
|
+
httpReferer: string | null;
|
|
60
|
+
/**
|
|
61
|
+
* Unique identifier for the generation
|
|
62
|
+
*/
|
|
63
|
+
id: string;
|
|
64
|
+
/**
|
|
65
|
+
* Whether this used bring-your-own-key
|
|
66
|
+
*/
|
|
67
|
+
isByok: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Total latency in milliseconds
|
|
70
|
+
*/
|
|
71
|
+
latency: number | null;
|
|
72
|
+
/**
|
|
73
|
+
* Model used for the generation
|
|
74
|
+
*/
|
|
75
|
+
model: string;
|
|
76
|
+
/**
|
|
77
|
+
* Moderation latency in milliseconds
|
|
78
|
+
*/
|
|
79
|
+
moderationLatency: number | null;
|
|
80
|
+
/**
|
|
81
|
+
* Native finish reason as reported by provider
|
|
82
|
+
*/
|
|
83
|
+
nativeFinishReason: string | null;
|
|
84
|
+
/**
|
|
85
|
+
* Native cached tokens as reported by provider
|
|
86
|
+
*/
|
|
87
|
+
nativeTokensCached: number | null;
|
|
88
|
+
/**
|
|
89
|
+
* Native completion tokens as reported by provider
|
|
90
|
+
*/
|
|
91
|
+
nativeTokensCompletion: number | null;
|
|
92
|
+
/**
|
|
93
|
+
* Native completion image tokens as reported by provider
|
|
94
|
+
*/
|
|
95
|
+
nativeTokensCompletionImages: number | null;
|
|
96
|
+
/**
|
|
97
|
+
* Native prompt tokens as reported by provider
|
|
98
|
+
*/
|
|
99
|
+
nativeTokensPrompt: number | null;
|
|
100
|
+
/**
|
|
101
|
+
* Native reasoning tokens as reported by provider
|
|
102
|
+
*/
|
|
103
|
+
nativeTokensReasoning: number | null;
|
|
104
|
+
/**
|
|
105
|
+
* Number of audio inputs in the prompt
|
|
106
|
+
*/
|
|
107
|
+
numInputAudioPrompt: number | null;
|
|
108
|
+
/**
|
|
109
|
+
* Number of media items in the completion
|
|
110
|
+
*/
|
|
111
|
+
numMediaCompletion: number | null;
|
|
112
|
+
/**
|
|
113
|
+
* Number of media items in the prompt
|
|
114
|
+
*/
|
|
115
|
+
numMediaPrompt: number | null;
|
|
116
|
+
/**
|
|
117
|
+
* Number of search results included
|
|
118
|
+
*/
|
|
119
|
+
numSearchResults: number | null;
|
|
120
|
+
/**
|
|
121
|
+
* Origin URL of the request
|
|
122
|
+
*/
|
|
123
|
+
origin: string;
|
|
124
|
+
/**
|
|
125
|
+
* Name of the provider that served the request
|
|
126
|
+
*/
|
|
127
|
+
providerName: string | null;
|
|
128
|
+
/**
|
|
129
|
+
* List of provider responses for this generation, including fallback attempts
|
|
130
|
+
*/
|
|
131
|
+
providerResponses: Array<ProviderResponse> | null;
|
|
132
|
+
/**
|
|
133
|
+
* Unique identifier grouping all generations from a single API request
|
|
134
|
+
*/
|
|
135
|
+
requestId?: string | null | undefined;
|
|
136
|
+
/**
|
|
137
|
+
* Router used for the request (e.g., openrouter/auto)
|
|
138
|
+
*/
|
|
139
|
+
router: string | null;
|
|
140
|
+
/**
|
|
141
|
+
* Session identifier grouping multiple generations in the same session
|
|
142
|
+
*/
|
|
143
|
+
sessionId?: string | null | undefined;
|
|
144
|
+
/**
|
|
145
|
+
* Whether the response was streamed
|
|
146
|
+
*/
|
|
147
|
+
streamed: boolean | null;
|
|
148
|
+
/**
|
|
149
|
+
* Number of tokens in the completion
|
|
150
|
+
*/
|
|
151
|
+
tokensCompletion: number | null;
|
|
152
|
+
/**
|
|
153
|
+
* Number of tokens in the prompt
|
|
154
|
+
*/
|
|
155
|
+
tokensPrompt: number | null;
|
|
156
|
+
/**
|
|
157
|
+
* Total cost of the generation in USD
|
|
158
|
+
*/
|
|
159
|
+
totalCost: number;
|
|
160
|
+
/**
|
|
161
|
+
* Upstream provider's identifier for this generation
|
|
162
|
+
*/
|
|
163
|
+
upstreamId: string | null;
|
|
164
|
+
/**
|
|
165
|
+
* Cost charged by the upstream provider
|
|
166
|
+
*/
|
|
167
|
+
upstreamInferenceCost: number | null;
|
|
168
|
+
/**
|
|
169
|
+
* Usage amount in USD
|
|
170
|
+
*/
|
|
171
|
+
usage: number;
|
|
172
|
+
/**
|
|
173
|
+
* User-Agent header from the request
|
|
174
|
+
*/
|
|
175
|
+
userAgent: string | null;
|
|
176
|
+
/**
|
|
177
|
+
* The resolved web search engine used for this generation (e.g. exa, firecrawl, parallel)
|
|
178
|
+
*/
|
|
179
|
+
webSearchEngine: string | null;
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* Generation response
|
|
183
|
+
*/
|
|
184
|
+
export type GenerationResponse = {
|
|
185
|
+
/**
|
|
186
|
+
* Generation data
|
|
187
|
+
*/
|
|
188
|
+
data: GenerationResponseData;
|
|
189
|
+
};
|
|
190
|
+
/** @internal */
|
|
191
|
+
export declare const ApiType$inboundSchema: z.ZodType<ApiType, unknown>;
|
|
192
|
+
/** @internal */
|
|
193
|
+
export declare const GenerationResponseData$inboundSchema: z.ZodType<GenerationResponseData, unknown>;
|
|
194
|
+
export declare function generationResponseDataFromJSON(jsonString: string): SafeParseResult<GenerationResponseData, SDKValidationError>;
|
|
195
|
+
/** @internal */
|
|
196
|
+
export declare const GenerationResponse$inboundSchema: z.ZodType<GenerationResponse, unknown>;
|
|
197
|
+
export declare function generationResponseFromJSON(jsonString: string): SafeParseResult<GenerationResponse, SDKValidationError>;
|
|
198
|
+
//# sourceMappingURL=generationresponse.d.ts.map
|