@openrouter/sdk 0.12.79 → 0.13.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -0
- package/esm/funcs/betaAnalyticsGetAnalyticsMeta.d.ts +18 -0
- package/esm/funcs/betaAnalyticsGetAnalyticsMeta.js +96 -0
- package/esm/funcs/betaAnalyticsQueryAnalytics.d.ts +18 -0
- package/esm/funcs/betaAnalyticsQueryAnalytics.js +97 -0
- package/esm/funcs/betaResponsesSend.js +1 -1
- package/esm/funcs/chatSend.js +1 -1
- package/esm/funcs/datasetsGetAppRankings.d.ts +43 -0
- package/esm/funcs/datasetsGetAppRankings.js +161 -0
- package/esm/funcs/datasetsGetBenchmarksArtificialAnalysis.d.ts +19 -0
- package/esm/funcs/datasetsGetBenchmarksArtificialAnalysis.js +102 -0
- package/esm/funcs/datasetsGetBenchmarksDesignArena.d.ts +19 -0
- package/esm/funcs/datasetsGetBenchmarksDesignArena.js +104 -0
- package/esm/funcs/filesDelete.d.ts +19 -0
- package/esm/funcs/filesDelete.js +107 -0
- package/esm/funcs/filesDownload.d.ts +18 -0
- package/esm/funcs/filesDownload.js +107 -0
- package/esm/funcs/filesList.d.ts +21 -0
- package/esm/funcs/filesList.js +131 -0
- package/esm/funcs/filesRetrieve.d.ts +19 -0
- package/esm/funcs/filesRetrieve.js +107 -0
- package/esm/funcs/filesUpload.d.ts +19 -0
- package/esm/funcs/filesUpload.js +121 -0
- package/esm/funcs/modelsGet.d.ts +19 -0
- package/esm/funcs/modelsGet.js +107 -0
- package/esm/funcs/modelsList.js +12 -0
- package/esm/funcs/oAuthCreateAuthCode.d.ts +1 -1
- package/esm/funcs/oAuthCreateAuthCode.js +1 -1
- package/esm/funcs/presetsGet.d.ts +21 -0
- package/esm/funcs/presetsGet.js +105 -0
- package/esm/funcs/presetsGetVersion.d.ts +21 -0
- package/esm/funcs/presetsGetVersion.js +109 -0
- package/esm/funcs/presetsList.d.ts +23 -0
- package/esm/funcs/presetsList.js +136 -0
- package/esm/funcs/presetsListVersions.d.ts +23 -0
- package/esm/funcs/presetsListVersions.js +142 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/aabenchmarkentry.d.ts +24 -0
- package/esm/models/aabenchmarkentry.js +23 -0
- package/esm/models/advisornestedtool.d.ts +25 -0
- package/esm/models/advisornestedtool.js +23 -0
- package/esm/models/advisorreasoning.d.ts +41 -0
- package/esm/models/advisorreasoning.js +33 -0
- package/esm/models/advisorservertoolconfig.d.ts +65 -0
- package/esm/models/advisorservertoolconfig.js +31 -0
- package/esm/models/advisorservertoolopenrouter.d.ts +28 -0
- package/esm/models/advisorservertoolopenrouter.js +20 -0
- package/esm/models/apprankingsitem.d.ts +29 -0
- package/esm/models/apprankingsitem.js +26 -0
- package/esm/models/apprankingsresponse.d.ts +16 -0
- package/esm/models/apprankingsresponse.js +17 -0
- package/esm/models/bashservertool.d.ts +28 -0
- package/esm/models/bashservertool.js +20 -0
- package/esm/models/bashservertoolconfig.d.ts +30 -0
- package/esm/models/bashservertoolconfig.js +22 -0
- package/esm/models/bashservertoolengine.d.ts +17 -0
- package/esm/models/bashservertoolengine.js +16 -0
- package/esm/models/bashservertoolenvironment.d.ts +13 -0
- package/esm/models/bashservertoolenvironment.js +16 -0
- package/esm/models/benchmarkpricing.d.ts +20 -0
- package/esm/models/benchmarkpricing.js +15 -0
- package/esm/models/benchmarksaaitem.d.ts +34 -0
- package/esm/models/benchmarksaaitem.js +29 -0
- package/esm/models/benchmarksaameta.d.ts +70 -0
- package/esm/models/benchmarksaameta.js +50 -0
- package/esm/models/benchmarksaaresponse.d.ts +13 -0
- package/esm/models/benchmarksaaresponse.js +17 -0
- package/esm/models/benchmarksdaitem.d.ts +59 -0
- package/esm/models/benchmarksdaitem.js +50 -0
- package/esm/models/benchmarksdameta.d.ts +98 -0
- package/esm/models/benchmarksdameta.js +62 -0
- package/esm/models/benchmarksdaresponse.d.ts +13 -0
- package/esm/models/benchmarksdaresponse.js +17 -0
- package/esm/models/byokproviderslug.d.ts +2 -1
- package/esm/models/byokproviderslug.js +2 -1
- package/esm/models/chatfunctiontool.d.ts +5 -2
- package/esm/models/chatfunctiontool.js +6 -0
- package/esm/models/chatrequest.d.ts +42 -0
- package/esm/models/chatrequest.js +24 -0
- package/esm/models/chatwebsearchshorthand.d.ts +10 -5
- package/esm/models/chatwebsearchshorthand.js +2 -0
- package/esm/models/containerautoenvironment.d.ts +15 -0
- package/esm/models/containerautoenvironment.js +13 -0
- package/esm/models/containerreferenceenvironment.d.ts +20 -0
- package/esm/models/containerreferenceenvironment.js +19 -0
- package/esm/models/contentfilterbuiltinentry.d.ts +5 -0
- package/esm/models/contentfilterbuiltinentry.js +7 -0
- package/esm/models/contentfilterbuiltinentryinput.d.ts +6 -0
- package/esm/models/contentfilterbuiltinentryinput.js +7 -0
- package/esm/models/contentpartaudio.d.ts +24 -0
- package/esm/models/contentpartaudio.js +27 -0
- package/esm/models/contentpartimage.d.ts +2 -9
- package/esm/models/contentpartimage.js +1 -6
- package/esm/models/contentpartvideo.d.ts +24 -0
- package/esm/models/contentpartvideo.js +27 -0
- package/esm/models/createobservabilitydestinationrequest.d.ts +1 -1
- package/esm/models/dabenchmarkentry.d.ts +32 -0
- package/esm/models/dabenchmarkentry.js +23 -0
- package/esm/models/filedeleteresponse.d.ts +21 -0
- package/esm/models/filedeleteresponse.js +20 -0
- package/esm/models/filelistresponse.d.ts +21 -0
- package/esm/models/filelistresponse.js +26 -0
- package/esm/models/filemetadata.d.ts +26 -0
- package/esm/models/filemetadata.js +33 -0
- package/esm/models/fusionanalysisresult.d.ts +88 -0
- package/esm/models/fusionanalysisresult.js +109 -0
- package/esm/models/fusioncallanalysiscompletedevent.d.ts +21 -0
- package/esm/models/fusioncallanalysiscompletedevent.js +26 -0
- package/esm/models/fusioncallanalysisinprogressevent.d.ts +17 -0
- package/esm/models/fusioncallanalysisinprogressevent.js +26 -0
- package/esm/models/fusioncallcompletedevent.d.ts +16 -0
- package/esm/models/fusioncallcompletedevent.js +24 -0
- package/esm/models/fusioncallinprogressevent.d.ts +16 -0
- package/esm/models/fusioncallinprogressevent.js +24 -0
- package/esm/models/fusioncallpaneladdedevent.d.ts +17 -0
- package/esm/models/fusioncallpaneladdedevent.js +25 -0
- package/esm/models/fusioncallpanelcompletedevent.d.ts +18 -0
- package/esm/models/fusioncallpanelcompletedevent.js +26 -0
- package/esm/models/fusioncallpaneldeltaevent.d.ts +18 -0
- package/esm/models/fusioncallpaneldeltaevent.js +26 -0
- package/esm/models/fusioncallpanelfailedevent.d.ts +19 -0
- package/esm/models/fusioncallpanelfailedevent.js +28 -0
- package/esm/models/fusioncallpanelreasoningdeltaevent.d.ts +18 -0
- package/esm/models/fusioncallpanelreasoningdeltaevent.js +26 -0
- package/esm/models/fusionplugin.d.ts +46 -0
- package/esm/models/fusionplugin.js +20 -0
- package/esm/models/fusionservertoolconfig.d.ts +27 -0
- package/esm/models/fusionservertoolconfig.js +10 -0
- package/esm/models/generationresponse.d.ts +22 -0
- package/esm/models/generationresponse.js +14 -0
- package/esm/models/getpresetresponse.d.ts +17 -0
- package/esm/models/getpresetresponse.js +15 -0
- package/esm/models/getpresetversionresponse.d.ts +17 -0
- package/esm/models/getpresetversionresponse.js +15 -0
- package/esm/models/index.d.ts +60 -0
- package/esm/models/index.js +60 -0
- package/esm/models/inputreference.d.ts +14 -0
- package/esm/models/inputreference.js +18 -0
- package/esm/models/inputsunion.d.ts +7 -4
- package/esm/models/inputsunion.js +11 -2
- package/esm/models/legacywebsearchservertool.d.ts +2 -2
- package/esm/models/listpresetsresponse.d.ts +15 -0
- package/esm/models/listpresetsresponse.js +21 -0
- package/esm/models/listpresetversionsresponse.d.ts +15 -0
- package/esm/models/listpresetversionsresponse.js +21 -0
- package/esm/models/messagesfallbackparam.d.ts +19 -0
- package/esm/models/messagesfallbackparam.js +22 -0
- package/esm/models/messagesrequest.d.ts +11 -4
- package/esm/models/messagesrequest.js +6 -0
- package/esm/models/model.d.ts +5 -0
- package/esm/models/model.js +2 -0
- package/esm/models/modelbenchmarks.d.ts +22 -0
- package/esm/models/modelbenchmarks.js +23 -0
- package/esm/models/modelresponse.d.ts +17 -0
- package/esm/models/modelresponse.js +16 -0
- package/esm/models/observabilityarizedestination.d.ts +1 -1
- package/esm/models/observabilitybraintrustdestination.d.ts +1 -1
- package/esm/models/observabilityclickhousedestination.d.ts +1 -1
- package/esm/models/observabilitydatadogdestination.d.ts +1 -1
- package/esm/models/observabilitygrafanadestination.d.ts +1 -1
- package/esm/models/observabilitylangfusedestination.d.ts +1 -1
- package/esm/models/observabilitylangsmithdestination.d.ts +1 -1
- package/esm/models/observabilitynewrelicdestination.d.ts +1 -1
- package/esm/models/observabilityopikdestination.d.ts +1 -1
- package/esm/models/observabilityotelcollectordestination.d.ts +1 -1
- package/esm/models/observabilityposthogdestination.d.ts +1 -1
- package/esm/models/observabilityrampdestination.d.ts +1 -1
- package/esm/models/observabilitys3destination.d.ts +1 -1
- package/esm/models/observabilitysentrydestination.d.ts +1 -1
- package/esm/models/observabilitysnowflakedestination.d.ts +1 -1
- package/esm/models/observabilityweavedestination.d.ts +1 -1
- package/esm/models/observabilitywebhookdestination.d.ts +1 -1
- package/esm/models/operations/createauthkeyscode.d.ts +6 -1
- package/esm/models/operations/createauthkeyscode.js +2 -0
- package/esm/models/operations/creatererank.d.ts +44 -10
- package/esm/models/operations/creatererank.js +21 -6
- package/esm/models/operations/createresponses.d.ts +3 -3
- package/esm/models/operations/createresponses.js +2 -3
- package/esm/models/operations/deletefile.d.ts +60 -0
- package/esm/models/operations/deletefile.js +24 -0
- package/esm/models/operations/downloadfilecontent.d.ts +60 -0
- package/esm/models/operations/downloadfilecontent.js +24 -0
- package/esm/models/operations/getanalyticsmeta.d.ts +198 -0
- package/esm/models/operations/getanalyticsmeta.js +141 -0
- package/esm/models/operations/getapprankings.d.ts +152 -0
- package/esm/models/operations/getapprankings.js +85 -0
- package/esm/models/operations/getbenchmarksartificialanalysis.d.ts +58 -0
- package/esm/models/operations/getbenchmarksartificialanalysis.js +22 -0
- package/esm/models/operations/getbenchmarksdesignarena.d.ts +83 -0
- package/esm/models/operations/getbenchmarksdesignarena.js +36 -0
- package/esm/models/operations/getfilemetadata.d.ts +60 -0
- package/esm/models/operations/getfilemetadata.js +24 -0
- package/esm/models/operations/getmodel.d.ts +63 -0
- package/esm/models/operations/getmodel.js +22 -0
- package/esm/models/operations/getmodels.d.ts +121 -5
- package/esm/models/operations/getmodels.js +59 -4
- package/esm/models/operations/getpreset.d.ts +58 -0
- package/esm/models/operations/getpreset.js +21 -0
- package/esm/models/operations/getpresetversion.d.ts +63 -0
- package/esm/models/operations/getpresetversion.js +22 -0
- package/esm/models/operations/index.d.ts +15 -0
- package/esm/models/operations/index.js +15 -0
- package/esm/models/operations/listbyokkeys.d.ts +2 -1
- package/esm/models/operations/listbyokkeys.js +2 -1
- package/esm/models/operations/listfiles.d.ts +77 -0
- package/esm/models/operations/listfiles.js +37 -0
- package/esm/models/operations/listpresets.d.ts +72 -0
- package/esm/models/operations/listpresets.js +35 -0
- package/esm/models/operations/listpresetversions.d.ts +77 -0
- package/esm/models/operations/listpresetversions.js +36 -0
- package/esm/models/operations/queryanalytics.d.ts +195 -0
- package/esm/models/operations/queryanalytics.js +129 -0
- package/esm/models/operations/sendchatcompletionrequest.d.ts +3 -3
- package/esm/models/operations/sendchatcompletionrequest.js +2 -3
- package/esm/models/operations/uploadfile.d.ts +82 -0
- package/esm/models/operations/uploadfile.js +45 -0
- package/esm/models/outputadvisorservertoolitem.d.ts +59 -0
- package/esm/models/outputadvisorservertoolitem.js +52 -0
- package/esm/models/outputfusionservertoolitem.d.ts +44 -43
- package/esm/models/outputfusionservertoolitem.js +49 -51
- package/esm/models/outputitems.d.ts +13 -3
- package/esm/models/outputitems.js +9 -1
- package/esm/models/outputshellcallitem.d.ts +29 -0
- package/esm/models/outputshellcallitem.js +38 -0
- package/esm/models/outputshellcalloutputitem.d.ts +48 -0
- package/esm/models/outputshellcalloutputitem.js +67 -0
- package/esm/models/outputsubagentservertoolitem.d.ts +59 -0
- package/esm/models/outputsubagentservertoolitem.js +54 -0
- package/esm/models/outputwebsearchcallitem.d.ts +2 -2
- package/esm/models/outputwebsearchcallitem.js +2 -2
- package/esm/models/preset.d.ts +27 -0
- package/esm/models/preset.js +35 -0
- package/esm/models/presetstatus.d.ts +17 -0
- package/esm/models/presetstatus.js +16 -0
- package/esm/models/presetwithdesignatedversion.d.ts +9 -14
- package/esm/models/presetwithdesignatedversion.js +4 -11
- package/esm/models/preview20250311websearchservertool.d.ts +2 -2
- package/esm/models/previewwebsearchservertool.d.ts +2 -2
- package/esm/models/promptinjectionscanscope.d.ts +18 -0
- package/esm/models/promptinjectionscanscope.js +17 -0
- package/esm/models/providername.d.ts +2 -1
- package/esm/models/providername.js +2 -1
- package/esm/models/provideroptions.d.ts +12 -0
- package/esm/models/provideroptions.js +2 -0
- package/esm/models/providerresponse.d.ts +3 -1
- package/esm/models/providerresponse.js +4 -2
- package/esm/models/rankingsdailymeta.d.ts +4 -4
- package/esm/models/rankingsdailymeta.js +3 -3
- package/esm/models/responsesrequest.d.ts +36 -8
- package/esm/models/responsesrequest.js +12 -0
- package/esm/models/searchqualitylevel.d.ts +2 -2
- package/esm/models/searchqualitylevel.js +1 -1
- package/esm/models/shellcallstatus.d.ts +17 -0
- package/esm/models/shellcallstatus.js +16 -0
- package/esm/models/shellservertoolconfig.d.ts +30 -0
- package/esm/models/shellservertoolconfig.js +22 -0
- package/esm/models/shellservertoolengine.d.ts +16 -0
- package/esm/models/shellservertoolengine.js +15 -0
- package/esm/models/shellservertoolenvironment.d.ts +13 -0
- package/esm/models/shellservertoolenvironment.js +16 -0
- package/esm/models/shellservertoolopenrouter.d.ts +21 -0
- package/esm/models/shellservertoolopenrouter.js +15 -0
- package/esm/models/streamevents.d.ts +10 -1
- package/esm/models/streamevents.js +18 -0
- package/esm/models/subagentnestedtool.d.ts +25 -0
- package/esm/models/subagentnestedtool.js +23 -0
- package/esm/models/subagentreasoning.d.ts +41 -0
- package/esm/models/subagentreasoning.js +33 -0
- package/esm/models/subagentservertoolconfig.d.ts +50 -0
- package/esm/models/subagentservertoolconfig.js +27 -0
- package/esm/models/subagentservertoolopenrouter.d.ts +28 -0
- package/esm/models/subagentservertoolopenrouter.js +20 -0
- package/esm/models/updateobservabilitydestinationrequest.d.ts +1 -1
- package/esm/models/urlcitation.d.ts +2 -0
- package/esm/models/urlcitation.js +2 -0
- package/esm/models/videogenerationrequest.d.ts +16 -4
- package/esm/models/videogenerationrequest.js +4 -2
- package/esm/models/websearchconfig.d.ts +10 -5
- package/esm/models/websearchconfig.js +2 -0
- package/esm/models/websearchengine.d.ts +1 -0
- package/esm/models/websearchengine.js +1 -0
- package/esm/models/websearchengineenum.d.ts +4 -3
- package/esm/models/websearchengineenum.js +3 -2
- package/esm/models/websearchservertool.d.ts +2 -2
- package/esm/models/websearchservertoolconfig.d.ts +10 -5
- package/esm/models/websearchservertoolconfig.js +2 -0
- package/esm/sdk/beta.d.ts +3 -0
- package/esm/sdk/beta.js +4 -0
- package/esm/sdk/betaanalytics.d.ts +19 -0
- package/esm/sdk/betaanalytics.js +29 -0
- package/esm/sdk/datasets.d.ts +46 -0
- package/esm/sdk/datasets.js +53 -0
- package/esm/sdk/files.d.ts +44 -0
- package/esm/sdk/files.js +60 -0
- package/esm/sdk/models.d.ts +7 -0
- package/esm/sdk/models.js +10 -0
- package/esm/sdk/presets.d.ts +33 -0
- package/esm/sdk/presets.js +41 -0
- package/esm/sdk/sdk.d.ts +5 -2
- package/esm/sdk/sdk.js +7 -3
- package/jsr.json +1 -1
- package/package.json +3 -3
|
@@ -12,13 +12,12 @@ export const SendChatCompletionRequestRequest$outboundSchema = z.object({
|
|
|
12
12
|
httpReferer: z.string().optional(),
|
|
13
13
|
appTitle: z.string().optional(),
|
|
14
14
|
appCategories: z.string().optional(),
|
|
15
|
-
|
|
16
|
-
.optional(),
|
|
15
|
+
xOpenRouterMetadata: models.MetadataLevel$outboundSchema.optional(),
|
|
17
16
|
chatRequest: models.ChatRequest$outboundSchema,
|
|
18
17
|
}).transform((v) => {
|
|
19
18
|
return remap$(v, {
|
|
20
19
|
httpReferer: "HTTP-Referer",
|
|
21
|
-
|
|
20
|
+
xOpenRouterMetadata: "X-OpenRouter-Metadata",
|
|
22
21
|
chatRequest: "ChatRequest",
|
|
23
22
|
});
|
|
24
23
|
});
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
export type UploadFileGlobals = {
|
|
3
|
+
/**
|
|
4
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* This is used to track API usage per application.
|
|
8
|
+
*/
|
|
9
|
+
httpReferer?: string | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
*/
|
|
15
|
+
appTitle?: string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
*/
|
|
21
|
+
appCategories?: string | undefined;
|
|
22
|
+
};
|
|
23
|
+
export type FileT = {
|
|
24
|
+
fileName: string;
|
|
25
|
+
content: ReadableStream<Uint8Array> | Blob | ArrayBuffer | Uint8Array;
|
|
26
|
+
};
|
|
27
|
+
export type UploadFileRequestBody = {
|
|
28
|
+
file: FileT | Blob;
|
|
29
|
+
};
|
|
30
|
+
export type UploadFileRequest = {
|
|
31
|
+
/**
|
|
32
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* This is used to track API usage per application.
|
|
36
|
+
*/
|
|
37
|
+
httpReferer?: string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
40
|
+
*
|
|
41
|
+
* @remarks
|
|
42
|
+
*/
|
|
43
|
+
appTitle?: string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
|
|
46
|
+
*
|
|
47
|
+
* @remarks
|
|
48
|
+
*/
|
|
49
|
+
appCategories?: string | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Workspace to scope the request to. Defaults to the caller’s default workspace.
|
|
52
|
+
*/
|
|
53
|
+
workspaceId?: string | undefined;
|
|
54
|
+
requestBody: UploadFileRequestBody;
|
|
55
|
+
};
|
|
56
|
+
/** @internal */
|
|
57
|
+
export type FileT$Outbound = {
|
|
58
|
+
fileName: string;
|
|
59
|
+
content: ReadableStream<Uint8Array> | Blob | ArrayBuffer | Uint8Array;
|
|
60
|
+
};
|
|
61
|
+
/** @internal */
|
|
62
|
+
export declare const FileT$outboundSchema: z.ZodType<FileT$Outbound, FileT>;
|
|
63
|
+
export declare function fileToJSON(fileT: FileT): string;
|
|
64
|
+
/** @internal */
|
|
65
|
+
export type UploadFileRequestBody$Outbound = {
|
|
66
|
+
file: FileT$Outbound | Blob;
|
|
67
|
+
};
|
|
68
|
+
/** @internal */
|
|
69
|
+
export declare const UploadFileRequestBody$outboundSchema: z.ZodType<UploadFileRequestBody$Outbound, UploadFileRequestBody>;
|
|
70
|
+
export declare function uploadFileRequestBodyToJSON(uploadFileRequestBody: UploadFileRequestBody): string;
|
|
71
|
+
/** @internal */
|
|
72
|
+
export type UploadFileRequest$Outbound = {
|
|
73
|
+
"HTTP-Referer"?: string | undefined;
|
|
74
|
+
appTitle?: string | undefined;
|
|
75
|
+
appCategories?: string | undefined;
|
|
76
|
+
workspace_id?: string | undefined;
|
|
77
|
+
RequestBody: UploadFileRequestBody$Outbound;
|
|
78
|
+
};
|
|
79
|
+
/** @internal */
|
|
80
|
+
export declare const UploadFileRequest$outboundSchema: z.ZodType<UploadFileRequest$Outbound, UploadFileRequest>;
|
|
81
|
+
export declare function uploadFileRequestToJSON(uploadFileRequest: UploadFileRequest): string;
|
|
82
|
+
//# sourceMappingURL=uploadfile.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: e2f1b0f34a4a
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { blobLikeSchema } from "../../types/blobs.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const FileT$outboundSchema = z.object({
|
|
10
|
+
fileName: z.string(),
|
|
11
|
+
content: z.union([
|
|
12
|
+
z.custom(x => x instanceof ReadableStream),
|
|
13
|
+
z.custom(x => x instanceof Blob),
|
|
14
|
+
z.custom(x => x instanceof ArrayBuffer),
|
|
15
|
+
z.custom(x => x instanceof Uint8Array),
|
|
16
|
+
]),
|
|
17
|
+
});
|
|
18
|
+
export function fileToJSON(fileT) {
|
|
19
|
+
return JSON.stringify(FileT$outboundSchema.parse(fileT));
|
|
20
|
+
}
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const UploadFileRequestBody$outboundSchema = z.object({
|
|
23
|
+
file: z.lazy(() => FileT$outboundSchema).or(blobLikeSchema),
|
|
24
|
+
});
|
|
25
|
+
export function uploadFileRequestBodyToJSON(uploadFileRequestBody) {
|
|
26
|
+
return JSON.stringify(UploadFileRequestBody$outboundSchema.parse(uploadFileRequestBody));
|
|
27
|
+
}
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const UploadFileRequest$outboundSchema = z.object({
|
|
30
|
+
httpReferer: z.string().optional(),
|
|
31
|
+
appTitle: z.string().optional(),
|
|
32
|
+
appCategories: z.string().optional(),
|
|
33
|
+
workspaceId: z.string().optional(),
|
|
34
|
+
requestBody: z.lazy(() => UploadFileRequestBody$outboundSchema),
|
|
35
|
+
}).transform((v) => {
|
|
36
|
+
return remap$(v, {
|
|
37
|
+
httpReferer: "HTTP-Referer",
|
|
38
|
+
workspaceId: "workspace_id",
|
|
39
|
+
requestBody: "RequestBody",
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
export function uploadFileRequestToJSON(uploadFileRequest) {
|
|
43
|
+
return JSON.stringify(UploadFileRequest$outboundSchema.parse(uploadFileRequest));
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=uploadfile.js.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
import { ToolCallStatus } from "./toolcallstatus.js";
|
|
6
|
+
export declare const OutputAdvisorServerToolItemType: {
|
|
7
|
+
readonly OpenrouterAdvisor: "openrouter:advisor";
|
|
8
|
+
};
|
|
9
|
+
export type OutputAdvisorServerToolItemType = ClosedEnum<typeof OutputAdvisorServerToolItemType>;
|
|
10
|
+
/**
|
|
11
|
+
* An openrouter:advisor server tool output item
|
|
12
|
+
*/
|
|
13
|
+
export type OutputAdvisorServerToolItem = {
|
|
14
|
+
/**
|
|
15
|
+
* The advisor model's response (the advice text returned to the executor).
|
|
16
|
+
*/
|
|
17
|
+
advice?: string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Error message when the advisor call did not produce advice.
|
|
20
|
+
*/
|
|
21
|
+
error?: string | undefined;
|
|
22
|
+
id?: string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Provider-safe function name of the specific advisor instance that produced this item (e.g. `openrouter_advisor__1`). Present only when more than one advisor tool is configured; omitted for the default single advisor. Echo this field back unchanged so the advisor's cross-request memory stays namespaced to the correct instance. This identity is positional: it is derived from the index of the advisor entry in the request `tools` array, so clients must keep the order of advisor tool entries stable across requests in a conversation. Reordering or inserting advisor entries shifts these names and causes each advisor's cross-request memory to be attributed to the wrong instance.
|
|
25
|
+
*/
|
|
26
|
+
instanceName?: string | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Slug of the advisor model that was consulted.
|
|
29
|
+
*/
|
|
30
|
+
model?: string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* The prompt the executor sent to the advisor.
|
|
33
|
+
*/
|
|
34
|
+
prompt?: string | undefined;
|
|
35
|
+
status: ToolCallStatus;
|
|
36
|
+
type: OutputAdvisorServerToolItemType;
|
|
37
|
+
};
|
|
38
|
+
/** @internal */
|
|
39
|
+
export declare const OutputAdvisorServerToolItemType$inboundSchema: z.ZodEnum<typeof OutputAdvisorServerToolItemType>;
|
|
40
|
+
/** @internal */
|
|
41
|
+
export declare const OutputAdvisorServerToolItemType$outboundSchema: z.ZodEnum<typeof OutputAdvisorServerToolItemType>;
|
|
42
|
+
/** @internal */
|
|
43
|
+
export declare const OutputAdvisorServerToolItem$inboundSchema: z.ZodType<OutputAdvisorServerToolItem, unknown>;
|
|
44
|
+
/** @internal */
|
|
45
|
+
export type OutputAdvisorServerToolItem$Outbound = {
|
|
46
|
+
advice?: string | undefined;
|
|
47
|
+
error?: string | undefined;
|
|
48
|
+
id?: string | undefined;
|
|
49
|
+
instance_name?: string | undefined;
|
|
50
|
+
model?: string | undefined;
|
|
51
|
+
prompt?: string | undefined;
|
|
52
|
+
status: string;
|
|
53
|
+
type: string;
|
|
54
|
+
};
|
|
55
|
+
/** @internal */
|
|
56
|
+
export declare const OutputAdvisorServerToolItem$outboundSchema: z.ZodType<OutputAdvisorServerToolItem$Outbound, OutputAdvisorServerToolItem>;
|
|
57
|
+
export declare function outputAdvisorServerToolItemToJSON(outputAdvisorServerToolItem: OutputAdvisorServerToolItem): string;
|
|
58
|
+
export declare function outputAdvisorServerToolItemFromJSON(jsonString: string): SafeParseResult<OutputAdvisorServerToolItem, SDKValidationError>;
|
|
59
|
+
//# sourceMappingURL=outputadvisorservertoolitem.d.ts.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 0c9d6ff77975
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import { ToolCallStatus$inboundSchema, ToolCallStatus$outboundSchema, } from "./toolcallstatus.js";
|
|
9
|
+
export const OutputAdvisorServerToolItemType = {
|
|
10
|
+
OpenrouterAdvisor: "openrouter:advisor",
|
|
11
|
+
};
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const OutputAdvisorServerToolItemType$inboundSchema = z.enum(OutputAdvisorServerToolItemType);
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const OutputAdvisorServerToolItemType$outboundSchema = OutputAdvisorServerToolItemType$inboundSchema;
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const OutputAdvisorServerToolItem$inboundSchema = z.object({
|
|
18
|
+
advice: z.string().optional(),
|
|
19
|
+
error: z.string().optional(),
|
|
20
|
+
id: z.string().optional(),
|
|
21
|
+
instance_name: z.string().optional(),
|
|
22
|
+
model: z.string().optional(),
|
|
23
|
+
prompt: z.string().optional(),
|
|
24
|
+
status: ToolCallStatus$inboundSchema,
|
|
25
|
+
type: OutputAdvisorServerToolItemType$inboundSchema,
|
|
26
|
+
}).transform((v) => {
|
|
27
|
+
return remap$(v, {
|
|
28
|
+
"instance_name": "instanceName",
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
/** @internal */
|
|
32
|
+
export const OutputAdvisorServerToolItem$outboundSchema = z.object({
|
|
33
|
+
advice: z.string().optional(),
|
|
34
|
+
error: z.string().optional(),
|
|
35
|
+
id: z.string().optional(),
|
|
36
|
+
instanceName: z.string().optional(),
|
|
37
|
+
model: z.string().optional(),
|
|
38
|
+
prompt: z.string().optional(),
|
|
39
|
+
status: ToolCallStatus$outboundSchema,
|
|
40
|
+
type: OutputAdvisorServerToolItemType$outboundSchema,
|
|
41
|
+
}).transform((v) => {
|
|
42
|
+
return remap$(v, {
|
|
43
|
+
instanceName: "instance_name",
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
export function outputAdvisorServerToolItemToJSON(outputAdvisorServerToolItem) {
|
|
47
|
+
return JSON.stringify(OutputAdvisorServerToolItem$outboundSchema.parse(outputAdvisorServerToolItem));
|
|
48
|
+
}
|
|
49
|
+
export function outputAdvisorServerToolItemFromJSON(jsonString) {
|
|
50
|
+
return safeParse(jsonString, (x) => OutputAdvisorServerToolItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OutputAdvisorServerToolItem' from JSON`);
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=outputadvisorservertoolitem.js.map
|
|
@@ -1,33 +1,9 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
2
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
import { FusionAnalysisResult, FusionAnalysisResult$Outbound } from "./fusionanalysisresult.js";
|
|
4
6
|
import { ToolCallStatus } from "./toolcallstatus.js";
|
|
5
|
-
export type Stance = {
|
|
6
|
-
model: string;
|
|
7
|
-
stance: string;
|
|
8
|
-
};
|
|
9
|
-
export type Contradiction = {
|
|
10
|
-
stances: Array<Stance>;
|
|
11
|
-
topic: string;
|
|
12
|
-
};
|
|
13
|
-
export type PartialCoverage = {
|
|
14
|
-
models: Array<string>;
|
|
15
|
-
point: string;
|
|
16
|
-
};
|
|
17
|
-
export type UniqueInsight = {
|
|
18
|
-
insight: string;
|
|
19
|
-
model: string;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Structured analysis produced by the fusion judge model.
|
|
23
|
-
*/
|
|
24
|
-
export type Analysis = {
|
|
25
|
-
blindSpots: Array<string>;
|
|
26
|
-
consensus: Array<string>;
|
|
27
|
-
contradictions: Array<Contradiction>;
|
|
28
|
-
partialCoverage: Array<PartialCoverage>;
|
|
29
|
-
uniqueInsights: Array<UniqueInsight>;
|
|
30
|
-
};
|
|
31
7
|
export type FailedModel = {
|
|
32
8
|
/**
|
|
33
9
|
* Error message describing why the model failed.
|
|
@@ -43,8 +19,13 @@ export type FailedModel = {
|
|
|
43
19
|
statusCode?: number | undefined;
|
|
44
20
|
};
|
|
45
21
|
export type ResponseT = {
|
|
22
|
+
content?: string | undefined;
|
|
46
23
|
model: string;
|
|
47
24
|
};
|
|
25
|
+
export declare const OutputFusionServerToolItemType: {
|
|
26
|
+
readonly OpenrouterFusion: "openrouter:fusion";
|
|
27
|
+
};
|
|
28
|
+
export type OutputFusionServerToolItemType = ClosedEnum<typeof OutputFusionServerToolItemType>;
|
|
48
29
|
/**
|
|
49
30
|
* An openrouter:fusion server tool output item
|
|
50
31
|
*/
|
|
@@ -52,7 +33,7 @@ export type OutputFusionServerToolItem = {
|
|
|
52
33
|
/**
|
|
53
34
|
* Structured analysis produced by the fusion judge model.
|
|
54
35
|
*/
|
|
55
|
-
analysis?:
|
|
36
|
+
analysis?: FusionAnalysisResult | undefined;
|
|
56
37
|
/**
|
|
57
38
|
* Error message when the fusion run did not produce an analysis result.
|
|
58
39
|
*/
|
|
@@ -67,34 +48,54 @@ export type OutputFusionServerToolItem = {
|
|
|
67
48
|
failureReason?: string | undefined;
|
|
68
49
|
id?: string | undefined;
|
|
69
50
|
/**
|
|
70
|
-
*
|
|
51
|
+
* Analysis models that produced a response in this fusion run, with each model's full panel content.
|
|
71
52
|
*/
|
|
72
53
|
responses?: Array<ResponseT> | undefined;
|
|
73
54
|
status: ToolCallStatus;
|
|
74
|
-
type:
|
|
55
|
+
type: OutputFusionServerToolItemType;
|
|
75
56
|
};
|
|
76
57
|
/** @internal */
|
|
77
|
-
export declare const
|
|
78
|
-
export declare function stanceFromJSON(jsonString: string): SafeParseResult<Stance, SDKValidationError>;
|
|
79
|
-
/** @internal */
|
|
80
|
-
export declare const Contradiction$inboundSchema: z.ZodType<Contradiction, unknown>;
|
|
81
|
-
export declare function contradictionFromJSON(jsonString: string): SafeParseResult<Contradiction, SDKValidationError>;
|
|
82
|
-
/** @internal */
|
|
83
|
-
export declare const PartialCoverage$inboundSchema: z.ZodType<PartialCoverage, unknown>;
|
|
84
|
-
export declare function partialCoverageFromJSON(jsonString: string): SafeParseResult<PartialCoverage, SDKValidationError>;
|
|
85
|
-
/** @internal */
|
|
86
|
-
export declare const UniqueInsight$inboundSchema: z.ZodType<UniqueInsight, unknown>;
|
|
87
|
-
export declare function uniqueInsightFromJSON(jsonString: string): SafeParseResult<UniqueInsight, SDKValidationError>;
|
|
58
|
+
export declare const FailedModel$inboundSchema: z.ZodType<FailedModel, unknown>;
|
|
88
59
|
/** @internal */
|
|
89
|
-
export
|
|
90
|
-
|
|
60
|
+
export type FailedModel$Outbound = {
|
|
61
|
+
error: string;
|
|
62
|
+
model: string;
|
|
63
|
+
status_code?: number | undefined;
|
|
64
|
+
};
|
|
91
65
|
/** @internal */
|
|
92
|
-
export declare const FailedModel$
|
|
66
|
+
export declare const FailedModel$outboundSchema: z.ZodType<FailedModel$Outbound, FailedModel>;
|
|
67
|
+
export declare function failedModelToJSON(failedModel: FailedModel): string;
|
|
93
68
|
export declare function failedModelFromJSON(jsonString: string): SafeParseResult<FailedModel, SDKValidationError>;
|
|
94
69
|
/** @internal */
|
|
95
70
|
export declare const ResponseT$inboundSchema: z.ZodType<ResponseT, unknown>;
|
|
71
|
+
/** @internal */
|
|
72
|
+
export type ResponseT$Outbound = {
|
|
73
|
+
content?: string | undefined;
|
|
74
|
+
model: string;
|
|
75
|
+
};
|
|
76
|
+
/** @internal */
|
|
77
|
+
export declare const ResponseT$outboundSchema: z.ZodType<ResponseT$Outbound, ResponseT>;
|
|
78
|
+
export declare function responseToJSON(responseT: ResponseT): string;
|
|
96
79
|
export declare function responseFromJSON(jsonString: string): SafeParseResult<ResponseT, SDKValidationError>;
|
|
97
80
|
/** @internal */
|
|
81
|
+
export declare const OutputFusionServerToolItemType$inboundSchema: z.ZodEnum<typeof OutputFusionServerToolItemType>;
|
|
82
|
+
/** @internal */
|
|
83
|
+
export declare const OutputFusionServerToolItemType$outboundSchema: z.ZodEnum<typeof OutputFusionServerToolItemType>;
|
|
84
|
+
/** @internal */
|
|
98
85
|
export declare const OutputFusionServerToolItem$inboundSchema: z.ZodType<OutputFusionServerToolItem, unknown>;
|
|
86
|
+
/** @internal */
|
|
87
|
+
export type OutputFusionServerToolItem$Outbound = {
|
|
88
|
+
analysis?: FusionAnalysisResult$Outbound | undefined;
|
|
89
|
+
error?: string | undefined;
|
|
90
|
+
failed_models?: Array<FailedModel$Outbound> | undefined;
|
|
91
|
+
failure_reason?: string | undefined;
|
|
92
|
+
id?: string | undefined;
|
|
93
|
+
responses?: Array<ResponseT$Outbound> | undefined;
|
|
94
|
+
status: string;
|
|
95
|
+
type: string;
|
|
96
|
+
};
|
|
97
|
+
/** @internal */
|
|
98
|
+
export declare const OutputFusionServerToolItem$outboundSchema: z.ZodType<OutputFusionServerToolItem$Outbound, OutputFusionServerToolItem>;
|
|
99
|
+
export declare function outputFusionServerToolItemToJSON(outputFusionServerToolItem: OutputFusionServerToolItem): string;
|
|
99
100
|
export declare function outputFusionServerToolItemFromJSON(jsonString: string): SafeParseResult<OutputFusionServerToolItem, SDKValidationError>;
|
|
100
101
|
//# sourceMappingURL=outputfusionservertoolitem.d.ts.map
|
|
@@ -5,95 +5,93 @@
|
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
|
-
import {
|
|
8
|
+
import { FusionAnalysisResult$inboundSchema, FusionAnalysisResult$outboundSchema, } from "./fusionanalysisresult.js";
|
|
9
|
+
import { ToolCallStatus$inboundSchema, ToolCallStatus$outboundSchema, } from "./toolcallstatus.js";
|
|
10
|
+
export const OutputFusionServerToolItemType = {
|
|
11
|
+
OpenrouterFusion: "openrouter:fusion",
|
|
12
|
+
};
|
|
9
13
|
/** @internal */
|
|
10
|
-
export const
|
|
11
|
-
model: z.string(),
|
|
12
|
-
stance: z.string(),
|
|
13
|
-
});
|
|
14
|
-
export function stanceFromJSON(jsonString) {
|
|
15
|
-
return safeParse(jsonString, (x) => Stance$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Stance' from JSON`);
|
|
16
|
-
}
|
|
17
|
-
/** @internal */
|
|
18
|
-
export const Contradiction$inboundSchema = z
|
|
19
|
-
.object({
|
|
20
|
-
stances: z.array(z.lazy(() => Stance$inboundSchema)),
|
|
21
|
-
topic: z.string(),
|
|
22
|
-
});
|
|
23
|
-
export function contradictionFromJSON(jsonString) {
|
|
24
|
-
return safeParse(jsonString, (x) => Contradiction$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Contradiction' from JSON`);
|
|
25
|
-
}
|
|
26
|
-
/** @internal */
|
|
27
|
-
export const PartialCoverage$inboundSchema = z.object({
|
|
28
|
-
models: z.array(z.string()),
|
|
29
|
-
point: z.string(),
|
|
30
|
-
});
|
|
31
|
-
export function partialCoverageFromJSON(jsonString) {
|
|
32
|
-
return safeParse(jsonString, (x) => PartialCoverage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartialCoverage' from JSON`);
|
|
33
|
-
}
|
|
34
|
-
/** @internal */
|
|
35
|
-
export const UniqueInsight$inboundSchema = z
|
|
14
|
+
export const FailedModel$inboundSchema = z
|
|
36
15
|
.object({
|
|
37
|
-
|
|
16
|
+
error: z.string(),
|
|
38
17
|
model: z.string(),
|
|
39
|
-
|
|
40
|
-
export function uniqueInsightFromJSON(jsonString) {
|
|
41
|
-
return safeParse(jsonString, (x) => UniqueInsight$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UniqueInsight' from JSON`);
|
|
42
|
-
}
|
|
43
|
-
/** @internal */
|
|
44
|
-
export const Analysis$inboundSchema = z.object({
|
|
45
|
-
blind_spots: z.array(z.string()),
|
|
46
|
-
consensus: z.array(z.string()),
|
|
47
|
-
contradictions: z.array(z.lazy(() => Contradiction$inboundSchema)),
|
|
48
|
-
partial_coverage: z.array(z.lazy(() => PartialCoverage$inboundSchema)),
|
|
49
|
-
unique_insights: z.array(z.lazy(() => UniqueInsight$inboundSchema)),
|
|
18
|
+
status_code: z.int().optional(),
|
|
50
19
|
}).transform((v) => {
|
|
51
20
|
return remap$(v, {
|
|
52
|
-
"
|
|
53
|
-
"partial_coverage": "partialCoverage",
|
|
54
|
-
"unique_insights": "uniqueInsights",
|
|
21
|
+
"status_code": "statusCode",
|
|
55
22
|
});
|
|
56
23
|
});
|
|
57
|
-
export function analysisFromJSON(jsonString) {
|
|
58
|
-
return safeParse(jsonString, (x) => Analysis$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Analysis' from JSON`);
|
|
59
|
-
}
|
|
60
24
|
/** @internal */
|
|
61
|
-
export const FailedModel$
|
|
62
|
-
.object({
|
|
25
|
+
export const FailedModel$outboundSchema = z.object({
|
|
63
26
|
error: z.string(),
|
|
64
27
|
model: z.string(),
|
|
65
|
-
|
|
28
|
+
statusCode: z.int().optional(),
|
|
66
29
|
}).transform((v) => {
|
|
67
30
|
return remap$(v, {
|
|
68
|
-
|
|
31
|
+
statusCode: "status_code",
|
|
69
32
|
});
|
|
70
33
|
});
|
|
34
|
+
export function failedModelToJSON(failedModel) {
|
|
35
|
+
return JSON.stringify(FailedModel$outboundSchema.parse(failedModel));
|
|
36
|
+
}
|
|
71
37
|
export function failedModelFromJSON(jsonString) {
|
|
72
38
|
return safeParse(jsonString, (x) => FailedModel$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FailedModel' from JSON`);
|
|
73
39
|
}
|
|
74
40
|
/** @internal */
|
|
75
41
|
export const ResponseT$inboundSchema = z.object({
|
|
42
|
+
content: z.string().optional(),
|
|
76
43
|
model: z.string(),
|
|
77
44
|
});
|
|
45
|
+
/** @internal */
|
|
46
|
+
export const ResponseT$outboundSchema = z.object({
|
|
47
|
+
content: z.string().optional(),
|
|
48
|
+
model: z.string(),
|
|
49
|
+
});
|
|
50
|
+
export function responseToJSON(responseT) {
|
|
51
|
+
return JSON.stringify(ResponseT$outboundSchema.parse(responseT));
|
|
52
|
+
}
|
|
78
53
|
export function responseFromJSON(jsonString) {
|
|
79
54
|
return safeParse(jsonString, (x) => ResponseT$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResponseT' from JSON`);
|
|
80
55
|
}
|
|
81
56
|
/** @internal */
|
|
57
|
+
export const OutputFusionServerToolItemType$inboundSchema = z.enum(OutputFusionServerToolItemType);
|
|
58
|
+
/** @internal */
|
|
59
|
+
export const OutputFusionServerToolItemType$outboundSchema = OutputFusionServerToolItemType$inboundSchema;
|
|
60
|
+
/** @internal */
|
|
82
61
|
export const OutputFusionServerToolItem$inboundSchema = z.object({
|
|
83
|
-
analysis:
|
|
62
|
+
analysis: FusionAnalysisResult$inboundSchema.optional(),
|
|
84
63
|
error: z.string().optional(),
|
|
85
64
|
failed_models: z.array(z.lazy(() => FailedModel$inboundSchema)).optional(),
|
|
86
65
|
failure_reason: z.string().optional(),
|
|
87
66
|
id: z.string().optional(),
|
|
88
67
|
responses: z.array(z.lazy(() => ResponseT$inboundSchema)).optional(),
|
|
89
68
|
status: ToolCallStatus$inboundSchema,
|
|
90
|
-
type:
|
|
69
|
+
type: OutputFusionServerToolItemType$inboundSchema,
|
|
91
70
|
}).transform((v) => {
|
|
92
71
|
return remap$(v, {
|
|
93
72
|
"failed_models": "failedModels",
|
|
94
73
|
"failure_reason": "failureReason",
|
|
95
74
|
});
|
|
96
75
|
});
|
|
76
|
+
/** @internal */
|
|
77
|
+
export const OutputFusionServerToolItem$outboundSchema = z.object({
|
|
78
|
+
analysis: FusionAnalysisResult$outboundSchema.optional(),
|
|
79
|
+
error: z.string().optional(),
|
|
80
|
+
failedModels: z.array(z.lazy(() => FailedModel$outboundSchema)).optional(),
|
|
81
|
+
failureReason: z.string().optional(),
|
|
82
|
+
id: z.string().optional(),
|
|
83
|
+
responses: z.array(z.lazy(() => ResponseT$outboundSchema)).optional(),
|
|
84
|
+
status: ToolCallStatus$outboundSchema,
|
|
85
|
+
type: OutputFusionServerToolItemType$outboundSchema,
|
|
86
|
+
}).transform((v) => {
|
|
87
|
+
return remap$(v, {
|
|
88
|
+
failedModels: "failed_models",
|
|
89
|
+
failureReason: "failure_reason",
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
export function outputFusionServerToolItemToJSON(outputFusionServerToolItem) {
|
|
93
|
+
return JSON.stringify(OutputFusionServerToolItem$outboundSchema.parse(outputFusionServerToolItem));
|
|
94
|
+
}
|
|
97
95
|
export function outputFusionServerToolItemFromJSON(jsonString) {
|
|
98
96
|
return safeParse(jsonString, (x) => OutputFusionServerToolItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OutputFusionServerToolItem' from JSON`);
|
|
99
97
|
}
|
|
@@ -2,6 +2,7 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import * as discriminatedUnionTypes from "../types/discriminatedUnion.js";
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
import { OutputAdvisorServerToolItem } from "./outputadvisorservertoolitem.js";
|
|
5
6
|
import { OutputApplyPatchCallItem } from "./outputapplypatchcallitem.js";
|
|
6
7
|
import { OutputApplyPatchServerToolItem } from "./outputapplypatchservertoolitem.js";
|
|
7
8
|
import { OutputBashServerToolItem } from "./outputbashservertoolitem.js";
|
|
@@ -22,6 +23,9 @@ import { OutputMemoryServerToolItem } from "./outputmemoryservertoolitem.js";
|
|
|
22
23
|
import { OutputMessageItem } from "./outputmessageitem.js";
|
|
23
24
|
import { OutputReasoningItem } from "./outputreasoningitem.js";
|
|
24
25
|
import { OutputSearchModelsServerToolItem } from "./outputsearchmodelsservertoolitem.js";
|
|
26
|
+
import { OutputShellCallItem } from "./outputshellcallitem.js";
|
|
27
|
+
import { OutputShellCallOutputItem } from "./outputshellcalloutputitem.js";
|
|
28
|
+
import { OutputSubagentServerToolItem } from "./outputsubagentservertoolitem.js";
|
|
25
29
|
import { OutputTextEditorServerToolItem } from "./outputtexteditorservertoolitem.js";
|
|
26
30
|
import { OutputToolSearchServerToolItem } from "./outputtoolsearchservertoolitem.js";
|
|
27
31
|
import { OutputWebFetchServerToolItem } from "./outputwebfetchservertoolitem.js";
|
|
@@ -42,7 +46,9 @@ export type OutputItems = OutputApplyPatchCallItem | (OutputCodeInterpreterCallI
|
|
|
42
46
|
type: "function_call";
|
|
43
47
|
}) | (OutputImageGenerationCallItem & {
|
|
44
48
|
type: "image_generation_call";
|
|
45
|
-
}) | OutputMessageItem | (
|
|
49
|
+
}) | OutputMessageItem | (OutputAdvisorServerToolItem & {
|
|
50
|
+
type: "openrouter:advisor";
|
|
51
|
+
}) | (OutputApplyPatchServerToolItem & {
|
|
46
52
|
type: "openrouter:apply_patch";
|
|
47
53
|
}) | (OutputBashServerToolItem & {
|
|
48
54
|
type: "openrouter:bash";
|
|
@@ -56,12 +62,16 @@ export type OutputItems = OutputApplyPatchCallItem | (OutputCodeInterpreterCallI
|
|
|
56
62
|
type: "openrouter:experimental__search_models";
|
|
57
63
|
}) | (OutputFileSearchServerToolItem & {
|
|
58
64
|
type: "openrouter:file_search";
|
|
59
|
-
}) | OutputFusionServerToolItem
|
|
65
|
+
}) | (OutputFusionServerToolItem & {
|
|
66
|
+
type: "openrouter:fusion";
|
|
67
|
+
}) | (OutputImageGenerationServerToolItem & {
|
|
60
68
|
type: "openrouter:image_generation";
|
|
61
69
|
}) | (OutputMcpServerToolItem & {
|
|
62
70
|
type: "openrouter:mcp";
|
|
63
71
|
}) | (OutputMemoryServerToolItem & {
|
|
64
72
|
type: "openrouter:memory";
|
|
73
|
+
}) | (OutputSubagentServerToolItem & {
|
|
74
|
+
type: "openrouter:subagent";
|
|
65
75
|
}) | (OutputTextEditorServerToolItem & {
|
|
66
76
|
type: "openrouter:text_editor";
|
|
67
77
|
}) | (OutputToolSearchServerToolItem & {
|
|
@@ -70,7 +80,7 @@ export type OutputItems = OutputApplyPatchCallItem | (OutputCodeInterpreterCallI
|
|
|
70
80
|
type: "openrouter:web_fetch";
|
|
71
81
|
}) | (OutputWebSearchServerToolItem & {
|
|
72
82
|
type: "openrouter:web_search";
|
|
73
|
-
}) | OutputReasoningItem | (OutputWebSearchCallItem & {
|
|
83
|
+
}) | OutputReasoningItem | OutputShellCallItem | OutputShellCallOutputItem | (OutputWebSearchCallItem & {
|
|
74
84
|
type: "web_search_call";
|
|
75
85
|
}) | discriminatedUnionTypes.Unknown<"type">;
|
|
76
86
|
/** @internal */
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
7
|
import { discriminatedUnion } from "../types/discriminatedUnion.js";
|
|
8
|
+
import { OutputAdvisorServerToolItem$inboundSchema, } from "./outputadvisorservertoolitem.js";
|
|
8
9
|
import { OutputApplyPatchCallItem$inboundSchema, } from "./outputapplypatchcallitem.js";
|
|
9
10
|
import { OutputApplyPatchServerToolItem$inboundSchema, } from "./outputapplypatchservertoolitem.js";
|
|
10
11
|
import { OutputBashServerToolItem$inboundSchema, } from "./outputbashservertoolitem.js";
|
|
@@ -25,6 +26,9 @@ import { OutputMemoryServerToolItem$inboundSchema, } from "./outputmemoryservert
|
|
|
25
26
|
import { OutputMessageItem$inboundSchema, } from "./outputmessageitem.js";
|
|
26
27
|
import { OutputReasoningItem$inboundSchema, } from "./outputreasoningitem.js";
|
|
27
28
|
import { OutputSearchModelsServerToolItem$inboundSchema, } from "./outputsearchmodelsservertoolitem.js";
|
|
29
|
+
import { OutputShellCallItem$inboundSchema, } from "./outputshellcallitem.js";
|
|
30
|
+
import { OutputShellCallOutputItem$inboundSchema, } from "./outputshellcalloutputitem.js";
|
|
31
|
+
import { OutputSubagentServerToolItem$inboundSchema, } from "./outputsubagentservertoolitem.js";
|
|
28
32
|
import { OutputTextEditorServerToolItem$inboundSchema, } from "./outputtexteditorservertoolitem.js";
|
|
29
33
|
import { OutputToolSearchServerToolItem$inboundSchema, } from "./outputtoolsearchservertoolitem.js";
|
|
30
34
|
import { OutputWebFetchServerToolItem$inboundSchema, } from "./outputwebfetchservertoolitem.js";
|
|
@@ -40,6 +44,7 @@ export const OutputItems$inboundSchema = discriminatedUnion("type", {
|
|
|
40
44
|
function_call: OutputFunctionCallItem$inboundSchema.and(z.object({ type: z.literal("function_call") })),
|
|
41
45
|
image_generation_call: OutputImageGenerationCallItem$inboundSchema.and(z.object({ type: z.literal("image_generation_call") })),
|
|
42
46
|
message: OutputMessageItem$inboundSchema,
|
|
47
|
+
["openrouter:advisor"]: OutputAdvisorServerToolItem$inboundSchema.and(z.object({ type: z.literal("openrouter:advisor") })),
|
|
43
48
|
["openrouter:apply_patch"]: OutputApplyPatchServerToolItem$inboundSchema
|
|
44
49
|
.and(z.object({ type: z.literal("openrouter:apply_patch") })),
|
|
45
50
|
["openrouter:bash"]: OutputBashServerToolItem$inboundSchema.and(z.object({ type: z.literal("openrouter:bash") })),
|
|
@@ -50,10 +55,11 @@ export const OutputItems$inboundSchema = discriminatedUnion("type", {
|
|
|
50
55
|
["openrouter:experimental__search_models"]: OutputSearchModelsServerToolItem$inboundSchema.and(z.object({ type: z.literal("openrouter:experimental__search_models") })),
|
|
51
56
|
["openrouter:file_search"]: OutputFileSearchServerToolItem$inboundSchema
|
|
52
57
|
.and(z.object({ type: z.literal("openrouter:file_search") })),
|
|
53
|
-
["openrouter:fusion"]: OutputFusionServerToolItem$inboundSchema,
|
|
58
|
+
["openrouter:fusion"]: OutputFusionServerToolItem$inboundSchema.and(z.object({ type: z.literal("openrouter:fusion") })),
|
|
54
59
|
["openrouter:image_generation"]: OutputImageGenerationServerToolItem$inboundSchema.and(z.object({ type: z.literal("openrouter:image_generation") })),
|
|
55
60
|
["openrouter:mcp"]: OutputMcpServerToolItem$inboundSchema.and(z.object({ type: z.literal("openrouter:mcp") })),
|
|
56
61
|
["openrouter:memory"]: OutputMemoryServerToolItem$inboundSchema.and(z.object({ type: z.literal("openrouter:memory") })),
|
|
62
|
+
["openrouter:subagent"]: OutputSubagentServerToolItem$inboundSchema.and(z.object({ type: z.literal("openrouter:subagent") })),
|
|
57
63
|
["openrouter:text_editor"]: OutputTextEditorServerToolItem$inboundSchema
|
|
58
64
|
.and(z.object({ type: z.literal("openrouter:text_editor") })),
|
|
59
65
|
["openrouter:tool_search"]: OutputToolSearchServerToolItem$inboundSchema
|
|
@@ -61,6 +67,8 @@ export const OutputItems$inboundSchema = discriminatedUnion("type", {
|
|
|
61
67
|
["openrouter:web_fetch"]: OutputWebFetchServerToolItem$inboundSchema.and(z.object({ type: z.literal("openrouter:web_fetch") })),
|
|
62
68
|
["openrouter:web_search"]: OutputWebSearchServerToolItem$inboundSchema.and(z.object({ type: z.literal("openrouter:web_search") })),
|
|
63
69
|
reasoning: OutputReasoningItem$inboundSchema,
|
|
70
|
+
shell_call: OutputShellCallItem$inboundSchema,
|
|
71
|
+
shell_call_output: OutputShellCallOutputItem$inboundSchema,
|
|
64
72
|
web_search_call: OutputWebSearchCallItem$inboundSchema.and(z.object({ type: z.literal("web_search_call") })),
|
|
65
73
|
});
|
|
66
74
|
export function outputItemsFromJSON(jsonString) {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
import { ShellCallStatus } from "./shellcallstatus.js";
|
|
5
|
+
export type OutputShellCallItemAction = {
|
|
6
|
+
commands: Array<string>;
|
|
7
|
+
maxOutputLength: number | null;
|
|
8
|
+
timeoutMs: number | null;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A native `shell_call` output item matching OpenAI's Responses API shape. Emitted for the sandbox-backed `shell` tool.
|
|
12
|
+
*/
|
|
13
|
+
export type OutputShellCallItem = {
|
|
14
|
+
action?: OutputShellCallItemAction | undefined;
|
|
15
|
+
callId: string;
|
|
16
|
+
id: string;
|
|
17
|
+
/**
|
|
18
|
+
* Status of a shell call or its output.
|
|
19
|
+
*/
|
|
20
|
+
status: ShellCallStatus;
|
|
21
|
+
type: "shell_call";
|
|
22
|
+
};
|
|
23
|
+
/** @internal */
|
|
24
|
+
export declare const OutputShellCallItemAction$inboundSchema: z.ZodType<OutputShellCallItemAction, unknown>;
|
|
25
|
+
export declare function outputShellCallItemActionFromJSON(jsonString: string): SafeParseResult<OutputShellCallItemAction, SDKValidationError>;
|
|
26
|
+
/** @internal */
|
|
27
|
+
export declare const OutputShellCallItem$inboundSchema: z.ZodType<OutputShellCallItem, unknown>;
|
|
28
|
+
export declare function outputShellCallItemFromJSON(jsonString: string): SafeParseResult<OutputShellCallItem, SDKValidationError>;
|
|
29
|
+
//# sourceMappingURL=outputshellcallitem.d.ts.map
|