@openrouter/sdk 0.5.1 → 0.9.11
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 -1
- package/esm/funcs/analyticsGetUserActivity.d.ts +1 -1
- package/esm/funcs/analyticsGetUserActivity.js +4 -2
- package/esm/funcs/apiKeysCreate.d.ts +1 -1
- package/esm/funcs/apiKeysCreate.js +5 -3
- package/esm/funcs/apiKeysDelete.d.ts +1 -1
- package/esm/funcs/apiKeysDelete.js +3 -1
- package/esm/funcs/apiKeysGet.d.ts +1 -1
- package/esm/funcs/apiKeysGet.js +3 -1
- package/esm/funcs/apiKeysGetCurrentKeyMetadata.d.ts +1 -1
- package/esm/funcs/apiKeysGetCurrentKeyMetadata.js +14 -3
- package/esm/funcs/apiKeysList.d.ts +1 -1
- package/esm/funcs/apiKeysList.js +4 -2
- package/esm/funcs/apiKeysUpdate.d.ts +1 -1
- package/esm/funcs/apiKeysUpdate.js +3 -1
- package/esm/funcs/betaResponsesSend.d.ts +9 -5
- package/esm/funcs/betaResponsesSend.js +10 -5
- package/esm/funcs/chatSend.d.ts +11 -7
- package/esm/funcs/chatSend.js +28 -7
- package/esm/funcs/creditsCreateCoinbaseCharge.d.ts +1 -2
- package/esm/funcs/creditsCreateCoinbaseCharge.js +7 -4
- package/esm/funcs/creditsGetCredits.d.ts +2 -2
- package/esm/funcs/creditsGetCredits.js +15 -4
- package/esm/funcs/embeddingsGenerate.js +4 -2
- package/esm/funcs/embeddingsListModels.d.ts +2 -1
- package/esm/funcs/embeddingsListModels.js +15 -3
- package/esm/funcs/endpointsList.js +2 -0
- package/esm/funcs/endpointsListZdrEndpoints.d.ts +1 -1
- package/esm/funcs/endpointsListZdrEndpoints.js +14 -3
- package/esm/funcs/generationsGetGeneration.js +3 -1
- package/esm/funcs/guardrailsBulkAssignKeys.d.ts +1 -1
- package/esm/funcs/guardrailsBulkAssignKeys.js +3 -1
- package/esm/funcs/guardrailsBulkAssignMembers.d.ts +1 -1
- package/esm/funcs/guardrailsBulkAssignMembers.js +3 -1
- package/esm/funcs/guardrailsBulkUnassignKeys.d.ts +1 -1
- package/esm/funcs/guardrailsBulkUnassignKeys.js +3 -1
- package/esm/funcs/guardrailsBulkUnassignMembers.d.ts +1 -1
- package/esm/funcs/guardrailsBulkUnassignMembers.js +3 -1
- package/esm/funcs/guardrailsCreate.d.ts +1 -1
- package/esm/funcs/guardrailsCreate.js +5 -3
- package/esm/funcs/guardrailsDelete.d.ts +1 -1
- package/esm/funcs/guardrailsDelete.js +3 -1
- package/esm/funcs/guardrailsGet.d.ts +1 -1
- package/esm/funcs/guardrailsGet.js +3 -1
- package/esm/funcs/guardrailsList.d.ts +1 -1
- package/esm/funcs/guardrailsList.js +4 -2
- package/esm/funcs/guardrailsListGuardrailKeyAssignments.d.ts +1 -1
- package/esm/funcs/guardrailsListGuardrailKeyAssignments.js +3 -1
- package/esm/funcs/guardrailsListGuardrailMemberAssignments.d.ts +1 -1
- package/esm/funcs/guardrailsListGuardrailMemberAssignments.js +3 -1
- package/esm/funcs/guardrailsListKeyAssignments.d.ts +1 -1
- package/esm/funcs/guardrailsListKeyAssignments.js +4 -2
- package/esm/funcs/guardrailsListMemberAssignments.d.ts +1 -1
- package/esm/funcs/guardrailsListMemberAssignments.js +4 -2
- package/esm/funcs/guardrailsUpdate.d.ts +1 -1
- package/esm/funcs/guardrailsUpdate.js +3 -1
- package/esm/funcs/modelsCount.d.ts +2 -1
- package/esm/funcs/modelsCount.js +15 -3
- package/esm/funcs/modelsList.js +3 -1
- package/esm/funcs/modelsListForUser.d.ts +1 -1
- package/esm/funcs/modelsListForUser.js +15 -3
- package/esm/funcs/oAuthCreateAuthCode.js +4 -2
- package/esm/funcs/oAuthExchangeAuthCodeForAPIKey.js +4 -2
- package/esm/funcs/providersList.d.ts +1 -1
- package/esm/funcs/providersList.js +14 -3
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/lib/model-result.d.ts +3 -5
- package/esm/lib/model-result.js +98 -46
- package/esm/models/assistantmessage.d.ts +47 -36
- package/esm/models/assistantmessage.js +35 -47
- package/esm/models/assistantmessageimages.d.ts +33 -0
- package/esm/models/assistantmessageimages.js +44 -0
- package/esm/models/chatgenerationparams.d.ts +318 -182
- package/esm/models/chatgenerationparams.js +157 -143
- package/esm/models/chatgenerationtokenusage.d.ts +48 -0
- package/esm/models/chatmessagecontentitem.d.ts +15 -10
- package/esm/models/chatmessagecontentitem.js +25 -4
- package/esm/models/chatmessagecontentitemaudio.d.ts +20 -2
- package/esm/models/chatmessagecontentitemaudio.js +9 -2
- package/esm/models/chatmessagecontentitemcachecontrol.d.ts +14 -3
- package/esm/models/chatmessagecontentitemcachecontrol.js +9 -2
- package/esm/models/chatmessagecontentitemimage.d.ts +26 -3
- package/esm/models/chatmessagecontentitemimage.js +12 -2
- package/esm/models/chatmessagecontentitemtext.d.ts +17 -2
- package/esm/models/chatmessagecontentitemtext.js +9 -2
- package/esm/models/chatmessagecontentitemvideo.d.ts +12 -55
- package/esm/models/chatmessagecontentitemvideo.js +5 -72
- package/esm/models/chatmessagecontentitemvideolegacy.d.ts +28 -0
- package/esm/models/chatmessagecontentitemvideolegacy.js +33 -0
- package/esm/models/chatmessagetokenlogprob.d.ts +15 -0
- package/esm/models/chatmessagetokenlogprobs.d.ts +9 -0
- package/esm/models/chatmessagetoolcall.d.ts +23 -2
- package/esm/models/chatmessagetoolcall.js +9 -2
- package/esm/models/chatresponse.d.ts +29 -1
- package/esm/models/chatresponse.js +6 -1
- package/esm/models/chatresponsechoice.d.ts +13 -2
- package/esm/models/chatresponsechoice.js +1 -2
- package/esm/models/chatstreamingchoice.d.ts +13 -2
- package/esm/models/chatstreamingchoice.js +1 -2
- package/esm/models/chatstreamingmessagechunk.d.ts +29 -2
- package/esm/models/chatstreamingmessagechunk.js +5 -2
- package/esm/models/chatstreamingmessagetoolcall.d.ts +38 -1
- package/esm/models/chatstreamingmessagetoolcall.js +9 -1
- package/esm/models/chatstreamingresponsechunk.d.ts +45 -11
- package/esm/models/chatstreamingresponsechunk.js +11 -25
- package/esm/models/chatstreamoptions.d.ts +8 -0
- package/esm/models/debugoptions.d.ts +18 -0
- package/esm/models/debugoptions.js +18 -0
- package/esm/models/developermessage.d.ts +35 -0
- package/esm/models/developermessage.js +24 -0
- package/esm/models/errors/index.d.ts +0 -1
- package/esm/models/errors/index.js +0 -1
- package/esm/models/index.d.ts +13 -5
- package/esm/models/index.js +13 -5
- package/esm/models/jsonschemaconfig.d.ts +17 -2
- package/esm/models/jsonschemaconfig.js +1 -1
- package/esm/models/message.d.ts +10 -23
- package/esm/models/message.js +3 -20
- package/esm/models/modelscountresponse.d.ts +4 -4
- package/esm/models/modelscountresponse.js +4 -4
- package/esm/models/namedtoolchoice.d.ts +15 -2
- package/esm/models/namedtoolchoice.js +6 -1
- package/esm/models/openairesponsesreasoningconfig.d.ts +1 -1
- package/esm/models/openairesponsesreasoningconfig.js +1 -1
- package/esm/models/openresponsesnonstreamingresponse.d.ts +4 -4
- package/esm/models/openresponsesnonstreamingresponse.js +3 -3
- package/esm/models/openresponsesreasoning.d.ts +2 -2
- package/esm/models/openresponsesreasoning.js +1 -1
- package/esm/models/openresponsesreasoningconfig.d.ts +2 -2
- package/esm/models/openresponsesreasoningconfig.js +1 -1
- package/esm/models/openresponsesrequest.d.ts +31 -13
- package/esm/models/openresponsesrequest.js +25 -0
- package/esm/models/operations/bulkassignkeystoguardrail.d.ts +30 -0
- package/esm/models/operations/bulkassignkeystoguardrail.js +4 -0
- package/esm/models/operations/bulkassignmemberstoguardrail.d.ts +30 -0
- package/esm/models/operations/bulkassignmemberstoguardrail.js +4 -0
- package/esm/models/operations/bulkunassignkeysfromguardrail.d.ts +30 -0
- package/esm/models/operations/bulkunassignkeysfromguardrail.js +4 -0
- package/esm/models/operations/bulkunassignmembersfromguardrail.d.ts +30 -0
- package/esm/models/operations/bulkunassignmembersfromguardrail.js +4 -0
- package/esm/models/operations/createauthkeyscode.d.ts +66 -2
- package/esm/models/operations/createauthkeyscode.js +30 -1
- package/esm/models/operations/createcoinbasecharge.d.ts +41 -0
- package/esm/models/operations/createcoinbasecharge.js +16 -0
- package/esm/models/operations/createembeddings.d.ts +42 -2
- package/esm/models/operations/createembeddings.js +16 -1
- package/esm/models/operations/createguardrail.d.ts +42 -2
- package/esm/models/operations/createguardrail.js +16 -1
- package/esm/models/operations/createkeys.d.ts +42 -2
- package/esm/models/operations/createkeys.js +16 -1
- package/esm/models/operations/createresponses.d.ts +40 -0
- package/esm/models/operations/createresponses.js +16 -0
- package/esm/models/operations/deleteguardrail.d.ts +30 -0
- package/esm/models/operations/deleteguardrail.js +8 -0
- package/esm/models/operations/deletekeys.d.ts +30 -0
- package/esm/models/operations/deletekeys.js +8 -0
- package/esm/models/operations/exchangeauthcodeforapikey.d.ts +42 -2
- package/esm/models/operations/exchangeauthcodeforapikey.js +16 -1
- package/esm/models/operations/getcredits.d.ts +38 -0
- package/esm/models/operations/getcredits.js +13 -0
- package/esm/models/operations/getcurrentkey.d.ts +45 -1
- package/esm/models/operations/getcurrentkey.js +15 -0
- package/esm/models/operations/getgeneration.d.ts +153 -0
- package/esm/models/operations/getgeneration.js +135 -0
- package/esm/models/operations/getguardrail.d.ts +30 -0
- package/esm/models/operations/getguardrail.js +7 -0
- package/esm/models/operations/getkey.d.ts +30 -0
- package/esm/models/operations/getkey.js +7 -0
- package/esm/models/operations/getmodels.d.ts +30 -0
- package/esm/models/operations/getmodels.js +4 -0
- package/esm/models/operations/getuseractivity.d.ts +30 -0
- package/esm/models/operations/getuseractivity.js +8 -0
- package/esm/models/operations/index.d.ts +2 -0
- package/esm/models/operations/index.js +2 -0
- package/esm/models/operations/list.d.ts +30 -0
- package/esm/models/operations/list.js +4 -0
- package/esm/models/operations/listembeddingsmodels.d.ts +40 -0
- package/esm/models/operations/listembeddingsmodels.js +20 -0
- package/esm/models/operations/listendpoints.d.ts +30 -0
- package/esm/models/operations/listendpoints.js +8 -0
- package/esm/models/operations/listendpointszdr.d.ts +38 -0
- package/esm/models/operations/listendpointszdr.js +14 -0
- package/esm/models/operations/listguardrailkeyassignments.d.ts +30 -0
- package/esm/models/operations/listguardrailkeyassignments.js +7 -0
- package/esm/models/operations/listguardrailmemberassignments.d.ts +30 -0
- package/esm/models/operations/listguardrailmemberassignments.js +7 -0
- package/esm/models/operations/listguardrails.d.ts +30 -0
- package/esm/models/operations/listguardrails.js +7 -0
- package/esm/models/operations/listkeyassignments.d.ts +30 -0
- package/esm/models/operations/listkeyassignments.js +7 -0
- package/esm/models/operations/listmemberassignments.d.ts +30 -0
- package/esm/models/operations/listmemberassignments.js +7 -0
- package/esm/models/operations/listmodelscount.d.ts +40 -0
- package/esm/models/operations/listmodelscount.js +20 -0
- package/esm/models/operations/listmodelsuser.d.ts +38 -0
- package/esm/models/operations/listmodelsuser.js +14 -0
- package/esm/models/operations/listproviders.d.ts +38 -0
- package/esm/models/operations/listproviders.js +13 -0
- package/esm/models/operations/sendchatcompletionrequest.d.ts +53 -1
- package/esm/models/operations/sendchatcompletionrequest.js +36 -2
- package/esm/models/operations/updateguardrail.d.ts +30 -0
- package/esm/models/operations/updateguardrail.js +4 -0
- package/esm/models/operations/updatekeys.d.ts +30 -0
- package/esm/models/operations/updatekeys.js +4 -0
- package/esm/models/providername.d.ts +4 -0
- package/esm/models/providername.js +4 -0
- package/esm/models/providerpreferences.d.ts +46 -27
- package/esm/models/providerpreferences.js +29 -15
- package/esm/models/providersort.d.ts +6 -0
- package/esm/models/providersort.js +3 -0
- package/esm/models/providersortconfig.d.ts +30 -2
- package/esm/models/providersortconfig.js +15 -2
- package/esm/models/publicendpoint.d.ts +0 -39
- package/esm/models/publicpricing.d.ts +0 -39
- package/esm/models/reasoningdetailencrypted.d.ts +42 -0
- package/esm/models/reasoningdetailencrypted.js +42 -0
- package/esm/models/reasoningdetailsummary.d.ts +42 -0
- package/esm/models/reasoningdetailsummary.js +42 -0
- package/esm/models/reasoningdetailtext.d.ts +44 -0
- package/esm/models/reasoningdetailtext.js +44 -0
- package/esm/models/reasoningdetailunion.d.ts +19 -0
- package/esm/models/reasoningdetailunion.js +28 -0
- package/esm/models/responseformatjsonobject.d.ts +20 -0
- package/esm/models/responseformatjsonobject.js +21 -0
- package/esm/models/responseformatjsonschema.d.ts +6 -0
- package/esm/models/responseformattext.d.ts +15 -0
- package/esm/models/responseformattext.js +13 -0
- package/esm/models/responseformattextconfig.d.ts +3 -3
- package/esm/models/responseformattextconfig.js +3 -3
- package/esm/models/responseformattextgrammar.d.ts +6 -0
- package/esm/models/responseformattextpython.d.ts +15 -0
- package/esm/models/responseformattextpython.js +13 -0
- package/esm/models/responseserrorfield.d.ts +4 -4
- package/esm/models/responseserrorfield.js +4 -4
- package/esm/models/responsesoutputitemreasoning.d.ts +2 -2
- package/esm/models/responsesoutputitemreasoning.js +2 -2
- package/esm/models/systemmessage.d.ts +12 -0
- package/esm/models/toolchoiceoption.d.ts +31 -0
- package/esm/models/toolchoiceoption.js +32 -0
- package/esm/models/tooldefinitionjson.d.ts +38 -4
- package/esm/models/tooldefinitionjson.js +14 -2
- package/esm/models/toolresponsemessage.d.ts +12 -0
- package/esm/models/usermessage.d.ts +12 -0
- package/esm/models/videoinput.d.ts +23 -0
- package/esm/models/videoinput.js +22 -0
- package/esm/sdk/analytics.d.ts +1 -1
- package/esm/sdk/analytics.js +1 -1
- package/esm/sdk/apikeys.d.ts +6 -6
- package/esm/sdk/apikeys.js +7 -7
- package/esm/sdk/chat.d.ts +10 -6
- package/esm/sdk/credits.d.ts +3 -4
- package/esm/sdk/credits.js +3 -3
- package/esm/sdk/embeddings.d.ts +1 -1
- package/esm/sdk/embeddings.js +2 -2
- package/esm/sdk/endpoints.d.ts +1 -1
- package/esm/sdk/endpoints.js +2 -2
- package/esm/sdk/guardrails.d.ts +13 -13
- package/esm/sdk/guardrails.js +13 -13
- package/esm/sdk/models.d.ts +2 -2
- package/esm/sdk/models.js +4 -4
- package/esm/sdk/providers.d.ts +1 -1
- package/esm/sdk/providers.js +2 -2
- package/esm/sdk/responses.d.ts +9 -5
- package/esm/sdk/sdk.d.ts +2 -2
- package/esm/sdk/sdk.js +3 -3
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/esm/models/chaterror.d.ts +0 -17
- package/esm/models/chaterror.js +0 -25
- package/esm/models/errors/chaterror.d.ts +0 -19
- package/esm/models/errors/chaterror.js +0 -32
- package/esm/models/providersortunion.d.ts +0 -10
- package/esm/models/providersortunion.js +0 -13
- package/esm/models/responsesformatjsonobject.d.ts +0 -20
- package/esm/models/responsesformatjsonobject.js +0 -21
- package/esm/models/schema0.d.ts +0 -84
- package/esm/models/schema0.js +0 -87
- package/esm/models/schema2.d.ts +0 -92
- package/esm/models/schema2.js +0 -109
package/esm/models/index.js
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export * from "./activityitem.js";
|
|
6
6
|
export * from "./assistantmessage.js";
|
|
7
|
+
export * from "./assistantmessageimages.js";
|
|
7
8
|
export * from "./badgatewayresponseerrordata.js";
|
|
8
9
|
export * from "./badrequestresponseerrordata.js";
|
|
9
10
|
export * from "./chatcompletionfinishreason.js";
|
|
10
|
-
export * from "./chaterror.js";
|
|
11
11
|
export * from "./chatgenerationparams.js";
|
|
12
12
|
export * from "./chatgenerationtokenusage.js";
|
|
13
13
|
export * from "./chatmessagecontentitem.js";
|
|
@@ -16,6 +16,7 @@ export * from "./chatmessagecontentitemcachecontrol.js";
|
|
|
16
16
|
export * from "./chatmessagecontentitemimage.js";
|
|
17
17
|
export * from "./chatmessagecontentitemtext.js";
|
|
18
18
|
export * from "./chatmessagecontentitemvideo.js";
|
|
19
|
+
export * from "./chatmessagecontentitemvideolegacy.js";
|
|
19
20
|
export * from "./chatmessagetokenlogprob.js";
|
|
20
21
|
export * from "./chatmessagetokenlogprobs.js";
|
|
21
22
|
export * from "./chatmessagetoolcall.js";
|
|
@@ -28,7 +29,9 @@ export * from "./chatstreamingresponsechunk.js";
|
|
|
28
29
|
export * from "./chatstreamoptions.js";
|
|
29
30
|
export * from "./createchargerequest.js";
|
|
30
31
|
export * from "./datacollection.js";
|
|
32
|
+
export * from "./debugoptions.js";
|
|
31
33
|
export * from "./defaultparameters.js";
|
|
34
|
+
export * from "./developermessage.js";
|
|
32
35
|
export * from "./edgenetworktimeoutresponseerrordata.js";
|
|
33
36
|
export * from "./endpointstatus.js";
|
|
34
37
|
export * from "./filecitation.js";
|
|
@@ -107,17 +110,23 @@ export * from "./provideroverloadedresponseerrordata.js";
|
|
|
107
110
|
export * from "./providerpreferences.js";
|
|
108
111
|
export * from "./providersort.js";
|
|
109
112
|
export * from "./providersortconfig.js";
|
|
110
|
-
export * from "./providersortunion.js";
|
|
111
113
|
export * from "./publicendpoint.js";
|
|
112
114
|
export * from "./publicpricing.js";
|
|
113
115
|
export * from "./quantization.js";
|
|
116
|
+
export * from "./reasoningdetailencrypted.js";
|
|
117
|
+
export * from "./reasoningdetailsummary.js";
|
|
118
|
+
export * from "./reasoningdetailtext.js";
|
|
119
|
+
export * from "./reasoningdetailunion.js";
|
|
114
120
|
export * from "./reasoningsummarytext.js";
|
|
115
121
|
export * from "./reasoningsummaryverbosity.js";
|
|
116
122
|
export * from "./reasoningtextcontent.js";
|
|
117
123
|
export * from "./requesttimeoutresponseerrordata.js";
|
|
124
|
+
export * from "./responseformatjsonobject.js";
|
|
118
125
|
export * from "./responseformatjsonschema.js";
|
|
126
|
+
export * from "./responseformattext.js";
|
|
119
127
|
export * from "./responseformattextconfig.js";
|
|
120
128
|
export * from "./responseformattextgrammar.js";
|
|
129
|
+
export * from "./responseformattextpython.js";
|
|
121
130
|
export * from "./responseinputaudio.js";
|
|
122
131
|
export * from "./responseinputfile.js";
|
|
123
132
|
export * from "./responseinputimage.js";
|
|
@@ -125,7 +134,6 @@ export * from "./responseinputtext.js";
|
|
|
125
134
|
export * from "./responseinputvideo.js";
|
|
126
135
|
export * from "./responseoutputtext.js";
|
|
127
136
|
export * from "./responseserrorfield.js";
|
|
128
|
-
export * from "./responsesformatjsonobject.js";
|
|
129
137
|
export * from "./responsesformattext.js";
|
|
130
138
|
export * from "./responsesformattextjsonschemaconfig.js";
|
|
131
139
|
export * from "./responsesimagegenerationcall.js";
|
|
@@ -139,12 +147,11 @@ export * from "./responsessearchcontextsize.js";
|
|
|
139
147
|
export * from "./responseswebsearchcalloutput.js";
|
|
140
148
|
export * from "./responseswebsearchuserlocation.js";
|
|
141
149
|
export * from "./responsetextconfig.js";
|
|
142
|
-
export * from "./schema0.js";
|
|
143
|
-
export * from "./schema2.js";
|
|
144
150
|
export * from "./security.js";
|
|
145
151
|
export * from "./serviceunavailableresponseerrordata.js";
|
|
146
152
|
export * from "./systemmessage.js";
|
|
147
153
|
export * from "./toolcallstatus.js";
|
|
154
|
+
export * from "./toolchoiceoption.js";
|
|
148
155
|
export * from "./tooldefinitionjson.js";
|
|
149
156
|
export * from "./toolresponsemessage.js";
|
|
150
157
|
export * from "./toomanyrequestsresponseerrordata.js";
|
|
@@ -153,6 +160,7 @@ export * from "./unauthorizedresponseerrordata.js";
|
|
|
153
160
|
export * from "./unprocessableentityresponseerrordata.js";
|
|
154
161
|
export * from "./urlcitation.js";
|
|
155
162
|
export * from "./usermessage.js";
|
|
163
|
+
export * from "./videoinput.js";
|
|
156
164
|
export * from "./websearchengine.js";
|
|
157
165
|
export * from "./websearchpreviewtooluserlocation.js";
|
|
158
166
|
export * from "./websearchstatus.js";
|
|
@@ -1,10 +1,25 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
+
/**
|
|
3
|
+
* JSON Schema configuration object
|
|
4
|
+
*/
|
|
2
5
|
export type JSONSchemaConfig = {
|
|
6
|
+
/**
|
|
7
|
+
* Schema name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars)
|
|
8
|
+
*/
|
|
3
9
|
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* Schema description for the model
|
|
12
|
+
*/
|
|
4
13
|
description?: string | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* JSON Schema object
|
|
16
|
+
*/
|
|
5
17
|
schema?: {
|
|
6
|
-
[k: string]: any;
|
|
18
|
+
[k: string]: any | null;
|
|
7
19
|
} | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Enable strict schema adherence
|
|
22
|
+
*/
|
|
8
23
|
strict?: boolean | null | undefined;
|
|
9
24
|
};
|
|
10
25
|
/** @internal */
|
|
@@ -12,7 +27,7 @@ export type JSONSchemaConfig$Outbound = {
|
|
|
12
27
|
name: string;
|
|
13
28
|
description?: string | undefined;
|
|
14
29
|
schema?: {
|
|
15
|
-
[k: string]: any;
|
|
30
|
+
[k: string]: any | null;
|
|
16
31
|
} | undefined;
|
|
17
32
|
strict?: boolean | null | undefined;
|
|
18
33
|
};
|
|
@@ -7,7 +7,7 @@ import * as z from "zod/v4";
|
|
|
7
7
|
export const JSONSchemaConfig$outboundSchema = z.object({
|
|
8
8
|
name: z.string(),
|
|
9
9
|
description: z.string().optional(),
|
|
10
|
-
schema: z.record(z.string(), z.any()).optional(),
|
|
10
|
+
schema: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
11
11
|
strict: z.nullable(z.boolean()).optional(),
|
|
12
12
|
});
|
|
13
13
|
export function jsonSchemaConfigToJSON(jsonSchemaConfig) {
|
package/esm/models/message.d.ts
CHANGED
|
@@ -1,32 +1,19 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { AssistantMessage, AssistantMessage$Outbound } from "./assistantmessage.js";
|
|
3
|
-
import {
|
|
3
|
+
import { DeveloperMessage, DeveloperMessage$Outbound } from "./developermessage.js";
|
|
4
4
|
import { SystemMessage, SystemMessage$Outbound } from "./systemmessage.js";
|
|
5
5
|
import { ToolResponseMessage, ToolResponseMessage$Outbound } from "./toolresponsemessage.js";
|
|
6
6
|
import { UserMessage, UserMessage$Outbound } from "./usermessage.js";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
export type Message = SystemMessage | UserMessage | MessageDeveloper | AssistantMessage | ToolResponseMessage;
|
|
7
|
+
/**
|
|
8
|
+
* Chat completion message with role-based discrimination
|
|
9
|
+
*/
|
|
10
|
+
export type Message = SystemMessage | UserMessage | DeveloperMessage | (AssistantMessage & {
|
|
11
|
+
role: "assistant";
|
|
12
|
+
}) | ToolResponseMessage;
|
|
14
13
|
/** @internal */
|
|
15
|
-
export type
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export declare function messageContentToJSON(messageContent: MessageContent): string;
|
|
19
|
-
/** @internal */
|
|
20
|
-
export type MessageDeveloper$Outbound = {
|
|
21
|
-
role: "developer";
|
|
22
|
-
content: string | Array<ChatMessageContentItemText$Outbound>;
|
|
23
|
-
name?: string | undefined;
|
|
24
|
-
};
|
|
25
|
-
/** @internal */
|
|
26
|
-
export declare const MessageDeveloper$outboundSchema: z.ZodType<MessageDeveloper$Outbound, MessageDeveloper>;
|
|
27
|
-
export declare function messageDeveloperToJSON(messageDeveloper: MessageDeveloper): string;
|
|
28
|
-
/** @internal */
|
|
29
|
-
export type Message$Outbound = SystemMessage$Outbound | UserMessage$Outbound | MessageDeveloper$Outbound | AssistantMessage$Outbound | ToolResponseMessage$Outbound;
|
|
14
|
+
export type Message$Outbound = SystemMessage$Outbound | UserMessage$Outbound | DeveloperMessage$Outbound | (AssistantMessage$Outbound & {
|
|
15
|
+
role: "assistant";
|
|
16
|
+
}) | ToolResponseMessage$Outbound;
|
|
30
17
|
/** @internal */
|
|
31
18
|
export declare const Message$outboundSchema: z.ZodType<Message$Outbound, Message>;
|
|
32
19
|
export declare function messageToJSON(message: Message): string;
|
package/esm/models/message.js
CHANGED
|
@@ -4,34 +4,17 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { AssistantMessage$outboundSchema, } from "./assistantmessage.js";
|
|
7
|
-
import {
|
|
7
|
+
import { DeveloperMessage$outboundSchema, } from "./developermessage.js";
|
|
8
8
|
import { SystemMessage$outboundSchema, } from "./systemmessage.js";
|
|
9
9
|
import { ToolResponseMessage$outboundSchema, } from "./toolresponsemessage.js";
|
|
10
10
|
import { UserMessage$outboundSchema, } from "./usermessage.js";
|
|
11
11
|
/** @internal */
|
|
12
|
-
export const MessageContent$outboundSchema = z.union([z.string(), z.array(ChatMessageContentItemText$outboundSchema)]);
|
|
13
|
-
export function messageContentToJSON(messageContent) {
|
|
14
|
-
return JSON.stringify(MessageContent$outboundSchema.parse(messageContent));
|
|
15
|
-
}
|
|
16
|
-
/** @internal */
|
|
17
|
-
export const MessageDeveloper$outboundSchema = z.object({
|
|
18
|
-
role: z.literal("developer"),
|
|
19
|
-
content: z.union([
|
|
20
|
-
z.string(),
|
|
21
|
-
z.array(ChatMessageContentItemText$outboundSchema),
|
|
22
|
-
]),
|
|
23
|
-
name: z.string().optional(),
|
|
24
|
-
});
|
|
25
|
-
export function messageDeveloperToJSON(messageDeveloper) {
|
|
26
|
-
return JSON.stringify(MessageDeveloper$outboundSchema.parse(messageDeveloper));
|
|
27
|
-
}
|
|
28
|
-
/** @internal */
|
|
29
12
|
export const Message$outboundSchema = z
|
|
30
13
|
.union([
|
|
31
14
|
SystemMessage$outboundSchema,
|
|
32
15
|
UserMessage$outboundSchema,
|
|
33
|
-
|
|
34
|
-
AssistantMessage$outboundSchema,
|
|
16
|
+
DeveloperMessage$outboundSchema,
|
|
17
|
+
AssistantMessage$outboundSchema.and(z.object({ role: z.literal("assistant") })),
|
|
35
18
|
ToolResponseMessage$outboundSchema,
|
|
36
19
|
]);
|
|
37
20
|
export function messageToJSON(message) {
|
|
@@ -4,7 +4,7 @@ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
|
4
4
|
/**
|
|
5
5
|
* Model count data
|
|
6
6
|
*/
|
|
7
|
-
export type
|
|
7
|
+
export type Data = {
|
|
8
8
|
/**
|
|
9
9
|
* Total number of available models
|
|
10
10
|
*/
|
|
@@ -17,11 +17,11 @@ export type ModelsCountResponse = {
|
|
|
17
17
|
/**
|
|
18
18
|
* Model count data
|
|
19
19
|
*/
|
|
20
|
-
data:
|
|
20
|
+
data: Data;
|
|
21
21
|
};
|
|
22
22
|
/** @internal */
|
|
23
|
-
export declare const
|
|
24
|
-
export declare function
|
|
23
|
+
export declare const Data$inboundSchema: z.ZodType<Data, unknown>;
|
|
24
|
+
export declare function dataFromJSON(jsonString: string): SafeParseResult<Data, SDKValidationError>;
|
|
25
25
|
/** @internal */
|
|
26
26
|
export declare const ModelsCountResponse$inboundSchema: z.ZodType<ModelsCountResponse, unknown>;
|
|
27
27
|
export declare function modelsCountResponseFromJSON(jsonString: string): SafeParseResult<ModelsCountResponse, SDKValidationError>;
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
7
|
/** @internal */
|
|
8
|
-
export const
|
|
8
|
+
export const Data$inboundSchema = z.object({
|
|
9
9
|
count: z.number(),
|
|
10
10
|
});
|
|
11
|
-
export function
|
|
12
|
-
return safeParse(jsonString, (x) =>
|
|
11
|
+
export function dataFromJSON(jsonString) {
|
|
12
|
+
return safeParse(jsonString, (x) => Data$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Data' from JSON`);
|
|
13
13
|
}
|
|
14
14
|
/** @internal */
|
|
15
15
|
export const ModelsCountResponse$inboundSchema = z.object({
|
|
16
|
-
data: z.lazy(() =>
|
|
16
|
+
data: z.lazy(() => Data$inboundSchema),
|
|
17
17
|
});
|
|
18
18
|
export function modelsCountResponseFromJSON(jsonString) {
|
|
19
19
|
return safeParse(jsonString, (x) => ModelsCountResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ModelsCountResponse' from JSON`);
|
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
export declare const NamedToolChoiceType: {
|
|
4
|
+
readonly Function: "function";
|
|
5
|
+
};
|
|
6
|
+
export type NamedToolChoiceType = ClosedEnum<typeof NamedToolChoiceType>;
|
|
2
7
|
export type NamedToolChoiceFunction = {
|
|
8
|
+
/**
|
|
9
|
+
* Function name to call
|
|
10
|
+
*/
|
|
3
11
|
name: string;
|
|
4
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* Named tool choice for specific function
|
|
15
|
+
*/
|
|
5
16
|
export type NamedToolChoice = {
|
|
6
|
-
type:
|
|
17
|
+
type: NamedToolChoiceType;
|
|
7
18
|
function: NamedToolChoiceFunction;
|
|
8
19
|
};
|
|
9
20
|
/** @internal */
|
|
21
|
+
export declare const NamedToolChoiceType$outboundSchema: z.ZodEnum<typeof NamedToolChoiceType>;
|
|
22
|
+
/** @internal */
|
|
10
23
|
export type NamedToolChoiceFunction$Outbound = {
|
|
11
24
|
name: string;
|
|
12
25
|
};
|
|
@@ -15,7 +28,7 @@ export declare const NamedToolChoiceFunction$outboundSchema: z.ZodType<NamedTool
|
|
|
15
28
|
export declare function namedToolChoiceFunctionToJSON(namedToolChoiceFunction: NamedToolChoiceFunction): string;
|
|
16
29
|
/** @internal */
|
|
17
30
|
export type NamedToolChoice$Outbound = {
|
|
18
|
-
type:
|
|
31
|
+
type: string;
|
|
19
32
|
function: NamedToolChoiceFunction$Outbound;
|
|
20
33
|
};
|
|
21
34
|
/** @internal */
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
* @generated-id: db68e36b6a77
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
|
+
export const NamedToolChoiceType = {
|
|
7
|
+
Function: "function",
|
|
8
|
+
};
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const NamedToolChoiceType$outboundSchema = z.enum(NamedToolChoiceType);
|
|
6
11
|
/** @internal */
|
|
7
12
|
export const NamedToolChoiceFunction$outboundSchema = z.object({
|
|
8
13
|
name: z.string(),
|
|
@@ -12,7 +17,7 @@ export function namedToolChoiceFunctionToJSON(namedToolChoiceFunction) {
|
|
|
12
17
|
}
|
|
13
18
|
/** @internal */
|
|
14
19
|
export const NamedToolChoice$outboundSchema = z.object({
|
|
15
|
-
type:
|
|
20
|
+
type: NamedToolChoiceType$outboundSchema,
|
|
16
21
|
function: z.lazy(() => NamedToolChoiceFunction$outboundSchema),
|
|
17
22
|
});
|
|
18
23
|
export function namedToolChoiceToJSON(namedToolChoice) {
|
|
@@ -5,7 +5,7 @@ import { OpenAIResponsesReasoningEffort } from "./openairesponsesreasoningeffort
|
|
|
5
5
|
import { ReasoningSummaryVerbosity } from "./reasoningsummaryverbosity.js";
|
|
6
6
|
export type OpenAIResponsesReasoningConfig = {
|
|
7
7
|
effort?: OpenAIResponsesReasoningEffort | null | undefined;
|
|
8
|
-
summary?: ReasoningSummaryVerbosity | undefined;
|
|
8
|
+
summary?: ReasoningSummaryVerbosity | null | undefined;
|
|
9
9
|
};
|
|
10
10
|
/** @internal */
|
|
11
11
|
export declare const OpenAIResponsesReasoningConfig$inboundSchema: z.ZodType<OpenAIResponsesReasoningConfig, unknown>;
|
|
@@ -9,7 +9,7 @@ import { ReasoningSummaryVerbosity$inboundSchema, } from "./reasoningsummaryverb
|
|
|
9
9
|
/** @internal */
|
|
10
10
|
export const OpenAIResponsesReasoningConfig$inboundSchema = z.object({
|
|
11
11
|
effort: z.nullable(OpenAIResponsesReasoningEffort$inboundSchema).optional(),
|
|
12
|
-
summary: ReasoningSummaryVerbosity$inboundSchema.optional(),
|
|
12
|
+
summary: z.nullable(ReasoningSummaryVerbosity$inboundSchema).optional(),
|
|
13
13
|
});
|
|
14
14
|
export function openAIResponsesReasoningConfigFromJSON(jsonString) {
|
|
15
15
|
return safeParse(jsonString, (x) => OpenAIResponsesReasoningConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenAIResponsesReasoningConfig' from JSON`);
|
|
@@ -18,10 +18,10 @@ import { OpenResponsesWebSearchTool } from "./openresponseswebsearchtool.js";
|
|
|
18
18
|
import { ResponsesErrorField } from "./responseserrorfield.js";
|
|
19
19
|
import { ResponsesOutputItem } from "./responsesoutputitem.js";
|
|
20
20
|
import { ResponseTextConfig } from "./responsetextconfig.js";
|
|
21
|
-
export declare const
|
|
21
|
+
export declare const OpenResponsesNonStreamingResponseObject: {
|
|
22
22
|
readonly Response: "response";
|
|
23
23
|
};
|
|
24
|
-
export type
|
|
24
|
+
export type OpenResponsesNonStreamingResponseObject = ClosedEnum<typeof OpenResponsesNonStreamingResponseObject>;
|
|
25
25
|
/**
|
|
26
26
|
* Function tool definition
|
|
27
27
|
*/
|
|
@@ -40,7 +40,7 @@ export type OpenResponsesNonStreamingResponseToolUnion = OpenResponsesNonStreami
|
|
|
40
40
|
*/
|
|
41
41
|
export type OpenResponsesNonStreamingResponse = {
|
|
42
42
|
id: string;
|
|
43
|
-
object:
|
|
43
|
+
object: OpenResponsesNonStreamingResponseObject;
|
|
44
44
|
createdAt: number;
|
|
45
45
|
model: string;
|
|
46
46
|
status: OpenAIResponsesResponseStatus;
|
|
@@ -89,7 +89,7 @@ export type OpenResponsesNonStreamingResponse = {
|
|
|
89
89
|
text?: ResponseTextConfig | undefined;
|
|
90
90
|
};
|
|
91
91
|
/** @internal */
|
|
92
|
-
export declare const
|
|
92
|
+
export declare const OpenResponsesNonStreamingResponseObject$inboundSchema: z.ZodEnum<typeof OpenResponsesNonStreamingResponseObject>;
|
|
93
93
|
/** @internal */
|
|
94
94
|
export declare const OpenResponsesNonStreamingResponseToolFunction$inboundSchema: z.ZodType<OpenResponsesNonStreamingResponseToolFunction, unknown>;
|
|
95
95
|
export declare function openResponsesNonStreamingResponseToolFunctionFromJSON(jsonString: string): SafeParseResult<OpenResponsesNonStreamingResponseToolFunction, SDKValidationError>;
|
|
@@ -21,11 +21,11 @@ import { OpenResponsesWebSearchTool$inboundSchema, } from "./openresponseswebsea
|
|
|
21
21
|
import { ResponsesErrorField$inboundSchema, } from "./responseserrorfield.js";
|
|
22
22
|
import { ResponsesOutputItem$inboundSchema, } from "./responsesoutputitem.js";
|
|
23
23
|
import { ResponseTextConfig$inboundSchema, } from "./responsetextconfig.js";
|
|
24
|
-
export const
|
|
24
|
+
export const OpenResponsesNonStreamingResponseObject = {
|
|
25
25
|
Response: "response",
|
|
26
26
|
};
|
|
27
27
|
/** @internal */
|
|
28
|
-
export const
|
|
28
|
+
export const OpenResponsesNonStreamingResponseObject$inboundSchema = z.enum(OpenResponsesNonStreamingResponseObject);
|
|
29
29
|
/** @internal */
|
|
30
30
|
export const OpenResponsesNonStreamingResponseToolFunction$inboundSchema = z.object({
|
|
31
31
|
type: z.literal("function"),
|
|
@@ -51,7 +51,7 @@ export function openResponsesNonStreamingResponseToolUnionFromJSON(jsonString) {
|
|
|
51
51
|
/** @internal */
|
|
52
52
|
export const OpenResponsesNonStreamingResponse$inboundSchema = z.object({
|
|
53
53
|
id: z.string(),
|
|
54
|
-
object:
|
|
54
|
+
object: OpenResponsesNonStreamingResponseObject$inboundSchema,
|
|
55
55
|
created_at: z.number(),
|
|
56
56
|
model: z.string(),
|
|
57
57
|
status: OpenAIResponsesResponseStatus$inboundSchema,
|
|
@@ -34,7 +34,7 @@ export type OpenResponsesReasoningFormat = OpenEnum<typeof OpenResponsesReasonin
|
|
|
34
34
|
export type OpenResponsesReasoning = {
|
|
35
35
|
type: OpenResponsesReasoningType;
|
|
36
36
|
id: string;
|
|
37
|
-
content?: Array<ReasoningTextContent> | undefined;
|
|
37
|
+
content?: Array<ReasoningTextContent> | null | undefined;
|
|
38
38
|
summary: Array<ReasoningSummaryText>;
|
|
39
39
|
encryptedContent?: string | null | undefined;
|
|
40
40
|
status?: OpenResponsesReasoningStatusCompleted | OpenResponsesReasoningStatusIncomplete | OpenResponsesReasoningStatusInProgress | undefined;
|
|
@@ -60,7 +60,7 @@ export declare const OpenResponsesReasoningFormat$outboundSchema: z.ZodType<stri
|
|
|
60
60
|
export type OpenResponsesReasoning$Outbound = {
|
|
61
61
|
type: string;
|
|
62
62
|
id: string;
|
|
63
|
-
content?: Array<ReasoningTextContent$Outbound> | undefined;
|
|
63
|
+
content?: Array<ReasoningTextContent$Outbound> | null | undefined;
|
|
64
64
|
summary: Array<ReasoningSummaryText$Outbound>;
|
|
65
65
|
encrypted_content?: string | null | undefined;
|
|
66
66
|
status?: string | string | string | undefined;
|
|
@@ -50,7 +50,7 @@ export const OpenResponsesReasoningFormat$outboundSchema = openEnums.outboundSch
|
|
|
50
50
|
export const OpenResponsesReasoning$outboundSchema = z.object({
|
|
51
51
|
type: OpenResponsesReasoningType$outboundSchema,
|
|
52
52
|
id: z.string(),
|
|
53
|
-
content: z.array(ReasoningTextContent$outboundSchema).optional(),
|
|
53
|
+
content: z.nullable(z.array(ReasoningTextContent$outboundSchema)).optional(),
|
|
54
54
|
summary: z.array(ReasoningSummaryText$outboundSchema),
|
|
55
55
|
encryptedContent: z.nullable(z.string()).optional(),
|
|
56
56
|
status: z.union([
|
|
@@ -6,14 +6,14 @@ import { ReasoningSummaryVerbosity } from "./reasoningsummaryverbosity.js";
|
|
|
6
6
|
*/
|
|
7
7
|
export type OpenResponsesReasoningConfig = {
|
|
8
8
|
effort?: OpenAIResponsesReasoningEffort | null | undefined;
|
|
9
|
-
summary?: ReasoningSummaryVerbosity | undefined;
|
|
9
|
+
summary?: ReasoningSummaryVerbosity | null | undefined;
|
|
10
10
|
maxTokens?: number | null | undefined;
|
|
11
11
|
enabled?: boolean | null | undefined;
|
|
12
12
|
};
|
|
13
13
|
/** @internal */
|
|
14
14
|
export type OpenResponsesReasoningConfig$Outbound = {
|
|
15
15
|
effort?: string | null | undefined;
|
|
16
|
-
summary?: string | undefined;
|
|
16
|
+
summary?: string | null | undefined;
|
|
17
17
|
max_tokens?: number | null | undefined;
|
|
18
18
|
enabled?: boolean | null | undefined;
|
|
19
19
|
};
|
|
@@ -9,7 +9,7 @@ import { ReasoningSummaryVerbosity$outboundSchema, } from "./reasoningsummaryver
|
|
|
9
9
|
/** @internal */
|
|
10
10
|
export const OpenResponsesReasoningConfig$outboundSchema = z.object({
|
|
11
11
|
effort: z.nullable(OpenAIResponsesReasoningEffort$outboundSchema).optional(),
|
|
12
|
-
summary: ReasoningSummaryVerbosity$outboundSchema.optional(),
|
|
12
|
+
summary: z.nullable(ReasoningSummaryVerbosity$outboundSchema).optional(),
|
|
13
13
|
maxTokens: z.nullable(z.number()).optional(),
|
|
14
14
|
enabled: z.nullable(z.boolean()).optional(),
|
|
15
15
|
}).transform((v) => {
|
|
@@ -55,24 +55,12 @@ export type OpenResponsesRequestSort = ProviderSort | ProviderSortConfig | any;
|
|
|
55
55
|
*/
|
|
56
56
|
export type OpenResponsesRequestMaxPrice = {
|
|
57
57
|
/**
|
|
58
|
-
*
|
|
58
|
+
* Price per million prompt tokens
|
|
59
59
|
*/
|
|
60
60
|
prompt?: string | undefined;
|
|
61
|
-
/**
|
|
62
|
-
* A value in string format that is a large number
|
|
63
|
-
*/
|
|
64
61
|
completion?: string | undefined;
|
|
65
|
-
/**
|
|
66
|
-
* A value in string format that is a large number
|
|
67
|
-
*/
|
|
68
62
|
image?: string | undefined;
|
|
69
|
-
/**
|
|
70
|
-
* A value in string format that is a large number
|
|
71
|
-
*/
|
|
72
63
|
audio?: string | undefined;
|
|
73
|
-
/**
|
|
74
|
-
* A value in string format that is a large number
|
|
75
|
-
*/
|
|
76
64
|
request?: string | undefined;
|
|
77
65
|
};
|
|
78
66
|
/**
|
|
@@ -187,6 +175,19 @@ export type OpenResponsesRequestPluginAutoRouter = {
|
|
|
187
175
|
allowedModels?: Array<string> | undefined;
|
|
188
176
|
};
|
|
189
177
|
export type OpenResponsesRequestPluginUnion = OpenResponsesRequestPluginAutoRouter | OpenResponsesRequestPluginModeration | OpenResponsesRequestPluginWeb | OpenResponsesRequestPluginFileParser | OpenResponsesRequestPluginResponseHealing;
|
|
178
|
+
/**
|
|
179
|
+
* Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.
|
|
180
|
+
*/
|
|
181
|
+
export type OpenResponsesRequestTrace = {
|
|
182
|
+
traceId?: string | undefined;
|
|
183
|
+
traceName?: string | undefined;
|
|
184
|
+
spanName?: string | undefined;
|
|
185
|
+
generationName?: string | undefined;
|
|
186
|
+
parentSpanId?: string | undefined;
|
|
187
|
+
additionalProperties?: {
|
|
188
|
+
[k: string]: any | null;
|
|
189
|
+
} | undefined;
|
|
190
|
+
};
|
|
190
191
|
/**
|
|
191
192
|
* Request schema for Responses endpoint
|
|
192
193
|
*/
|
|
@@ -259,6 +260,10 @@ export type OpenResponsesRequest = {
|
|
|
259
260
|
* A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters.
|
|
260
261
|
*/
|
|
261
262
|
sessionId?: string | undefined;
|
|
263
|
+
/**
|
|
264
|
+
* Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.
|
|
265
|
+
*/
|
|
266
|
+
trace?: OpenResponsesRequestTrace | undefined;
|
|
262
267
|
};
|
|
263
268
|
/** @internal */
|
|
264
269
|
export type OpenResponsesRequestToolFunction$Outbound = {
|
|
@@ -387,6 +392,18 @@ export type OpenResponsesRequestPluginUnion$Outbound = OpenResponsesRequestPlugi
|
|
|
387
392
|
export declare const OpenResponsesRequestPluginUnion$outboundSchema: z.ZodType<OpenResponsesRequestPluginUnion$Outbound, OpenResponsesRequestPluginUnion>;
|
|
388
393
|
export declare function openResponsesRequestPluginUnionToJSON(openResponsesRequestPluginUnion: OpenResponsesRequestPluginUnion): string;
|
|
389
394
|
/** @internal */
|
|
395
|
+
export type OpenResponsesRequestTrace$Outbound = {
|
|
396
|
+
trace_id?: string | undefined;
|
|
397
|
+
trace_name?: string | undefined;
|
|
398
|
+
span_name?: string | undefined;
|
|
399
|
+
generation_name?: string | undefined;
|
|
400
|
+
parent_span_id?: string | undefined;
|
|
401
|
+
[additionalProperties: string]: unknown;
|
|
402
|
+
};
|
|
403
|
+
/** @internal */
|
|
404
|
+
export declare const OpenResponsesRequestTrace$outboundSchema: z.ZodType<OpenResponsesRequestTrace$Outbound, OpenResponsesRequestTrace>;
|
|
405
|
+
export declare function openResponsesRequestTraceToJSON(openResponsesRequestTrace: OpenResponsesRequestTrace): string;
|
|
406
|
+
/** @internal */
|
|
390
407
|
export type OpenResponsesRequest$Outbound = {
|
|
391
408
|
input?: OpenResponsesInput$Outbound | undefined;
|
|
392
409
|
instructions?: string | null | undefined;
|
|
@@ -426,6 +443,7 @@ export type OpenResponsesRequest$Outbound = {
|
|
|
426
443
|
plugins?: Array<OpenResponsesRequestPluginAutoRouter$Outbound | OpenResponsesRequestPluginModeration$Outbound | OpenResponsesRequestPluginWeb$Outbound | OpenResponsesRequestPluginFileParser$Outbound | OpenResponsesRequestPluginResponseHealing$Outbound> | undefined;
|
|
427
444
|
user?: string | undefined;
|
|
428
445
|
session_id?: string | undefined;
|
|
446
|
+
trace?: OpenResponsesRequestTrace$Outbound | undefined;
|
|
429
447
|
};
|
|
430
448
|
/** @internal */
|
|
431
449
|
export declare const OpenResponsesRequest$outboundSchema: z.ZodType<OpenResponsesRequest$Outbound, OpenResponsesRequest>;
|
|
@@ -201,6 +201,30 @@ export function openResponsesRequestPluginUnionToJSON(openResponsesRequestPlugin
|
|
|
201
201
|
return JSON.stringify(OpenResponsesRequestPluginUnion$outboundSchema.parse(openResponsesRequestPluginUnion));
|
|
202
202
|
}
|
|
203
203
|
/** @internal */
|
|
204
|
+
export const OpenResponsesRequestTrace$outboundSchema = z.object({
|
|
205
|
+
traceId: z.string().optional(),
|
|
206
|
+
traceName: z.string().optional(),
|
|
207
|
+
spanName: z.string().optional(),
|
|
208
|
+
generationName: z.string().optional(),
|
|
209
|
+
parentSpanId: z.string().optional(),
|
|
210
|
+
additionalProperties: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
211
|
+
}).transform((v) => {
|
|
212
|
+
return {
|
|
213
|
+
...v.additionalProperties,
|
|
214
|
+
...remap$(v, {
|
|
215
|
+
traceId: "trace_id",
|
|
216
|
+
traceName: "trace_name",
|
|
217
|
+
spanName: "span_name",
|
|
218
|
+
generationName: "generation_name",
|
|
219
|
+
parentSpanId: "parent_span_id",
|
|
220
|
+
additionalProperties: null,
|
|
221
|
+
}),
|
|
222
|
+
};
|
|
223
|
+
});
|
|
224
|
+
export function openResponsesRequestTraceToJSON(openResponsesRequestTrace) {
|
|
225
|
+
return JSON.stringify(OpenResponsesRequestTrace$outboundSchema.parse(openResponsesRequestTrace));
|
|
226
|
+
}
|
|
227
|
+
/** @internal */
|
|
204
228
|
export const OpenResponsesRequest$outboundSchema = z.object({
|
|
205
229
|
input: OpenResponsesInput$outboundSchema.optional(),
|
|
206
230
|
instructions: z.nullable(z.string()).optional(),
|
|
@@ -250,6 +274,7 @@ export const OpenResponsesRequest$outboundSchema = z.object({
|
|
|
250
274
|
])).optional(),
|
|
251
275
|
user: z.string().optional(),
|
|
252
276
|
sessionId: z.string().optional(),
|
|
277
|
+
trace: z.lazy(() => OpenResponsesRequestTrace$outboundSchema).optional(),
|
|
253
278
|
}).transform((v) => {
|
|
254
279
|
return remap$(v, {
|
|
255
280
|
toolChoice: "tool_choice",
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
3
3
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
4
|
+
export type BulkAssignKeysToGuardrailGlobals = {
|
|
5
|
+
/**
|
|
6
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* This is used to track API usage per application.
|
|
10
|
+
*/
|
|
11
|
+
httpReferer?: string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
*/
|
|
17
|
+
xTitle?: string | undefined;
|
|
18
|
+
};
|
|
4
19
|
export type BulkAssignKeysToGuardrailRequestBody = {
|
|
5
20
|
/**
|
|
6
21
|
* Array of API key hashes to assign to the guardrail
|
|
@@ -8,6 +23,19 @@ export type BulkAssignKeysToGuardrailRequestBody = {
|
|
|
8
23
|
keyHashes: Array<string>;
|
|
9
24
|
};
|
|
10
25
|
export type BulkAssignKeysToGuardrailRequest = {
|
|
26
|
+
/**
|
|
27
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* This is used to track API usage per application.
|
|
31
|
+
*/
|
|
32
|
+
httpReferer?: string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
*/
|
|
38
|
+
xTitle?: string | undefined;
|
|
11
39
|
/**
|
|
12
40
|
* The unique identifier of the guardrail
|
|
13
41
|
*/
|
|
@@ -32,6 +60,8 @@ export declare const BulkAssignKeysToGuardrailRequestBody$outboundSchema: z.ZodT
|
|
|
32
60
|
export declare function bulkAssignKeysToGuardrailRequestBodyToJSON(bulkAssignKeysToGuardrailRequestBody: BulkAssignKeysToGuardrailRequestBody): string;
|
|
33
61
|
/** @internal */
|
|
34
62
|
export type BulkAssignKeysToGuardrailRequest$Outbound = {
|
|
63
|
+
"HTTP-Referer"?: string | undefined;
|
|
64
|
+
"X-Title"?: string | undefined;
|
|
35
65
|
id: string;
|
|
36
66
|
RequestBody: BulkAssignKeysToGuardrailRequestBody$Outbound;
|
|
37
67
|
};
|
|
@@ -18,10 +18,14 @@ export function bulkAssignKeysToGuardrailRequestBodyToJSON(bulkAssignKeysToGuard
|
|
|
18
18
|
}
|
|
19
19
|
/** @internal */
|
|
20
20
|
export const BulkAssignKeysToGuardrailRequest$outboundSchema = z.object({
|
|
21
|
+
httpReferer: z.string().optional(),
|
|
22
|
+
xTitle: z.string().optional(),
|
|
21
23
|
id: z.string(),
|
|
22
24
|
requestBody: z.lazy(() => BulkAssignKeysToGuardrailRequestBody$outboundSchema),
|
|
23
25
|
}).transform((v) => {
|
|
24
26
|
return remap$(v, {
|
|
27
|
+
httpReferer: "HTTP-Referer",
|
|
28
|
+
xTitle: "X-Title",
|
|
25
29
|
requestBody: "RequestBody",
|
|
26
30
|
});
|
|
27
31
|
});
|