@openrouter/sdk 0.13.58 → 0.13.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/funcs/betaResponsesSend.d.ts +2 -4
- package/esm/funcs/byokList.js +1 -2
- package/esm/funcs/chatSend.d.ts +2 -4
- package/esm/funcs/datasetsGetAppRankings.js +1 -2
- package/esm/funcs/embeddingsListModels.js +1 -2
- package/esm/funcs/filesList.js +2 -3
- package/esm/funcs/guardrailsList.js +1 -2
- package/esm/funcs/guardrailsListGuardrailKeyAssignments.js +1 -2
- package/esm/funcs/guardrailsListGuardrailMemberAssignments.js +1 -2
- package/esm/funcs/guardrailsListKeyAssignments.js +1 -2
- package/esm/funcs/guardrailsListMemberAssignments.js +1 -2
- package/esm/funcs/imagesGenerate.d.ts +2 -4
- package/esm/funcs/modelsList.js +1 -2
- package/esm/funcs/modelsListForUser.js +1 -2
- package/esm/funcs/observabilityList.js +1 -2
- package/esm/funcs/organizationListMembers.js +1 -2
- package/esm/funcs/presetsList.js +1 -2
- package/esm/funcs/presetsListVersions.js +1 -2
- package/esm/funcs/workspacesList.js +1 -2
- package/esm/funcs/workspacesListMembers.js +1 -2
- package/esm/hooks/types.d.ts +1 -0
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/lib/encodings.js +1 -1
- package/esm/lib/env.js +3 -3
- package/esm/lib/event-streams.d.ts +7 -2
- package/esm/lib/event-streams.js +30 -14
- package/esm/lib/matchers.js +1 -1
- package/esm/lib/primitives.d.ts +1 -0
- package/esm/lib/primitives.js +17 -0
- package/esm/lib/retries.js +7 -0
- package/esm/lib/sdks.js +50 -16
- package/esm/models/additionaltoolsitem.d.ts +7 -7
- package/esm/models/additionaltoolsitem.js +5 -5
- package/esm/models/advisornestedtool.d.ts +3 -3
- package/esm/models/advisornestedtool.js +2 -2
- package/esm/models/agentmessageitem.d.ts +3 -3
- package/esm/models/agentmessageitem.js +3 -3
- package/esm/models/badgatewayresponseerrordata.d.ts +1 -1
- package/esm/models/badgatewayresponseerrordata.js +1 -1
- package/esm/models/badrequestresponseerrordata.d.ts +1 -1
- package/esm/models/badrequestresponseerrordata.js +1 -1
- package/esm/models/baseinputsunion.d.ts +3 -3
- package/esm/models/baseinputsunion.js +0 -3
- package/esm/models/byokproviderslug.d.ts +1 -0
- package/esm/models/byokproviderslug.js +1 -0
- package/esm/models/chatassistantmessage.d.ts +4 -4
- package/esm/models/chatassistantmessage.js +4 -4
- package/esm/models/chatfunctiontool.d.ts +2 -2
- package/esm/models/chatfunctiontool.js +1 -1
- package/esm/models/chatjsonschemaconfig.d.ts +2 -2
- package/esm/models/chatjsonschemaconfig.js +1 -1
- package/esm/models/chatrequest.d.ts +4 -4
- package/esm/models/chatrequest.js +1 -3
- package/esm/models/chatstreamingresponse.js +3 -1
- package/esm/models/compactionitem.d.ts +1 -1
- package/esm/models/compactionitem.js +1 -1
- package/esm/models/compoundfilter.d.ts +2 -2
- package/esm/models/compoundfilter.js +2 -2
- package/esm/models/conflictresponseerrordata.d.ts +1 -1
- package/esm/models/conflictresponseerrordata.js +1 -1
- package/esm/models/contextcompactionitem.d.ts +1 -1
- package/esm/models/contextcompactionitem.js +1 -1
- package/esm/models/createobservabilitydestinationrequest.d.ts +2 -2
- package/esm/models/createobservabilitydestinationrequest.js +1 -1
- package/esm/models/debugevent.d.ts +1 -1
- package/esm/models/debugevent.js +1 -1
- package/esm/models/easyinputmessage.d.ts +8 -8
- package/esm/models/easyinputmessage.js +0 -4
- package/esm/models/edgenetworktimeoutresponseerrordata.d.ts +1 -1
- package/esm/models/edgenetworktimeoutresponseerrordata.js +1 -1
- package/esm/models/errors/badgatewayresponseerror.d.ts +2 -2
- package/esm/models/errors/badgatewayresponseerror.js +1 -2
- package/esm/models/errors/badrequestresponseerror.d.ts +2 -2
- package/esm/models/errors/badrequestresponseerror.js +1 -2
- package/esm/models/errors/conflictresponseerror.d.ts +2 -2
- package/esm/models/errors/conflictresponseerror.js +1 -2
- package/esm/models/errors/edgenetworktimeoutresponseerror.d.ts +2 -2
- package/esm/models/errors/edgenetworktimeoutresponseerror.js +1 -2
- package/esm/models/errors/forbiddenresponseerror.d.ts +2 -2
- package/esm/models/errors/forbiddenresponseerror.js +1 -2
- package/esm/models/errors/internalserverresponseerror.d.ts +2 -2
- package/esm/models/errors/internalserverresponseerror.js +1 -2
- package/esm/models/errors/notfoundresponseerror.d.ts +2 -2
- package/esm/models/errors/notfoundresponseerror.js +1 -2
- package/esm/models/errors/payloadtoolargeresponseerror.d.ts +2 -2
- package/esm/models/errors/payloadtoolargeresponseerror.js +1 -2
- package/esm/models/errors/paymentrequiredresponseerror.d.ts +2 -2
- package/esm/models/errors/paymentrequiredresponseerror.js +1 -2
- package/esm/models/errors/provideroverloadedresponseerror.d.ts +2 -2
- package/esm/models/errors/provideroverloadedresponseerror.js +1 -2
- package/esm/models/errors/requesttimeoutresponseerror.d.ts +2 -2
- package/esm/models/errors/requesttimeoutresponseerror.js +1 -2
- package/esm/models/errors/serviceunavailableresponseerror.d.ts +2 -2
- package/esm/models/errors/serviceunavailableresponseerror.js +1 -2
- package/esm/models/errors/toomanyrequestsresponseerror.d.ts +2 -2
- package/esm/models/errors/toomanyrequestsresponseerror.js +1 -2
- package/esm/models/errors/unauthorizedresponseerror.d.ts +2 -2
- package/esm/models/errors/unauthorizedresponseerror.js +1 -2
- package/esm/models/errors/unprocessableentityresponseerror.d.ts +2 -2
- package/esm/models/errors/unprocessableentityresponseerror.js +1 -2
- package/esm/models/filesearchservertool.d.ts +4 -4
- package/esm/models/filesearchservertool.js +1 -8
- package/esm/models/forbiddenresponseerrordata.d.ts +1 -1
- package/esm/models/forbiddenresponseerrordata.js +1 -1
- package/esm/models/formatjsonschemaconfig.d.ts +2 -2
- package/esm/models/formatjsonschemaconfig.js +2 -2
- package/esm/models/functioncalloutputitem.d.ts +2 -9
- package/esm/models/functioncalloutputitem.js +2 -8
- package/esm/models/fusionplugin.d.ts +28 -2
- package/esm/models/fusionplugin.js +28 -1
- package/esm/models/fusionservertoolconfig.d.ts +2 -2
- package/esm/models/fusionservertoolconfig.js +1 -1
- package/esm/models/generationcontentdata.d.ts +1 -1
- package/esm/models/generationcontentdata.js +1 -1
- package/esm/models/imageconfig.d.ts +2 -2
- package/esm/models/imageconfig.js +1 -1
- package/esm/models/imagegenerationproviderpreferences.d.ts +256 -250
- package/esm/models/imagegenerationproviderpreferences.js +126 -133
- package/esm/models/imagegenerationservertoolconfigunion.d.ts +2 -2
- package/esm/models/imagegenerationservertoolconfigunion.js +1 -1
- package/esm/models/imagestreamingresponse.js +3 -1
- package/esm/models/index.d.ts +0 -2
- package/esm/models/index.js +0 -2
- package/esm/models/inputsunion.d.ts +8 -8
- package/esm/models/inputsunion.js +0 -4
- package/esm/models/internalserverresponseerrordata.d.ts +1 -1
- package/esm/models/internalserverresponseerrordata.js +1 -1
- package/esm/models/listendpointsresponse.d.ts +2 -33
- package/esm/models/listendpointsresponse.js +2 -30
- package/esm/models/localshellcalloutputitem.d.ts +3 -10
- package/esm/models/localshellcalloutputitem.js +2 -9
- package/esm/models/mcplisttoolsitem.d.ts +4 -4
- package/esm/models/mcplisttoolsitem.js +2 -2
- package/esm/models/mcpservertool.d.ts +8 -8
- package/esm/models/mcpservertool.js +4 -24
- package/esm/models/messagesadvisortoolresultblock.d.ts +2 -2
- package/esm/models/messagesadvisortoolresultblock.js +1 -1
- package/esm/models/messagesfallbackparam.d.ts +1 -1
- package/esm/models/messagesfallbackparam.js +1 -1
- package/esm/models/messagesmessageparam.d.ts +4 -4
- package/esm/models/messagesmessageparam.js +2 -2
- package/esm/models/messagesoutputconfig.d.ts +2 -2
- package/esm/models/messagesoutputconfig.js +1 -1
- package/esm/models/messagesrequest.d.ts +10 -32
- package/esm/models/messagesrequest.js +7 -21
- package/esm/models/namespacefunctiontool.d.ts +4 -4
- package/esm/models/namespacefunctiontool.js +4 -6
- package/esm/models/notfoundresponseerrordata.d.ts +1 -1
- package/esm/models/notfoundresponseerrordata.js +1 -1
- package/esm/models/openairesponsefunctiontoolcalloutput.d.ts +3 -10
- package/esm/models/openairesponsefunctiontoolcalloutput.js +2 -11
- package/esm/models/openresponsesresult.d.ts +46 -2
- package/esm/models/openresponsesresult.js +69 -3
- package/esm/models/operations/listbyokkeys.d.ts +1 -0
- package/esm/models/operations/listbyokkeys.js +1 -0
- package/esm/models/outputcomputercallitem.d.ts +2 -2
- package/esm/models/outputcomputercallitem.js +2 -2
- package/esm/models/outputmemoryservertoolitem.d.ts +2 -2
- package/esm/models/outputmemoryservertoolitem.js +2 -2
- package/esm/models/outputmessage.d.ts +2 -2
- package/esm/models/outputmessage.js +0 -2
- package/esm/models/outputmessageitem.d.ts +2 -2
- package/esm/models/outputmessageitem.js +0 -2
- package/esm/models/payloadtoolargeresponseerrordata.d.ts +1 -1
- package/esm/models/payloadtoolargeresponseerrordata.js +1 -1
- package/esm/models/paymentrequiredresponseerrordata.d.ts +1 -1
- package/esm/models/paymentrequiredresponseerrordata.js +1 -1
- package/esm/models/pipelinestage.d.ts +1 -1
- package/esm/models/pipelinestage.js +1 -1
- package/esm/models/preferredmaxlatency.d.ts +2 -2
- package/esm/models/preferredmaxlatency.js +1 -1
- package/esm/models/preferredminthroughput.d.ts +2 -2
- package/esm/models/preferredminthroughput.js +1 -1
- package/esm/models/presetdesignatedversion.d.ts +1 -1
- package/esm/models/presetdesignatedversion.js +1 -1
- package/esm/models/providername.d.ts +2 -1
- package/esm/models/providername.js +2 -1
- package/esm/models/provideroptions.d.ts +252 -246
- package/esm/models/provideroptions.js +124 -123
- package/esm/models/provideroverloadedresponseerrordata.d.ts +1 -1
- package/esm/models/provideroverloadedresponseerrordata.js +1 -1
- package/esm/models/providerpreferences.d.ts +4 -4
- package/esm/models/providerpreferences.js +2 -10
- package/esm/models/providerresponse.d.ts +2 -1
- package/esm/models/providerresponse.js +2 -1
- package/esm/models/publicendpoint.d.ts +2 -16
- package/esm/models/publicendpoint.js +2 -15
- package/esm/models/quantization.d.ts +2 -0
- package/esm/models/quantization.js +2 -0
- package/esm/models/requesttimeoutresponseerrordata.d.ts +1 -1
- package/esm/models/requesttimeoutresponseerrordata.js +1 -1
- package/esm/models/responsesrequest.d.ts +37 -5
- package/esm/models/responsesrequest.js +24 -4
- package/esm/models/responsesstreamingresponse.js +3 -1
- package/esm/models/routerparams.d.ts +1 -1
- package/esm/models/serviceunavailableresponseerrordata.d.ts +1 -1
- package/esm/models/serviceunavailableresponseerrordata.js +1 -1
- package/esm/models/shellcallitem.d.ts +5 -12
- package/esm/models/shellcallitem.js +3 -10
- package/esm/models/shellcalloutputitem.d.ts +4 -11
- package/esm/models/shellcalloutputitem.js +3 -10
- package/esm/models/subagentnestedtool.d.ts +3 -3
- package/esm/models/subagentnestedtool.js +2 -2
- package/esm/models/toolchoiceallowed.d.ts +2 -2
- package/esm/models/toolchoiceallowed.js +2 -2
- package/esm/models/toomanyrequestsresponseerrordata.d.ts +1 -1
- package/esm/models/toomanyrequestsresponseerrordata.js +1 -1
- package/esm/models/traceconfig.d.ts +1 -1
- package/esm/models/traceconfig.js +1 -1
- package/esm/models/unauthorizedresponseerrordata.d.ts +1 -1
- package/esm/models/unauthorizedresponseerrordata.js +1 -1
- package/esm/models/unprocessableentityresponseerrordata.d.ts +1 -1
- package/esm/models/unprocessableentityresponseerrordata.js +1 -1
- package/esm/models/updateobservabilitydestinationrequest.d.ts +2 -2
- package/esm/models/updateobservabilitydestinationrequest.js +1 -1
- package/esm/models/videogenerationrequest.d.ts +252 -246
- package/esm/models/videogenerationrequest.js +124 -123
- package/esm/sdk/chat.d.ts +2 -4
- package/esm/sdk/images.d.ts +2 -3
- package/esm/sdk/responses.d.ts +2 -4
- package/esm/types/async.js +8 -7
- package/jsr.json +1 -1
- package/package.json +4 -4
- package/esm/lib/dlv.d.ts +0 -14
- package/esm/lib/dlv.js +0 -47
- package/esm/lib/is-plain-object.d.ts +0 -2
- package/esm/lib/is-plain-object.js +0 -39
- package/esm/models/reasoningconfig.d.ts +0 -35
- package/esm/models/reasoningconfig.js +0 -27
- package/esm/models/usage.d.ts +0 -52
- package/esm/models/usage.js +0 -75
package/esm/lib/retries.js
CHANGED
|
@@ -127,6 +127,13 @@ async function retryBackoff(fn, strategy) {
|
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
function retryIntervalFromResponse(res) {
|
|
130
|
+
const retryAfterMsVal = res.headers.get("retry-after-ms");
|
|
131
|
+
if (retryAfterMsVal) {
|
|
132
|
+
const parsedMs = Number(retryAfterMsVal);
|
|
133
|
+
if (Number.isFinite(parsedMs) && parsedMs >= 0) {
|
|
134
|
+
return parsedMs;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
130
137
|
const retryVal = res.headers.get("retry-after") || "";
|
|
131
138
|
if (!retryVal) {
|
|
132
139
|
return 0;
|
package/esm/lib/sdks.js
CHANGED
|
@@ -22,6 +22,7 @@ import { SDK_METADATA, serverURLFromOptions } from "./config.js";
|
|
|
22
22
|
import { encodeForm } from "./encodings.js";
|
|
23
23
|
import { env, fillGlobals } from "./env.js";
|
|
24
24
|
import { HTTPClient, isAbortError, isConnectionError, isTimeoutError, matchContentType, } from "./http.js";
|
|
25
|
+
import { combineSignals } from "./primitives.js";
|
|
25
26
|
import { retry } from "./retries.js";
|
|
26
27
|
const gt = typeof globalThis === "undefined" ? null : globalThis;
|
|
27
28
|
const webWorkerLike = typeof gt === "object"
|
|
@@ -72,25 +73,50 @@ export class ClientSDK {
|
|
|
72
73
|
if (path) {
|
|
73
74
|
baseURL.pathname = baseURL.pathname.replace(/\/+$/, "") + "/";
|
|
74
75
|
reqURL = new URL(path, baseURL);
|
|
76
|
+
if (!reqURL.search && baseURL.search) {
|
|
77
|
+
reqURL.search = baseURL.search;
|
|
78
|
+
}
|
|
75
79
|
}
|
|
76
80
|
else {
|
|
77
81
|
reqURL = baseURL;
|
|
78
82
|
}
|
|
79
83
|
reqURL.hash = "";
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
secQuery.push(q);
|
|
84
|
+
// Appends already-encoded query pairs to a query string, replacing any
|
|
85
|
+
// existing pairs with the same key so later sources take precedence.
|
|
86
|
+
const mergeQuery = (current, additions) => {
|
|
87
|
+
if (!additions) {
|
|
88
|
+
return current;
|
|
86
89
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
90
|
+
const additionKeys = new Set(additions
|
|
91
|
+
.split("&")
|
|
92
|
+
.filter((pair) => pair !== "")
|
|
93
|
+
.map((pair) => pair.split("=")[0] ?? ""));
|
|
94
|
+
const kept = current.split("&").filter((pair) => {
|
|
95
|
+
return pair !== "" && !additionKeys.has(pair.split("=")[0] ?? "");
|
|
96
|
+
});
|
|
97
|
+
return [...kept, additions].join("&");
|
|
98
|
+
};
|
|
99
|
+
const encodeQueryRecord = (record) => {
|
|
100
|
+
return Object.entries(record)
|
|
101
|
+
.map(([k, v]) => {
|
|
102
|
+
if (v == null) {
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
const value = v;
|
|
106
|
+
return encodeForm(k, value, {
|
|
107
|
+
explode: Array.isArray(value),
|
|
108
|
+
charEncoding: "percent",
|
|
109
|
+
});
|
|
110
|
+
})
|
|
111
|
+
.filter((pair) => typeof pair !== "undefined")
|
|
112
|
+
.join("&");
|
|
113
|
+
};
|
|
114
|
+
const finalQuery = [
|
|
115
|
+
query || "",
|
|
116
|
+
encodeQueryRecord(security?.queryParams || {}),
|
|
117
|
+
].reduce(mergeQuery, reqURL.search.slice(1));
|
|
91
118
|
if (finalQuery) {
|
|
92
|
-
|
|
93
|
-
reqURL.search = `?${q}`;
|
|
119
|
+
reqURL.search = `?${finalQuery}`;
|
|
94
120
|
}
|
|
95
121
|
const headers = new Headers(opHeaders);
|
|
96
122
|
const username = security?.basic.username;
|
|
@@ -122,9 +148,8 @@ export class ClientSDK {
|
|
|
122
148
|
...options?.fetchOptions,
|
|
123
149
|
...options,
|
|
124
150
|
};
|
|
125
|
-
if (!fetchOptions?.signal && conf.timeoutMs && conf.timeoutMs > 0) {
|
|
126
|
-
|
|
127
|
-
fetchOptions.signal = timeoutSignal;
|
|
151
|
+
if (!fetchOptions?.signal && conf.timeoutMs != null && conf.timeoutMs > 0) {
|
|
152
|
+
context.timeoutMs = conf.timeoutMs;
|
|
128
153
|
}
|
|
129
154
|
if (conf.body instanceof ReadableStream) {
|
|
130
155
|
Object.assign(fetchOptions, { duplex: "half" });
|
|
@@ -150,8 +175,17 @@ export class ClientSDK {
|
|
|
150
175
|
}
|
|
151
176
|
async _do(request, options) {
|
|
152
177
|
const { context, isErrorStatusCode } = options;
|
|
178
|
+
const timeoutMs = context.timeoutMs;
|
|
153
179
|
return retry(async () => {
|
|
154
|
-
const
|
|
180
|
+
const cloned = request.clone();
|
|
181
|
+
let attempt = cloned;
|
|
182
|
+
if (timeoutMs != null && timeoutMs > 0) {
|
|
183
|
+
const timeoutSignal = AbortSignal.timeout(timeoutMs);
|
|
184
|
+
const combined = combineSignals(cloned.signal, timeoutSignal)
|
|
185
|
+
?? timeoutSignal;
|
|
186
|
+
attempt = new Request(cloned, { signal: combined });
|
|
187
|
+
}
|
|
188
|
+
const req = await __classPrivateFieldGet(this, _ClientSDK_hooks, "f").beforeRequest(context, attempt);
|
|
155
189
|
await logRequest(__classPrivateFieldGet(this, _ClientSDK_logger, "f"), req).catch((e) => __classPrivateFieldGet(this, _ClientSDK_logger, "f")?.log("Failed to log request:", e));
|
|
156
190
|
let response = await __classPrivateFieldGet(this, _ClientSDK_httpClient, "f").request(req);
|
|
157
191
|
try {
|
|
@@ -40,13 +40,13 @@ export type AdditionalToolsItemRole = OpenEnum<typeof AdditionalToolsItemRole>;
|
|
|
40
40
|
export type AdditionalToolsItemTool = {
|
|
41
41
|
type: string;
|
|
42
42
|
additionalProperties?: {
|
|
43
|
-
[k: string]: any
|
|
43
|
+
[k: string]: any;
|
|
44
44
|
} | undefined;
|
|
45
45
|
};
|
|
46
|
-
export declare const
|
|
46
|
+
export declare const AdditionalToolsItemToolType: {
|
|
47
47
|
readonly Function: "function";
|
|
48
48
|
};
|
|
49
|
-
export type
|
|
49
|
+
export type AdditionalToolsItemToolType = ClosedEnum<typeof AdditionalToolsItemToolType>;
|
|
50
50
|
/**
|
|
51
51
|
* Function tool definition
|
|
52
52
|
*/
|
|
@@ -54,10 +54,10 @@ export type AdditionalToolsItemToolFunction = {
|
|
|
54
54
|
description?: string | null | undefined;
|
|
55
55
|
name: string;
|
|
56
56
|
parameters: {
|
|
57
|
-
[k: string]: any
|
|
57
|
+
[k: string]: any;
|
|
58
58
|
} | null;
|
|
59
59
|
strict?: boolean | null | undefined;
|
|
60
|
-
type:
|
|
60
|
+
type: AdditionalToolsItemToolType;
|
|
61
61
|
};
|
|
62
62
|
export type AdditionalToolsItemToolUnion = ComputerUseServerTool | NamespaceTool | AdditionalToolsItemToolFunction | FileSearchServerTool | CodeInterpreterServerTool | McpServerTool | CustomTool | PreviewWebSearchServerTool | Preview20250311WebSearchServerTool | LegacyWebSearchServerTool | WebSearchServerTool | ImageGenerationServerTool | CodexLocalShellTool | ShellServerTool | ApplyPatchServerTool | AdvisorServerToolOpenRouter | SubagentServerToolOpenRouter | DatetimeServerTool | FilesServerTool | FusionServerToolOpenRouter | ImageGenerationServerToolOpenRouter | SearchModelsServerToolOpenRouter | WebFetchServerTool | WebSearchServerToolOpenRouter | ApplyPatchServerToolOpenRouter | BashServerTool | ShellServerToolOpenRouter | AdditionalToolsItemTool;
|
|
63
63
|
export declare const TypeAdditionalTools: {
|
|
@@ -84,13 +84,13 @@ export type AdditionalToolsItemTool$Outbound = {
|
|
|
84
84
|
export declare const AdditionalToolsItemTool$outboundSchema: z.ZodType<AdditionalToolsItemTool$Outbound, AdditionalToolsItemTool>;
|
|
85
85
|
export declare function additionalToolsItemToolToJSON(additionalToolsItemTool: AdditionalToolsItemTool): string;
|
|
86
86
|
/** @internal */
|
|
87
|
-
export declare const
|
|
87
|
+
export declare const AdditionalToolsItemToolType$outboundSchema: z.ZodEnum<typeof AdditionalToolsItemToolType>;
|
|
88
88
|
/** @internal */
|
|
89
89
|
export type AdditionalToolsItemToolFunction$Outbound = {
|
|
90
90
|
description?: string | null | undefined;
|
|
91
91
|
name: string;
|
|
92
92
|
parameters: {
|
|
93
|
-
[k: string]: any
|
|
93
|
+
[k: string]: any;
|
|
94
94
|
} | null;
|
|
95
95
|
strict?: boolean | null | undefined;
|
|
96
96
|
type: string;
|
|
@@ -41,7 +41,7 @@ export const AdditionalToolsItemRole = {
|
|
|
41
41
|
Developer: "developer",
|
|
42
42
|
Tool: "tool",
|
|
43
43
|
};
|
|
44
|
-
export const
|
|
44
|
+
export const AdditionalToolsItemToolType = {
|
|
45
45
|
Function: "function",
|
|
46
46
|
};
|
|
47
47
|
export const TypeAdditionalTools = {
|
|
@@ -52,7 +52,7 @@ export const AdditionalToolsItemRole$outboundSchema = openEnums.outboundSchema(A
|
|
|
52
52
|
/** @internal */
|
|
53
53
|
export const AdditionalToolsItemTool$outboundSchema = z.object({
|
|
54
54
|
type: z.string(),
|
|
55
|
-
additionalProperties: z.record(z.string(), z.
|
|
55
|
+
additionalProperties: z.record(z.string(), z.any()).optional(),
|
|
56
56
|
}).transform((v) => {
|
|
57
57
|
return {
|
|
58
58
|
...v.additionalProperties,
|
|
@@ -65,14 +65,14 @@ export function additionalToolsItemToolToJSON(additionalToolsItemTool) {
|
|
|
65
65
|
return JSON.stringify(AdditionalToolsItemTool$outboundSchema.parse(additionalToolsItemTool));
|
|
66
66
|
}
|
|
67
67
|
/** @internal */
|
|
68
|
-
export const
|
|
68
|
+
export const AdditionalToolsItemToolType$outboundSchema = z.enum(AdditionalToolsItemToolType);
|
|
69
69
|
/** @internal */
|
|
70
70
|
export const AdditionalToolsItemToolFunction$outboundSchema = z.object({
|
|
71
71
|
description: z.nullable(z.string()).optional(),
|
|
72
72
|
name: z.string(),
|
|
73
|
-
parameters: z.nullable(z.record(z.string(), z.
|
|
73
|
+
parameters: z.nullable(z.record(z.string(), z.any())),
|
|
74
74
|
strict: z.nullable(z.boolean()).optional(),
|
|
75
|
-
type:
|
|
75
|
+
type: AdditionalToolsItemToolType$outboundSchema,
|
|
76
76
|
});
|
|
77
77
|
export function additionalToolsItemToolFunctionToJSON(additionalToolsItemToolFunction) {
|
|
78
78
|
return JSON.stringify(AdditionalToolsItemToolFunction$outboundSchema.parse(additionalToolsItemToolFunction));
|
|
@@ -4,17 +4,17 @@ import * as z from "zod/v4";
|
|
|
4
4
|
*/
|
|
5
5
|
export type AdvisorNestedTool = {
|
|
6
6
|
parameters?: {
|
|
7
|
-
[k: string]: any
|
|
7
|
+
[k: string]: any;
|
|
8
8
|
} | undefined;
|
|
9
9
|
type: string;
|
|
10
10
|
additionalProperties?: {
|
|
11
|
-
[k: string]: any
|
|
11
|
+
[k: string]: any;
|
|
12
12
|
} | undefined;
|
|
13
13
|
};
|
|
14
14
|
/** @internal */
|
|
15
15
|
export type AdvisorNestedTool$Outbound = {
|
|
16
16
|
parameters?: {
|
|
17
|
-
[k: string]: any
|
|
17
|
+
[k: string]: any;
|
|
18
18
|
} | undefined;
|
|
19
19
|
type: string;
|
|
20
20
|
[additionalProperties: string]: unknown;
|
|
@@ -6,9 +6,9 @@ import * as z from "zod/v4";
|
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
/** @internal */
|
|
8
8
|
export const AdvisorNestedTool$outboundSchema = z.object({
|
|
9
|
-
parameters: z.record(z.string(), z.
|
|
9
|
+
parameters: z.record(z.string(), z.any()).optional(),
|
|
10
10
|
type: z.string(),
|
|
11
|
-
additionalProperties: z.record(z.string(), z.
|
|
11
|
+
additionalProperties: z.record(z.string(), z.any()).optional(),
|
|
12
12
|
}).transform((v) => {
|
|
13
13
|
return {
|
|
14
14
|
...v.additionalProperties,
|
|
@@ -4,14 +4,14 @@ import { InputText, InputText$Outbound } from "./inputtext.js";
|
|
|
4
4
|
export type Agent = {
|
|
5
5
|
agentName: string;
|
|
6
6
|
additionalProperties?: {
|
|
7
|
-
[k: string]: any
|
|
7
|
+
[k: string]: any;
|
|
8
8
|
} | undefined;
|
|
9
9
|
};
|
|
10
10
|
export type ContentEncryptedContent = {
|
|
11
11
|
encryptedContent: string;
|
|
12
12
|
type: "encrypted_content";
|
|
13
13
|
additionalProperties?: {
|
|
14
|
-
[k: string]: any
|
|
14
|
+
[k: string]: any;
|
|
15
15
|
} | undefined;
|
|
16
16
|
};
|
|
17
17
|
export declare const AgentMessageItemDetail: {
|
|
@@ -45,7 +45,7 @@ export type AgentMessageItem = {
|
|
|
45
45
|
recipient: string;
|
|
46
46
|
type: TypeAgentMessage;
|
|
47
47
|
additionalProperties?: {
|
|
48
|
-
[k: string]: any
|
|
48
|
+
[k: string]: any;
|
|
49
49
|
} | undefined;
|
|
50
50
|
};
|
|
51
51
|
/** @internal */
|
|
@@ -18,7 +18,7 @@ export const TypeAgentMessage = {
|
|
|
18
18
|
/** @internal */
|
|
19
19
|
export const Agent$outboundSchema = z.object({
|
|
20
20
|
agentName: z.string(),
|
|
21
|
-
additionalProperties: z.record(z.string(), z.
|
|
21
|
+
additionalProperties: z.record(z.string(), z.any()).optional(),
|
|
22
22
|
}).transform((v) => {
|
|
23
23
|
return {
|
|
24
24
|
...v.additionalProperties,
|
|
@@ -35,7 +35,7 @@ export function agentToJSON(agent) {
|
|
|
35
35
|
export const ContentEncryptedContent$outboundSchema = z.object({
|
|
36
36
|
encryptedContent: z.string(),
|
|
37
37
|
type: z.literal("encrypted_content"),
|
|
38
|
-
additionalProperties: z.record(z.string(), z.
|
|
38
|
+
additionalProperties: z.record(z.string(), z.any()).optional(),
|
|
39
39
|
}).transform((v) => {
|
|
40
40
|
return {
|
|
41
41
|
...v.additionalProperties,
|
|
@@ -86,7 +86,7 @@ export const AgentMessageItem$outboundSchema = z.object({
|
|
|
86
86
|
id: z.nullable(z.string()).optional(),
|
|
87
87
|
recipient: z.string(),
|
|
88
88
|
type: TypeAgentMessage$outboundSchema,
|
|
89
|
-
additionalProperties: z.record(z.string(), z.
|
|
89
|
+
additionalProperties: z.record(z.string(), z.any()).optional(),
|
|
90
90
|
}).transform((v) => {
|
|
91
91
|
return {
|
|
92
92
|
...v.additionalProperties,
|
|
@@ -8,7 +8,7 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
8
8
|
export const BadGatewayResponseErrorData$inboundSchema = z.object({
|
|
9
9
|
code: z.int(),
|
|
10
10
|
message: z.string(),
|
|
11
|
-
metadata: z.nullable(z.record(z.string(), z.
|
|
11
|
+
metadata: z.nullable(z.record(z.string(), z.any())).optional(),
|
|
12
12
|
});
|
|
13
13
|
export function badGatewayResponseErrorDataFromJSON(jsonString) {
|
|
14
14
|
return safeParse(jsonString, (x) => BadGatewayResponseErrorData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BadGatewayResponseErrorData' from JSON`);
|
|
@@ -8,7 +8,7 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
8
8
|
export const BadRequestResponseErrorData$inboundSchema = z.object({
|
|
9
9
|
code: z.int(),
|
|
10
10
|
message: z.string(),
|
|
11
|
-
metadata: z.nullable(z.record(z.string(), z.
|
|
11
|
+
metadata: z.nullable(z.record(z.string(), z.any())).optional(),
|
|
12
12
|
});
|
|
13
13
|
export function badRequestResponseErrorDataFromJSON(jsonString) {
|
|
14
14
|
return safeParse(jsonString, (x) => BadRequestResponseErrorData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BadRequestResponseErrorData' from JSON`);
|
|
@@ -30,7 +30,7 @@ export declare const BaseInputsPhaseCommentary: {
|
|
|
30
30
|
readonly Commentary: "commentary";
|
|
31
31
|
};
|
|
32
32
|
export type BaseInputsPhaseCommentary = ClosedEnum<typeof BaseInputsPhaseCommentary>;
|
|
33
|
-
export type BaseInputsPhaseUnion = BaseInputsPhaseCommentary | BaseInputsPhaseFinalAnswer
|
|
33
|
+
export type BaseInputsPhaseUnion = BaseInputsPhaseCommentary | BaseInputsPhaseFinalAnswer;
|
|
34
34
|
export declare const BaseInputsRoleDeveloper: {
|
|
35
35
|
readonly Developer: "developer";
|
|
36
36
|
};
|
|
@@ -56,12 +56,12 @@ export type BaseInputsMessage = {
|
|
|
56
56
|
content: Array<InputAudio | InputFile | (InputImage & {
|
|
57
57
|
type: "input_image";
|
|
58
58
|
}) | InputText | discriminatedUnionTypes.Unknown<"type">> | string;
|
|
59
|
-
phase?: BaseInputsPhaseCommentary | BaseInputsPhaseFinalAnswer |
|
|
59
|
+
phase?: BaseInputsPhaseCommentary | BaseInputsPhaseFinalAnswer | null | undefined;
|
|
60
60
|
role: BaseInputsRoleUser | BaseInputsRoleSystem | BaseInputsRoleAssistant | BaseInputsRoleDeveloper;
|
|
61
61
|
type?: BaseInputsType | undefined;
|
|
62
62
|
};
|
|
63
63
|
export type BaseInputsUnion1 = OpenAIResponseFunctionToolCall | OutputMessage | OpenAIResponseCustomToolCall | ApplyPatchCallItem | OpenAIResponseInputMessageItem | OpenAIResponseFunctionToolCallOutput | OutputItemImageGenerationCall | OpenAIResponseCustomToolCallOutput | ApplyPatchCallOutputItem | BaseInputsMessage;
|
|
64
|
-
export type BaseInputsUnion = string | Array<OpenAIResponseFunctionToolCall | OutputMessage | OpenAIResponseCustomToolCall | ApplyPatchCallItem | OpenAIResponseInputMessageItem | OpenAIResponseFunctionToolCallOutput | OutputItemImageGenerationCall | OpenAIResponseCustomToolCallOutput | ApplyPatchCallOutputItem | BaseInputsMessage
|
|
64
|
+
export type BaseInputsUnion = string | Array<OpenAIResponseFunctionToolCall | OutputMessage | OpenAIResponseCustomToolCall | ApplyPatchCallItem | OpenAIResponseInputMessageItem | OpenAIResponseFunctionToolCallOutput | OutputItemImageGenerationCall | OpenAIResponseCustomToolCallOutput | ApplyPatchCallOutputItem | BaseInputsMessage>;
|
|
65
65
|
/** @internal */
|
|
66
66
|
export declare const BaseInputsContent1$inboundSchema: z.ZodType<BaseInputsContent1, unknown>;
|
|
67
67
|
export declare function baseInputsContent1FromJSON(jsonString: string): SafeParseResult<BaseInputsContent1, SDKValidationError>;
|
|
@@ -70,7 +70,6 @@ export const BaseInputsPhaseCommentary$inboundSchema = z.enum(BaseInputsPhaseCom
|
|
|
70
70
|
export const BaseInputsPhaseUnion$inboundSchema = z.union([
|
|
71
71
|
BaseInputsPhaseCommentary$inboundSchema,
|
|
72
72
|
BaseInputsPhaseFinalAnswer$inboundSchema,
|
|
73
|
-
z.any(),
|
|
74
73
|
]);
|
|
75
74
|
export function baseInputsPhaseUnionFromJSON(jsonString) {
|
|
76
75
|
return safeParse(jsonString, (x) => BaseInputsPhaseUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BaseInputsPhaseUnion' from JSON`);
|
|
@@ -110,7 +109,6 @@ export const BaseInputsMessage$inboundSchema = z.object({
|
|
|
110
109
|
phase: z.nullable(z.union([
|
|
111
110
|
BaseInputsPhaseCommentary$inboundSchema,
|
|
112
111
|
BaseInputsPhaseFinalAnswer$inboundSchema,
|
|
113
|
-
z.any(),
|
|
114
112
|
])).optional(),
|
|
115
113
|
role: z.union([
|
|
116
114
|
BaseInputsRoleUser$inboundSchema,
|
|
@@ -154,7 +152,6 @@ export const BaseInputsUnion$inboundSchema = z.union([
|
|
|
154
152
|
ApplyPatchCallOutputItem$inboundSchema,
|
|
155
153
|
z.lazy(() => BaseInputsMessage$inboundSchema),
|
|
156
154
|
])),
|
|
157
|
-
z.any(),
|
|
158
155
|
]);
|
|
159
156
|
export function baseInputsUnionFromJSON(jsonString) {
|
|
160
157
|
return safeParse(jsonString, (x) => BaseInputsUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BaseInputsUnion' from JSON`);
|
|
@@ -87,6 +87,7 @@ export declare const BYOKProviderSlug: {
|
|
|
87
87
|
readonly Stepfun: "stepfun";
|
|
88
88
|
readonly Streamlake: "streamlake";
|
|
89
89
|
readonly Switchpoint: "switchpoint";
|
|
90
|
+
readonly Tencent: "tencent";
|
|
90
91
|
readonly Tenstorrent: "tenstorrent";
|
|
91
92
|
readonly Together: "together";
|
|
92
93
|
readonly Upstage: "upstage";
|
|
@@ -10,7 +10,7 @@ import { ReasoningDetailUnion, ReasoningDetailUnion$Outbound } from "./reasoning
|
|
|
10
10
|
/**
|
|
11
11
|
* Assistant message content
|
|
12
12
|
*/
|
|
13
|
-
export type ChatAssistantMessageContent = string | Array<ChatContentItems
|
|
13
|
+
export type ChatAssistantMessageContent = string | Array<ChatContentItems>;
|
|
14
14
|
export declare const ChatAssistantMessageRole: {
|
|
15
15
|
readonly Assistant: "assistant";
|
|
16
16
|
};
|
|
@@ -26,7 +26,7 @@ export type ChatAssistantMessage = {
|
|
|
26
26
|
/**
|
|
27
27
|
* Assistant message content
|
|
28
28
|
*/
|
|
29
|
-
content?: string | Array<ChatContentItems> |
|
|
29
|
+
content?: string | Array<ChatContentItems> | null | undefined;
|
|
30
30
|
/**
|
|
31
31
|
* Generated images from image generation models
|
|
32
32
|
*/
|
|
@@ -56,7 +56,7 @@ export type ChatAssistantMessage = {
|
|
|
56
56
|
/** @internal */
|
|
57
57
|
export declare const ChatAssistantMessageContent$inboundSchema: z.ZodType<ChatAssistantMessageContent, unknown>;
|
|
58
58
|
/** @internal */
|
|
59
|
-
export type ChatAssistantMessageContent$Outbound = string | Array<ChatContentItems$Outbound
|
|
59
|
+
export type ChatAssistantMessageContent$Outbound = string | Array<ChatContentItems$Outbound>;
|
|
60
60
|
/** @internal */
|
|
61
61
|
export declare const ChatAssistantMessageContent$outboundSchema: z.ZodType<ChatAssistantMessageContent$Outbound, ChatAssistantMessageContent>;
|
|
62
62
|
export declare function chatAssistantMessageContentToJSON(chatAssistantMessageContent: ChatAssistantMessageContent): string;
|
|
@@ -70,7 +70,7 @@ export declare const ChatAssistantMessage$inboundSchema: z.ZodType<ChatAssistant
|
|
|
70
70
|
/** @internal */
|
|
71
71
|
export type ChatAssistantMessage$Outbound = {
|
|
72
72
|
audio?: ChatAudioOutput$Outbound | undefined;
|
|
73
|
-
content?: string | Array<ChatContentItems$Outbound> |
|
|
73
|
+
content?: string | Array<ChatContentItems$Outbound> | null | undefined;
|
|
74
74
|
images?: Array<ChatAssistantImages$Outbound> | undefined;
|
|
75
75
|
name?: string | undefined;
|
|
76
76
|
reasoning?: string | null | undefined;
|
|
@@ -14,9 +14,9 @@ export const ChatAssistantMessageRole = {
|
|
|
14
14
|
Assistant: "assistant",
|
|
15
15
|
};
|
|
16
16
|
/** @internal */
|
|
17
|
-
export const ChatAssistantMessageContent$inboundSchema = z.union([z.string(), z.array(ChatContentItems$inboundSchema)
|
|
17
|
+
export const ChatAssistantMessageContent$inboundSchema = z.union([z.string(), z.array(ChatContentItems$inboundSchema)]);
|
|
18
18
|
/** @internal */
|
|
19
|
-
export const ChatAssistantMessageContent$outboundSchema = z.union([z.string(), z.array(ChatContentItems$outboundSchema)
|
|
19
|
+
export const ChatAssistantMessageContent$outboundSchema = z.union([z.string(), z.array(ChatContentItems$outboundSchema)]);
|
|
20
20
|
export function chatAssistantMessageContentToJSON(chatAssistantMessageContent) {
|
|
21
21
|
return JSON.stringify(ChatAssistantMessageContent$outboundSchema.parse(chatAssistantMessageContent));
|
|
22
22
|
}
|
|
@@ -30,7 +30,7 @@ export const ChatAssistantMessageRole$outboundSchema = ChatAssistantMessageRole$
|
|
|
30
30
|
/** @internal */
|
|
31
31
|
export const ChatAssistantMessage$inboundSchema = z.object({
|
|
32
32
|
audio: ChatAudioOutput$inboundSchema.optional(),
|
|
33
|
-
content: z.nullable(z.union([z.string(), z.array(ChatContentItems$inboundSchema)
|
|
33
|
+
content: z.nullable(z.union([z.string(), z.array(ChatContentItems$inboundSchema)])).optional(),
|
|
34
34
|
images: z.array(ChatAssistantImages$inboundSchema).optional(),
|
|
35
35
|
name: z.string().optional(),
|
|
36
36
|
reasoning: z.nullable(z.string()).optional(),
|
|
@@ -47,7 +47,7 @@ export const ChatAssistantMessage$inboundSchema = z.object({
|
|
|
47
47
|
/** @internal */
|
|
48
48
|
export const ChatAssistantMessage$outboundSchema = z.object({
|
|
49
49
|
audio: ChatAudioOutput$outboundSchema.optional(),
|
|
50
|
-
content: z.nullable(z.union([z.string(), z.array(ChatContentItems$outboundSchema)
|
|
50
|
+
content: z.nullable(z.union([z.string(), z.array(ChatContentItems$outboundSchema)])).optional(),
|
|
51
51
|
images: z.array(ChatAssistantImages$outboundSchema).optional(),
|
|
52
52
|
name: z.string().optional(),
|
|
53
53
|
reasoning: z.nullable(z.string()).optional(),
|
|
@@ -28,7 +28,7 @@ export type ChatFunctionToolFunctionFunction = {
|
|
|
28
28
|
* Function parameters as JSON Schema object
|
|
29
29
|
*/
|
|
30
30
|
parameters?: {
|
|
31
|
-
[k: string]: any
|
|
31
|
+
[k: string]: any;
|
|
32
32
|
} | undefined;
|
|
33
33
|
/**
|
|
34
34
|
* Enable strict schema adherence
|
|
@@ -59,7 +59,7 @@ export type ChatFunctionToolFunctionFunction$Outbound = {
|
|
|
59
59
|
description?: string | undefined;
|
|
60
60
|
name: string;
|
|
61
61
|
parameters?: {
|
|
62
|
-
[k: string]: any
|
|
62
|
+
[k: string]: any;
|
|
63
63
|
} | undefined;
|
|
64
64
|
strict?: boolean | null | undefined;
|
|
65
65
|
};
|
|
@@ -23,7 +23,7 @@ export const ChatFunctionToolType = {
|
|
|
23
23
|
export const ChatFunctionToolFunctionFunction$outboundSchema = z.object({
|
|
24
24
|
description: z.string().optional(),
|
|
25
25
|
name: z.string(),
|
|
26
|
-
parameters: z.record(z.string(), z.
|
|
26
|
+
parameters: z.record(z.string(), z.any()).optional(),
|
|
27
27
|
strict: z.nullable(z.boolean()).optional(),
|
|
28
28
|
});
|
|
29
29
|
export function chatFunctionToolFunctionFunctionToJSON(chatFunctionToolFunctionFunction) {
|
|
@@ -15,7 +15,7 @@ export type ChatJsonSchemaConfig = {
|
|
|
15
15
|
* JSON Schema object
|
|
16
16
|
*/
|
|
17
17
|
schema?: {
|
|
18
|
-
[k: string]: any
|
|
18
|
+
[k: string]: any;
|
|
19
19
|
} | undefined;
|
|
20
20
|
/**
|
|
21
21
|
* Enable strict schema adherence
|
|
@@ -27,7 +27,7 @@ export type ChatJsonSchemaConfig$Outbound = {
|
|
|
27
27
|
description?: string | undefined;
|
|
28
28
|
name: string;
|
|
29
29
|
schema?: {
|
|
30
|
-
[k: string]: any
|
|
30
|
+
[k: string]: any;
|
|
31
31
|
} | undefined;
|
|
32
32
|
strict?: boolean | null | undefined;
|
|
33
33
|
};
|
|
@@ -7,7 +7,7 @@ import * as z from "zod/v4";
|
|
|
7
7
|
export const ChatJsonSchemaConfig$outboundSchema = z.object({
|
|
8
8
|
description: z.string().optional(),
|
|
9
9
|
name: z.string(),
|
|
10
|
-
schema: z.record(z.string(), z.
|
|
10
|
+
schema: z.record(z.string(), z.any()).optional(),
|
|
11
11
|
strict: z.nullable(z.boolean()).optional(),
|
|
12
12
|
});
|
|
13
13
|
export function chatJsonSchemaConfigToJSON(chatJsonSchemaConfig) {
|
|
@@ -97,7 +97,7 @@ export type ChatRequestServiceTier = OpenEnum<typeof ChatRequestServiceTier>;
|
|
|
97
97
|
/**
|
|
98
98
|
* Stop sequences (up to 4)
|
|
99
99
|
*/
|
|
100
|
-
export type Stop = string | Array<string
|
|
100
|
+
export type Stop = string | Array<string>;
|
|
101
101
|
/**
|
|
102
102
|
* Chat completion request parameters
|
|
103
103
|
*/
|
|
@@ -220,7 +220,7 @@ export type ChatRequest = {
|
|
|
220
220
|
/**
|
|
221
221
|
* Stop sequences (up to 4)
|
|
222
222
|
*/
|
|
223
|
-
stop?: string | Array<string> |
|
|
223
|
+
stop?: string | Array<string> | null | undefined;
|
|
224
224
|
/**
|
|
225
225
|
* Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this overrides `max_tool_calls`.
|
|
226
226
|
*/
|
|
@@ -297,7 +297,7 @@ export declare function responseFormatToJSON(responseFormat: ResponseFormat): st
|
|
|
297
297
|
/** @internal */
|
|
298
298
|
export declare const ChatRequestServiceTier$outboundSchema: z.ZodType<string, ChatRequestServiceTier>;
|
|
299
299
|
/** @internal */
|
|
300
|
-
export type Stop$Outbound = string | Array<string
|
|
300
|
+
export type Stop$Outbound = string | Array<string>;
|
|
301
301
|
/** @internal */
|
|
302
302
|
export declare const Stop$outboundSchema: z.ZodType<Stop$Outbound, Stop>;
|
|
303
303
|
export declare function stopToJSON(stop: Stop): string;
|
|
@@ -337,7 +337,7 @@ export type ChatRequest$Outbound = {
|
|
|
337
337
|
seed?: number | null | undefined;
|
|
338
338
|
service_tier?: string | null | undefined;
|
|
339
339
|
session_id?: string | undefined;
|
|
340
|
-
stop?: string | Array<string> |
|
|
340
|
+
stop?: string | Array<string> | null | undefined;
|
|
341
341
|
stop_server_tools_when?: Array<StopServerToolsWhenCondition$Outbound> | undefined;
|
|
342
342
|
stream: boolean;
|
|
343
343
|
stream_options?: ChatStreamOptions$Outbound | null | undefined;
|
|
@@ -119,7 +119,6 @@ export const ChatRequestServiceTier$outboundSchema = openEnums.outboundSchema(Ch
|
|
|
119
119
|
export const Stop$outboundSchema = z.union([
|
|
120
120
|
z.string(),
|
|
121
121
|
z.array(z.string()),
|
|
122
|
-
z.any(),
|
|
123
122
|
]);
|
|
124
123
|
export function stopToJSON(stop) {
|
|
125
124
|
return JSON.stringify(Stop$outboundSchema.parse(stop));
|
|
@@ -171,8 +170,7 @@ export const ChatRequest$outboundSchema = z.object({
|
|
|
171
170
|
seed: z.nullable(z.int()).optional(),
|
|
172
171
|
serviceTier: z.nullable(ChatRequestServiceTier$outboundSchema).optional(),
|
|
173
172
|
sessionId: z.string().optional(),
|
|
174
|
-
stop: z.nullable(z.union([z.string(), z.array(z.string())
|
|
175
|
-
.optional(),
|
|
173
|
+
stop: z.nullable(z.union([z.string(), z.array(z.string())])).optional(),
|
|
176
174
|
stopServerToolsWhen: z.array(StopServerToolsWhenCondition$outboundSchema)
|
|
177
175
|
.optional(),
|
|
178
176
|
stream: z.boolean().default(false),
|
|
@@ -7,7 +7,9 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
7
7
|
import { ChatStreamChunk$inboundSchema, } from "./chatstreamchunk.js";
|
|
8
8
|
/** @internal */
|
|
9
9
|
export const ChatStreamingResponse$inboundSchema = z.object({
|
|
10
|
-
data: z.
|
|
10
|
+
data: z.unknown().transform((v, ctx) => {
|
|
11
|
+
if (typeof v !== "string")
|
|
12
|
+
return v;
|
|
11
13
|
try {
|
|
12
14
|
return JSON.parse(v);
|
|
13
15
|
}
|
|
@@ -14,7 +14,7 @@ export const CompactionItem$outboundSchema = z.object({
|
|
|
14
14
|
encryptedContent: z.string(),
|
|
15
15
|
id: z.nullable(z.string()).optional(),
|
|
16
16
|
type: CompactionItemType$outboundSchema,
|
|
17
|
-
additionalProperties: z.record(z.string(), z.
|
|
17
|
+
additionalProperties: z.record(z.string(), z.any()).optional(),
|
|
18
18
|
}).transform((v) => {
|
|
19
19
|
return {
|
|
20
20
|
...v.additionalProperties,
|
|
@@ -12,7 +12,7 @@ export type CompoundFilterType = OpenEnum<typeof CompoundFilterType>;
|
|
|
12
12
|
*/
|
|
13
13
|
export type CompoundFilter = {
|
|
14
14
|
filters: Array<{
|
|
15
|
-
[k: string]: any
|
|
15
|
+
[k: string]: any;
|
|
16
16
|
}>;
|
|
17
17
|
type: CompoundFilterType;
|
|
18
18
|
};
|
|
@@ -25,7 +25,7 @@ export declare const CompoundFilter$inboundSchema: z.ZodType<CompoundFilter, unk
|
|
|
25
25
|
/** @internal */
|
|
26
26
|
export type CompoundFilter$Outbound = {
|
|
27
27
|
filters: Array<{
|
|
28
|
-
[k: string]: any
|
|
28
|
+
[k: string]: any;
|
|
29
29
|
}>;
|
|
30
30
|
type: string;
|
|
31
31
|
};
|
|
@@ -15,12 +15,12 @@ export const CompoundFilterType$inboundSchema = openEnums.inboundSchema(Compound
|
|
|
15
15
|
export const CompoundFilterType$outboundSchema = openEnums.outboundSchema(CompoundFilterType);
|
|
16
16
|
/** @internal */
|
|
17
17
|
export const CompoundFilter$inboundSchema = z.object({
|
|
18
|
-
filters: z.array(z.record(z.string(), z.
|
|
18
|
+
filters: z.array(z.record(z.string(), z.any())),
|
|
19
19
|
type: CompoundFilterType$inboundSchema,
|
|
20
20
|
});
|
|
21
21
|
/** @internal */
|
|
22
22
|
export const CompoundFilter$outboundSchema = z.object({
|
|
23
|
-
filters: z.array(z.record(z.string(), z.
|
|
23
|
+
filters: z.array(z.record(z.string(), z.any())),
|
|
24
24
|
type: CompoundFilterType$outboundSchema,
|
|
25
25
|
});
|
|
26
26
|
export function compoundFilterToJSON(compoundFilter) {
|