@openrouter/sdk 0.0.0-beta.32 → 0.0.0-beta.37
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 +5 -3
- package/REACT_QUERY.md +6 -4
- package/README.md +21 -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/endpointsList.d.ts +1 -1
- package/dist/commonjs/funcs/endpointsList.d.ts.map +1 -1
- package/dist/commonjs/funcs/endpointsList.js +1 -1
- package/dist/commonjs/funcs/endpointsList.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 +2 -9
- package/dist/commonjs/funcs/modelsList.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/endpointslist.d.ts +768 -0
- package/dist/commonjs/models/endpointslist.d.ts.map +1 -0
- package/dist/commonjs/models/endpointslist.js +625 -0
- package/dist/commonjs/models/endpointslist.js.map +1 -0
- package/dist/commonjs/models/index.d.ts +4 -4
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +4 -4
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/keyinfo.d.ts +155 -0
- package/dist/commonjs/models/keyinfo.d.ts.map +1 -0
- package/dist/commonjs/models/keyinfo.js +163 -0
- package/dist/commonjs/models/keyinfo.js.map +1 -0
- package/dist/commonjs/models/modelslist.d.ts +854 -0
- package/dist/commonjs/models/modelslist.d.ts.map +1 -0
- package/dist/commonjs/models/modelslist.js +768 -0
- package/dist/commonjs/models/modelslist.js.map +1 -0
- 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/getcurrentkey.d.ts +3 -108
- package/dist/commonjs/models/operations/getcurrentkey.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getcurrentkey.js +4 -88
- package/dist/commonjs/models/operations/getcurrentkey.js.map +1 -1
- package/dist/commonjs/models/operations/list.d.ts +63 -825
- package/dist/commonjs/models/operations/list.d.ts.map +1 -1
- package/dist/commonjs/models/operations/list.js +86 -667
- package/dist/commonjs/models/operations/list.js.map +1 -1
- package/dist/commonjs/models/operations/listmodels.d.ts +16 -865
- package/dist/commonjs/models/operations/listmodels.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listmodels.js +19 -742
- package/dist/commonjs/models/operations/listmodels.js.map +1 -1
- package/dist/commonjs/models/operations/listusermodels.d.ts +3 -852
- package/dist/commonjs/models/operations/listusermodels.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listusermodels.js +4 -730
- package/dist/commonjs/models/operations/listusermodels.js.map +1 -1
- package/dist/commonjs/models/operations/previewzdr.d.ts +97 -97
- package/dist/commonjs/models/operations/previewzdr.d.ts.map +1 -1
- package/dist/commonjs/models/operations/previewzdr.js +134 -133
- package/dist/commonjs/models/operations/previewzdr.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/responsereasoningconfig.d.ts +4 -0
- package/dist/commonjs/models/responsereasoningconfig.d.ts.map +1 -1
- package/dist/commonjs/models/responsereasoningconfig.js +13 -0
- package/dist/commonjs/models/responsereasoningconfig.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/responsesusage.d.ts +41 -0
- package/dist/commonjs/models/responsesusage.d.ts.map +1 -1
- package/dist/commonjs/models/responsesusage.js +54 -1
- package/dist/commonjs/models/responsesusage.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/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/endpointsList.d.ts +4 -4
- package/dist/commonjs/react-query/endpointsList.d.ts.map +1 -1
- package/dist/commonjs/react-query/endpointsList.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 +4 -8
- 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/endpoints.d.ts +1 -1
- package/dist/commonjs/sdk/endpoints.d.ts.map +1 -1
- package/dist/commonjs/sdk/endpoints.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 +6 -14
- 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/endpointsList.d.ts +1 -1
- package/dist/esm/funcs/endpointsList.d.ts.map +1 -1
- package/dist/esm/funcs/endpointsList.js +1 -1
- package/dist/esm/funcs/endpointsList.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 +2 -8
- package/dist/esm/funcs/modelsList.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/endpointslist.d.ts +768 -0
- package/dist/esm/models/endpointslist.d.ts.map +1 -0
- package/dist/esm/models/endpointslist.js +562 -0
- package/dist/esm/models/endpointslist.js.map +1 -0
- package/dist/esm/models/index.d.ts +4 -4
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +4 -4
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/keyinfo.d.ts +155 -0
- package/dist/esm/models/keyinfo.d.ts.map +1 -0
- package/dist/esm/models/keyinfo.js +123 -0
- package/dist/esm/models/keyinfo.js.map +1 -0
- package/dist/esm/models/modelslist.d.ts +854 -0
- package/dist/esm/models/modelslist.d.ts.map +1 -0
- package/dist/esm/models/modelslist.js +697 -0
- package/dist/esm/models/modelslist.js.map +1 -0
- 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/getcurrentkey.d.ts +3 -108
- package/dist/esm/models/operations/getcurrentkey.d.ts.map +1 -1
- package/dist/esm/models/operations/getcurrentkey.js +3 -83
- package/dist/esm/models/operations/getcurrentkey.js.map +1 -1
- package/dist/esm/models/operations/list.d.ts +63 -825
- package/dist/esm/models/operations/list.d.ts.map +1 -1
- package/dist/esm/models/operations/list.js +81 -635
- package/dist/esm/models/operations/list.js.map +1 -1
- package/dist/esm/models/operations/listmodels.d.ts +16 -865
- package/dist/esm/models/operations/listmodels.d.ts.map +1 -1
- package/dist/esm/models/operations/listmodels.js +16 -704
- package/dist/esm/models/operations/listmodels.js.map +1 -1
- package/dist/esm/models/operations/listusermodels.d.ts +3 -852
- package/dist/esm/models/operations/listusermodels.d.ts.map +1 -1
- package/dist/esm/models/operations/listusermodels.js +3 -694
- package/dist/esm/models/operations/listusermodels.js.map +1 -1
- package/dist/esm/models/operations/previewzdr.d.ts +97 -97
- package/dist/esm/models/operations/previewzdr.d.ts.map +1 -1
- package/dist/esm/models/operations/previewzdr.js +118 -117
- package/dist/esm/models/operations/previewzdr.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/responsereasoningconfig.d.ts +4 -0
- package/dist/esm/models/responsereasoningconfig.d.ts.map +1 -1
- package/dist/esm/models/responsereasoningconfig.js +13 -0
- package/dist/esm/models/responsereasoningconfig.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/responsesusage.d.ts +41 -0
- package/dist/esm/models/responsesusage.d.ts.map +1 -1
- package/dist/esm/models/responsesusage.js +51 -0
- package/dist/esm/models/responsesusage.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/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/endpointsList.d.ts +4 -4
- package/dist/esm/react-query/endpointsList.d.ts.map +1 -1
- package/dist/esm/react-query/endpointsList.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 +4 -8
- 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/endpoints.d.ts +1 -1
- package/dist/esm/sdk/endpoints.d.ts.map +1 -1
- package/dist/esm/sdk/endpoints.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 +6 -14
- 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/endpoints/README.md +1 -1
- package/docs/sdks/models/README.md +1 -1
- package/docs/sdks/responses/README.md +13 -9
- package/examples/{betaResponsesSendRequest.example.ts → betaResponsesSend.example.ts} +4 -2
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/{betaResponsesSendRequest.ts → betaResponsesSend.ts} +19 -24
- package/src/funcs/chatSend.ts +6 -12
- package/src/funcs/endpointsList.ts +3 -3
- package/src/funcs/modelsList.ts +6 -14
- package/src/lib/config.ts +2 -2
- package/src/models/endpointslist.ts +1030 -0
- package/src/models/index.ts +4 -4
- package/src/models/keyinfo.ts +281 -0
- package/src/models/modelslist.ts +1394 -0
- package/src/models/operations/generate.ts +232 -188
- package/src/models/operations/getcurrentkey.ts +5 -203
- package/src/models/operations/list.ts +109 -1106
- package/src/models/operations/listmodels.ts +26 -1436
- package/src/models/operations/listusermodels.ts +5 -1440
- package/src/models/operations/previewzdr.ts +196 -225
- package/src/models/operations/sendresponsesrequest.ts +2005 -0
- package/src/models/responsereasoningconfig.ts +17 -0
- package/src/models/responsesnonstreamingresponse.ts +37 -55
- package/src/models/responsesusage.ts +96 -0
- package/src/models/{toolchoice.ts → toolchoiceunion.ts} +181 -37
- package/src/react-query/{betaResponsesSendRequest.ts → betaResponsesSend.ts} +20 -26
- package/src/react-query/chatSend.ts +2 -4
- package/src/react-query/endpointsList.ts +4 -4
- package/src/react-query/index.ts +1 -1
- package/src/react-query/modelsList.ts +6 -8
- package/src/sdk/chat.ts +5 -7
- package/src/sdk/endpoints.ts +1 -1
- package/src/sdk/models.ts +3 -5
- package/src/sdk/responses.ts +18 -21
- 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 -1212
- 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 -1138
- 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 -1935
- package/src/models/toolchoicefunction.ts +0 -100
- package/src/models/toolchoicetypes.ts +0 -73
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
7
|
import { safeParse } from "../lib/schemas.js";
|
|
7
8
|
import { ClosedEnum } from "../types/enums.js";
|
|
8
9
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
@@ -29,6 +30,8 @@ export type ResponseReasoningConfigEffort = ClosedEnum<
|
|
|
29
30
|
export type ResponseReasoningConfig = {
|
|
30
31
|
effort?: ResponseReasoningConfigEffort | null | undefined;
|
|
31
32
|
summary?: ResponseReasoningSummaryMode | null | undefined;
|
|
33
|
+
maxTokens?: number | null | undefined;
|
|
34
|
+
enabled?: boolean | null | undefined;
|
|
32
35
|
};
|
|
33
36
|
|
|
34
37
|
/** @internal */
|
|
@@ -60,12 +63,20 @@ export const ResponseReasoningConfig$inboundSchema: z.ZodType<
|
|
|
60
63
|
> = z.object({
|
|
61
64
|
effort: z.nullable(ResponseReasoningConfigEffort$inboundSchema).optional(),
|
|
62
65
|
summary: z.nullable(ResponseReasoningSummaryMode$inboundSchema).optional(),
|
|
66
|
+
max_tokens: z.nullable(z.number()).optional(),
|
|
67
|
+
enabled: z.nullable(z.boolean()).optional(),
|
|
68
|
+
}).transform((v) => {
|
|
69
|
+
return remap$(v, {
|
|
70
|
+
"max_tokens": "maxTokens",
|
|
71
|
+
});
|
|
63
72
|
});
|
|
64
73
|
|
|
65
74
|
/** @internal */
|
|
66
75
|
export type ResponseReasoningConfig$Outbound = {
|
|
67
76
|
effort?: string | null | undefined;
|
|
68
77
|
summary?: string | null | undefined;
|
|
78
|
+
max_tokens?: number | null | undefined;
|
|
79
|
+
enabled?: boolean | null | undefined;
|
|
69
80
|
};
|
|
70
81
|
|
|
71
82
|
/** @internal */
|
|
@@ -76,6 +87,12 @@ export const ResponseReasoningConfig$outboundSchema: z.ZodType<
|
|
|
76
87
|
> = z.object({
|
|
77
88
|
effort: z.nullable(ResponseReasoningConfigEffort$outboundSchema).optional(),
|
|
78
89
|
summary: z.nullable(ResponseReasoningSummaryMode$outboundSchema).optional(),
|
|
90
|
+
maxTokens: z.nullable(z.number()).optional(),
|
|
91
|
+
enabled: z.nullable(z.boolean()).optional(),
|
|
92
|
+
}).transform((v) => {
|
|
93
|
+
return remap$(v, {
|
|
94
|
+
maxTokens: "max_tokens",
|
|
95
|
+
});
|
|
79
96
|
});
|
|
80
97
|
|
|
81
98
|
/**
|
|
@@ -57,11 +57,11 @@ import {
|
|
|
57
57
|
Tool$outboundSchema,
|
|
58
58
|
} from "./tool.js";
|
|
59
59
|
import {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
} from "./
|
|
60
|
+
ToolChoiceUnion,
|
|
61
|
+
ToolChoiceUnion$inboundSchema,
|
|
62
|
+
ToolChoiceUnion$Outbound,
|
|
63
|
+
ToolChoiceUnion$outboundSchema,
|
|
64
|
+
} from "./toolchoiceunion.js";
|
|
65
65
|
|
|
66
66
|
export const ObjectT = {
|
|
67
67
|
Response: "response",
|
|
@@ -96,24 +96,20 @@ export type ResponsesNonStreamingResponseError = {
|
|
|
96
96
|
|
|
97
97
|
export type Instructions = string | Array<ResponseInputItem> | any;
|
|
98
98
|
|
|
99
|
-
export const
|
|
99
|
+
export const ServiceTier = {
|
|
100
100
|
Auto: "auto",
|
|
101
101
|
Default: "default",
|
|
102
102
|
Flex: "flex",
|
|
103
103
|
Priority: "priority",
|
|
104
104
|
Scale: "scale",
|
|
105
105
|
} as const;
|
|
106
|
-
export type
|
|
107
|
-
typeof ResponsesNonStreamingResponseServiceTier
|
|
108
|
-
>;
|
|
106
|
+
export type ServiceTier = ClosedEnum<typeof ServiceTier>;
|
|
109
107
|
|
|
110
|
-
export const
|
|
108
|
+
export const Truncation = {
|
|
111
109
|
Auto: "auto",
|
|
112
110
|
Disabled: "disabled",
|
|
113
111
|
} as const;
|
|
114
|
-
export type
|
|
115
|
-
typeof ResponsesNonStreamingResponseTruncation
|
|
116
|
-
>;
|
|
112
|
+
export type Truncation = ClosedEnum<typeof Truncation>;
|
|
117
113
|
|
|
118
114
|
/**
|
|
119
115
|
* Non-streaming response from Responses API
|
|
@@ -152,7 +148,7 @@ export type ResponsesNonStreamingResponse = {
|
|
|
152
148
|
/**
|
|
153
149
|
* Tool choice configuration
|
|
154
150
|
*/
|
|
155
|
-
toolChoice:
|
|
151
|
+
toolChoice: ToolChoiceUnion;
|
|
156
152
|
parallelToolCalls: boolean;
|
|
157
153
|
/**
|
|
158
154
|
* Prompt configuration with variables
|
|
@@ -164,9 +160,9 @@ export type ResponsesNonStreamingResponse = {
|
|
|
164
160
|
* Reasoning configuration for Responses API
|
|
165
161
|
*/
|
|
166
162
|
reasoning?: ResponseReasoningConfig | null | undefined;
|
|
167
|
-
serviceTier?:
|
|
163
|
+
serviceTier?: ServiceTier | null | undefined;
|
|
168
164
|
store?: boolean | undefined;
|
|
169
|
-
truncation?:
|
|
165
|
+
truncation?: Truncation | null | undefined;
|
|
170
166
|
/**
|
|
171
167
|
* Text configuration for Responses API
|
|
172
168
|
*/
|
|
@@ -346,49 +342,41 @@ export function instructionsFromJSON(
|
|
|
346
342
|
}
|
|
347
343
|
|
|
348
344
|
/** @internal */
|
|
349
|
-
export const
|
|
350
|
-
|
|
351
|
-
.nativeEnum(ResponsesNonStreamingResponseServiceTier);
|
|
345
|
+
export const ServiceTier$inboundSchema: z.ZodNativeEnum<typeof ServiceTier> = z
|
|
346
|
+
.nativeEnum(ServiceTier);
|
|
352
347
|
|
|
353
348
|
/** @internal */
|
|
354
|
-
export const
|
|
355
|
-
|
|
356
|
-
ResponsesNonStreamingResponseServiceTier$inboundSchema;
|
|
349
|
+
export const ServiceTier$outboundSchema: z.ZodNativeEnum<typeof ServiceTier> =
|
|
350
|
+
ServiceTier$inboundSchema;
|
|
357
351
|
|
|
358
352
|
/**
|
|
359
353
|
* @internal
|
|
360
354
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
361
355
|
*/
|
|
362
|
-
export namespace
|
|
363
|
-
/** @deprecated use `
|
|
364
|
-
export const inboundSchema =
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
export const outboundSchema =
|
|
368
|
-
ResponsesNonStreamingResponseServiceTier$outboundSchema;
|
|
356
|
+
export namespace ServiceTier$ {
|
|
357
|
+
/** @deprecated use `ServiceTier$inboundSchema` instead. */
|
|
358
|
+
export const inboundSchema = ServiceTier$inboundSchema;
|
|
359
|
+
/** @deprecated use `ServiceTier$outboundSchema` instead. */
|
|
360
|
+
export const outboundSchema = ServiceTier$outboundSchema;
|
|
369
361
|
}
|
|
370
362
|
|
|
371
363
|
/** @internal */
|
|
372
|
-
export const
|
|
373
|
-
|
|
374
|
-
.nativeEnum(ResponsesNonStreamingResponseTruncation);
|
|
364
|
+
export const Truncation$inboundSchema: z.ZodNativeEnum<typeof Truncation> = z
|
|
365
|
+
.nativeEnum(Truncation);
|
|
375
366
|
|
|
376
367
|
/** @internal */
|
|
377
|
-
export const
|
|
378
|
-
|
|
379
|
-
ResponsesNonStreamingResponseTruncation$inboundSchema;
|
|
368
|
+
export const Truncation$outboundSchema: z.ZodNativeEnum<typeof Truncation> =
|
|
369
|
+
Truncation$inboundSchema;
|
|
380
370
|
|
|
381
371
|
/**
|
|
382
372
|
* @internal
|
|
383
373
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
384
374
|
*/
|
|
385
|
-
export namespace
|
|
386
|
-
/** @deprecated use `
|
|
387
|
-
export const inboundSchema =
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
export const outboundSchema =
|
|
391
|
-
ResponsesNonStreamingResponseTruncation$outboundSchema;
|
|
375
|
+
export namespace Truncation$ {
|
|
376
|
+
/** @deprecated use `Truncation$inboundSchema` instead. */
|
|
377
|
+
export const inboundSchema = Truncation$inboundSchema;
|
|
378
|
+
/** @deprecated use `Truncation$outboundSchema` instead. */
|
|
379
|
+
export const outboundSchema = Truncation$outboundSchema;
|
|
392
380
|
}
|
|
393
381
|
|
|
394
382
|
/** @internal */
|
|
@@ -422,18 +410,15 @@ export const ResponsesNonStreamingResponse$inboundSchema: z.ZodType<
|
|
|
422
410
|
).optional(),
|
|
423
411
|
metadata: z.nullable(z.record(z.string())),
|
|
424
412
|
tools: z.array(Tool$inboundSchema),
|
|
425
|
-
tool_choice:
|
|
413
|
+
tool_choice: ToolChoiceUnion$inboundSchema,
|
|
426
414
|
parallel_tool_calls: z.boolean(),
|
|
427
415
|
prompt: z.nullable(ResponsePrompt$inboundSchema).optional(),
|
|
428
416
|
background: z.nullable(z.boolean()).optional(),
|
|
429
417
|
previous_response_id: z.nullable(z.string()).optional(),
|
|
430
418
|
reasoning: z.nullable(ResponseReasoningConfig$inboundSchema).optional(),
|
|
431
|
-
service_tier: z.nullable(
|
|
432
|
-
ResponsesNonStreamingResponseServiceTier$inboundSchema,
|
|
433
|
-
).optional(),
|
|
419
|
+
service_tier: z.nullable(ServiceTier$inboundSchema).optional(),
|
|
434
420
|
store: z.boolean().optional(),
|
|
435
|
-
truncation: z.nullable(
|
|
436
|
-
.optional(),
|
|
421
|
+
truncation: z.nullable(Truncation$inboundSchema).optional(),
|
|
437
422
|
text: ResponseTextConfig$inboundSchema.optional(),
|
|
438
423
|
}).transform((v) => {
|
|
439
424
|
return remap$(v, {
|
|
@@ -481,7 +466,7 @@ export type ResponsesNonStreamingResponse$Outbound = {
|
|
|
481
466
|
| undefined;
|
|
482
467
|
metadata: { [k: string]: string } | null;
|
|
483
468
|
tools: Array<Tool$Outbound>;
|
|
484
|
-
tool_choice:
|
|
469
|
+
tool_choice: ToolChoiceUnion$Outbound;
|
|
485
470
|
parallel_tool_calls: boolean;
|
|
486
471
|
prompt?: ResponsePrompt$Outbound | null | undefined;
|
|
487
472
|
background?: boolean | null | undefined;
|
|
@@ -524,18 +509,15 @@ export const ResponsesNonStreamingResponse$outboundSchema: z.ZodType<
|
|
|
524
509
|
).optional(),
|
|
525
510
|
metadata: z.nullable(z.record(z.string())),
|
|
526
511
|
tools: z.array(Tool$outboundSchema),
|
|
527
|
-
toolChoice:
|
|
512
|
+
toolChoice: ToolChoiceUnion$outboundSchema,
|
|
528
513
|
parallelToolCalls: z.boolean(),
|
|
529
514
|
prompt: z.nullable(ResponsePrompt$outboundSchema).optional(),
|
|
530
515
|
background: z.nullable(z.boolean()).optional(),
|
|
531
516
|
previousResponseId: z.nullable(z.string()).optional(),
|
|
532
517
|
reasoning: z.nullable(ResponseReasoningConfig$outboundSchema).optional(),
|
|
533
|
-
serviceTier: z.nullable(
|
|
534
|
-
ResponsesNonStreamingResponseServiceTier$outboundSchema,
|
|
535
|
-
).optional(),
|
|
518
|
+
serviceTier: z.nullable(ServiceTier$outboundSchema).optional(),
|
|
536
519
|
store: z.boolean().optional(),
|
|
537
|
-
truncation: z.nullable(
|
|
538
|
-
.optional(),
|
|
520
|
+
truncation: z.nullable(Truncation$outboundSchema).optional(),
|
|
539
521
|
text: ResponseTextConfig$outboundSchema.optional(),
|
|
540
522
|
}).transform((v) => {
|
|
541
523
|
return remap$(v, {
|
|
@@ -20,6 +20,12 @@ import {
|
|
|
20
20
|
ResponsesOutputTokensDetails$outboundSchema,
|
|
21
21
|
} from "./responsesoutputtokensdetails.js";
|
|
22
22
|
|
|
23
|
+
export type CostDetails = {
|
|
24
|
+
upstreamInferenceCost?: number | null | undefined;
|
|
25
|
+
upstreamInferenceInputCost: number;
|
|
26
|
+
upstreamInferenceOutputCost: number;
|
|
27
|
+
};
|
|
28
|
+
|
|
23
29
|
/**
|
|
24
30
|
* Token usage statistics for Responses API
|
|
25
31
|
*/
|
|
@@ -35,8 +41,85 @@ export type ResponsesUsage = {
|
|
|
35
41
|
*/
|
|
36
42
|
outputTokensDetails: ResponsesOutputTokensDetails;
|
|
37
43
|
totalTokens: number;
|
|
44
|
+
/**
|
|
45
|
+
* Cost of the completion
|
|
46
|
+
*/
|
|
47
|
+
cost?: number | null | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Whether a request was made using a Bring Your Own Key configuration
|
|
50
|
+
*/
|
|
51
|
+
isByok?: boolean | undefined;
|
|
52
|
+
costDetails?: CostDetails | undefined;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/** @internal */
|
|
56
|
+
export const CostDetails$inboundSchema: z.ZodType<
|
|
57
|
+
CostDetails,
|
|
58
|
+
z.ZodTypeDef,
|
|
59
|
+
unknown
|
|
60
|
+
> = z.object({
|
|
61
|
+
upstream_inference_cost: z.nullable(z.number()).optional(),
|
|
62
|
+
upstream_inference_input_cost: z.number(),
|
|
63
|
+
upstream_inference_output_cost: z.number(),
|
|
64
|
+
}).transform((v) => {
|
|
65
|
+
return remap$(v, {
|
|
66
|
+
"upstream_inference_cost": "upstreamInferenceCost",
|
|
67
|
+
"upstream_inference_input_cost": "upstreamInferenceInputCost",
|
|
68
|
+
"upstream_inference_output_cost": "upstreamInferenceOutputCost",
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
/** @internal */
|
|
73
|
+
export type CostDetails$Outbound = {
|
|
74
|
+
upstream_inference_cost?: number | null | undefined;
|
|
75
|
+
upstream_inference_input_cost: number;
|
|
76
|
+
upstream_inference_output_cost: number;
|
|
38
77
|
};
|
|
39
78
|
|
|
79
|
+
/** @internal */
|
|
80
|
+
export const CostDetails$outboundSchema: z.ZodType<
|
|
81
|
+
CostDetails$Outbound,
|
|
82
|
+
z.ZodTypeDef,
|
|
83
|
+
CostDetails
|
|
84
|
+
> = z.object({
|
|
85
|
+
upstreamInferenceCost: z.nullable(z.number()).optional(),
|
|
86
|
+
upstreamInferenceInputCost: z.number(),
|
|
87
|
+
upstreamInferenceOutputCost: z.number(),
|
|
88
|
+
}).transform((v) => {
|
|
89
|
+
return remap$(v, {
|
|
90
|
+
upstreamInferenceCost: "upstream_inference_cost",
|
|
91
|
+
upstreamInferenceInputCost: "upstream_inference_input_cost",
|
|
92
|
+
upstreamInferenceOutputCost: "upstream_inference_output_cost",
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* @internal
|
|
98
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
99
|
+
*/
|
|
100
|
+
export namespace CostDetails$ {
|
|
101
|
+
/** @deprecated use `CostDetails$inboundSchema` instead. */
|
|
102
|
+
export const inboundSchema = CostDetails$inboundSchema;
|
|
103
|
+
/** @deprecated use `CostDetails$outboundSchema` instead. */
|
|
104
|
+
export const outboundSchema = CostDetails$outboundSchema;
|
|
105
|
+
/** @deprecated use `CostDetails$Outbound` instead. */
|
|
106
|
+
export type Outbound = CostDetails$Outbound;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function costDetailsToJSON(costDetails: CostDetails): string {
|
|
110
|
+
return JSON.stringify(CostDetails$outboundSchema.parse(costDetails));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function costDetailsFromJSON(
|
|
114
|
+
jsonString: string,
|
|
115
|
+
): SafeParseResult<CostDetails, SDKValidationError> {
|
|
116
|
+
return safeParse(
|
|
117
|
+
jsonString,
|
|
118
|
+
(x) => CostDetails$inboundSchema.parse(JSON.parse(x)),
|
|
119
|
+
`Failed to parse 'CostDetails' from JSON`,
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
40
123
|
/** @internal */
|
|
41
124
|
export const ResponsesUsage$inboundSchema: z.ZodType<
|
|
42
125
|
ResponsesUsage,
|
|
@@ -48,6 +131,9 @@ export const ResponsesUsage$inboundSchema: z.ZodType<
|
|
|
48
131
|
output_tokens: z.number(),
|
|
49
132
|
output_tokens_details: ResponsesOutputTokensDetails$inboundSchema,
|
|
50
133
|
total_tokens: z.number(),
|
|
134
|
+
cost: z.nullable(z.number()).optional(),
|
|
135
|
+
is_byok: z.boolean().optional(),
|
|
136
|
+
cost_details: z.lazy(() => CostDetails$inboundSchema).optional(),
|
|
51
137
|
}).transform((v) => {
|
|
52
138
|
return remap$(v, {
|
|
53
139
|
"input_tokens": "inputTokens",
|
|
@@ -55,6 +141,8 @@ export const ResponsesUsage$inboundSchema: z.ZodType<
|
|
|
55
141
|
"output_tokens": "outputTokens",
|
|
56
142
|
"output_tokens_details": "outputTokensDetails",
|
|
57
143
|
"total_tokens": "totalTokens",
|
|
144
|
+
"is_byok": "isByok",
|
|
145
|
+
"cost_details": "costDetails",
|
|
58
146
|
});
|
|
59
147
|
});
|
|
60
148
|
|
|
@@ -65,6 +153,9 @@ export type ResponsesUsage$Outbound = {
|
|
|
65
153
|
output_tokens: number;
|
|
66
154
|
output_tokens_details: ResponsesOutputTokensDetails$Outbound;
|
|
67
155
|
total_tokens: number;
|
|
156
|
+
cost?: number | null | undefined;
|
|
157
|
+
is_byok?: boolean | undefined;
|
|
158
|
+
cost_details?: CostDetails$Outbound | undefined;
|
|
68
159
|
};
|
|
69
160
|
|
|
70
161
|
/** @internal */
|
|
@@ -78,6 +169,9 @@ export const ResponsesUsage$outboundSchema: z.ZodType<
|
|
|
78
169
|
outputTokens: z.number(),
|
|
79
170
|
outputTokensDetails: ResponsesOutputTokensDetails$outboundSchema,
|
|
80
171
|
totalTokens: z.number(),
|
|
172
|
+
cost: z.nullable(z.number()).optional(),
|
|
173
|
+
isByok: z.boolean().optional(),
|
|
174
|
+
costDetails: z.lazy(() => CostDetails$outboundSchema).optional(),
|
|
81
175
|
}).transform((v) => {
|
|
82
176
|
return remap$(v, {
|
|
83
177
|
inputTokens: "input_tokens",
|
|
@@ -85,6 +179,8 @@ export const ResponsesUsage$outboundSchema: z.ZodType<
|
|
|
85
179
|
outputTokens: "output_tokens",
|
|
86
180
|
outputTokensDetails: "output_tokens_details",
|
|
87
181
|
totalTokens: "total_tokens",
|
|
182
|
+
isByok: "is_byok",
|
|
183
|
+
costDetails: "cost_details",
|
|
88
184
|
});
|
|
89
185
|
});
|
|
90
186
|
|
|
@@ -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
|
}
|