@openrouter/sdk 0.12.24 → 0.12.26
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/sttCreateTranscription.d.ts +1 -1
- package/esm/funcs/sttCreateTranscription.js +1 -1
- package/esm/funcs/ttsCreateSpeech.d.ts +1 -1
- package/esm/funcs/ttsCreateSpeech.js +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/model.d.ts +4 -0
- package/esm/models/model.js +2 -0
- package/esm/models/outputwebsearchcallitem.d.ts +10 -10
- package/esm/models/outputwebsearchcallitem.js +10 -11
- package/esm/models/outputwebsearchservertoolitem.d.ts +61 -5
- package/esm/models/outputwebsearchservertoolitem.js +59 -5
- package/esm/sdk/stt.d.ts +1 -1
- package/esm/sdk/stt.js +1 -1
- package/esm/sdk/tts.d.ts +1 -1
- package/esm/sdk/tts.js +1 -1
- package/jsr.json +1 -1
- package/package.json +5 -5
|
@@ -13,7 +13,7 @@ import { Result } from "../types/fp.js";
|
|
|
13
13
|
* Create transcription
|
|
14
14
|
*
|
|
15
15
|
* @remarks
|
|
16
|
-
* Transcribes audio into text
|
|
16
|
+
* Transcribes audio into text. Accepts base64-encoded audio input and returns the transcribed text.
|
|
17
17
|
*/
|
|
18
18
|
export declare function sttCreateTranscription(client: OpenRouterCore, request: operations.CreateAudioTranscriptionsRequest, options?: RequestOptions): APIPromise<Result<models.STTResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.PaymentRequiredResponseError | errors.NotFoundResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | errors.BadGatewayResponseError | errors.ServiceUnavailableResponseError | errors.EdgeNetworkTimeoutResponseError | errors.ProviderOverloadedResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
19
19
|
//# sourceMappingURL=sttCreateTranscription.d.ts.map
|
|
@@ -16,7 +16,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
16
16
|
* Create transcription
|
|
17
17
|
*
|
|
18
18
|
* @remarks
|
|
19
|
-
* Transcribes audio into text
|
|
19
|
+
* Transcribes audio into text. Accepts base64-encoded audio input and returns the transcribed text.
|
|
20
20
|
*/
|
|
21
21
|
export function sttCreateTranscription(client, request, options) {
|
|
22
22
|
return new APIPromise($do(client, request, options));
|
|
@@ -12,7 +12,7 @@ import { Result } from "../types/fp.js";
|
|
|
12
12
|
* Create speech
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
|
-
* Synthesizes audio from the input text
|
|
15
|
+
* Synthesizes audio from the input text. Returns a raw audio bytestream in the requested format (e.g. mp3, pcm, wav).
|
|
16
16
|
*/
|
|
17
17
|
export declare function ttsCreateSpeech(client: OpenRouterCore, request: operations.CreateAudioSpeechRequest, options?: RequestOptions): APIPromise<Result<ReadableStream<Uint8Array>, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.PaymentRequiredResponseError | errors.NotFoundResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | errors.BadGatewayResponseError | errors.ServiceUnavailableResponseError | errors.EdgeNetworkTimeoutResponseError | errors.ProviderOverloadedResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
18
|
//# sourceMappingURL=ttsCreateSpeech.d.ts.map
|
|
@@ -16,7 +16,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
16
16
|
* Create speech
|
|
17
17
|
*
|
|
18
18
|
* @remarks
|
|
19
|
-
* Synthesizes audio from the input text
|
|
19
|
+
* Synthesizes audio from the input text. Returns a raw audio bytestream in the requested format (e.g. mp3, pcm, wav).
|
|
20
20
|
*/
|
|
21
21
|
export function ttsCreateSpeech(client, request, options) {
|
|
22
22
|
return new APIPromise($do(client, request, options));
|
package/esm/lib/config.d.ts
CHANGED
|
@@ -49,8 +49,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
49
49
|
export declare const SDK_METADATA: {
|
|
50
50
|
readonly language: "typescript";
|
|
51
51
|
readonly openapiDocVersion: "1.0.0";
|
|
52
|
-
readonly sdkVersion: "0.12.
|
|
52
|
+
readonly sdkVersion: "0.12.26";
|
|
53
53
|
readonly genVersion: "2.879.1";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.12.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.12.26 2.879.1 1.0.0 @openrouter/sdk";
|
|
55
55
|
};
|
|
56
56
|
//# sourceMappingURL=config.d.ts.map
|
package/esm/lib/config.js
CHANGED
|
@@ -26,8 +26,8 @@ export function serverURLFromOptions(options) {
|
|
|
26
26
|
export const SDK_METADATA = {
|
|
27
27
|
language: "typescript",
|
|
28
28
|
openapiDocVersion: "1.0.0",
|
|
29
|
-
sdkVersion: "0.12.
|
|
29
|
+
sdkVersion: "0.12.26",
|
|
30
30
|
genVersion: "2.879.1",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 0.12.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 0.12.26 2.879.1 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
package/esm/models/model.d.ts
CHANGED
|
@@ -72,6 +72,10 @@ export type Model = {
|
|
|
72
72
|
* List of supported parameters for this model
|
|
73
73
|
*/
|
|
74
74
|
supportedParameters: Array<Parameter>;
|
|
75
|
+
/**
|
|
76
|
+
* List of supported voice identifiers for TTS models. Null for non-TTS models.
|
|
77
|
+
*/
|
|
78
|
+
supportedVoices: Array<string> | null;
|
|
75
79
|
/**
|
|
76
80
|
* Information about the top provider for this model
|
|
77
81
|
*/
|
package/esm/models/model.js
CHANGED
|
@@ -29,6 +29,7 @@ export const Model$inboundSchema = z.object({
|
|
|
29
29
|
per_request_limits: z.nullable(PerRequestLimits$inboundSchema),
|
|
30
30
|
pricing: PublicPricing$inboundSchema,
|
|
31
31
|
supported_parameters: z.array(Parameter$inboundSchema),
|
|
32
|
+
supported_voices: z.nullable(z.array(z.string())),
|
|
32
33
|
top_provider: TopProviderInfo$inboundSchema,
|
|
33
34
|
}).transform((v) => {
|
|
34
35
|
return remap$(v, {
|
|
@@ -40,6 +41,7 @@ export const Model$inboundSchema = z.object({
|
|
|
40
41
|
"knowledge_cutoff": "knowledgeCutoff",
|
|
41
42
|
"per_request_limits": "perRequestLimits",
|
|
42
43
|
"supported_parameters": "supportedParameters",
|
|
44
|
+
"supported_voices": "supportedVoices",
|
|
43
45
|
"top_provider": "topProvider",
|
|
44
46
|
});
|
|
45
47
|
});
|
|
@@ -14,19 +14,19 @@ export type ActionOpenPage = {
|
|
|
14
14
|
type: "open_page";
|
|
15
15
|
url?: string | null | undefined;
|
|
16
16
|
};
|
|
17
|
-
export type
|
|
17
|
+
export type OutputWebSearchCallItemActionSearch = {
|
|
18
18
|
queries?: Array<string> | undefined;
|
|
19
19
|
query: string;
|
|
20
20
|
sources?: Array<WebSearchSource> | undefined;
|
|
21
21
|
type: "search";
|
|
22
22
|
};
|
|
23
|
-
export type Action =
|
|
23
|
+
export type Action = OutputWebSearchCallItemActionSearch | ActionOpenPage | ActionFindInPage | discriminatedUnionTypes.Unknown<"type">;
|
|
24
24
|
export declare const TypeWebSearchCall: {
|
|
25
25
|
readonly WebSearchCall: "web_search_call";
|
|
26
26
|
};
|
|
27
27
|
export type TypeWebSearchCall = ClosedEnum<typeof TypeWebSearchCall>;
|
|
28
28
|
export type OutputWebSearchCallItem = {
|
|
29
|
-
action:
|
|
29
|
+
action: OutputWebSearchCallItemActionSearch | ActionOpenPage | ActionFindInPage | discriminatedUnionTypes.Unknown<"type">;
|
|
30
30
|
id: string;
|
|
31
31
|
status: WebSearchStatus;
|
|
32
32
|
type: TypeWebSearchCall;
|
|
@@ -55,22 +55,22 @@ export declare const ActionOpenPage$outboundSchema: z.ZodType<ActionOpenPage$Out
|
|
|
55
55
|
export declare function actionOpenPageToJSON(actionOpenPage: ActionOpenPage): string;
|
|
56
56
|
export declare function actionOpenPageFromJSON(jsonString: string): SafeParseResult<ActionOpenPage, SDKValidationError>;
|
|
57
57
|
/** @internal */
|
|
58
|
-
export declare const
|
|
58
|
+
export declare const OutputWebSearchCallItemActionSearch$inboundSchema: z.ZodType<OutputWebSearchCallItemActionSearch, unknown>;
|
|
59
59
|
/** @internal */
|
|
60
|
-
export type
|
|
60
|
+
export type OutputWebSearchCallItemActionSearch$Outbound = {
|
|
61
61
|
queries?: Array<string> | undefined;
|
|
62
62
|
query: string;
|
|
63
63
|
sources?: Array<WebSearchSource$Outbound> | undefined;
|
|
64
64
|
type: "search";
|
|
65
65
|
};
|
|
66
66
|
/** @internal */
|
|
67
|
-
export declare const
|
|
68
|
-
export declare function
|
|
69
|
-
export declare function
|
|
67
|
+
export declare const OutputWebSearchCallItemActionSearch$outboundSchema: z.ZodType<OutputWebSearchCallItemActionSearch$Outbound, OutputWebSearchCallItemActionSearch>;
|
|
68
|
+
export declare function outputWebSearchCallItemActionSearchToJSON(outputWebSearchCallItemActionSearch: OutputWebSearchCallItemActionSearch): string;
|
|
69
|
+
export declare function outputWebSearchCallItemActionSearchFromJSON(jsonString: string): SafeParseResult<OutputWebSearchCallItemActionSearch, SDKValidationError>;
|
|
70
70
|
/** @internal */
|
|
71
71
|
export declare const Action$inboundSchema: z.ZodType<Action, unknown>;
|
|
72
72
|
/** @internal */
|
|
73
|
-
export type Action$Outbound =
|
|
73
|
+
export type Action$Outbound = OutputWebSearchCallItemActionSearch$Outbound | ActionOpenPage$Outbound | ActionFindInPage$Outbound;
|
|
74
74
|
/** @internal */
|
|
75
75
|
export declare const Action$outboundSchema: z.ZodType<Action$Outbound, Action>;
|
|
76
76
|
export declare function actionToJSON(action: Action): string;
|
|
@@ -83,7 +83,7 @@ export declare const TypeWebSearchCall$outboundSchema: z.ZodEnum<typeof TypeWebS
|
|
|
83
83
|
export declare const OutputWebSearchCallItem$inboundSchema: z.ZodType<OutputWebSearchCallItem, unknown>;
|
|
84
84
|
/** @internal */
|
|
85
85
|
export type OutputWebSearchCallItem$Outbound = {
|
|
86
|
-
action:
|
|
86
|
+
action: OutputWebSearchCallItemActionSearch$Outbound | ActionOpenPage$Outbound | ActionFindInPage$Outbound;
|
|
87
87
|
id: string;
|
|
88
88
|
status: string;
|
|
89
89
|
type: string;
|
|
@@ -45,36 +45,35 @@ export function actionOpenPageFromJSON(jsonString) {
|
|
|
45
45
|
return safeParse(jsonString, (x) => ActionOpenPage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ActionOpenPage' from JSON`);
|
|
46
46
|
}
|
|
47
47
|
/** @internal */
|
|
48
|
-
export const
|
|
49
|
-
.object({
|
|
48
|
+
export const OutputWebSearchCallItemActionSearch$inboundSchema = z.object({
|
|
50
49
|
queries: z.array(z.string()).optional(),
|
|
51
50
|
query: z.string(),
|
|
52
51
|
sources: z.array(WebSearchSource$inboundSchema).optional(),
|
|
53
52
|
type: z.literal("search"),
|
|
54
53
|
});
|
|
55
54
|
/** @internal */
|
|
56
|
-
export const
|
|
55
|
+
export const OutputWebSearchCallItemActionSearch$outboundSchema = z.object({
|
|
57
56
|
queries: z.array(z.string()).optional(),
|
|
58
57
|
query: z.string(),
|
|
59
58
|
sources: z.array(WebSearchSource$outboundSchema).optional(),
|
|
60
59
|
type: z.literal("search"),
|
|
61
60
|
});
|
|
62
|
-
export function
|
|
63
|
-
return JSON.stringify(
|
|
61
|
+
export function outputWebSearchCallItemActionSearchToJSON(outputWebSearchCallItemActionSearch) {
|
|
62
|
+
return JSON.stringify(OutputWebSearchCallItemActionSearch$outboundSchema.parse(outputWebSearchCallItemActionSearch));
|
|
64
63
|
}
|
|
65
|
-
export function
|
|
66
|
-
return safeParse(jsonString, (x) =>
|
|
64
|
+
export function outputWebSearchCallItemActionSearchFromJSON(jsonString) {
|
|
65
|
+
return safeParse(jsonString, (x) => OutputWebSearchCallItemActionSearch$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OutputWebSearchCallItemActionSearch' from JSON`);
|
|
67
66
|
}
|
|
68
67
|
/** @internal */
|
|
69
68
|
export const Action$inboundSchema = discriminatedUnion("type", {
|
|
70
|
-
search: z.lazy(() =>
|
|
69
|
+
search: z.lazy(() => OutputWebSearchCallItemActionSearch$inboundSchema),
|
|
71
70
|
open_page: z.lazy(() => ActionOpenPage$inboundSchema),
|
|
72
71
|
find_in_page: z.lazy(() => ActionFindInPage$inboundSchema),
|
|
73
72
|
});
|
|
74
73
|
/** @internal */
|
|
75
74
|
export const Action$outboundSchema = z
|
|
76
75
|
.union([
|
|
77
|
-
z.lazy(() =>
|
|
76
|
+
z.lazy(() => OutputWebSearchCallItemActionSearch$outboundSchema),
|
|
78
77
|
z.lazy(() => ActionOpenPage$outboundSchema),
|
|
79
78
|
z.lazy(() => ActionFindInPage$outboundSchema),
|
|
80
79
|
]);
|
|
@@ -91,7 +90,7 @@ export const TypeWebSearchCall$outboundSchema = TypeWebSearchCall$inboundSchema;
|
|
|
91
90
|
/** @internal */
|
|
92
91
|
export const OutputWebSearchCallItem$inboundSchema = z.object({
|
|
93
92
|
action: discriminatedUnion("type", {
|
|
94
|
-
search: z.lazy(() =>
|
|
93
|
+
search: z.lazy(() => OutputWebSearchCallItemActionSearch$inboundSchema),
|
|
95
94
|
open_page: z.lazy(() => ActionOpenPage$inboundSchema),
|
|
96
95
|
find_in_page: z.lazy(() => ActionFindInPage$inboundSchema),
|
|
97
96
|
}),
|
|
@@ -102,7 +101,7 @@ export const OutputWebSearchCallItem$inboundSchema = z.object({
|
|
|
102
101
|
/** @internal */
|
|
103
102
|
export const OutputWebSearchCallItem$outboundSchema = z.object({
|
|
104
103
|
action: z.union([
|
|
105
|
-
z.lazy(() =>
|
|
104
|
+
z.lazy(() => OutputWebSearchCallItemActionSearch$outboundSchema),
|
|
106
105
|
z.lazy(() => ActionOpenPage$outboundSchema),
|
|
107
106
|
z.lazy(() => ActionFindInPage$outboundSchema),
|
|
108
107
|
]),
|
|
@@ -3,26 +3,82 @@ import { ClosedEnum } from "../types/enums.js";
|
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
5
|
import { ToolCallStatus } from "./toolcallstatus.js";
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const OutputWebSearchServerToolItemTypeURL: {
|
|
7
|
+
readonly Url: "url";
|
|
8
|
+
};
|
|
9
|
+
export type OutputWebSearchServerToolItemTypeURL = ClosedEnum<typeof OutputWebSearchServerToolItemTypeURL>;
|
|
10
|
+
export type Source = {
|
|
11
|
+
type: OutputWebSearchServerToolItemTypeURL;
|
|
12
|
+
url: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const OutputWebSearchServerToolItemTypeSearch: {
|
|
15
|
+
readonly Search: "search";
|
|
16
|
+
};
|
|
17
|
+
export type OutputWebSearchServerToolItemTypeSearch = ClosedEnum<typeof OutputWebSearchServerToolItemTypeSearch>;
|
|
18
|
+
/**
|
|
19
|
+
* The search action performed, matching OpenAI web_search_call.action shape. Includes the query the model issued and optional source URLs returned by the search provider.
|
|
20
|
+
*/
|
|
21
|
+
export type OutputWebSearchServerToolItemAction = {
|
|
22
|
+
query: string;
|
|
23
|
+
sources?: Array<Source> | undefined;
|
|
24
|
+
type: OutputWebSearchServerToolItemTypeSearch;
|
|
25
|
+
};
|
|
26
|
+
export declare const OutputWebSearchServerToolItemTypeOpenrouterWebSearch: {
|
|
7
27
|
readonly OpenrouterWebSearch: "openrouter:web_search";
|
|
8
28
|
};
|
|
9
|
-
export type
|
|
29
|
+
export type OutputWebSearchServerToolItemTypeOpenrouterWebSearch = ClosedEnum<typeof OutputWebSearchServerToolItemTypeOpenrouterWebSearch>;
|
|
10
30
|
/**
|
|
11
31
|
* An openrouter:web_search server tool output item
|
|
12
32
|
*/
|
|
13
33
|
export type OutputWebSearchServerToolItem = {
|
|
34
|
+
/**
|
|
35
|
+
* The search action performed, matching OpenAI web_search_call.action shape. Includes the query the model issued and optional source URLs returned by the search provider.
|
|
36
|
+
*/
|
|
37
|
+
action?: OutputWebSearchServerToolItemAction | undefined;
|
|
14
38
|
id?: string | undefined;
|
|
15
39
|
status: ToolCallStatus;
|
|
16
|
-
type:
|
|
40
|
+
type: OutputWebSearchServerToolItemTypeOpenrouterWebSearch;
|
|
41
|
+
};
|
|
42
|
+
/** @internal */
|
|
43
|
+
export declare const OutputWebSearchServerToolItemTypeURL$inboundSchema: z.ZodEnum<typeof OutputWebSearchServerToolItemTypeURL>;
|
|
44
|
+
/** @internal */
|
|
45
|
+
export declare const OutputWebSearchServerToolItemTypeURL$outboundSchema: z.ZodEnum<typeof OutputWebSearchServerToolItemTypeURL>;
|
|
46
|
+
/** @internal */
|
|
47
|
+
export declare const Source$inboundSchema: z.ZodType<Source, unknown>;
|
|
48
|
+
/** @internal */
|
|
49
|
+
export type Source$Outbound = {
|
|
50
|
+
type: string;
|
|
51
|
+
url: string;
|
|
52
|
+
};
|
|
53
|
+
/** @internal */
|
|
54
|
+
export declare const Source$outboundSchema: z.ZodType<Source$Outbound, Source>;
|
|
55
|
+
export declare function sourceToJSON(source: Source): string;
|
|
56
|
+
export declare function sourceFromJSON(jsonString: string): SafeParseResult<Source, SDKValidationError>;
|
|
57
|
+
/** @internal */
|
|
58
|
+
export declare const OutputWebSearchServerToolItemTypeSearch$inboundSchema: z.ZodEnum<typeof OutputWebSearchServerToolItemTypeSearch>;
|
|
59
|
+
/** @internal */
|
|
60
|
+
export declare const OutputWebSearchServerToolItemTypeSearch$outboundSchema: z.ZodEnum<typeof OutputWebSearchServerToolItemTypeSearch>;
|
|
61
|
+
/** @internal */
|
|
62
|
+
export declare const OutputWebSearchServerToolItemAction$inboundSchema: z.ZodType<OutputWebSearchServerToolItemAction, unknown>;
|
|
63
|
+
/** @internal */
|
|
64
|
+
export type OutputWebSearchServerToolItemAction$Outbound = {
|
|
65
|
+
query: string;
|
|
66
|
+
sources?: Array<Source$Outbound> | undefined;
|
|
67
|
+
type: string;
|
|
17
68
|
};
|
|
18
69
|
/** @internal */
|
|
19
|
-
export declare const
|
|
70
|
+
export declare const OutputWebSearchServerToolItemAction$outboundSchema: z.ZodType<OutputWebSearchServerToolItemAction$Outbound, OutputWebSearchServerToolItemAction>;
|
|
71
|
+
export declare function outputWebSearchServerToolItemActionToJSON(outputWebSearchServerToolItemAction: OutputWebSearchServerToolItemAction): string;
|
|
72
|
+
export declare function outputWebSearchServerToolItemActionFromJSON(jsonString: string): SafeParseResult<OutputWebSearchServerToolItemAction, SDKValidationError>;
|
|
73
|
+
/** @internal */
|
|
74
|
+
export declare const OutputWebSearchServerToolItemTypeOpenrouterWebSearch$inboundSchema: z.ZodEnum<typeof OutputWebSearchServerToolItemTypeOpenrouterWebSearch>;
|
|
20
75
|
/** @internal */
|
|
21
|
-
export declare const
|
|
76
|
+
export declare const OutputWebSearchServerToolItemTypeOpenrouterWebSearch$outboundSchema: z.ZodEnum<typeof OutputWebSearchServerToolItemTypeOpenrouterWebSearch>;
|
|
22
77
|
/** @internal */
|
|
23
78
|
export declare const OutputWebSearchServerToolItem$inboundSchema: z.ZodType<OutputWebSearchServerToolItem, unknown>;
|
|
24
79
|
/** @internal */
|
|
25
80
|
export type OutputWebSearchServerToolItem$Outbound = {
|
|
81
|
+
action?: OutputWebSearchServerToolItemAction$Outbound | undefined;
|
|
26
82
|
id?: string | undefined;
|
|
27
83
|
status: string;
|
|
28
84
|
type: string;
|
|
@@ -5,24 +5,78 @@
|
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
7
|
import { ToolCallStatus$inboundSchema, ToolCallStatus$outboundSchema, } from "./toolcallstatus.js";
|
|
8
|
-
export const
|
|
8
|
+
export const OutputWebSearchServerToolItemTypeURL = {
|
|
9
|
+
Url: "url",
|
|
10
|
+
};
|
|
11
|
+
export const OutputWebSearchServerToolItemTypeSearch = {
|
|
12
|
+
Search: "search",
|
|
13
|
+
};
|
|
14
|
+
export const OutputWebSearchServerToolItemTypeOpenrouterWebSearch = {
|
|
9
15
|
OpenrouterWebSearch: "openrouter:web_search",
|
|
10
16
|
};
|
|
11
17
|
/** @internal */
|
|
12
|
-
export const
|
|
18
|
+
export const OutputWebSearchServerToolItemTypeURL$inboundSchema = z.enum(OutputWebSearchServerToolItemTypeURL);
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const OutputWebSearchServerToolItemTypeURL$outboundSchema = OutputWebSearchServerToolItemTypeURL$inboundSchema;
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const Source$inboundSchema = z.object({
|
|
23
|
+
type: OutputWebSearchServerToolItemTypeURL$inboundSchema,
|
|
24
|
+
url: z.string(),
|
|
25
|
+
});
|
|
26
|
+
/** @internal */
|
|
27
|
+
export const Source$outboundSchema = z
|
|
28
|
+
.object({
|
|
29
|
+
type: OutputWebSearchServerToolItemTypeURL$outboundSchema,
|
|
30
|
+
url: z.string(),
|
|
31
|
+
});
|
|
32
|
+
export function sourceToJSON(source) {
|
|
33
|
+
return JSON.stringify(Source$outboundSchema.parse(source));
|
|
34
|
+
}
|
|
35
|
+
export function sourceFromJSON(jsonString) {
|
|
36
|
+
return safeParse(jsonString, (x) => Source$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Source' from JSON`);
|
|
37
|
+
}
|
|
38
|
+
/** @internal */
|
|
39
|
+
export const OutputWebSearchServerToolItemTypeSearch$inboundSchema = z.enum(OutputWebSearchServerToolItemTypeSearch);
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const OutputWebSearchServerToolItemTypeSearch$outboundSchema = OutputWebSearchServerToolItemTypeSearch$inboundSchema;
|
|
42
|
+
/** @internal */
|
|
43
|
+
export const OutputWebSearchServerToolItemAction$inboundSchema = z.object({
|
|
44
|
+
query: z.string(),
|
|
45
|
+
sources: z.array(z.lazy(() => Source$inboundSchema)).optional(),
|
|
46
|
+
type: OutputWebSearchServerToolItemTypeSearch$inboundSchema,
|
|
47
|
+
});
|
|
48
|
+
/** @internal */
|
|
49
|
+
export const OutputWebSearchServerToolItemAction$outboundSchema = z.object({
|
|
50
|
+
query: z.string(),
|
|
51
|
+
sources: z.array(z.lazy(() => Source$outboundSchema)).optional(),
|
|
52
|
+
type: OutputWebSearchServerToolItemTypeSearch$outboundSchema,
|
|
53
|
+
});
|
|
54
|
+
export function outputWebSearchServerToolItemActionToJSON(outputWebSearchServerToolItemAction) {
|
|
55
|
+
return JSON.stringify(OutputWebSearchServerToolItemAction$outboundSchema.parse(outputWebSearchServerToolItemAction));
|
|
56
|
+
}
|
|
57
|
+
export function outputWebSearchServerToolItemActionFromJSON(jsonString) {
|
|
58
|
+
return safeParse(jsonString, (x) => OutputWebSearchServerToolItemAction$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OutputWebSearchServerToolItemAction' from JSON`);
|
|
59
|
+
}
|
|
60
|
+
/** @internal */
|
|
61
|
+
export const OutputWebSearchServerToolItemTypeOpenrouterWebSearch$inboundSchema = z
|
|
62
|
+
.enum(OutputWebSearchServerToolItemTypeOpenrouterWebSearch);
|
|
13
63
|
/** @internal */
|
|
14
|
-
export const
|
|
64
|
+
export const OutputWebSearchServerToolItemTypeOpenrouterWebSearch$outboundSchema = OutputWebSearchServerToolItemTypeOpenrouterWebSearch$inboundSchema;
|
|
15
65
|
/** @internal */
|
|
16
66
|
export const OutputWebSearchServerToolItem$inboundSchema = z.object({
|
|
67
|
+
action: z.lazy(() => OutputWebSearchServerToolItemAction$inboundSchema)
|
|
68
|
+
.optional(),
|
|
17
69
|
id: z.string().optional(),
|
|
18
70
|
status: ToolCallStatus$inboundSchema,
|
|
19
|
-
type:
|
|
71
|
+
type: OutputWebSearchServerToolItemTypeOpenrouterWebSearch$inboundSchema,
|
|
20
72
|
});
|
|
21
73
|
/** @internal */
|
|
22
74
|
export const OutputWebSearchServerToolItem$outboundSchema = z.object({
|
|
75
|
+
action: z.lazy(() => OutputWebSearchServerToolItemAction$outboundSchema)
|
|
76
|
+
.optional(),
|
|
23
77
|
id: z.string().optional(),
|
|
24
78
|
status: ToolCallStatus$outboundSchema,
|
|
25
|
-
type:
|
|
79
|
+
type: OutputWebSearchServerToolItemTypeOpenrouterWebSearch$outboundSchema,
|
|
26
80
|
});
|
|
27
81
|
export function outputWebSearchServerToolItemToJSON(outputWebSearchServerToolItem) {
|
|
28
82
|
return JSON.stringify(OutputWebSearchServerToolItem$outboundSchema.parse(outputWebSearchServerToolItem));
|
package/esm/sdk/stt.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare class Stt extends ClientSDK {
|
|
|
6
6
|
* Create transcription
|
|
7
7
|
*
|
|
8
8
|
* @remarks
|
|
9
|
-
* Transcribes audio into text
|
|
9
|
+
* Transcribes audio into text. Accepts base64-encoded audio input and returns the transcribed text.
|
|
10
10
|
*/
|
|
11
11
|
createTranscription(request: operations.CreateAudioTranscriptionsRequest, options?: RequestOptions): Promise<models.STTResponse>;
|
|
12
12
|
}
|
package/esm/sdk/stt.js
CHANGED
|
@@ -10,7 +10,7 @@ export class Stt extends ClientSDK {
|
|
|
10
10
|
* Create transcription
|
|
11
11
|
*
|
|
12
12
|
* @remarks
|
|
13
|
-
* Transcribes audio into text
|
|
13
|
+
* Transcribes audio into text. Accepts base64-encoded audio input and returns the transcribed text.
|
|
14
14
|
*/
|
|
15
15
|
async createTranscription(request, options) {
|
|
16
16
|
return unwrapAsync(sttCreateTranscription(this, request, options));
|
package/esm/sdk/tts.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare class Tts extends ClientSDK {
|
|
|
5
5
|
* Create speech
|
|
6
6
|
*
|
|
7
7
|
* @remarks
|
|
8
|
-
* Synthesizes audio from the input text
|
|
8
|
+
* Synthesizes audio from the input text. Returns a raw audio bytestream in the requested format (e.g. mp3, pcm, wav).
|
|
9
9
|
*/
|
|
10
10
|
createSpeech(request: operations.CreateAudioSpeechRequest, options?: RequestOptions): Promise<ReadableStream<Uint8Array>>;
|
|
11
11
|
}
|
package/esm/sdk/tts.js
CHANGED
|
@@ -10,7 +10,7 @@ export class Tts extends ClientSDK {
|
|
|
10
10
|
* Create speech
|
|
11
11
|
*
|
|
12
12
|
* @remarks
|
|
13
|
-
* Synthesizes audio from the input text
|
|
13
|
+
* Synthesizes audio from the input text. Returns a raw audio bytestream in the requested format (e.g. mp3, pcm, wav).
|
|
14
14
|
*/
|
|
15
15
|
async createSpeech(request, options) {
|
|
16
16
|
return unwrapAsync(ttsCreateSpeech(this, request, options));
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.26",
|
|
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": [
|
|
@@ -69,15 +69,15 @@
|
|
|
69
69
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
70
70
|
"build": "tsc",
|
|
71
71
|
"prepublishOnly": "npm run build",
|
|
72
|
-
"prepare": "npm run build",
|
|
73
72
|
"test:watch": "vitest --watch --project unit",
|
|
73
|
+
"typecheck": "tsc --noEmit",
|
|
74
|
+
"typecheck:transit": "exit 0",
|
|
74
75
|
"compile": "tsc",
|
|
75
76
|
"postinstall": "node scripts/check-types.js || true",
|
|
77
|
+
"prepare": "npm run build",
|
|
76
78
|
"test": "vitest --run --project unit",
|
|
77
79
|
"test:e2e": "vitest --run --project e2e",
|
|
78
|
-
"test:transit": "exit 0"
|
|
79
|
-
"typecheck": "tsc --noEmit",
|
|
80
|
-
"typecheck:transit": "exit 0"
|
|
80
|
+
"test:transit": "exit 0"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {},
|
|
83
83
|
"devDependencies": {
|