@openrouter/sdk 0.1.6 → 0.1.8
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/README.md +3 -3
- package/esm/funcs/{modelsListEmbeddings.d.ts → embeddingsListModels.d.ts} +2 -2
- package/esm/funcs/{modelsListEmbeddings.js → embeddingsListModels.js} +4 -4
- package/esm/lib/base64.d.ts +2 -2
- package/esm/lib/base64.js +2 -4
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/lib/schemas.d.ts +1 -1
- package/esm/lib/schemas.js +2 -2
- package/esm/models/badgatewayresponseerrordata.js +1 -1
- package/esm/models/badrequestresponseerrordata.js +1 -1
- package/esm/models/chatgenerationparams.js +1 -1
- package/esm/models/chatmessagecontentitem.js +8 -20
- package/esm/models/completioncreateparams.js +5 -5
- package/esm/models/edgenetworktimeoutresponseerrordata.js +1 -1
- package/esm/models/errors/responsevalidationerror.js +2 -2
- package/esm/models/errors/sdkvalidationerror.d.ts +2 -2
- package/esm/models/errors/sdkvalidationerror.js +2 -2
- package/esm/models/forbiddenresponseerrordata.js +1 -1
- package/esm/models/internalserverresponseerrordata.js +1 -1
- package/esm/models/notfoundresponseerrordata.js +1 -1
- package/esm/models/openairesponsesinputunion.d.ts +2 -2
- package/esm/models/openairesponsesinputunion.js +22 -62
- package/esm/models/openresponseseasyinputmessage.js +12 -36
- package/esm/models/openresponsesinput.d.ts +4 -4
- package/esm/models/openresponsesinput.js +2 -2
- package/esm/models/openresponsesinputmessageitem.js +8 -24
- package/esm/models/operations/createauthkeyscode.d.ts +5 -0
- package/esm/models/operations/createauthkeyscode.js +2 -0
- package/esm/models/outputitemimagegenerationcall.d.ts +1 -1
- package/esm/models/outputitemimagegenerationcall.js +1 -1
- package/esm/models/payloadtoolargeresponseerrordata.js +1 -1
- package/esm/models/paymentrequiredresponseerrordata.js +1 -1
- package/esm/models/provideroverloadedresponseerrordata.js +1 -1
- package/esm/models/requesttimeoutresponseerrordata.js +1 -1
- package/esm/models/responsesimagegenerationcall.d.ts +1 -1
- package/esm/models/responsesimagegenerationcall.js +2 -2
- package/esm/models/responsesoutputitem.d.ts +1 -1
- package/esm/models/responsesoutputitem.js +1 -1
- package/esm/models/serviceunavailableresponseerrordata.js +1 -1
- package/esm/models/toomanyrequestsresponseerrordata.js +1 -1
- package/esm/models/unauthorizedresponseerrordata.js +1 -1
- package/esm/models/unprocessableentityresponseerrordata.js +1 -1
- package/esm/react-query/embeddingsListModels.d.ts +29 -0
- package/esm/react-query/{modelsListEmbeddings.js → embeddingsListModels.js} +18 -18
- package/esm/react-query/index.d.ts +1 -1
- package/esm/react-query/index.js +1 -1
- package/esm/sdk/embeddings.d.ts +8 -0
- package/esm/sdk/embeddings.js +10 -0
- package/esm/sdk/models.d.ts +0 -7
- package/esm/sdk/models.js +0 -10
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/esm/react-query/modelsListEmbeddings.d.ts +0 -29
package/README.md
CHANGED
|
@@ -73,7 +73,7 @@ const result = await openRouter.chat.send({
|
|
|
73
73
|
content: "Hello, how are you?",
|
|
74
74
|
},
|
|
75
75
|
],
|
|
76
|
-
model: "openai/gpt-5"
|
|
76
|
+
model: "openai/gpt-5",
|
|
77
77
|
provider: {
|
|
78
78
|
zdr: true,
|
|
79
79
|
sort: "price",
|
|
@@ -81,8 +81,8 @@ const result = await openRouter.chat.send({
|
|
|
81
81
|
stream: true
|
|
82
82
|
});
|
|
83
83
|
|
|
84
|
-
for await (const chunk of
|
|
85
|
-
console.log(
|
|
84
|
+
for await (const chunk of result) {
|
|
85
|
+
console.log(chunk.choices[0].delta.content)
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
```
|
|
@@ -14,5 +14,5 @@ import { Result } from "../types/fp.js";
|
|
|
14
14
|
* @remarks
|
|
15
15
|
* Returns a list of all available embeddings models and their properties
|
|
16
16
|
*/
|
|
17
|
-
export declare function
|
|
18
|
-
//# sourceMappingURL=
|
|
17
|
+
export declare function embeddingsListModels(client: OpenRouterCore, options?: RequestOptions): APIPromise<Result<models.ModelsListResponse, errors.BadRequestResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
|
+
//# sourceMappingURL=embeddingsListModels.d.ts.map
|
|
@@ -14,11 +14,11 @@ import { APIPromise } from "../types/async.js";
|
|
|
14
14
|
* @remarks
|
|
15
15
|
* Returns a list of all available embeddings models and their properties
|
|
16
16
|
*/
|
|
17
|
-
export function
|
|
17
|
+
export function embeddingsListModels(client, options) {
|
|
18
18
|
return new APIPromise($do(client, options));
|
|
19
19
|
}
|
|
20
20
|
async function $do(client, options) {
|
|
21
|
-
const path = pathToFunc("/models
|
|
21
|
+
const path = pathToFunc("/embeddings/models")();
|
|
22
22
|
const headers = new Headers(compactMap({
|
|
23
23
|
Accept: "application/json",
|
|
24
24
|
}));
|
|
@@ -28,7 +28,7 @@ async function $do(client, options) {
|
|
|
28
28
|
const context = {
|
|
29
29
|
options: client._options,
|
|
30
30
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
31
|
-
operationID: "
|
|
31
|
+
operationID: "listEmbeddingsModels",
|
|
32
32
|
oAuth2Scopes: null,
|
|
33
33
|
resolvedSecurity: requestSecurity,
|
|
34
34
|
securitySource: client._options.apiKey,
|
|
@@ -69,4 +69,4 @@ async function $do(client, options) {
|
|
|
69
69
|
}
|
|
70
70
|
return [result, { status: "complete", request: req, response }];
|
|
71
71
|
}
|
|
72
|
-
//# sourceMappingURL=
|
|
72
|
+
//# sourceMappingURL=embeddingsListModels.js.map
|
package/esm/lib/base64.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ export declare function stringToBytes(str: string): Uint8Array;
|
|
|
5
5
|
export declare function stringFromBytes(u8arr: Uint8Array): string;
|
|
6
6
|
export declare function stringToBase64(str: string): string;
|
|
7
7
|
export declare function stringFromBase64(b64str: string): string;
|
|
8
|
-
export declare const zodOutbound: z.ZodUnion<[z.ZodCustom<Uint8Array<
|
|
9
|
-
export declare const zodInbound: z.ZodUnion<[z.ZodCustom<Uint8Array<
|
|
8
|
+
export declare const zodOutbound: z.ZodUnion<[z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>, z.ZodPipe<z.ZodString, z.ZodTransform<Uint8Array<ArrayBufferLike>, string>>]>;
|
|
9
|
+
export declare const zodInbound: z.ZodUnion<[z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>, z.ZodPipe<z.ZodString, z.ZodTransform<Uint8Array<ArrayBufferLike>, string>>]>;
|
|
10
10
|
//# sourceMappingURL=base64.d.ts.map
|
package/esm/lib/base64.js
CHANGED
|
@@ -20,10 +20,8 @@ export function stringToBase64(str) {
|
|
|
20
20
|
export function stringFromBase64(b64str) {
|
|
21
21
|
return stringFromBytes(bytesFromBase64(b64str));
|
|
22
22
|
}
|
|
23
|
-
export const zodOutbound = z
|
|
24
|
-
.instanceof(Uint8Array)
|
|
23
|
+
export const zodOutbound = z.custom(x => x instanceof Uint8Array)
|
|
25
24
|
.or(z.string().transform(stringToBytes));
|
|
26
|
-
export const zodInbound = z
|
|
27
|
-
.instanceof(Uint8Array)
|
|
25
|
+
export const zodInbound = z.custom(x => x instanceof Uint8Array)
|
|
28
26
|
.or(z.string().transform(bytesFromBase64));
|
|
29
27
|
//# sourceMappingURL=base64.js.map
|
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.8";
|
|
41
|
+
readonly genVersion: "2.748.0";
|
|
42
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.1.8 2.748.0 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.8",
|
|
29
|
+
genVersion: "2.748.0",
|
|
30
|
+
userAgent: "speakeasy-sdk/typescript 0.1.8 2.748.0 1.0.0 @openrouter/sdk",
|
|
31
31
|
};
|
|
32
32
|
//# sourceMappingURL=config.js.map
|
package/esm/lib/schemas.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export declare function parse<Inp, Out>(rawValue: Inp, fn: (value: Inp) => Out,
|
|
|
13
13
|
* leak Zod implementation details to user code.
|
|
14
14
|
*/
|
|
15
15
|
export declare function safeParse<Inp, Out>(rawValue: Inp, fn: (value: Inp) => Out, errorMessage: string): Result<Out, SDKValidationError>;
|
|
16
|
-
export declare function collectExtraKeys<Shape extends z.ZodRawShape, Catchall extends z.ZodType, K extends string, Optional extends boolean>(obj: z.ZodObject<Shape, z.core.$catchall<Catchall>>, extrasKey: K, optional: Optional): z.ZodPipe<z.ZodObject<Shape, z.core.$catchall<Catchall>>, z.ZodTransform<z.output<z.ZodObject<Shape, z.core.$strip>> & (Optional extends
|
|
16
|
+
export declare function collectExtraKeys<Shape extends z.ZodRawShape, Catchall extends z.ZodType, K extends string, Optional extends boolean>(obj: z.ZodObject<Shape, z.core.$catchall<Catchall>>, extrasKey: K, optional: Optional): z.ZodPipe<z.ZodObject<Shape, z.core.$catchall<Catchall>>, z.ZodTransform<z.output<z.ZodObject<Shape, z.core.$strip>> & (Optional extends false ? {
|
|
17
17
|
[k in K]: Record<string, z.output<Catchall>>;
|
|
18
18
|
} : {
|
|
19
19
|
[k in K]?: Record<string, z.output<Catchall>> | undefined;
|
package/esm/lib/schemas.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import * as z from "zod/v4";
|
|
5
5
|
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
6
6
|
import { ERR, OK } from "../types/fp.js";
|
|
7
7
|
/**
|
|
@@ -14,7 +14,7 @@ export function parse(rawValue, fn, errorMessage) {
|
|
|
14
14
|
return fn(rawValue);
|
|
15
15
|
}
|
|
16
16
|
catch (err) {
|
|
17
|
-
if (err instanceof ZodError) {
|
|
17
|
+
if (err instanceof z.ZodError) {
|
|
18
18
|
throw new SDKValidationError(errorMessage, err, rawValue);
|
|
19
19
|
}
|
|
20
20
|
throw err;
|
|
@@ -5,7 +5,7 @@ import * as z from "zod/v4";
|
|
|
5
5
|
import { safeParse } from "../lib/schemas.js";
|
|
6
6
|
/** @internal */
|
|
7
7
|
export const BadGatewayResponseErrorData$inboundSchema = z.object({
|
|
8
|
-
code: z.
|
|
8
|
+
code: z.int(),
|
|
9
9
|
message: z.string(),
|
|
10
10
|
metadata: z.nullable(z.record(z.string(), z.nullable(z.any()))).optional(),
|
|
11
11
|
});
|
|
@@ -5,7 +5,7 @@ import * as z from "zod/v4";
|
|
|
5
5
|
import { safeParse } from "../lib/schemas.js";
|
|
6
6
|
/** @internal */
|
|
7
7
|
export const BadRequestResponseErrorData$inboundSchema = z.object({
|
|
8
|
-
code: z.
|
|
8
|
+
code: z.int(),
|
|
9
9
|
message: z.string(),
|
|
10
10
|
metadata: z.nullable(z.record(z.string(), z.nullable(z.any()))).optional(),
|
|
11
11
|
});
|
|
@@ -86,7 +86,7 @@ export const ChatGenerationParams$outboundSchema = z.object({
|
|
|
86
86
|
z.lazy(() => ChatGenerationParamsResponseFormatJSONObject$outboundSchema),
|
|
87
87
|
z.lazy(() => ChatGenerationParamsResponseFormatPython$outboundSchema),
|
|
88
88
|
]).optional(),
|
|
89
|
-
seed: z.nullable(z.
|
|
89
|
+
seed: z.nullable(z.int()).optional(),
|
|
90
90
|
stop: z.nullable(z.union([z.string(), z.array(z.string())])).optional(),
|
|
91
91
|
stream: z.boolean().default(false),
|
|
92
92
|
streamOptions: z.nullable(ChatStreamOptions$outboundSchema).optional(),
|
|
@@ -9,29 +9,17 @@ import { ChatMessageContentItemText$inboundSchema, ChatMessageContentItemText$ou
|
|
|
9
9
|
import { ChatMessageContentItemVideo$inboundSchema, ChatMessageContentItemVideo$outboundSchema, } from "./chatmessagecontentitemvideo.js";
|
|
10
10
|
/** @internal */
|
|
11
11
|
export const ChatMessageContentItem$inboundSchema = z.union([
|
|
12
|
-
ChatMessageContentItemText$inboundSchema.and(z.object({ type: z.literal("text") })
|
|
13
|
-
ChatMessageContentItemImage$inboundSchema.and(z.object({ type: z.literal("image_url") })
|
|
14
|
-
|
|
15
|
-
}))
|
|
16
|
-
ChatMessageContentItemAudio$inboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
17
|
-
type: v.type,
|
|
18
|
-
}))),
|
|
19
|
-
ChatMessageContentItemVideo$inboundSchema.and(z.object({ type: z.literal("input_video") }).transform((v) => ({
|
|
20
|
-
type: v.type,
|
|
21
|
-
}))),
|
|
12
|
+
ChatMessageContentItemText$inboundSchema.and(z.object({ type: z.literal("text") })),
|
|
13
|
+
ChatMessageContentItemImage$inboundSchema.and(z.object({ type: z.literal("image_url") })),
|
|
14
|
+
ChatMessageContentItemAudio$inboundSchema.and(z.object({ type: z.literal("input_audio") })),
|
|
15
|
+
ChatMessageContentItemVideo$inboundSchema.and(z.object({ type: z.literal("input_video") })),
|
|
22
16
|
]);
|
|
23
17
|
/** @internal */
|
|
24
18
|
export const ChatMessageContentItem$outboundSchema = z.union([
|
|
25
|
-
ChatMessageContentItemText$outboundSchema.and(z.object({ type: z.literal("text") })
|
|
26
|
-
ChatMessageContentItemImage$outboundSchema.and(z.object({ type: z.literal("image_url") })
|
|
27
|
-
|
|
28
|
-
}))
|
|
29
|
-
ChatMessageContentItemAudio$outboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
30
|
-
type: v.type,
|
|
31
|
-
}))),
|
|
32
|
-
ChatMessageContentItemVideo$outboundSchema.and(z.object({ type: z.literal("input_video") }).transform((v) => ({
|
|
33
|
-
type: v.type,
|
|
34
|
-
}))),
|
|
19
|
+
ChatMessageContentItemText$outboundSchema.and(z.object({ type: z.literal("text") })),
|
|
20
|
+
ChatMessageContentItemImage$outboundSchema.and(z.object({ type: z.literal("image_url") })),
|
|
21
|
+
ChatMessageContentItemAudio$outboundSchema.and(z.object({ type: z.literal("input_audio") })),
|
|
22
|
+
ChatMessageContentItemVideo$outboundSchema.and(z.object({ type: z.literal("input_video") })),
|
|
35
23
|
]);
|
|
36
24
|
export function chatMessageContentItemToJSON(chatMessageContentItem) {
|
|
37
25
|
return JSON.stringify(ChatMessageContentItem$outboundSchema.parse(chatMessageContentItem));
|
|
@@ -74,15 +74,15 @@ export const CompletionCreateParams$outboundSchema = z.object({
|
|
|
74
74
|
z.array(z.number()),
|
|
75
75
|
z.array(z.array(z.number())),
|
|
76
76
|
]),
|
|
77
|
-
bestOf: z.nullable(z.
|
|
77
|
+
bestOf: z.nullable(z.int()).optional(),
|
|
78
78
|
echo: z.nullable(z.boolean()).optional(),
|
|
79
79
|
frequencyPenalty: z.nullable(z.number()).optional(),
|
|
80
80
|
logitBias: z.nullable(z.record(z.string(), z.number())).optional(),
|
|
81
|
-
logprobs: z.nullable(z.
|
|
82
|
-
maxTokens: z.nullable(z.
|
|
83
|
-
n: z.nullable(z.
|
|
81
|
+
logprobs: z.nullable(z.int()).optional(),
|
|
82
|
+
maxTokens: z.nullable(z.int()).optional(),
|
|
83
|
+
n: z.nullable(z.int()).optional(),
|
|
84
84
|
presencePenalty: z.nullable(z.number()).optional(),
|
|
85
|
-
seed: z.nullable(z.
|
|
85
|
+
seed: z.nullable(z.int()).optional(),
|
|
86
86
|
stop: z.nullable(z.union([z.string(), z.array(z.string())])).optional(),
|
|
87
87
|
stream: z.boolean().default(false),
|
|
88
88
|
streamOptions: z.nullable(z.lazy(() => StreamOptions$outboundSchema))
|
|
@@ -5,7 +5,7 @@ import * as z from "zod/v4";
|
|
|
5
5
|
import { safeParse } from "../lib/schemas.js";
|
|
6
6
|
/** @internal */
|
|
7
7
|
export const EdgeNetworkTimeoutResponseErrorData$inboundSchema = z.object({
|
|
8
|
-
code: z.
|
|
8
|
+
code: z.int(),
|
|
9
9
|
message: z.string(),
|
|
10
10
|
metadata: z.nullable(z.record(z.string(), z.nullable(z.any()))).optional(),
|
|
11
11
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
|
-
import * as z from "zod/v4";
|
|
4
|
+
import * as z from "zod/v4/core";
|
|
5
5
|
import { OpenRouterError } from "./openroutererror.js";
|
|
6
6
|
import { formatZodError } from "./sdkvalidationerror.js";
|
|
7
7
|
export class ResponseValidationError extends OpenRouterError {
|
|
@@ -18,7 +18,7 @@ export class ResponseValidationError extends OpenRouterError {
|
|
|
18
18
|
* default error message.
|
|
19
19
|
*/
|
|
20
20
|
pretty() {
|
|
21
|
-
if (this.cause instanceof z
|
|
21
|
+
if (this.cause instanceof z.$ZodError) {
|
|
22
22
|
return `${this.rawMessage}\n${formatZodError(this.cause)}`;
|
|
23
23
|
}
|
|
24
24
|
else {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as z from "zod/v4";
|
|
1
|
+
import * as z from "zod/v4/core";
|
|
2
2
|
export declare class SDKValidationError extends Error {
|
|
3
3
|
/**
|
|
4
4
|
* The raw value that failed validation.
|
|
@@ -17,5 +17,5 @@ export declare class SDKValidationError extends Error {
|
|
|
17
17
|
*/
|
|
18
18
|
pretty(): string;
|
|
19
19
|
}
|
|
20
|
-
export declare function formatZodError(err: z
|
|
20
|
+
export declare function formatZodError(err: z.$ZodError): string;
|
|
21
21
|
//# sourceMappingURL=sdkvalidationerror.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
|
-
import * as z from "zod/v4";
|
|
4
|
+
import * as z from "zod/v4/core";
|
|
5
5
|
export class SDKValidationError extends Error {
|
|
6
6
|
// Allows for backwards compatibility for `instanceof` checks of `ResponseValidationError`
|
|
7
7
|
static [Symbol.hasInstance](instance) {
|
|
@@ -30,7 +30,7 @@ export class SDKValidationError extends Error {
|
|
|
30
30
|
* default error message.
|
|
31
31
|
*/
|
|
32
32
|
pretty() {
|
|
33
|
-
if (this.cause instanceof z
|
|
33
|
+
if (this.cause instanceof z.$ZodError) {
|
|
34
34
|
return `${this.rawMessage}\n${formatZodError(this.cause)}`;
|
|
35
35
|
}
|
|
36
36
|
else {
|
|
@@ -5,7 +5,7 @@ import * as z from "zod/v4";
|
|
|
5
5
|
import { safeParse } from "../lib/schemas.js";
|
|
6
6
|
/** @internal */
|
|
7
7
|
export const ForbiddenResponseErrorData$inboundSchema = z.object({
|
|
8
|
-
code: z.
|
|
8
|
+
code: z.int(),
|
|
9
9
|
message: z.string(),
|
|
10
10
|
metadata: z.nullable(z.record(z.string(), z.nullable(z.any()))).optional(),
|
|
11
11
|
});
|
|
@@ -5,7 +5,7 @@ import * as z from "zod/v4";
|
|
|
5
5
|
import { safeParse } from "../lib/schemas.js";
|
|
6
6
|
/** @internal */
|
|
7
7
|
export const InternalServerResponseErrorData$inboundSchema = z.object({
|
|
8
|
-
code: z.
|
|
8
|
+
code: z.int(),
|
|
9
9
|
message: z.string(),
|
|
10
10
|
metadata: z.nullable(z.record(z.string(), z.nullable(z.any()))).optional(),
|
|
11
11
|
});
|
|
@@ -5,7 +5,7 @@ import * as z from "zod/v4";
|
|
|
5
5
|
import { safeParse } from "../lib/schemas.js";
|
|
6
6
|
/** @internal */
|
|
7
7
|
export const NotFoundResponseErrorData$inboundSchema = z.object({
|
|
8
|
-
code: z.
|
|
8
|
+
code: z.int(),
|
|
9
9
|
message: z.string(),
|
|
10
10
|
metadata: z.nullable(z.record(z.string(), z.nullable(z.any()))).optional(),
|
|
11
11
|
});
|
|
@@ -124,8 +124,8 @@ export type OpenAIResponsesInputMessage1 = {
|
|
|
124
124
|
type: "input_file";
|
|
125
125
|
})> | string;
|
|
126
126
|
};
|
|
127
|
-
export type OpenAIResponsesInputUnion1 = OpenAIResponsesInputFunctionCallOutput | OpenAIResponsesInputFunctionCall |
|
|
128
|
-
export type OpenAIResponsesInputUnion = string | Array<OpenAIResponsesInputFunctionCallOutput | OpenAIResponsesInputFunctionCall |
|
|
127
|
+
export type OpenAIResponsesInputUnion1 = OpenAIResponsesInputFunctionCallOutput | OpenAIResponsesInputFunctionCall | OutputMessage | OpenAIResponsesInputMessage2 | OutputItemImageGenerationCall | OpenAIResponsesInputMessage1;
|
|
128
|
+
export type OpenAIResponsesInputUnion = string | Array<OpenAIResponsesInputFunctionCallOutput | OpenAIResponsesInputFunctionCall | OutputMessage | OpenAIResponsesInputMessage2 | OutputItemImageGenerationCall | OpenAIResponsesInputMessage1> | any;
|
|
129
129
|
/** @internal */
|
|
130
130
|
export declare const OpenAIResponsesInputTypeFunctionCall$inboundSchema: z.ZodEnum<typeof OpenAIResponsesInputTypeFunctionCall>;
|
|
131
131
|
/** @internal */
|
|
@@ -98,18 +98,10 @@ export function openAIResponsesInputRoleUnion2FromJSON(jsonString) {
|
|
|
98
98
|
}
|
|
99
99
|
/** @internal */
|
|
100
100
|
export const OpenAIResponsesInputContent3$inboundSchema = z.union([
|
|
101
|
-
ResponseInputText$inboundSchema.and(z.object({ type: z.literal("input_text") })
|
|
102
|
-
|
|
103
|
-
}))
|
|
104
|
-
|
|
105
|
-
type: v.type,
|
|
106
|
-
}))),
|
|
107
|
-
ResponseInputAudio$inboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
108
|
-
type: v.type,
|
|
109
|
-
}))),
|
|
110
|
-
ResponseInputFile$inboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
111
|
-
type: v.type,
|
|
112
|
-
}))),
|
|
101
|
+
ResponseInputText$inboundSchema.and(z.object({ type: z.literal("input_text") })),
|
|
102
|
+
ResponseInputImage$inboundSchema.and(z.object({ type: z.literal("input_image") })),
|
|
103
|
+
ResponseInputAudio$inboundSchema.and(z.object({ type: z.literal("input_audio") })),
|
|
104
|
+
ResponseInputFile$inboundSchema.and(z.object({ type: z.literal("input_file") })),
|
|
113
105
|
]);
|
|
114
106
|
export function openAIResponsesInputContent3FromJSON(jsonString) {
|
|
115
107
|
return safeParse(jsonString, (x) => OpenAIResponsesInputContent3$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenAIResponsesInputContent3' from JSON`);
|
|
@@ -124,18 +116,10 @@ export const OpenAIResponsesInputMessage2$inboundSchema = z.object({
|
|
|
124
116
|
OpenAIResponsesInputRoleDeveloper2$inboundSchema,
|
|
125
117
|
]),
|
|
126
118
|
content: z.array(z.union([
|
|
127
|
-
ResponseInputText$inboundSchema.and(z.object({ type: z.literal("input_text") })
|
|
128
|
-
|
|
129
|
-
}))
|
|
130
|
-
|
|
131
|
-
type: v.type,
|
|
132
|
-
}))),
|
|
133
|
-
ResponseInputAudio$inboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
134
|
-
type: v.type,
|
|
135
|
-
}))),
|
|
136
|
-
ResponseInputFile$inboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
137
|
-
type: v.type,
|
|
138
|
-
}))),
|
|
119
|
+
ResponseInputText$inboundSchema.and(z.object({ type: z.literal("input_text") })),
|
|
120
|
+
ResponseInputImage$inboundSchema.and(z.object({ type: z.literal("input_image") })),
|
|
121
|
+
ResponseInputAudio$inboundSchema.and(z.object({ type: z.literal("input_audio") })),
|
|
122
|
+
ResponseInputFile$inboundSchema.and(z.object({ type: z.literal("input_file") })),
|
|
139
123
|
])),
|
|
140
124
|
});
|
|
141
125
|
export function openAIResponsesInputMessage2FromJSON(jsonString) {
|
|
@@ -163,18 +147,10 @@ export function openAIResponsesInputRoleUnion1FromJSON(jsonString) {
|
|
|
163
147
|
}
|
|
164
148
|
/** @internal */
|
|
165
149
|
export const OpenAIResponsesInputContent1$inboundSchema = z.union([
|
|
166
|
-
ResponseInputText$inboundSchema.and(z.object({ type: z.literal("input_text") })
|
|
167
|
-
|
|
168
|
-
}))
|
|
169
|
-
|
|
170
|
-
type: v.type,
|
|
171
|
-
}))),
|
|
172
|
-
ResponseInputAudio$inboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
173
|
-
type: v.type,
|
|
174
|
-
}))),
|
|
175
|
-
ResponseInputFile$inboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
176
|
-
type: v.type,
|
|
177
|
-
}))),
|
|
150
|
+
ResponseInputText$inboundSchema.and(z.object({ type: z.literal("input_text") })),
|
|
151
|
+
ResponseInputImage$inboundSchema.and(z.object({ type: z.literal("input_image") })),
|
|
152
|
+
ResponseInputAudio$inboundSchema.and(z.object({ type: z.literal("input_audio") })),
|
|
153
|
+
ResponseInputFile$inboundSchema.and(z.object({ type: z.literal("input_file") })),
|
|
178
154
|
]);
|
|
179
155
|
export function openAIResponsesInputContent1FromJSON(jsonString) {
|
|
180
156
|
return safeParse(jsonString, (x) => OpenAIResponsesInputContent1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenAIResponsesInputContent1' from JSON`);
|
|
@@ -182,18 +158,10 @@ export function openAIResponsesInputContent1FromJSON(jsonString) {
|
|
|
182
158
|
/** @internal */
|
|
183
159
|
export const OpenAIResponsesInputContent2$inboundSchema = z.union([
|
|
184
160
|
z.array(z.union([
|
|
185
|
-
ResponseInputText$inboundSchema.and(z.object({ type: z.literal("input_text") })
|
|
186
|
-
|
|
187
|
-
}))
|
|
188
|
-
|
|
189
|
-
type: v.type,
|
|
190
|
-
}))),
|
|
191
|
-
ResponseInputAudio$inboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
192
|
-
type: v.type,
|
|
193
|
-
}))),
|
|
194
|
-
ResponseInputFile$inboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
195
|
-
type: v.type,
|
|
196
|
-
}))),
|
|
161
|
+
ResponseInputText$inboundSchema.and(z.object({ type: z.literal("input_text") })),
|
|
162
|
+
ResponseInputImage$inboundSchema.and(z.object({ type: z.literal("input_image") })),
|
|
163
|
+
ResponseInputAudio$inboundSchema.and(z.object({ type: z.literal("input_audio") })),
|
|
164
|
+
ResponseInputFile$inboundSchema.and(z.object({ type: z.literal("input_file") })),
|
|
197
165
|
])),
|
|
198
166
|
z.string(),
|
|
199
167
|
]);
|
|
@@ -211,18 +179,10 @@ export const OpenAIResponsesInputMessage1$inboundSchema = z.object({
|
|
|
211
179
|
]),
|
|
212
180
|
content: z.union([
|
|
213
181
|
z.array(z.union([
|
|
214
|
-
ResponseInputText$inboundSchema.and(z.object({ type: z.literal("input_text") })
|
|
215
|
-
|
|
216
|
-
}))
|
|
217
|
-
|
|
218
|
-
type: v.type,
|
|
219
|
-
}))),
|
|
220
|
-
ResponseInputAudio$inboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
221
|
-
type: v.type,
|
|
222
|
-
}))),
|
|
223
|
-
ResponseInputFile$inboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
224
|
-
type: v.type,
|
|
225
|
-
}))),
|
|
182
|
+
ResponseInputText$inboundSchema.and(z.object({ type: z.literal("input_text") })),
|
|
183
|
+
ResponseInputImage$inboundSchema.and(z.object({ type: z.literal("input_image") })),
|
|
184
|
+
ResponseInputAudio$inboundSchema.and(z.object({ type: z.literal("input_audio") })),
|
|
185
|
+
ResponseInputFile$inboundSchema.and(z.object({ type: z.literal("input_file") })),
|
|
226
186
|
])),
|
|
227
187
|
z.string(),
|
|
228
188
|
]),
|
|
@@ -234,9 +194,9 @@ export function openAIResponsesInputMessage1FromJSON(jsonString) {
|
|
|
234
194
|
export const OpenAIResponsesInputUnion1$inboundSchema = z.union([
|
|
235
195
|
z.lazy(() => OpenAIResponsesInputFunctionCallOutput$inboundSchema),
|
|
236
196
|
z.lazy(() => OpenAIResponsesInputFunctionCall$inboundSchema),
|
|
237
|
-
OutputItemImageGenerationCall$inboundSchema,
|
|
238
197
|
OutputMessage$inboundSchema,
|
|
239
198
|
z.lazy(() => OpenAIResponsesInputMessage2$inboundSchema),
|
|
199
|
+
OutputItemImageGenerationCall$inboundSchema,
|
|
240
200
|
z.lazy(() => OpenAIResponsesInputMessage1$inboundSchema),
|
|
241
201
|
]);
|
|
242
202
|
export function openAIResponsesInputUnion1FromJSON(jsonString) {
|
|
@@ -248,9 +208,9 @@ export const OpenAIResponsesInputUnion$inboundSchema = z.union([
|
|
|
248
208
|
z.array(z.union([
|
|
249
209
|
z.lazy(() => OpenAIResponsesInputFunctionCallOutput$inboundSchema),
|
|
250
210
|
z.lazy(() => OpenAIResponsesInputFunctionCall$inboundSchema),
|
|
251
|
-
OutputItemImageGenerationCall$inboundSchema,
|
|
252
211
|
OutputMessage$inboundSchema,
|
|
253
212
|
z.lazy(() => OpenAIResponsesInputMessage2$inboundSchema),
|
|
213
|
+
OutputItemImageGenerationCall$inboundSchema,
|
|
254
214
|
z.lazy(() => OpenAIResponsesInputMessage1$inboundSchema),
|
|
255
215
|
])),
|
|
256
216
|
z.any(),
|
|
@@ -43,18 +43,10 @@ export function openResponsesEasyInputMessageRoleUnionToJSON(openResponsesEasyIn
|
|
|
43
43
|
}
|
|
44
44
|
/** @internal */
|
|
45
45
|
export const OpenResponsesEasyInputMessageContent1$outboundSchema = z.union([
|
|
46
|
-
ResponseInputText$outboundSchema.and(z.object({ type: z.literal("input_text") })
|
|
47
|
-
|
|
48
|
-
}))
|
|
49
|
-
|
|
50
|
-
type: v.type,
|
|
51
|
-
}))),
|
|
52
|
-
ResponseInputAudio$outboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
53
|
-
type: v.type,
|
|
54
|
-
}))),
|
|
55
|
-
ResponseInputFile$outboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
56
|
-
type: v.type,
|
|
57
|
-
}))),
|
|
46
|
+
ResponseInputText$outboundSchema.and(z.object({ type: z.literal("input_text") })),
|
|
47
|
+
ResponseInputImage$outboundSchema.and(z.object({ type: z.literal("input_image") })),
|
|
48
|
+
ResponseInputAudio$outboundSchema.and(z.object({ type: z.literal("input_audio") })),
|
|
49
|
+
ResponseInputFile$outboundSchema.and(z.object({ type: z.literal("input_file") })),
|
|
58
50
|
]);
|
|
59
51
|
export function openResponsesEasyInputMessageContent1ToJSON(openResponsesEasyInputMessageContent1) {
|
|
60
52
|
return JSON.stringify(OpenResponsesEasyInputMessageContent1$outboundSchema.parse(openResponsesEasyInputMessageContent1));
|
|
@@ -62,18 +54,10 @@ export function openResponsesEasyInputMessageContent1ToJSON(openResponsesEasyInp
|
|
|
62
54
|
/** @internal */
|
|
63
55
|
export const OpenResponsesEasyInputMessageContent2$outboundSchema = z.union([
|
|
64
56
|
z.array(z.union([
|
|
65
|
-
ResponseInputText$outboundSchema.and(z.object({ type: z.literal("input_text") })
|
|
66
|
-
|
|
67
|
-
}))
|
|
68
|
-
|
|
69
|
-
type: v.type,
|
|
70
|
-
}))),
|
|
71
|
-
ResponseInputAudio$outboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
72
|
-
type: v.type,
|
|
73
|
-
}))),
|
|
74
|
-
ResponseInputFile$outboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
75
|
-
type: v.type,
|
|
76
|
-
}))),
|
|
57
|
+
ResponseInputText$outboundSchema.and(z.object({ type: z.literal("input_text") })),
|
|
58
|
+
ResponseInputImage$outboundSchema.and(z.object({ type: z.literal("input_image") })),
|
|
59
|
+
ResponseInputAudio$outboundSchema.and(z.object({ type: z.literal("input_audio") })),
|
|
60
|
+
ResponseInputFile$outboundSchema.and(z.object({ type: z.literal("input_file") })),
|
|
77
61
|
])),
|
|
78
62
|
z.string(),
|
|
79
63
|
]);
|
|
@@ -91,18 +75,10 @@ export const OpenResponsesEasyInputMessage$outboundSchema = z.object({
|
|
|
91
75
|
]),
|
|
92
76
|
content: z.union([
|
|
93
77
|
z.array(z.union([
|
|
94
|
-
ResponseInputText$outboundSchema.and(z.object({ type: z.literal("input_text") })
|
|
95
|
-
|
|
96
|
-
}))
|
|
97
|
-
|
|
98
|
-
type: v.type,
|
|
99
|
-
}))),
|
|
100
|
-
ResponseInputAudio$outboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
101
|
-
type: v.type,
|
|
102
|
-
}))),
|
|
103
|
-
ResponseInputFile$outboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
104
|
-
type: v.type,
|
|
105
|
-
}))),
|
|
78
|
+
ResponseInputText$outboundSchema.and(z.object({ type: z.literal("input_text") })),
|
|
79
|
+
ResponseInputImage$outboundSchema.and(z.object({ type: z.literal("input_image") })),
|
|
80
|
+
ResponseInputAudio$outboundSchema.and(z.object({ type: z.literal("input_audio") })),
|
|
81
|
+
ResponseInputFile$outboundSchema.and(z.object({ type: z.literal("input_file") })),
|
|
106
82
|
])),
|
|
107
83
|
z.string(),
|
|
108
84
|
]),
|
|
@@ -10,18 +10,18 @@ import { ResponsesOutputItemFunctionCall, ResponsesOutputItemFunctionCall$Outbou
|
|
|
10
10
|
import { ResponsesOutputItemReasoning, ResponsesOutputItemReasoning$Outbound } from "./responsesoutputitemreasoning.js";
|
|
11
11
|
import { ResponsesOutputMessage, ResponsesOutputMessage$Outbound } from "./responsesoutputmessage.js";
|
|
12
12
|
import { ResponsesWebSearchCallOutput, ResponsesWebSearchCallOutput$Outbound } from "./responseswebsearchcalloutput.js";
|
|
13
|
-
export type OpenResponsesInput1 = OpenResponsesFunctionToolCall | OpenResponsesFunctionCallOutput | ResponsesOutputMessage | ResponsesOutputItemFunctionCall | ResponsesOutputItemFileSearchCall |
|
|
13
|
+
export type OpenResponsesInput1 = OpenResponsesFunctionToolCall | OpenResponsesFunctionCallOutput | ResponsesOutputMessage | ResponsesOutputItemFunctionCall | ResponsesOutputItemFileSearchCall | OpenResponsesReasoning | ResponsesWebSearchCallOutput | ResponsesImageGenerationCall | OpenResponsesEasyInputMessage | OpenResponsesInputMessageItem | ResponsesOutputItemReasoning;
|
|
14
14
|
/**
|
|
15
15
|
* Input for a response request - can be a string or array of items
|
|
16
16
|
*/
|
|
17
|
-
export type OpenResponsesInput = string | Array<OpenResponsesFunctionToolCall | OpenResponsesFunctionCallOutput | ResponsesOutputMessage | ResponsesOutputItemFunctionCall | ResponsesOutputItemFileSearchCall |
|
|
17
|
+
export type OpenResponsesInput = string | Array<OpenResponsesFunctionToolCall | OpenResponsesFunctionCallOutput | ResponsesOutputMessage | ResponsesOutputItemFunctionCall | ResponsesOutputItemFileSearchCall | OpenResponsesReasoning | ResponsesWebSearchCallOutput | ResponsesImageGenerationCall | OpenResponsesEasyInputMessage | OpenResponsesInputMessageItem | ResponsesOutputItemReasoning>;
|
|
18
18
|
/** @internal */
|
|
19
|
-
export type OpenResponsesInput1$Outbound = OpenResponsesFunctionToolCall$Outbound | OpenResponsesFunctionCallOutput$Outbound | ResponsesOutputMessage$Outbound | ResponsesOutputItemFunctionCall$Outbound | ResponsesOutputItemFileSearchCall$Outbound |
|
|
19
|
+
export type OpenResponsesInput1$Outbound = OpenResponsesFunctionToolCall$Outbound | OpenResponsesFunctionCallOutput$Outbound | ResponsesOutputMessage$Outbound | ResponsesOutputItemFunctionCall$Outbound | ResponsesOutputItemFileSearchCall$Outbound | OpenResponsesReasoning$Outbound | ResponsesWebSearchCallOutput$Outbound | ResponsesImageGenerationCall$Outbound | OpenResponsesEasyInputMessage$Outbound | OpenResponsesInputMessageItem$Outbound | ResponsesOutputItemReasoning$Outbound;
|
|
20
20
|
/** @internal */
|
|
21
21
|
export declare const OpenResponsesInput1$outboundSchema: z.ZodType<OpenResponsesInput1$Outbound, OpenResponsesInput1>;
|
|
22
22
|
export declare function openResponsesInput1ToJSON(openResponsesInput1: OpenResponsesInput1): string;
|
|
23
23
|
/** @internal */
|
|
24
|
-
export type OpenResponsesInput$Outbound = string | Array<OpenResponsesFunctionToolCall$Outbound | OpenResponsesFunctionCallOutput$Outbound | ResponsesOutputMessage$Outbound | ResponsesOutputItemFunctionCall$Outbound | ResponsesOutputItemFileSearchCall$Outbound |
|
|
24
|
+
export type OpenResponsesInput$Outbound = string | Array<OpenResponsesFunctionToolCall$Outbound | OpenResponsesFunctionCallOutput$Outbound | ResponsesOutputMessage$Outbound | ResponsesOutputItemFunctionCall$Outbound | ResponsesOutputItemFileSearchCall$Outbound | OpenResponsesReasoning$Outbound | ResponsesWebSearchCallOutput$Outbound | ResponsesImageGenerationCall$Outbound | OpenResponsesEasyInputMessage$Outbound | OpenResponsesInputMessageItem$Outbound | ResponsesOutputItemReasoning$Outbound>;
|
|
25
25
|
/** @internal */
|
|
26
26
|
export declare const OpenResponsesInput$outboundSchema: z.ZodType<OpenResponsesInput$Outbound, OpenResponsesInput>;
|
|
27
27
|
export declare function openResponsesInputToJSON(openResponsesInput: OpenResponsesInput): string;
|
|
@@ -20,9 +20,9 @@ export const OpenResponsesInput1$outboundSchema = z.union([
|
|
|
20
20
|
ResponsesOutputMessage$outboundSchema,
|
|
21
21
|
ResponsesOutputItemFunctionCall$outboundSchema,
|
|
22
22
|
ResponsesOutputItemFileSearchCall$outboundSchema,
|
|
23
|
-
ResponsesImageGenerationCall$outboundSchema,
|
|
24
23
|
OpenResponsesReasoning$outboundSchema,
|
|
25
24
|
ResponsesWebSearchCallOutput$outboundSchema,
|
|
25
|
+
ResponsesImageGenerationCall$outboundSchema,
|
|
26
26
|
OpenResponsesEasyInputMessage$outboundSchema,
|
|
27
27
|
OpenResponsesInputMessageItem$outboundSchema,
|
|
28
28
|
ResponsesOutputItemReasoning$outboundSchema,
|
|
@@ -39,9 +39,9 @@ export const OpenResponsesInput$outboundSchema = z.union([
|
|
|
39
39
|
ResponsesOutputMessage$outboundSchema,
|
|
40
40
|
ResponsesOutputItemFunctionCall$outboundSchema,
|
|
41
41
|
ResponsesOutputItemFileSearchCall$outboundSchema,
|
|
42
|
-
ResponsesImageGenerationCall$outboundSchema,
|
|
43
42
|
OpenResponsesReasoning$outboundSchema,
|
|
44
43
|
ResponsesWebSearchCallOutput$outboundSchema,
|
|
44
|
+
ResponsesImageGenerationCall$outboundSchema,
|
|
45
45
|
OpenResponsesEasyInputMessage$outboundSchema,
|
|
46
46
|
OpenResponsesInputMessageItem$outboundSchema,
|
|
47
47
|
ResponsesOutputItemReasoning$outboundSchema,
|
|
@@ -37,18 +37,10 @@ export function openResponsesInputMessageItemRoleUnionToJSON(openResponsesInputM
|
|
|
37
37
|
}
|
|
38
38
|
/** @internal */
|
|
39
39
|
export const OpenResponsesInputMessageItemContent$outboundSchema = z.union([
|
|
40
|
-
ResponseInputText$outboundSchema.and(z.object({ type: z.literal("input_text") })
|
|
41
|
-
|
|
42
|
-
}))
|
|
43
|
-
|
|
44
|
-
type: v.type,
|
|
45
|
-
}))),
|
|
46
|
-
ResponseInputAudio$outboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
47
|
-
type: v.type,
|
|
48
|
-
}))),
|
|
49
|
-
ResponseInputFile$outboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
50
|
-
type: v.type,
|
|
51
|
-
}))),
|
|
40
|
+
ResponseInputText$outboundSchema.and(z.object({ type: z.literal("input_text") })),
|
|
41
|
+
ResponseInputImage$outboundSchema.and(z.object({ type: z.literal("input_image") })),
|
|
42
|
+
ResponseInputAudio$outboundSchema.and(z.object({ type: z.literal("input_audio") })),
|
|
43
|
+
ResponseInputFile$outboundSchema.and(z.object({ type: z.literal("input_file") })),
|
|
52
44
|
]);
|
|
53
45
|
export function openResponsesInputMessageItemContentToJSON(openResponsesInputMessageItemContent) {
|
|
54
46
|
return JSON.stringify(OpenResponsesInputMessageItemContent$outboundSchema.parse(openResponsesInputMessageItemContent));
|
|
@@ -63,18 +55,10 @@ export const OpenResponsesInputMessageItem$outboundSchema = z.object({
|
|
|
63
55
|
OpenResponsesInputMessageItemRoleDeveloper$outboundSchema,
|
|
64
56
|
]),
|
|
65
57
|
content: z.array(z.union([
|
|
66
|
-
ResponseInputText$outboundSchema.and(z.object({ type: z.literal("input_text") })
|
|
67
|
-
|
|
68
|
-
}))
|
|
69
|
-
|
|
70
|
-
type: v.type,
|
|
71
|
-
}))),
|
|
72
|
-
ResponseInputAudio$outboundSchema.and(z.object({ type: z.literal("input_audio") }).transform((v) => ({
|
|
73
|
-
type: v.type,
|
|
74
|
-
}))),
|
|
75
|
-
ResponseInputFile$outboundSchema.and(z.object({ type: z.literal("input_file") }).transform((v) => ({
|
|
76
|
-
type: v.type,
|
|
77
|
-
}))),
|
|
58
|
+
ResponseInputText$outboundSchema.and(z.object({ type: z.literal("input_text") })),
|
|
59
|
+
ResponseInputImage$outboundSchema.and(z.object({ type: z.literal("input_image") })),
|
|
60
|
+
ResponseInputAudio$outboundSchema.and(z.object({ type: z.literal("input_audio") })),
|
|
61
|
+
ResponseInputFile$outboundSchema.and(z.object({ type: z.literal("input_file") })),
|
|
78
62
|
])),
|
|
79
63
|
});
|
|
80
64
|
export function openResponsesInputMessageItemToJSON(openResponsesInputMessageItem) {
|
|
@@ -30,6 +30,10 @@ export type CreateAuthKeysCodeRequest = {
|
|
|
30
30
|
* Credit limit for the API key to be created
|
|
31
31
|
*/
|
|
32
32
|
limit?: number | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Optional expiration time for the API key to be created
|
|
35
|
+
*/
|
|
36
|
+
expiresAt?: Date | null | undefined;
|
|
33
37
|
};
|
|
34
38
|
/**
|
|
35
39
|
* Auth code data
|
|
@@ -65,6 +69,7 @@ export type CreateAuthKeysCodeRequest$Outbound = {
|
|
|
65
69
|
code_challenge?: string | undefined;
|
|
66
70
|
code_challenge_method?: string | undefined;
|
|
67
71
|
limit?: number | undefined;
|
|
72
|
+
expires_at?: string | null | undefined;
|
|
68
73
|
};
|
|
69
74
|
/** @internal */
|
|
70
75
|
export declare const CreateAuthKeysCodeRequest$outboundSchema: z.ZodType<CreateAuthKeysCodeRequest$Outbound, CreateAuthKeysCodeRequest>;
|
|
@@ -23,11 +23,13 @@ export const CreateAuthKeysCodeRequest$outboundSchema = z.object({
|
|
|
23
23
|
codeChallengeMethod: CreateAuthKeysCodeCodeChallengeMethod$outboundSchema
|
|
24
24
|
.optional(),
|
|
25
25
|
limit: z.number().optional(),
|
|
26
|
+
expiresAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
|
|
26
27
|
}).transform((v) => {
|
|
27
28
|
return remap$(v, {
|
|
28
29
|
callbackUrl: "callback_url",
|
|
29
30
|
codeChallenge: "code_challenge",
|
|
30
31
|
codeChallengeMethod: "code_challenge_method",
|
|
32
|
+
expiresAt: "expires_at",
|
|
31
33
|
});
|
|
32
34
|
});
|
|
33
35
|
export function createAuthKeysCodeRequestToJSON(createAuthKeysCodeRequest) {
|
|
@@ -10,7 +10,7 @@ export type OutputItemImageGenerationCallType = ClosedEnum<typeof OutputItemImag
|
|
|
10
10
|
export type OutputItemImageGenerationCall = {
|
|
11
11
|
type: OutputItemImageGenerationCallType;
|
|
12
12
|
id: string;
|
|
13
|
-
result
|
|
13
|
+
result?: string | null | undefined;
|
|
14
14
|
status: ImageGenerationStatus;
|
|
15
15
|
};
|
|
16
16
|
/** @internal */
|
|
@@ -13,7 +13,7 @@ export const OutputItemImageGenerationCallType$inboundSchema = z.enum(OutputItem
|
|
|
13
13
|
export const OutputItemImageGenerationCall$inboundSchema = z.object({
|
|
14
14
|
type: OutputItemImageGenerationCallType$inboundSchema,
|
|
15
15
|
id: z.string(),
|
|
16
|
-
result: z.nullable(z.string()),
|
|
16
|
+
result: z.nullable(z.string()).default(null),
|
|
17
17
|
status: ImageGenerationStatus$inboundSchema,
|
|
18
18
|
});
|
|
19
19
|
export function outputItemImageGenerationCallFromJSON(jsonString) {
|
|
@@ -5,7 +5,7 @@ import * as z from "zod/v4";
|
|
|
5
5
|
import { safeParse } from "../lib/schemas.js";
|
|
6
6
|
/** @internal */
|
|
7
7
|
export const PayloadTooLargeResponseErrorData$inboundSchema = z.object({
|
|
8
|
-
code: z.
|
|
8
|
+
code: z.int(),
|
|
9
9
|
message: z.string(),
|
|
10
10
|
metadata: z.nullable(z.record(z.string(), z.nullable(z.any()))).optional(),
|
|
11
11
|
});
|
|
@@ -5,7 +5,7 @@ import * as z from "zod/v4";
|
|
|
5
5
|
import { safeParse } from "../lib/schemas.js";
|
|
6
6
|
/** @internal */
|
|
7
7
|
export const PaymentRequiredResponseErrorData$inboundSchema = z.object({
|
|
8
|
-
code: z.
|
|
8
|
+
code: z.int(),
|
|
9
9
|
message: z.string(),
|
|
10
10
|
metadata: z.nullable(z.record(z.string(), z.nullable(z.any()))).optional(),
|
|
11
11
|
});
|
|
@@ -5,7 +5,7 @@ import * as z from "zod/v4";
|
|
|
5
5
|
import { safeParse } from "../lib/schemas.js";
|
|
6
6
|
/** @internal */
|
|
7
7
|
export const ProviderOverloadedResponseErrorData$inboundSchema = z.object({
|
|
8
|
-
code: z.
|
|
8
|
+
code: z.int(),
|
|
9
9
|
message: z.string(),
|
|
10
10
|
metadata: z.nullable(z.record(z.string(), z.nullable(z.any()))).optional(),
|
|
11
11
|
});
|
|
@@ -5,7 +5,7 @@ import * as z from "zod/v4";
|
|
|
5
5
|
import { safeParse } from "../lib/schemas.js";
|
|
6
6
|
/** @internal */
|
|
7
7
|
export const RequestTimeoutResponseErrorData$inboundSchema = z.object({
|
|
8
|
-
code: z.
|
|
8
|
+
code: z.int(),
|
|
9
9
|
message: z.string(),
|
|
10
10
|
metadata: z.nullable(z.record(z.string(), z.nullable(z.any()))).optional(),
|
|
11
11
|
});
|
|
@@ -10,7 +10,7 @@ export type ResponsesImageGenerationCallType = ClosedEnum<typeof ResponsesImageG
|
|
|
10
10
|
export type ResponsesImageGenerationCall = {
|
|
11
11
|
type: ResponsesImageGenerationCallType;
|
|
12
12
|
id: string;
|
|
13
|
-
result
|
|
13
|
+
result?: string | null | undefined;
|
|
14
14
|
status: ImageGenerationStatus;
|
|
15
15
|
};
|
|
16
16
|
/** @internal */
|
|
@@ -15,14 +15,14 @@ export const ResponsesImageGenerationCallType$outboundSchema = ResponsesImageGen
|
|
|
15
15
|
export const ResponsesImageGenerationCall$inboundSchema = z.object({
|
|
16
16
|
type: ResponsesImageGenerationCallType$inboundSchema,
|
|
17
17
|
id: z.string(),
|
|
18
|
-
result: z.nullable(z.string()),
|
|
18
|
+
result: z.nullable(z.string()).default(null),
|
|
19
19
|
status: ImageGenerationStatus$inboundSchema,
|
|
20
20
|
});
|
|
21
21
|
/** @internal */
|
|
22
22
|
export const ResponsesImageGenerationCall$outboundSchema = z.object({
|
|
23
23
|
type: ResponsesImageGenerationCallType$outboundSchema,
|
|
24
24
|
id: z.string(),
|
|
25
|
-
result: z.nullable(z.string()),
|
|
25
|
+
result: z.nullable(z.string()).default(null),
|
|
26
26
|
status: ImageGenerationStatus$outboundSchema,
|
|
27
27
|
});
|
|
28
28
|
export function responsesImageGenerationCallToJSON(responsesImageGenerationCall) {
|
|
@@ -10,7 +10,7 @@ import { ResponsesWebSearchCallOutput } from "./responseswebsearchcalloutput.js"
|
|
|
10
10
|
/**
|
|
11
11
|
* An output item from the response
|
|
12
12
|
*/
|
|
13
|
-
export type ResponsesOutputItem = ResponsesOutputMessage | ResponsesOutputItemFunctionCall | ResponsesOutputItemFileSearchCall |
|
|
13
|
+
export type ResponsesOutputItem = ResponsesOutputMessage | ResponsesOutputItemFunctionCall | ResponsesOutputItemFileSearchCall | ResponsesWebSearchCallOutput | ResponsesImageGenerationCall | ResponsesOutputItemReasoning;
|
|
14
14
|
/** @internal */
|
|
15
15
|
export declare const ResponsesOutputItem$inboundSchema: z.ZodType<ResponsesOutputItem, unknown>;
|
|
16
16
|
export declare function responsesOutputItemFromJSON(jsonString: string): SafeParseResult<ResponsesOutputItem, SDKValidationError>;
|
|
@@ -14,8 +14,8 @@ export const ResponsesOutputItem$inboundSchema = z.union([
|
|
|
14
14
|
ResponsesOutputMessage$inboundSchema,
|
|
15
15
|
ResponsesOutputItemFunctionCall$inboundSchema,
|
|
16
16
|
ResponsesOutputItemFileSearchCall$inboundSchema,
|
|
17
|
-
ResponsesImageGenerationCall$inboundSchema,
|
|
18
17
|
ResponsesWebSearchCallOutput$inboundSchema,
|
|
18
|
+
ResponsesImageGenerationCall$inboundSchema,
|
|
19
19
|
ResponsesOutputItemReasoning$inboundSchema,
|
|
20
20
|
]);
|
|
21
21
|
export function responsesOutputItemFromJSON(jsonString) {
|
|
@@ -5,7 +5,7 @@ import * as z from "zod/v4";
|
|
|
5
5
|
import { safeParse } from "../lib/schemas.js";
|
|
6
6
|
/** @internal */
|
|
7
7
|
export const ServiceUnavailableResponseErrorData$inboundSchema = z.object({
|
|
8
|
-
code: z.
|
|
8
|
+
code: z.int(),
|
|
9
9
|
message: z.string(),
|
|
10
10
|
metadata: z.nullable(z.record(z.string(), z.nullable(z.any()))).optional(),
|
|
11
11
|
});
|
|
@@ -5,7 +5,7 @@ import * as z from "zod/v4";
|
|
|
5
5
|
import { safeParse } from "../lib/schemas.js";
|
|
6
6
|
/** @internal */
|
|
7
7
|
export const TooManyRequestsResponseErrorData$inboundSchema = z.object({
|
|
8
|
-
code: z.
|
|
8
|
+
code: z.int(),
|
|
9
9
|
message: z.string(),
|
|
10
10
|
metadata: z.nullable(z.record(z.string(), z.nullable(z.any()))).optional(),
|
|
11
11
|
});
|
|
@@ -5,7 +5,7 @@ import * as z from "zod/v4";
|
|
|
5
5
|
import { safeParse } from "../lib/schemas.js";
|
|
6
6
|
/** @internal */
|
|
7
7
|
export const UnauthorizedResponseErrorData$inboundSchema = z.object({
|
|
8
|
-
code: z.
|
|
8
|
+
code: z.int(),
|
|
9
9
|
message: z.string(),
|
|
10
10
|
metadata: z.nullable(z.record(z.string(), z.nullable(z.any()))).optional(),
|
|
11
11
|
});
|
|
@@ -5,7 +5,7 @@ import * as z from "zod/v4";
|
|
|
5
5
|
import { safeParse } from "../lib/schemas.js";
|
|
6
6
|
/** @internal */
|
|
7
7
|
export const UnprocessableEntityResponseErrorData$inboundSchema = z.object({
|
|
8
|
-
code: z.
|
|
8
|
+
code: z.int(),
|
|
9
9
|
message: z.string(),
|
|
10
10
|
metadata: z.nullable(z.record(z.string(), z.nullable(z.any()))).optional(),
|
|
11
11
|
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { InvalidateQueryFilters, QueryClient, QueryFunctionContext, QueryKey, UseQueryResult, UseSuspenseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import { OpenRouterCore } from "../core.js";
|
|
3
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
4
|
+
import * as models from "../models/index.js";
|
|
5
|
+
import { QueryHookOptions, SuspenseQueryHookOptions } from "./_types.js";
|
|
6
|
+
export type EmbeddingsListModelsQueryData = models.ModelsListResponse;
|
|
7
|
+
/**
|
|
8
|
+
* List all embeddings models
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* Returns a list of all available embeddings models and their properties
|
|
12
|
+
*/
|
|
13
|
+
export declare function useEmbeddingsListModels(options?: QueryHookOptions<EmbeddingsListModelsQueryData>): UseQueryResult<EmbeddingsListModelsQueryData, Error>;
|
|
14
|
+
/**
|
|
15
|
+
* List all embeddings models
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* Returns a list of all available embeddings models and their properties
|
|
19
|
+
*/
|
|
20
|
+
export declare function useEmbeddingsListModelsSuspense(options?: SuspenseQueryHookOptions<EmbeddingsListModelsQueryData>): UseSuspenseQueryResult<EmbeddingsListModelsQueryData, Error>;
|
|
21
|
+
export declare function prefetchEmbeddingsListModels(queryClient: QueryClient, client$: OpenRouterCore): Promise<void>;
|
|
22
|
+
export declare function setEmbeddingsListModelsData(client: QueryClient, data: EmbeddingsListModelsQueryData): EmbeddingsListModelsQueryData | undefined;
|
|
23
|
+
export declare function invalidateAllEmbeddingsListModels(client: QueryClient, filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">): Promise<void>;
|
|
24
|
+
export declare function buildEmbeddingsListModelsQuery(client$: OpenRouterCore, options?: RequestOptions): {
|
|
25
|
+
queryKey: QueryKey;
|
|
26
|
+
queryFn: (context: QueryFunctionContext) => Promise<EmbeddingsListModelsQueryData>;
|
|
27
|
+
};
|
|
28
|
+
export declare function queryKeyEmbeddingsListModels(): QueryKey;
|
|
29
|
+
//# sourceMappingURL=embeddingsListModels.d.ts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
import { useQuery, useSuspenseQuery, } from "@tanstack/react-query";
|
|
5
|
-
import {
|
|
5
|
+
import { embeddingsListModels } from "../funcs/embeddingsListModels.js";
|
|
6
6
|
import { combineSignals } from "../lib/primitives.js";
|
|
7
7
|
import { unwrapAsync } from "../types/fp.js";
|
|
8
8
|
import { useOpenRouterContext } from "./_context.js";
|
|
@@ -12,10 +12,10 @@ import { useOpenRouterContext } from "./_context.js";
|
|
|
12
12
|
* @remarks
|
|
13
13
|
* Returns a list of all available embeddings models and their properties
|
|
14
14
|
*/
|
|
15
|
-
export function
|
|
15
|
+
export function useEmbeddingsListModels(options) {
|
|
16
16
|
const client = useOpenRouterContext();
|
|
17
17
|
return useQuery({
|
|
18
|
-
...
|
|
18
|
+
...buildEmbeddingsListModelsQuery(client, options),
|
|
19
19
|
...options,
|
|
20
20
|
});
|
|
21
21
|
}
|
|
@@ -25,42 +25,42 @@ export function useModelsListEmbeddings(options) {
|
|
|
25
25
|
* @remarks
|
|
26
26
|
* Returns a list of all available embeddings models and their properties
|
|
27
27
|
*/
|
|
28
|
-
export function
|
|
28
|
+
export function useEmbeddingsListModelsSuspense(options) {
|
|
29
29
|
const client = useOpenRouterContext();
|
|
30
30
|
return useSuspenseQuery({
|
|
31
|
-
...
|
|
31
|
+
...buildEmbeddingsListModelsQuery(client, options),
|
|
32
32
|
...options,
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
export function
|
|
35
|
+
export function prefetchEmbeddingsListModels(queryClient, client$) {
|
|
36
36
|
return queryClient.prefetchQuery({
|
|
37
|
-
...
|
|
37
|
+
...buildEmbeddingsListModelsQuery(client$),
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
export function
|
|
41
|
-
const key =
|
|
40
|
+
export function setEmbeddingsListModelsData(client, data) {
|
|
41
|
+
const key = queryKeyEmbeddingsListModels();
|
|
42
42
|
return client.setQueryData(key, data);
|
|
43
43
|
}
|
|
44
|
-
export function
|
|
44
|
+
export function invalidateAllEmbeddingsListModels(client, filters) {
|
|
45
45
|
return client.invalidateQueries({
|
|
46
46
|
...filters,
|
|
47
|
-
queryKey: ["@openrouter/sdk", "
|
|
47
|
+
queryKey: ["@openrouter/sdk", "Embeddings", "listModels"],
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
-
export function
|
|
50
|
+
export function buildEmbeddingsListModelsQuery(client$, options) {
|
|
51
51
|
return {
|
|
52
|
-
queryKey:
|
|
53
|
-
queryFn: async function
|
|
52
|
+
queryKey: queryKeyEmbeddingsListModels(),
|
|
53
|
+
queryFn: async function embeddingsListModelsQueryFn(ctx) {
|
|
54
54
|
const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
|
|
55
55
|
const mergedOptions = {
|
|
56
56
|
...options,
|
|
57
57
|
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
58
58
|
};
|
|
59
|
-
return unwrapAsync(
|
|
59
|
+
return unwrapAsync(embeddingsListModels(client$, mergedOptions));
|
|
60
60
|
},
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
|
-
export function
|
|
64
|
-
return ["@openrouter/sdk", "
|
|
63
|
+
export function queryKeyEmbeddingsListModels() {
|
|
64
|
+
return ["@openrouter/sdk", "Embeddings", "listModels"];
|
|
65
65
|
}
|
|
66
|
-
//# sourceMappingURL=
|
|
66
|
+
//# sourceMappingURL=embeddingsListModels.js.map
|
|
@@ -13,12 +13,12 @@ export * from "./completionsGenerate.js";
|
|
|
13
13
|
export * from "./creditsCreateCoinbaseCharge.js";
|
|
14
14
|
export * from "./creditsGetCredits.js";
|
|
15
15
|
export * from "./embeddingsGenerate.js";
|
|
16
|
+
export * from "./embeddingsListModels.js";
|
|
16
17
|
export * from "./endpointsList.js";
|
|
17
18
|
export * from "./endpointsListZdrEndpoints.js";
|
|
18
19
|
export * from "./generationsGetGeneration.js";
|
|
19
20
|
export * from "./modelsCount.js";
|
|
20
21
|
export * from "./modelsList.js";
|
|
21
|
-
export * from "./modelsListEmbeddings.js";
|
|
22
22
|
export * from "./modelsListForUser.js";
|
|
23
23
|
export * from "./oAuthCreateAuthCode.js";
|
|
24
24
|
export * from "./oAuthExchangeAuthCodeForAPIKey.js";
|
package/esm/react-query/index.js
CHANGED
|
@@ -16,12 +16,12 @@ export * from "./completionsGenerate.js";
|
|
|
16
16
|
export * from "./creditsCreateCoinbaseCharge.js";
|
|
17
17
|
export * from "./creditsGetCredits.js";
|
|
18
18
|
export * from "./embeddingsGenerate.js";
|
|
19
|
+
export * from "./embeddingsListModels.js";
|
|
19
20
|
export * from "./endpointsList.js";
|
|
20
21
|
export * from "./endpointsListZdrEndpoints.js";
|
|
21
22
|
export * from "./generationsGetGeneration.js";
|
|
22
23
|
export * from "./modelsCount.js";
|
|
23
24
|
export * from "./modelsList.js";
|
|
24
|
-
export * from "./modelsListEmbeddings.js";
|
|
25
25
|
export * from "./modelsListForUser.js";
|
|
26
26
|
export * from "./oAuthCreateAuthCode.js";
|
|
27
27
|
export * from "./oAuthExchangeAuthCodeForAPIKey.js";
|
package/esm/sdk/embeddings.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
2
|
+
import * as models from "../models/index.js";
|
|
2
3
|
import * as operations from "../models/operations/index.js";
|
|
3
4
|
export declare class Embeddings extends ClientSDK {
|
|
4
5
|
/**
|
|
@@ -8,5 +9,12 @@ export declare class Embeddings extends ClientSDK {
|
|
|
8
9
|
* Submits an embedding request to the embeddings router
|
|
9
10
|
*/
|
|
10
11
|
generate(request: operations.CreateEmbeddingsRequest, options?: RequestOptions): Promise<operations.CreateEmbeddingsResponse>;
|
|
12
|
+
/**
|
|
13
|
+
* List all embeddings models
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* Returns a list of all available embeddings models and their properties
|
|
17
|
+
*/
|
|
18
|
+
listModels(options?: RequestOptions): Promise<models.ModelsListResponse>;
|
|
11
19
|
}
|
|
12
20
|
//# sourceMappingURL=embeddings.d.ts.map
|
package/esm/sdk/embeddings.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
import { embeddingsGenerate } from "../funcs/embeddingsGenerate.js";
|
|
5
|
+
import { embeddingsListModels } from "../funcs/embeddingsListModels.js";
|
|
5
6
|
import { ClientSDK } from "../lib/sdks.js";
|
|
6
7
|
import { unwrapAsync } from "../types/fp.js";
|
|
7
8
|
export class Embeddings extends ClientSDK {
|
|
@@ -14,5 +15,14 @@ export class Embeddings extends ClientSDK {
|
|
|
14
15
|
async generate(request, options) {
|
|
15
16
|
return unwrapAsync(embeddingsGenerate(this, request, options));
|
|
16
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* List all embeddings models
|
|
20
|
+
*
|
|
21
|
+
* @remarks
|
|
22
|
+
* Returns a list of all available embeddings models and their properties
|
|
23
|
+
*/
|
|
24
|
+
async listModels(options) {
|
|
25
|
+
return unwrapAsync(embeddingsListModels(this, options));
|
|
26
|
+
}
|
|
17
27
|
}
|
|
18
28
|
//# sourceMappingURL=embeddings.js.map
|
package/esm/sdk/models.d.ts
CHANGED
|
@@ -10,13 +10,6 @@ export declare class Models extends ClientSDK {
|
|
|
10
10
|
* List all models and their properties
|
|
11
11
|
*/
|
|
12
12
|
list(request?: operations.GetModelsRequest | undefined, options?: RequestOptions): Promise<models.ModelsListResponse>;
|
|
13
|
-
/**
|
|
14
|
-
* List all embeddings models
|
|
15
|
-
*
|
|
16
|
-
* @remarks
|
|
17
|
-
* Returns a list of all available embeddings models and their properties
|
|
18
|
-
*/
|
|
19
|
-
listEmbeddings(options?: RequestOptions): Promise<models.ModelsListResponse>;
|
|
20
13
|
/**
|
|
21
14
|
* List models filtered by user provider preferences
|
|
22
15
|
*/
|
package/esm/sdk/models.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { modelsCount } from "../funcs/modelsCount.js";
|
|
5
5
|
import { modelsList } from "../funcs/modelsList.js";
|
|
6
|
-
import { modelsListEmbeddings } from "../funcs/modelsListEmbeddings.js";
|
|
7
6
|
import { modelsListForUser } from "../funcs/modelsListForUser.js";
|
|
8
7
|
import { ClientSDK } from "../lib/sdks.js";
|
|
9
8
|
import { unwrapAsync } from "../types/fp.js";
|
|
@@ -20,15 +19,6 @@ export class Models extends ClientSDK {
|
|
|
20
19
|
async list(request, options) {
|
|
21
20
|
return unwrapAsync(modelsList(this, request, options));
|
|
22
21
|
}
|
|
23
|
-
/**
|
|
24
|
-
* List all embeddings models
|
|
25
|
-
*
|
|
26
|
-
* @remarks
|
|
27
|
-
* Returns a list of all available embeddings models and their properties
|
|
28
|
-
*/
|
|
29
|
-
async listEmbeddings(options) {
|
|
30
|
-
return unwrapAsync(modelsListEmbeddings(this, options));
|
|
31
|
-
}
|
|
32
22
|
/**
|
|
33
23
|
* List models filtered by user provider preferences
|
|
34
24
|
*/
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"author": "OpenRouter",
|
|
5
5
|
"description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 300+ language models through a unified API.",
|
|
6
6
|
"keywords": [
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { InvalidateQueryFilters, QueryClient, QueryFunctionContext, QueryKey, UseQueryResult, UseSuspenseQueryResult } from "@tanstack/react-query";
|
|
2
|
-
import { OpenRouterCore } from "../core.js";
|
|
3
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
4
|
-
import * as models from "../models/index.js";
|
|
5
|
-
import { QueryHookOptions, SuspenseQueryHookOptions } from "./_types.js";
|
|
6
|
-
export type ModelsListEmbeddingsQueryData = models.ModelsListResponse;
|
|
7
|
-
/**
|
|
8
|
-
* List all embeddings models
|
|
9
|
-
*
|
|
10
|
-
* @remarks
|
|
11
|
-
* Returns a list of all available embeddings models and their properties
|
|
12
|
-
*/
|
|
13
|
-
export declare function useModelsListEmbeddings(options?: QueryHookOptions<ModelsListEmbeddingsQueryData>): UseQueryResult<ModelsListEmbeddingsQueryData, Error>;
|
|
14
|
-
/**
|
|
15
|
-
* List all embeddings models
|
|
16
|
-
*
|
|
17
|
-
* @remarks
|
|
18
|
-
* Returns a list of all available embeddings models and their properties
|
|
19
|
-
*/
|
|
20
|
-
export declare function useModelsListEmbeddingsSuspense(options?: SuspenseQueryHookOptions<ModelsListEmbeddingsQueryData>): UseSuspenseQueryResult<ModelsListEmbeddingsQueryData, Error>;
|
|
21
|
-
export declare function prefetchModelsListEmbeddings(queryClient: QueryClient, client$: OpenRouterCore): Promise<void>;
|
|
22
|
-
export declare function setModelsListEmbeddingsData(client: QueryClient, data: ModelsListEmbeddingsQueryData): ModelsListEmbeddingsQueryData | undefined;
|
|
23
|
-
export declare function invalidateAllModelsListEmbeddings(client: QueryClient, filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">): Promise<void>;
|
|
24
|
-
export declare function buildModelsListEmbeddingsQuery(client$: OpenRouterCore, options?: RequestOptions): {
|
|
25
|
-
queryKey: QueryKey;
|
|
26
|
-
queryFn: (context: QueryFunctionContext) => Promise<ModelsListEmbeddingsQueryData>;
|
|
27
|
-
};
|
|
28
|
-
export declare function queryKeyModelsListEmbeddings(): QueryKey;
|
|
29
|
-
//# sourceMappingURL=modelsListEmbeddings.d.ts.map
|