@openrouter/sdk 0.0.0-beta.33 → 0.0.0-beta.38
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/FUNCTIONS.md +3 -3
- package/REACT_QUERY.md +4 -4
- package/README.md +9 -9
- package/dist/commonjs/funcs/betaResponsesSend.d.ts +26 -0
- package/dist/commonjs/funcs/betaResponsesSend.d.ts.map +1 -0
- package/dist/commonjs/funcs/{betaResponsesSendRequest.js → betaResponsesSend.js} +5 -13
- package/dist/commonjs/funcs/betaResponsesSend.js.map +1 -0
- package/dist/commonjs/funcs/chatSend.d.ts +3 -13
- package/dist/commonjs/funcs/chatSend.d.ts.map +1 -1
- package/dist/commonjs/funcs/chatSend.js +1 -8
- package/dist/commonjs/funcs/chatSend.js.map +1 -1
- package/dist/commonjs/funcs/modelsList.d.ts +1 -7
- package/dist/commonjs/funcs/modelsList.d.ts.map +1 -1
- package/dist/commonjs/funcs/modelsList.js +1 -8
- package/dist/commonjs/funcs/modelsList.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/models/createapikeydata.d.ts +120 -0
- package/dist/commonjs/models/createapikeydata.d.ts.map +1 -0
- package/dist/commonjs/models/createapikeydata.js +134 -0
- package/dist/commonjs/models/createapikeydata.js.map +1 -0
- package/dist/commonjs/models/endpointslist.d.ts +8 -8
- package/dist/commonjs/models/endpointslist.d.ts.map +1 -1
- package/dist/commonjs/models/endpointslist.js +13 -13
- package/dist/commonjs/models/endpointslist.js.map +1 -1
- package/dist/commonjs/models/getapikeydata.d.ts +120 -0
- package/dist/commonjs/models/getapikeydata.d.ts.map +1 -0
- package/dist/commonjs/models/getapikeydata.js +134 -0
- package/dist/commonjs/models/getapikeydata.js.map +1 -0
- package/dist/commonjs/models/index.d.ts +5 -4
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +5 -4
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/keyinfo.d.ts +8 -8
- package/dist/commonjs/models/listapikeysdata.d.ts +117 -0
- package/dist/commonjs/models/listapikeysdata.d.ts.map +1 -0
- package/dist/commonjs/models/listapikeysdata.js +134 -0
- package/dist/commonjs/models/listapikeysdata.js.map +1 -0
- package/dist/commonjs/models/operations/create.d.ts +43 -68
- package/dist/commonjs/models/operations/create.d.ts.map +1 -1
- package/dist/commonjs/models/operations/create.js +31 -54
- package/dist/commonjs/models/operations/create.js.map +1 -1
- package/dist/commonjs/models/operations/generate.d.ts +103 -103
- package/dist/commonjs/models/operations/generate.d.ts.map +1 -1
- package/dist/commonjs/models/operations/generate.js +142 -153
- package/dist/commonjs/models/operations/generate.js.map +1 -1
- package/dist/commonjs/models/operations/getapikey.d.ts +3 -68
- package/dist/commonjs/models/operations/getapikey.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getapikey.js +4 -55
- package/dist/commonjs/models/operations/getapikey.js.map +1 -1
- package/dist/commonjs/models/operations/listapikeys.d.ts +3 -65
- package/dist/commonjs/models/operations/listapikeys.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listapikeys.js +4 -54
- package/dist/commonjs/models/operations/listapikeys.js.map +1 -1
- package/dist/commonjs/models/operations/sendresponsesrequest.d.ts +1693 -0
- package/dist/commonjs/models/operations/sendresponsesrequest.d.ts.map +1 -1
- package/dist/commonjs/models/operations/sendresponsesrequest.js +1156 -1
- package/dist/commonjs/models/operations/sendresponsesrequest.js.map +1 -1
- package/dist/commonjs/models/operations/update.d.ts +43 -68
- package/dist/commonjs/models/operations/update.d.ts.map +1 -1
- package/dist/commonjs/models/operations/update.js +31 -54
- package/dist/commonjs/models/operations/update.js.map +1 -1
- package/dist/commonjs/models/responsesnonstreamingresponse.d.ts +19 -19
- package/dist/commonjs/models/responsesnonstreamingresponse.d.ts.map +1 -1
- package/dist/commonjs/models/responsesnonstreamingresponse.js +30 -32
- package/dist/commonjs/models/responsesnonstreamingresponse.js.map +1 -1
- package/dist/commonjs/models/responsesoutputitemreasoning.d.ts +3 -0
- package/dist/commonjs/models/responsesoutputitemreasoning.d.ts.map +1 -1
- package/dist/commonjs/models/responsesoutputitemreasoning.js +1 -0
- package/dist/commonjs/models/responsesoutputitemreasoning.js.map +1 -1
- package/dist/commonjs/models/{toolchoice.d.ts → toolchoiceunion.d.ts} +95 -16
- package/dist/commonjs/models/toolchoiceunion.d.ts.map +1 -0
- package/dist/commonjs/models/{toolchoice.js → toolchoiceunion.js} +94 -21
- package/dist/commonjs/models/toolchoiceunion.js.map +1 -0
- package/dist/commonjs/models/updateapikeydata.d.ts +120 -0
- package/dist/commonjs/models/updateapikeydata.d.ts.map +1 -0
- package/dist/commonjs/models/updateapikeydata.js +134 -0
- package/dist/commonjs/models/updateapikeydata.js.map +1 -0
- package/dist/commonjs/react-query/betaResponsesSend.d.ts +23 -0
- package/dist/commonjs/react-query/betaResponsesSend.d.ts.map +1 -0
- package/dist/commonjs/react-query/betaResponsesSend.js +47 -0
- package/dist/commonjs/react-query/betaResponsesSend.js.map +1 -0
- package/dist/commonjs/react-query/chatSend.d.ts +1 -5
- package/dist/commonjs/react-query/chatSend.d.ts.map +1 -1
- package/dist/commonjs/react-query/chatSend.js +0 -3
- package/dist/commonjs/react-query/chatSend.js.map +1 -1
- package/dist/commonjs/react-query/index.d.ts +1 -1
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +1 -1
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/modelsList.d.ts +1 -5
- package/dist/commonjs/react-query/modelsList.d.ts.map +1 -1
- package/dist/commonjs/react-query/modelsList.js +0 -3
- package/dist/commonjs/react-query/modelsList.js.map +1 -1
- package/dist/commonjs/sdk/chat.d.ts +3 -11
- package/dist/commonjs/sdk/chat.d.ts.map +1 -1
- package/dist/commonjs/sdk/chat.js +1 -3
- package/dist/commonjs/sdk/chat.js.map +1 -1
- package/dist/commonjs/sdk/models.d.ts +1 -5
- package/dist/commonjs/sdk/models.d.ts.map +1 -1
- package/dist/commonjs/sdk/models.js +1 -3
- package/dist/commonjs/sdk/models.js.map +1 -1
- package/dist/commonjs/sdk/responses.d.ts +5 -13
- package/dist/commonjs/sdk/responses.d.ts.map +1 -1
- package/dist/commonjs/sdk/responses.js +4 -6
- package/dist/commonjs/sdk/responses.js.map +1 -1
- package/dist/esm/funcs/betaResponsesSend.d.ts +26 -0
- package/dist/esm/funcs/betaResponsesSend.d.ts.map +1 -0
- package/dist/esm/funcs/{betaResponsesSendRequest.js → betaResponsesSend.js} +4 -11
- package/dist/esm/funcs/betaResponsesSend.js.map +1 -0
- package/dist/esm/funcs/chatSend.d.ts +3 -13
- package/dist/esm/funcs/chatSend.d.ts.map +1 -1
- package/dist/esm/funcs/chatSend.js +1 -7
- package/dist/esm/funcs/chatSend.js.map +1 -1
- package/dist/esm/funcs/modelsList.d.ts +1 -7
- package/dist/esm/funcs/modelsList.d.ts.map +1 -1
- package/dist/esm/funcs/modelsList.js +1 -7
- package/dist/esm/funcs/modelsList.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/models/createapikeydata.d.ts +120 -0
- package/dist/esm/models/createapikeydata.d.ts.map +1 -0
- package/dist/esm/models/createapikeydata.js +96 -0
- package/dist/esm/models/createapikeydata.js.map +1 -0
- package/dist/esm/models/endpointslist.d.ts +8 -8
- package/dist/esm/models/endpointslist.d.ts.map +1 -1
- package/dist/esm/models/endpointslist.js +12 -12
- package/dist/esm/models/endpointslist.js.map +1 -1
- package/dist/esm/models/getapikeydata.d.ts +120 -0
- package/dist/esm/models/getapikeydata.d.ts.map +1 -0
- package/dist/esm/models/getapikeydata.js +96 -0
- package/dist/esm/models/getapikeydata.js.map +1 -0
- package/dist/esm/models/index.d.ts +5 -4
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +5 -4
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/keyinfo.d.ts +8 -8
- package/dist/esm/models/listapikeysdata.d.ts +117 -0
- package/dist/esm/models/listapikeysdata.d.ts.map +1 -0
- package/dist/esm/models/listapikeysdata.js +96 -0
- package/dist/esm/models/listapikeysdata.js.map +1 -0
- package/dist/esm/models/operations/create.d.ts +43 -68
- package/dist/esm/models/operations/create.d.ts.map +1 -1
- package/dist/esm/models/operations/create.js +30 -51
- package/dist/esm/models/operations/create.js.map +1 -1
- package/dist/esm/models/operations/generate.d.ts +103 -103
- package/dist/esm/models/operations/generate.d.ts.map +1 -1
- package/dist/esm/models/operations/generate.js +138 -149
- package/dist/esm/models/operations/generate.js.map +1 -1
- package/dist/esm/models/operations/getapikey.d.ts +3 -68
- package/dist/esm/models/operations/getapikey.d.ts.map +1 -1
- package/dist/esm/models/operations/getapikey.js +3 -52
- package/dist/esm/models/operations/getapikey.js.map +1 -1
- package/dist/esm/models/operations/listapikeys.d.ts +3 -65
- package/dist/esm/models/operations/listapikeys.d.ts.map +1 -1
- package/dist/esm/models/operations/listapikeys.js +3 -51
- package/dist/esm/models/operations/listapikeys.js.map +1 -1
- package/dist/esm/models/operations/sendresponsesrequest.d.ts +1693 -0
- package/dist/esm/models/operations/sendresponsesrequest.d.ts.map +1 -1
- package/dist/esm/models/operations/sendresponsesrequest.js +1117 -0
- package/dist/esm/models/operations/sendresponsesrequest.js.map +1 -1
- package/dist/esm/models/operations/update.d.ts +43 -68
- package/dist/esm/models/operations/update.d.ts.map +1 -1
- package/dist/esm/models/operations/update.js +30 -51
- package/dist/esm/models/operations/update.js.map +1 -1
- package/dist/esm/models/responsesnonstreamingresponse.d.ts +19 -19
- package/dist/esm/models/responsesnonstreamingresponse.d.ts.map +1 -1
- package/dist/esm/models/responsesnonstreamingresponse.js +29 -31
- package/dist/esm/models/responsesnonstreamingresponse.js.map +1 -1
- package/dist/esm/models/responsesoutputitemreasoning.d.ts +3 -0
- package/dist/esm/models/responsesoutputitemreasoning.d.ts.map +1 -1
- package/dist/esm/models/responsesoutputitemreasoning.js +1 -0
- package/dist/esm/models/responsesoutputitemreasoning.js.map +1 -1
- package/dist/esm/models/{toolchoice.d.ts → toolchoiceunion.d.ts} +95 -16
- package/dist/esm/models/toolchoiceunion.d.ts.map +1 -0
- package/dist/esm/models/toolchoiceunion.js +164 -0
- package/dist/esm/models/toolchoiceunion.js.map +1 -0
- package/dist/esm/models/updateapikeydata.d.ts +120 -0
- package/dist/esm/models/updateapikeydata.d.ts.map +1 -0
- package/dist/esm/models/updateapikeydata.js +96 -0
- package/dist/esm/models/updateapikeydata.js.map +1 -0
- package/dist/esm/react-query/betaResponsesSend.d.ts +23 -0
- package/dist/esm/react-query/betaResponsesSend.d.ts.map +1 -0
- package/dist/esm/react-query/{betaResponsesSendRequest.js → betaResponsesSend.js} +10 -11
- package/dist/esm/react-query/betaResponsesSend.js.map +1 -0
- package/dist/esm/react-query/chatSend.d.ts +1 -5
- package/dist/esm/react-query/chatSend.d.ts.map +1 -1
- package/dist/esm/react-query/chatSend.js +0 -1
- package/dist/esm/react-query/chatSend.js.map +1 -1
- package/dist/esm/react-query/index.d.ts +1 -1
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +1 -1
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/modelsList.d.ts +1 -5
- package/dist/esm/react-query/modelsList.d.ts.map +1 -1
- package/dist/esm/react-query/modelsList.js +0 -1
- package/dist/esm/react-query/modelsList.js.map +1 -1
- package/dist/esm/sdk/chat.d.ts +3 -11
- package/dist/esm/sdk/chat.d.ts.map +1 -1
- package/dist/esm/sdk/chat.js +0 -1
- package/dist/esm/sdk/chat.js.map +1 -1
- package/dist/esm/sdk/models.d.ts +1 -5
- package/dist/esm/sdk/models.d.ts.map +1 -1
- package/dist/esm/sdk/models.js +0 -1
- package/dist/esm/sdk/models.js.map +1 -1
- package/dist/esm/sdk/responses.d.ts +5 -13
- package/dist/esm/sdk/responses.d.ts.map +1 -1
- package/dist/esm/sdk/responses.js +3 -4
- package/dist/esm/sdk/responses.js.map +1 -1
- package/docs/sdks/apikeys/README.md +4 -0
- package/docs/sdks/responses/README.md +9 -9
- package/examples/{betaResponsesSendRequest.example.ts → betaResponsesSend.example.ts} +2 -2
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/{betaResponsesSendRequest.ts → betaResponsesSend.ts} +17 -22
- package/src/funcs/chatSend.ts +6 -12
- package/src/funcs/modelsList.ts +3 -9
- package/src/lib/config.ts +3 -3
- package/src/models/createapikeydata.ts +222 -0
- package/src/models/endpointslist.ts +14 -18
- package/src/models/getapikeydata.ts +218 -0
- package/src/models/index.ts +5 -4
- package/src/models/keyinfo.ts +8 -8
- package/src/models/listapikeysdata.ts +217 -0
- package/src/models/operations/create.ts +49 -123
- package/src/models/operations/generate.ts +232 -188
- package/src/models/operations/getapikey.ts +5 -124
- package/src/models/operations/listapikeys.ts +5 -122
- package/src/models/operations/sendresponsesrequest.ts +2005 -0
- package/src/models/operations/update.ts +49 -123
- package/src/models/responsesnonstreamingresponse.ts +37 -55
- package/src/models/responsesoutputitemreasoning.ts +1 -0
- package/src/models/{toolchoice.ts → toolchoiceunion.ts} +181 -37
- package/src/models/updateapikeydata.ts +222 -0
- package/src/react-query/{betaResponsesSendRequest.ts → betaResponsesSend.ts} +20 -26
- package/src/react-query/chatSend.ts +2 -4
- package/src/react-query/index.ts +1 -1
- package/src/react-query/modelsList.ts +2 -4
- package/src/sdk/chat.ts +5 -7
- package/src/sdk/models.ts +2 -4
- package/src/sdk/responses.ts +16 -19
- package/dist/commonjs/funcs/betaResponsesSendRequest.d.ts +0 -36
- package/dist/commonjs/funcs/betaResponsesSendRequest.d.ts.map +0 -1
- package/dist/commonjs/funcs/betaResponsesSendRequest.js.map +0 -1
- package/dist/commonjs/models/openairesponsesrequest.d.ts +0 -1704
- package/dist/commonjs/models/openairesponsesrequest.d.ts.map +0 -1
- package/dist/commonjs/models/openairesponsesrequest.js +0 -1210
- package/dist/commonjs/models/openairesponsesrequest.js.map +0 -1
- package/dist/commonjs/models/toolchoice.d.ts.map +0 -1
- package/dist/commonjs/models/toolchoice.js.map +0 -1
- package/dist/commonjs/models/toolchoicefunction.d.ts +0 -57
- package/dist/commonjs/models/toolchoicefunction.d.ts.map +0 -1
- package/dist/commonjs/models/toolchoicefunction.js +0 -89
- package/dist/commonjs/models/toolchoicefunction.js.map +0 -1
- package/dist/commonjs/models/toolchoicetypes.d.ts +0 -33
- package/dist/commonjs/models/toolchoicetypes.d.ts.map +0 -1
- package/dist/commonjs/models/toolchoicetypes.js +0 -70
- package/dist/commonjs/models/toolchoicetypes.js.map +0 -1
- package/dist/commonjs/react-query/betaResponsesSendRequest.d.ts +0 -28
- package/dist/commonjs/react-query/betaResponsesSendRequest.d.ts.map +0 -1
- package/dist/commonjs/react-query/betaResponsesSendRequest.js +0 -50
- package/dist/commonjs/react-query/betaResponsesSendRequest.js.map +0 -1
- package/dist/esm/funcs/betaResponsesSendRequest.d.ts +0 -36
- package/dist/esm/funcs/betaResponsesSendRequest.d.ts.map +0 -1
- package/dist/esm/funcs/betaResponsesSendRequest.js.map +0 -1
- package/dist/esm/models/openairesponsesrequest.d.ts +0 -1704
- package/dist/esm/models/openairesponsesrequest.d.ts.map +0 -1
- package/dist/esm/models/openairesponsesrequest.js +0 -1136
- package/dist/esm/models/openairesponsesrequest.js.map +0 -1
- package/dist/esm/models/toolchoice.d.ts.map +0 -1
- package/dist/esm/models/toolchoice.js +0 -95
- package/dist/esm/models/toolchoice.js.map +0 -1
- package/dist/esm/models/toolchoicefunction.d.ts +0 -57
- package/dist/esm/models/toolchoicefunction.d.ts.map +0 -1
- package/dist/esm/models/toolchoicefunction.js +0 -51
- package/dist/esm/models/toolchoicefunction.js.map +0 -1
- package/dist/esm/models/toolchoicetypes.d.ts +0 -33
- package/dist/esm/models/toolchoicetypes.d.ts.map +0 -1
- package/dist/esm/models/toolchoicetypes.js +0 -32
- package/dist/esm/models/toolchoicetypes.js.map +0 -1
- package/dist/esm/react-query/betaResponsesSendRequest.d.ts +0 -28
- package/dist/esm/react-query/betaResponsesSendRequest.d.ts.map +0 -1
- package/dist/esm/react-query/betaResponsesSendRequest.js.map +0 -1
- package/src/models/openairesponsesrequest.ts +0 -1974
- package/src/models/toolchoicefunction.ts +0 -100
- package/src/models/toolchoicetypes.ts +0 -73
|
@@ -8,17 +8,31 @@ import { ClosedEnum } from "../types/enums.js";
|
|
|
8
8
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
9
9
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
10
10
|
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} from "./
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
ToolChoiceTypeUnion,
|
|
12
|
+
ToolChoiceTypeUnion$inboundSchema,
|
|
13
|
+
ToolChoiceTypeUnion$Outbound,
|
|
14
|
+
ToolChoiceTypeUnion$outboundSchema,
|
|
15
|
+
} from "./toolchoicetypeunion.js";
|
|
16
|
+
|
|
17
|
+
export const ToolChoiceType = {
|
|
18
|
+
Function: "function",
|
|
19
|
+
} as const;
|
|
20
|
+
export type ToolChoiceType = ClosedEnum<typeof ToolChoiceType>;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Specific function tool choice
|
|
24
|
+
*/
|
|
25
|
+
export type ToolChoiceFunction = {
|
|
26
|
+
type: ToolChoiceType;
|
|
27
|
+
name: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Tool choice by type
|
|
32
|
+
*/
|
|
33
|
+
export type ToolChoice = {
|
|
34
|
+
type: ToolChoiceTypeUnion;
|
|
35
|
+
};
|
|
22
36
|
|
|
23
37
|
export const ToolChoiceRequired = {
|
|
24
38
|
Required: "required",
|
|
@@ -38,13 +52,141 @@ export type ToolChoiceAuto = ClosedEnum<typeof ToolChoiceAuto>;
|
|
|
38
52
|
/**
|
|
39
53
|
* Tool choice configuration
|
|
40
54
|
*/
|
|
41
|
-
export type
|
|
55
|
+
export type ToolChoiceUnion =
|
|
42
56
|
| ToolChoiceFunction
|
|
43
|
-
|
|
|
57
|
+
| ToolChoice
|
|
44
58
|
| ToolChoiceAuto
|
|
45
59
|
| ToolChoiceNone
|
|
46
60
|
| ToolChoiceRequired;
|
|
47
61
|
|
|
62
|
+
/** @internal */
|
|
63
|
+
export const ToolChoiceType$inboundSchema: z.ZodNativeEnum<
|
|
64
|
+
typeof ToolChoiceType
|
|
65
|
+
> = z.nativeEnum(ToolChoiceType);
|
|
66
|
+
|
|
67
|
+
/** @internal */
|
|
68
|
+
export const ToolChoiceType$outboundSchema: z.ZodNativeEnum<
|
|
69
|
+
typeof ToolChoiceType
|
|
70
|
+
> = ToolChoiceType$inboundSchema;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @internal
|
|
74
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
75
|
+
*/
|
|
76
|
+
export namespace ToolChoiceType$ {
|
|
77
|
+
/** @deprecated use `ToolChoiceType$inboundSchema` instead. */
|
|
78
|
+
export const inboundSchema = ToolChoiceType$inboundSchema;
|
|
79
|
+
/** @deprecated use `ToolChoiceType$outboundSchema` instead. */
|
|
80
|
+
export const outboundSchema = ToolChoiceType$outboundSchema;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** @internal */
|
|
84
|
+
export const ToolChoiceFunction$inboundSchema: z.ZodType<
|
|
85
|
+
ToolChoiceFunction,
|
|
86
|
+
z.ZodTypeDef,
|
|
87
|
+
unknown
|
|
88
|
+
> = z.object({
|
|
89
|
+
type: ToolChoiceType$inboundSchema,
|
|
90
|
+
name: z.string(),
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
/** @internal */
|
|
94
|
+
export type ToolChoiceFunction$Outbound = {
|
|
95
|
+
type: string;
|
|
96
|
+
name: string;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
/** @internal */
|
|
100
|
+
export const ToolChoiceFunction$outboundSchema: z.ZodType<
|
|
101
|
+
ToolChoiceFunction$Outbound,
|
|
102
|
+
z.ZodTypeDef,
|
|
103
|
+
ToolChoiceFunction
|
|
104
|
+
> = z.object({
|
|
105
|
+
type: ToolChoiceType$outboundSchema,
|
|
106
|
+
name: z.string(),
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* @internal
|
|
111
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
112
|
+
*/
|
|
113
|
+
export namespace ToolChoiceFunction$ {
|
|
114
|
+
/** @deprecated use `ToolChoiceFunction$inboundSchema` instead. */
|
|
115
|
+
export const inboundSchema = ToolChoiceFunction$inboundSchema;
|
|
116
|
+
/** @deprecated use `ToolChoiceFunction$outboundSchema` instead. */
|
|
117
|
+
export const outboundSchema = ToolChoiceFunction$outboundSchema;
|
|
118
|
+
/** @deprecated use `ToolChoiceFunction$Outbound` instead. */
|
|
119
|
+
export type Outbound = ToolChoiceFunction$Outbound;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function toolChoiceFunctionToJSON(
|
|
123
|
+
toolChoiceFunction: ToolChoiceFunction,
|
|
124
|
+
): string {
|
|
125
|
+
return JSON.stringify(
|
|
126
|
+
ToolChoiceFunction$outboundSchema.parse(toolChoiceFunction),
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export function toolChoiceFunctionFromJSON(
|
|
131
|
+
jsonString: string,
|
|
132
|
+
): SafeParseResult<ToolChoiceFunction, SDKValidationError> {
|
|
133
|
+
return safeParse(
|
|
134
|
+
jsonString,
|
|
135
|
+
(x) => ToolChoiceFunction$inboundSchema.parse(JSON.parse(x)),
|
|
136
|
+
`Failed to parse 'ToolChoiceFunction' from JSON`,
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** @internal */
|
|
141
|
+
export const ToolChoice$inboundSchema: z.ZodType<
|
|
142
|
+
ToolChoice,
|
|
143
|
+
z.ZodTypeDef,
|
|
144
|
+
unknown
|
|
145
|
+
> = z.object({
|
|
146
|
+
type: ToolChoiceTypeUnion$inboundSchema,
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
/** @internal */
|
|
150
|
+
export type ToolChoice$Outbound = {
|
|
151
|
+
type: ToolChoiceTypeUnion$Outbound;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
/** @internal */
|
|
155
|
+
export const ToolChoice$outboundSchema: z.ZodType<
|
|
156
|
+
ToolChoice$Outbound,
|
|
157
|
+
z.ZodTypeDef,
|
|
158
|
+
ToolChoice
|
|
159
|
+
> = z.object({
|
|
160
|
+
type: ToolChoiceTypeUnion$outboundSchema,
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* @internal
|
|
165
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
166
|
+
*/
|
|
167
|
+
export namespace ToolChoice$ {
|
|
168
|
+
/** @deprecated use `ToolChoice$inboundSchema` instead. */
|
|
169
|
+
export const inboundSchema = ToolChoice$inboundSchema;
|
|
170
|
+
/** @deprecated use `ToolChoice$outboundSchema` instead. */
|
|
171
|
+
export const outboundSchema = ToolChoice$outboundSchema;
|
|
172
|
+
/** @deprecated use `ToolChoice$Outbound` instead. */
|
|
173
|
+
export type Outbound = ToolChoice$Outbound;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export function toolChoiceToJSON(toolChoice: ToolChoice): string {
|
|
177
|
+
return JSON.stringify(ToolChoice$outboundSchema.parse(toolChoice));
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export function toolChoiceFromJSON(
|
|
181
|
+
jsonString: string,
|
|
182
|
+
): SafeParseResult<ToolChoice, SDKValidationError> {
|
|
183
|
+
return safeParse(
|
|
184
|
+
jsonString,
|
|
185
|
+
(x) => ToolChoice$inboundSchema.parse(JSON.parse(x)),
|
|
186
|
+
`Failed to parse 'ToolChoice' from JSON`,
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
|
|
48
190
|
/** @internal */
|
|
49
191
|
export const ToolChoiceRequired$inboundSchema: z.ZodNativeEnum<
|
|
50
192
|
typeof ToolChoiceRequired
|
|
@@ -109,34 +251,34 @@ export namespace ToolChoiceAuto$ {
|
|
|
109
251
|
}
|
|
110
252
|
|
|
111
253
|
/** @internal */
|
|
112
|
-
export const
|
|
113
|
-
|
|
254
|
+
export const ToolChoiceUnion$inboundSchema: z.ZodType<
|
|
255
|
+
ToolChoiceUnion,
|
|
114
256
|
z.ZodTypeDef,
|
|
115
257
|
unknown
|
|
116
258
|
> = z.union([
|
|
117
|
-
ToolChoiceFunction$inboundSchema,
|
|
118
|
-
|
|
259
|
+
z.lazy(() => ToolChoiceFunction$inboundSchema),
|
|
260
|
+
z.lazy(() => ToolChoice$inboundSchema),
|
|
119
261
|
ToolChoiceAuto$inboundSchema,
|
|
120
262
|
ToolChoiceNone$inboundSchema,
|
|
121
263
|
ToolChoiceRequired$inboundSchema,
|
|
122
264
|
]);
|
|
123
265
|
|
|
124
266
|
/** @internal */
|
|
125
|
-
export type
|
|
267
|
+
export type ToolChoiceUnion$Outbound =
|
|
126
268
|
| ToolChoiceFunction$Outbound
|
|
127
|
-
|
|
|
269
|
+
| ToolChoice$Outbound
|
|
128
270
|
| string
|
|
129
271
|
| string
|
|
130
272
|
| string;
|
|
131
273
|
|
|
132
274
|
/** @internal */
|
|
133
|
-
export const
|
|
134
|
-
|
|
275
|
+
export const ToolChoiceUnion$outboundSchema: z.ZodType<
|
|
276
|
+
ToolChoiceUnion$Outbound,
|
|
135
277
|
z.ZodTypeDef,
|
|
136
|
-
|
|
278
|
+
ToolChoiceUnion
|
|
137
279
|
> = z.union([
|
|
138
|
-
ToolChoiceFunction$outboundSchema,
|
|
139
|
-
|
|
280
|
+
z.lazy(() => ToolChoiceFunction$outboundSchema),
|
|
281
|
+
z.lazy(() => ToolChoice$outboundSchema),
|
|
140
282
|
ToolChoiceAuto$outboundSchema,
|
|
141
283
|
ToolChoiceNone$outboundSchema,
|
|
142
284
|
ToolChoiceRequired$outboundSchema,
|
|
@@ -146,25 +288,27 @@ export const ToolChoice$outboundSchema: z.ZodType<
|
|
|
146
288
|
* @internal
|
|
147
289
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
148
290
|
*/
|
|
149
|
-
export namespace
|
|
150
|
-
/** @deprecated use `
|
|
151
|
-
export const inboundSchema =
|
|
152
|
-
/** @deprecated use `
|
|
153
|
-
export const outboundSchema =
|
|
154
|
-
/** @deprecated use `
|
|
155
|
-
export type Outbound =
|
|
291
|
+
export namespace ToolChoiceUnion$ {
|
|
292
|
+
/** @deprecated use `ToolChoiceUnion$inboundSchema` instead. */
|
|
293
|
+
export const inboundSchema = ToolChoiceUnion$inboundSchema;
|
|
294
|
+
/** @deprecated use `ToolChoiceUnion$outboundSchema` instead. */
|
|
295
|
+
export const outboundSchema = ToolChoiceUnion$outboundSchema;
|
|
296
|
+
/** @deprecated use `ToolChoiceUnion$Outbound` instead. */
|
|
297
|
+
export type Outbound = ToolChoiceUnion$Outbound;
|
|
156
298
|
}
|
|
157
299
|
|
|
158
|
-
export function
|
|
159
|
-
|
|
300
|
+
export function toolChoiceUnionToJSON(
|
|
301
|
+
toolChoiceUnion: ToolChoiceUnion,
|
|
302
|
+
): string {
|
|
303
|
+
return JSON.stringify(ToolChoiceUnion$outboundSchema.parse(toolChoiceUnion));
|
|
160
304
|
}
|
|
161
305
|
|
|
162
|
-
export function
|
|
306
|
+
export function toolChoiceUnionFromJSON(
|
|
163
307
|
jsonString: string,
|
|
164
|
-
): SafeParseResult<
|
|
308
|
+
): SafeParseResult<ToolChoiceUnion, SDKValidationError> {
|
|
165
309
|
return safeParse(
|
|
166
310
|
jsonString,
|
|
167
|
-
(x) =>
|
|
168
|
-
`Failed to parse '
|
|
311
|
+
(x) => ToolChoiceUnion$inboundSchema.parse(JSON.parse(x)),
|
|
312
|
+
`Failed to parse 'ToolChoiceUnion' from JSON`,
|
|
169
313
|
);
|
|
170
314
|
}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The updated API key information
|
|
13
|
+
*/
|
|
14
|
+
export type UpdateAPIKeyData = {
|
|
15
|
+
/**
|
|
16
|
+
* Unique hash identifier for the API key
|
|
17
|
+
*/
|
|
18
|
+
hash: string;
|
|
19
|
+
/**
|
|
20
|
+
* Name of the API key
|
|
21
|
+
*/
|
|
22
|
+
name: string;
|
|
23
|
+
/**
|
|
24
|
+
* Human-readable label for the API key
|
|
25
|
+
*/
|
|
26
|
+
label: string;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the API key is disabled
|
|
29
|
+
*/
|
|
30
|
+
disabled: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Spending limit for the API key in USD
|
|
33
|
+
*/
|
|
34
|
+
limit: number | null;
|
|
35
|
+
/**
|
|
36
|
+
* Remaining spending limit in USD
|
|
37
|
+
*/
|
|
38
|
+
limitRemaining: number | null;
|
|
39
|
+
/**
|
|
40
|
+
* Type of limit reset for the API key
|
|
41
|
+
*/
|
|
42
|
+
limitReset: string | null;
|
|
43
|
+
/**
|
|
44
|
+
* Whether to include external BYOK usage in the credit limit
|
|
45
|
+
*/
|
|
46
|
+
includeByokInLimit: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Total OpenRouter credit usage (in USD) for the API key
|
|
49
|
+
*/
|
|
50
|
+
usage: number;
|
|
51
|
+
/**
|
|
52
|
+
* OpenRouter credit usage (in USD) for the current UTC day
|
|
53
|
+
*/
|
|
54
|
+
usageDaily: number;
|
|
55
|
+
/**
|
|
56
|
+
* OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)
|
|
57
|
+
*/
|
|
58
|
+
usageWeekly: number;
|
|
59
|
+
/**
|
|
60
|
+
* OpenRouter credit usage (in USD) for the current UTC month
|
|
61
|
+
*/
|
|
62
|
+
usageMonthly: number;
|
|
63
|
+
/**
|
|
64
|
+
* Total external BYOK usage (in USD) for the API key
|
|
65
|
+
*/
|
|
66
|
+
byokUsage: number;
|
|
67
|
+
/**
|
|
68
|
+
* External BYOK usage (in USD) for the current UTC day
|
|
69
|
+
*/
|
|
70
|
+
byokUsageDaily: number;
|
|
71
|
+
/**
|
|
72
|
+
* External BYOK usage (in USD) for the current UTC week (Monday-Sunday)
|
|
73
|
+
*/
|
|
74
|
+
byokUsageWeekly: number;
|
|
75
|
+
/**
|
|
76
|
+
* External BYOK usage (in USD) for current UTC month
|
|
77
|
+
*/
|
|
78
|
+
byokUsageMonthly: number;
|
|
79
|
+
/**
|
|
80
|
+
* ISO 8601 timestamp of when the API key was created
|
|
81
|
+
*/
|
|
82
|
+
createdAt: string;
|
|
83
|
+
/**
|
|
84
|
+
* ISO 8601 timestamp of when the API key was last updated
|
|
85
|
+
*/
|
|
86
|
+
updatedAt: string | null;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/** @internal */
|
|
90
|
+
export const UpdateAPIKeyData$inboundSchema: z.ZodType<
|
|
91
|
+
UpdateAPIKeyData,
|
|
92
|
+
z.ZodTypeDef,
|
|
93
|
+
unknown
|
|
94
|
+
> = z.object({
|
|
95
|
+
hash: z.string(),
|
|
96
|
+
name: z.string(),
|
|
97
|
+
label: z.string(),
|
|
98
|
+
disabled: z.boolean(),
|
|
99
|
+
limit: z.nullable(z.number()),
|
|
100
|
+
limit_remaining: z.nullable(z.number()),
|
|
101
|
+
limit_reset: z.nullable(z.string()),
|
|
102
|
+
include_byok_in_limit: z.boolean(),
|
|
103
|
+
usage: z.number(),
|
|
104
|
+
usage_daily: z.number(),
|
|
105
|
+
usage_weekly: z.number(),
|
|
106
|
+
usage_monthly: z.number(),
|
|
107
|
+
byok_usage: z.number(),
|
|
108
|
+
byok_usage_daily: z.number(),
|
|
109
|
+
byok_usage_weekly: z.number(),
|
|
110
|
+
byok_usage_monthly: z.number(),
|
|
111
|
+
created_at: z.string(),
|
|
112
|
+
updated_at: z.nullable(z.string()),
|
|
113
|
+
}).transform((v) => {
|
|
114
|
+
return remap$(v, {
|
|
115
|
+
"limit_remaining": "limitRemaining",
|
|
116
|
+
"limit_reset": "limitReset",
|
|
117
|
+
"include_byok_in_limit": "includeByokInLimit",
|
|
118
|
+
"usage_daily": "usageDaily",
|
|
119
|
+
"usage_weekly": "usageWeekly",
|
|
120
|
+
"usage_monthly": "usageMonthly",
|
|
121
|
+
"byok_usage": "byokUsage",
|
|
122
|
+
"byok_usage_daily": "byokUsageDaily",
|
|
123
|
+
"byok_usage_weekly": "byokUsageWeekly",
|
|
124
|
+
"byok_usage_monthly": "byokUsageMonthly",
|
|
125
|
+
"created_at": "createdAt",
|
|
126
|
+
"updated_at": "updatedAt",
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
/** @internal */
|
|
131
|
+
export type UpdateAPIKeyData$Outbound = {
|
|
132
|
+
hash: string;
|
|
133
|
+
name: string;
|
|
134
|
+
label: string;
|
|
135
|
+
disabled: boolean;
|
|
136
|
+
limit: number | null;
|
|
137
|
+
limit_remaining: number | null;
|
|
138
|
+
limit_reset: string | null;
|
|
139
|
+
include_byok_in_limit: boolean;
|
|
140
|
+
usage: number;
|
|
141
|
+
usage_daily: number;
|
|
142
|
+
usage_weekly: number;
|
|
143
|
+
usage_monthly: number;
|
|
144
|
+
byok_usage: number;
|
|
145
|
+
byok_usage_daily: number;
|
|
146
|
+
byok_usage_weekly: number;
|
|
147
|
+
byok_usage_monthly: number;
|
|
148
|
+
created_at: string;
|
|
149
|
+
updated_at: string | null;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
/** @internal */
|
|
153
|
+
export const UpdateAPIKeyData$outboundSchema: z.ZodType<
|
|
154
|
+
UpdateAPIKeyData$Outbound,
|
|
155
|
+
z.ZodTypeDef,
|
|
156
|
+
UpdateAPIKeyData
|
|
157
|
+
> = z.object({
|
|
158
|
+
hash: z.string(),
|
|
159
|
+
name: z.string(),
|
|
160
|
+
label: z.string(),
|
|
161
|
+
disabled: z.boolean(),
|
|
162
|
+
limit: z.nullable(z.number()),
|
|
163
|
+
limitRemaining: z.nullable(z.number()),
|
|
164
|
+
limitReset: z.nullable(z.string()),
|
|
165
|
+
includeByokInLimit: z.boolean(),
|
|
166
|
+
usage: z.number(),
|
|
167
|
+
usageDaily: z.number(),
|
|
168
|
+
usageWeekly: z.number(),
|
|
169
|
+
usageMonthly: z.number(),
|
|
170
|
+
byokUsage: z.number(),
|
|
171
|
+
byokUsageDaily: z.number(),
|
|
172
|
+
byokUsageWeekly: z.number(),
|
|
173
|
+
byokUsageMonthly: z.number(),
|
|
174
|
+
createdAt: z.string(),
|
|
175
|
+
updatedAt: z.nullable(z.string()),
|
|
176
|
+
}).transform((v) => {
|
|
177
|
+
return remap$(v, {
|
|
178
|
+
limitRemaining: "limit_remaining",
|
|
179
|
+
limitReset: "limit_reset",
|
|
180
|
+
includeByokInLimit: "include_byok_in_limit",
|
|
181
|
+
usageDaily: "usage_daily",
|
|
182
|
+
usageWeekly: "usage_weekly",
|
|
183
|
+
usageMonthly: "usage_monthly",
|
|
184
|
+
byokUsage: "byok_usage",
|
|
185
|
+
byokUsageDaily: "byok_usage_daily",
|
|
186
|
+
byokUsageWeekly: "byok_usage_weekly",
|
|
187
|
+
byokUsageMonthly: "byok_usage_monthly",
|
|
188
|
+
createdAt: "created_at",
|
|
189
|
+
updatedAt: "updated_at",
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* @internal
|
|
195
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
196
|
+
*/
|
|
197
|
+
export namespace UpdateAPIKeyData$ {
|
|
198
|
+
/** @deprecated use `UpdateAPIKeyData$inboundSchema` instead. */
|
|
199
|
+
export const inboundSchema = UpdateAPIKeyData$inboundSchema;
|
|
200
|
+
/** @deprecated use `UpdateAPIKeyData$outboundSchema` instead. */
|
|
201
|
+
export const outboundSchema = UpdateAPIKeyData$outboundSchema;
|
|
202
|
+
/** @deprecated use `UpdateAPIKeyData$Outbound` instead. */
|
|
203
|
+
export type Outbound = UpdateAPIKeyData$Outbound;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export function updateAPIKeyDataToJSON(
|
|
207
|
+
updateAPIKeyData: UpdateAPIKeyData,
|
|
208
|
+
): string {
|
|
209
|
+
return JSON.stringify(
|
|
210
|
+
UpdateAPIKeyData$outboundSchema.parse(updateAPIKeyData),
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export function updateAPIKeyDataFromJSON(
|
|
215
|
+
jsonString: string,
|
|
216
|
+
): SafeParseResult<UpdateAPIKeyData, SDKValidationError> {
|
|
217
|
+
return safeParse(
|
|
218
|
+
jsonString,
|
|
219
|
+
(x) => UpdateAPIKeyData$inboundSchema.parse(JSON.parse(x)),
|
|
220
|
+
`Failed to parse 'UpdateAPIKeyData' from JSON`,
|
|
221
|
+
);
|
|
222
|
+
}
|
|
@@ -8,26 +8,20 @@ import {
|
|
|
8
8
|
UseMutationResult,
|
|
9
9
|
} from "@tanstack/react-query";
|
|
10
10
|
import { OpenRouterCore } from "../core.js";
|
|
11
|
-
import {
|
|
12
|
-
betaResponsesSendRequest,
|
|
13
|
-
SendRequestAcceptEnum,
|
|
14
|
-
} from "../funcs/betaResponsesSendRequest.js";
|
|
11
|
+
import { betaResponsesSend } from "../funcs/betaResponsesSend.js";
|
|
15
12
|
import { combineSignals } from "../lib/primitives.js";
|
|
16
13
|
import { RequestOptions } from "../lib/sdks.js";
|
|
17
|
-
import * as models from "../models/index.js";
|
|
18
14
|
import * as operations from "../models/operations/index.js";
|
|
19
15
|
import { unwrapAsync } from "../types/fp.js";
|
|
20
16
|
import { useOpenRouterContext } from "./_context.js";
|
|
21
17
|
import { MutationHookOptions } from "./_types.js";
|
|
22
18
|
|
|
23
|
-
export
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
request: models.OpenAIResponsesRequest;
|
|
27
|
-
options?: RequestOptions & { acceptHeaderOverride?: SendRequestAcceptEnum };
|
|
19
|
+
export type BetaResponsesSendMutationVariables = {
|
|
20
|
+
request: operations.SendResponsesRequestRequest;
|
|
21
|
+
options?: RequestOptions;
|
|
28
22
|
};
|
|
29
23
|
|
|
30
|
-
export type
|
|
24
|
+
export type BetaResponsesSendMutationData =
|
|
31
25
|
operations.SendResponsesRequestResponse;
|
|
32
26
|
|
|
33
27
|
/**
|
|
@@ -36,43 +30,43 @@ export type BetaResponsesSendRequestMutationData =
|
|
|
36
30
|
* @remarks
|
|
37
31
|
* Submits a request to the Responses API (beta)
|
|
38
32
|
*/
|
|
39
|
-
export function
|
|
33
|
+
export function useBetaResponsesSendMutation(
|
|
40
34
|
options?: MutationHookOptions<
|
|
41
|
-
|
|
35
|
+
BetaResponsesSendMutationData,
|
|
42
36
|
Error,
|
|
43
|
-
|
|
37
|
+
BetaResponsesSendMutationVariables
|
|
44
38
|
>,
|
|
45
39
|
): UseMutationResult<
|
|
46
|
-
|
|
40
|
+
BetaResponsesSendMutationData,
|
|
47
41
|
Error,
|
|
48
|
-
|
|
42
|
+
BetaResponsesSendMutationVariables
|
|
49
43
|
> {
|
|
50
44
|
const client = useOpenRouterContext();
|
|
51
45
|
return useMutation({
|
|
52
|
-
...
|
|
46
|
+
...buildBetaResponsesSendMutation(client, options),
|
|
53
47
|
...options,
|
|
54
48
|
});
|
|
55
49
|
}
|
|
56
50
|
|
|
57
|
-
export function
|
|
58
|
-
return ["@openrouter/sdk", "responses", "
|
|
51
|
+
export function mutationKeyBetaResponsesSend(): MutationKey {
|
|
52
|
+
return ["@openrouter/sdk", "responses", "send"];
|
|
59
53
|
}
|
|
60
54
|
|
|
61
|
-
export function
|
|
55
|
+
export function buildBetaResponsesSendMutation(
|
|
62
56
|
client$: OpenRouterCore,
|
|
63
57
|
hookOptions?: RequestOptions,
|
|
64
58
|
): {
|
|
65
59
|
mutationKey: MutationKey;
|
|
66
60
|
mutationFn: (
|
|
67
|
-
variables:
|
|
68
|
-
) => Promise<
|
|
61
|
+
variables: BetaResponsesSendMutationVariables,
|
|
62
|
+
) => Promise<BetaResponsesSendMutationData>;
|
|
69
63
|
} {
|
|
70
64
|
return {
|
|
71
|
-
mutationKey:
|
|
72
|
-
mutationFn: function
|
|
65
|
+
mutationKey: mutationKeyBetaResponsesSend(),
|
|
66
|
+
mutationFn: function betaResponsesSendMutationFn({
|
|
73
67
|
request,
|
|
74
68
|
options,
|
|
75
|
-
}): Promise<
|
|
69
|
+
}): Promise<BetaResponsesSendMutationData> {
|
|
76
70
|
const mergedOptions = {
|
|
77
71
|
...hookOptions,
|
|
78
72
|
...options,
|
|
@@ -85,7 +79,7 @@ export function buildBetaResponsesSendRequestMutation(
|
|
|
85
79
|
),
|
|
86
80
|
},
|
|
87
81
|
};
|
|
88
|
-
return unwrapAsync(
|
|
82
|
+
return unwrapAsync(betaResponsesSend(
|
|
89
83
|
client$,
|
|
90
84
|
request,
|
|
91
85
|
mergedOptions,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
UseMutationResult,
|
|
9
9
|
} from "@tanstack/react-query";
|
|
10
10
|
import { OpenRouterCore } from "../core.js";
|
|
11
|
-
import { chatSend
|
|
11
|
+
import { chatSend } from "../funcs/chatSend.js";
|
|
12
12
|
import { combineSignals } from "../lib/primitives.js";
|
|
13
13
|
import { RequestOptions } from "../lib/sdks.js";
|
|
14
14
|
import * as models from "../models/index.js";
|
|
@@ -17,11 +17,9 @@ import { unwrapAsync } from "../types/fp.js";
|
|
|
17
17
|
import { useOpenRouterContext } from "./_context.js";
|
|
18
18
|
import { MutationHookOptions } from "./_types.js";
|
|
19
19
|
|
|
20
|
-
export { SendAcceptEnum } from "../funcs/chatSend.js";
|
|
21
|
-
|
|
22
20
|
export type ChatSendMutationVariables = {
|
|
23
21
|
request: models.ChatGenerationParams;
|
|
24
|
-
options?: RequestOptions
|
|
22
|
+
options?: RequestOptions;
|
|
25
23
|
};
|
|
26
24
|
|
|
27
25
|
export type ChatSendMutationData = operations.SendChatCompletionRequestResponse;
|
package/src/react-query/index.ts
CHANGED
|
@@ -12,7 +12,7 @@ export * from "./apiKeysGet.js";
|
|
|
12
12
|
export * from "./apiKeysGetCurrentKeyMetadata.js";
|
|
13
13
|
export * from "./apiKeysList.js";
|
|
14
14
|
export * from "./apiKeysUpdate.js";
|
|
15
|
-
export * from "./
|
|
15
|
+
export * from "./betaResponsesSend.js";
|
|
16
16
|
export * from "./chatSend.js";
|
|
17
17
|
export * from "./completionsGenerate.js";
|
|
18
18
|
export * from "./creditsAddCoinbaseCharge.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
UseSuspenseQueryResult,
|
|
14
14
|
} from "@tanstack/react-query";
|
|
15
15
|
import { OpenRouterCore } from "../core.js";
|
|
16
|
-
import {
|
|
16
|
+
import { modelsList } from "../funcs/modelsList.js";
|
|
17
17
|
import { combineSignals } from "../lib/primitives.js";
|
|
18
18
|
import { RequestOptions } from "../lib/sdks.js";
|
|
19
19
|
import * as operations from "../models/operations/index.js";
|
|
@@ -25,8 +25,6 @@ import {
|
|
|
25
25
|
TupleToPrefixes,
|
|
26
26
|
} from "./_types.js";
|
|
27
27
|
|
|
28
|
-
export { ListAcceptEnum } from "../funcs/modelsList.js";
|
|
29
|
-
|
|
30
28
|
export type ModelsListQueryData = operations.ListModelsResponse;
|
|
31
29
|
|
|
32
30
|
/**
|
|
@@ -126,7 +124,7 @@ export function invalidateAllModelsList(
|
|
|
126
124
|
export function buildModelsListQuery(
|
|
127
125
|
client$: OpenRouterCore,
|
|
128
126
|
request?: operations.ListModelsRequest | undefined,
|
|
129
|
-
options?: RequestOptions
|
|
127
|
+
options?: RequestOptions,
|
|
130
128
|
): {
|
|
131
129
|
queryKey: QueryKey;
|
|
132
130
|
queryFn: (context: QueryFunctionContext) => Promise<ModelsListQueryData>;
|
package/src/sdk/chat.ts
CHANGED
|
@@ -2,15 +2,13 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { chatSend
|
|
5
|
+
import { chatSend } from "../funcs/chatSend.js";
|
|
6
6
|
import { EventStream } from "../lib/event-streams.js";
|
|
7
7
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
8
8
|
import * as models from "../models/index.js";
|
|
9
9
|
import * as operations from "../models/operations/index.js";
|
|
10
10
|
import { unwrapAsync } from "../types/fp.js";
|
|
11
11
|
|
|
12
|
-
export { SendAcceptEnum } from "../funcs/chatSend.js";
|
|
13
|
-
|
|
14
12
|
export class Chat extends ClientSDK {
|
|
15
13
|
/**
|
|
16
14
|
* Create a chat completion
|
|
@@ -20,19 +18,19 @@ export class Chat extends ClientSDK {
|
|
|
20
18
|
*/
|
|
21
19
|
async send(
|
|
22
20
|
request: models.ChatGenerationParams & { stream?: false | undefined },
|
|
23
|
-
options?: RequestOptions
|
|
21
|
+
options?: RequestOptions,
|
|
24
22
|
): Promise<models.ChatResponse>;
|
|
25
23
|
async send(
|
|
26
24
|
request: models.ChatGenerationParams & { stream: true },
|
|
27
|
-
options?: RequestOptions
|
|
25
|
+
options?: RequestOptions,
|
|
28
26
|
): Promise<EventStream<models.ChatStreamingResponseChunk>>;
|
|
29
27
|
async send(
|
|
30
28
|
request: models.ChatGenerationParams,
|
|
31
|
-
options?: RequestOptions
|
|
29
|
+
options?: RequestOptions,
|
|
32
30
|
): Promise<operations.SendChatCompletionRequestResponse>;
|
|
33
31
|
async send(
|
|
34
32
|
request: models.ChatGenerationParams,
|
|
35
|
-
options?: RequestOptions
|
|
33
|
+
options?: RequestOptions,
|
|
36
34
|
): Promise<operations.SendChatCompletionRequestResponse> {
|
|
37
35
|
return unwrapAsync(chatSend(
|
|
38
36
|
this,
|