@openrouter/sdk 1.3.20 → 1.3.22
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/alphaDecisionsCreate.js +5 -5
- package/esm/funcs/analyticsGetAnalyticsMeta.js +4 -4
- package/esm/funcs/analyticsGetUserActivity.js +5 -5
- package/esm/funcs/analyticsQueryAnalytics.js +4 -4
- package/esm/funcs/apiKeysCreate.js +4 -4
- package/esm/funcs/apiKeysDelete.js +4 -4
- package/esm/funcs/apiKeysGet.js +4 -4
- package/esm/funcs/apiKeysGetCurrentKeyMetadata.js +4 -4
- package/esm/funcs/apiKeysList.js +4 -4
- package/esm/funcs/apiKeysUpdate.js +4 -4
- package/esm/funcs/benchmarksGetBenchmarks.js +5 -5
- package/esm/funcs/byokCreate.js +5 -5
- package/esm/funcs/byokDelete.js +5 -5
- package/esm/funcs/byokGet.js +5 -5
- package/esm/funcs/byokList.js +5 -5
- package/esm/funcs/byokUpdate.js +5 -5
- package/esm/funcs/chatSend.js +4 -4
- package/esm/funcs/classificationsGetTaskClassifications.js +5 -5
- package/esm/funcs/containersDownloadContainerFileContent.js +4 -4
- package/esm/funcs/containersGetContainerFile.js +5 -5
- package/esm/funcs/containersListContainerFiles.js +5 -5
- package/esm/funcs/containersPromoteContainerFile.js +5 -5
- package/esm/funcs/creditsGetCredits.js +4 -4
- package/esm/funcs/datasetsGetAppRankings.js +5 -5
- package/esm/funcs/datasetsGetRankingsDaily.js +5 -5
- package/esm/funcs/datasetsGetSessionCost.js +5 -5
- package/esm/funcs/embeddingsGenerate.js +5 -5
- package/esm/funcs/embeddingsListModels.js +5 -5
- package/esm/funcs/endpointsList.js +4 -4
- package/esm/funcs/endpointsListZdrEndpoints.js +4 -4
- package/esm/funcs/filesDelete.js +5 -5
- package/esm/funcs/filesDownload.js +4 -4
- package/esm/funcs/filesList.js +4 -4
- package/esm/funcs/filesRetrieve.js +5 -5
- package/esm/funcs/filesUpload.js +5 -5
- package/esm/funcs/generationsGetGeneration.js +5 -5
- package/esm/funcs/generationsListGenerationContent.js +5 -5
- package/esm/funcs/generationsSubmitFeedback.js +5 -5
- package/esm/funcs/guardrailsBulkAssignKeys.js +5 -5
- package/esm/funcs/guardrailsBulkAssignMembers.js +5 -5
- package/esm/funcs/guardrailsBulkUnassignKeys.js +5 -5
- package/esm/funcs/guardrailsBulkUnassignMembers.js +5 -5
- package/esm/funcs/guardrailsCreate.js +5 -5
- package/esm/funcs/guardrailsDelete.js +5 -5
- package/esm/funcs/guardrailsGet.js +5 -5
- package/esm/funcs/guardrailsList.js +5 -5
- package/esm/funcs/guardrailsListGuardrailKeyAssignments.js +5 -5
- package/esm/funcs/guardrailsListGuardrailMemberAssignments.js +4 -4
- package/esm/funcs/guardrailsListKeyAssignments.js +5 -5
- package/esm/funcs/guardrailsListMemberAssignments.js +5 -5
- package/esm/funcs/guardrailsUpdate.js +5 -5
- package/esm/funcs/imagesGenerate.js +4 -4
- package/esm/funcs/imagesListModelEndpoints.js +5 -5
- package/esm/funcs/imagesListModels.js +5 -5
- package/esm/funcs/internsChat.js +8 -8
- package/esm/funcs/internsCreateIntern.js +5 -5
- package/esm/funcs/internsDeleteIntern.js +5 -5
- package/esm/funcs/internsGetIntern.js +5 -5
- package/esm/funcs/internsInvoke.d.ts +26 -0
- package/esm/funcs/internsInvoke.js +119 -0
- package/esm/funcs/internsListInterns.js +5 -5
- package/esm/funcs/internsProvisionIntern.js +5 -5
- package/esm/funcs/internsSuspendIntern.js +5 -5
- package/esm/funcs/internsUpdateIntern.js +5 -5
- package/esm/funcs/modelsCount.js +5 -5
- package/esm/funcs/modelsGet.js +5 -5
- package/esm/funcs/modelsList.js +4 -4
- package/esm/funcs/modelsListForUser.js +5 -5
- package/esm/funcs/oAuthCreateAuthCode.js +4 -4
- package/esm/funcs/oAuthCreateOauthToken.js +5 -5
- package/esm/funcs/oAuthExchangeAuthCodeForAPIKey.js +4 -4
- package/esm/funcs/oAuthListOauthJwks.js +5 -5
- package/esm/funcs/observabilityCreate.js +5 -5
- package/esm/funcs/observabilityDelete.js +5 -5
- package/esm/funcs/observabilityGet.js +5 -5
- package/esm/funcs/observabilityList.js +4 -4
- package/esm/funcs/observabilityUpdate.js +5 -5
- package/esm/funcs/organizationListMembers.js +5 -5
- package/esm/funcs/presetsCreatePresetsChatCompletions.js +5 -5
- package/esm/funcs/presetsCreatePresetsMessages.js +5 -5
- package/esm/funcs/presetsCreatePresetsResponses.js +5 -5
- package/esm/funcs/presetsGet.js +5 -5
- package/esm/funcs/presetsGetVersion.js +5 -5
- package/esm/funcs/presetsList.js +5 -5
- package/esm/funcs/presetsListVersions.js +5 -5
- package/esm/funcs/providersList.js +4 -4
- package/esm/funcs/rerankRerank.js +5 -5
- package/esm/funcs/responsesSend.js +4 -4
- package/esm/funcs/scimCreate.js +5 -5
- package/esm/funcs/scimCreateSyncJob.js +5 -5
- package/esm/funcs/scimDelete.js +5 -5
- package/esm/funcs/scimGetSyncJob.js +5 -5
- package/esm/funcs/scimListGroups.js +5 -5
- package/esm/funcs/scimListMappings.js +5 -5
- package/esm/funcs/scimRead.js +5 -5
- package/esm/funcs/scimUpdate.js +5 -5
- package/esm/funcs/sttCreateTranscription.js +5 -5
- package/esm/funcs/sttCreateTranscriptionMultipart.js +5 -5
- package/esm/funcs/systemOneCreate.js +5 -5
- package/esm/funcs/ttsCreateSpeech.js +4 -4
- package/esm/funcs/vaultCopyVaultSecretsToIntern.js +5 -5
- package/esm/funcs/vaultDeleteInternVaultSecret.js +4 -4
- package/esm/funcs/vaultDeleteVaultSecret.js +4 -4
- package/esm/funcs/vaultListInternVaultSecrets.js +5 -5
- package/esm/funcs/vaultListVaultSecrets.js +5 -5
- package/esm/funcs/vaultStoreInternVaultSecret.js +5 -5
- package/esm/funcs/vaultStoreVaultSecret.js +5 -5
- package/esm/funcs/videoGenerationGenerate.js +5 -5
- package/esm/funcs/videoGenerationGetGeneration.js +5 -5
- package/esm/funcs/videoGenerationGetVideoContent.js +4 -4
- package/esm/funcs/videoGenerationListVideosModels.js +5 -5
- package/esm/funcs/workspacesBulkAddMembers.js +5 -5
- package/esm/funcs/workspacesBulkRemoveMembers.js +5 -5
- package/esm/funcs/workspacesCreate.js +5 -5
- package/esm/funcs/workspacesDelete.js +5 -5
- package/esm/funcs/workspacesDeleteBudget.js +5 -5
- package/esm/funcs/workspacesGet.js +5 -5
- package/esm/funcs/workspacesGetBudget.js +5 -5
- package/esm/funcs/workspacesList.js +5 -5
- package/esm/funcs/workspacesListBudgets.js +5 -5
- package/esm/funcs/workspacesListMembers.js +5 -5
- package/esm/funcs/workspacesSetBudget.js +5 -5
- package/esm/funcs/workspacesUpdate.js +5 -5
- package/esm/lib/anthropic-compat.d.ts +2 -2
- package/esm/lib/async-params.d.ts +4 -4
- package/esm/lib/chat-compat.d.ts +3 -2
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/lib/conversation-state.d.ts +7 -5
- package/esm/lib/model-result.d.ts +7 -4
- package/esm/lib/next-turn-params.d.ts +4 -4
- package/esm/lib/stream-transformers.d.ts +26 -17
- package/esm/lib/stream-type-guards.d.ts +41 -21
- package/esm/lib/tool-orchestrator.d.ts +7 -5
- package/esm/lib/tool-types.d.ts +14 -10
- package/esm/lib/turn-context.d.ts +6 -4
- package/esm/lib/turn-context.js +2 -2
- package/esm/models/customtoolcallitem.d.ts +8 -8
- package/esm/models/customtoolcallitem.js +4 -4
- package/esm/models/errors/badgatewayresponseerror.js +2 -2
- package/esm/models/errors/badrequestresponseerror.js +2 -2
- package/esm/models/errors/conflictresponseerror.js +2 -2
- package/esm/models/errors/edgenetworktimeoutresponseerror.js +2 -2
- package/esm/models/errors/forbiddenresponseerror.js +2 -2
- package/esm/models/errors/gatewaytimeoutresponseerror.js +2 -2
- package/esm/models/errors/goneresponseerror.js +2 -2
- package/esm/models/errors/internalserverresponseerror.js +2 -2
- package/esm/models/errors/internchaterrorresponse.js +2 -2
- package/esm/models/errors/internlifecycleerror.js +2 -2
- package/esm/models/errors/notfoundresponseerror.js +2 -2
- package/esm/models/errors/oautherrorresponse.js +2 -2
- package/esm/models/errors/payloadtoolargeresponseerror.js +2 -2
- package/esm/models/errors/paymentrequiredresponseerror.js +2 -2
- package/esm/models/errors/provideroverloadedresponseerror.js +2 -2
- package/esm/models/errors/requesttimeoutresponseerror.js +2 -2
- package/esm/models/errors/serviceunavailableresponseerror.js +2 -2
- package/esm/models/errors/toomanyrequestsresponseerror.js +2 -2
- package/esm/models/errors/unauthorizedresponseerror.js +2 -2
- package/esm/models/errors/unprocessableentityresponseerror.js +2 -2
- package/esm/models/functioncallitem.d.ts +12 -12
- package/esm/models/functioncallitem.js +6 -6
- package/esm/models/index.d.ts +2 -0
- package/esm/models/index.js +2 -0
- package/esm/models/inputsunion.d.ts +4 -6
- package/esm/models/inputsunion.js +2 -8
- package/esm/models/interninvokeacceptedresponse.d.ts +34 -0
- package/esm/models/interninvokeacceptedresponse.js +30 -0
- package/esm/models/interninvokerequest.d.ts +23 -0
- package/esm/models/interninvokerequest.js +19 -0
- package/esm/models/operations/bulkaddworkspacemembers.js +2 -2
- package/esm/models/operations/bulkassignkeystoguardrail.js +2 -2
- package/esm/models/operations/bulkassignmemberstoguardrail.js +2 -2
- package/esm/models/operations/bulkremoveworkspacemembers.js +2 -2
- package/esm/models/operations/bulkunassignkeysfromguardrail.js +2 -2
- package/esm/models/operations/bulkunassignmembersfromguardrail.js +2 -2
- package/esm/models/operations/copyvaultsecretstointern.js +2 -2
- package/esm/models/operations/createapialphadecisions.js +2 -2
- package/esm/models/operations/createaudiospeech.js +2 -2
- package/esm/models/operations/createaudiotranscriptions.js +2 -2
- package/esm/models/operations/createbyokkey.js +2 -2
- package/esm/models/operations/createembeddings.js +10 -10
- package/esm/models/operations/createguardrail.js +2 -2
- package/esm/models/operations/createimages.js +4 -4
- package/esm/models/operations/createintern.js +2 -2
- package/esm/models/operations/createinternchatcompletion.js +6 -6
- package/esm/models/operations/createoauthtoken.js +2 -2
- package/esm/models/operations/createobservabilitydestination.js +2 -2
- package/esm/models/operations/createpresetschatcompletions.js +2 -2
- package/esm/models/operations/createpresetsmessages.js +2 -2
- package/esm/models/operations/createpresetsresponses.js +2 -2
- package/esm/models/operations/creatererank.js +3 -3
- package/esm/models/operations/createresponses.js +5 -5
- package/esm/models/operations/createscimgroupmapping.js +2 -2
- package/esm/models/operations/createscimsyncjob.js +2 -2
- package/esm/models/operations/createsystemone.js +2 -2
- package/esm/models/operations/createvideos.js +2 -2
- package/esm/models/operations/createworkspace.js +2 -2
- package/esm/models/operations/deletefile.js +2 -2
- package/esm/models/operations/deleteintern.js +2 -2
- package/esm/models/operations/deleteworkspacebudget.js +2 -2
- package/esm/models/operations/downloadfilecontent.js +2 -2
- package/esm/models/operations/getapprankings.js +2 -2
- package/esm/models/operations/getcurrentkey.js +2 -2
- package/esm/models/operations/getfilemetadata.js +2 -2
- package/esm/models/operations/getmodels.js +2 -2
- package/esm/models/operations/getsessioncost.js +2 -2
- package/esm/models/operations/getworkspacebudget.js +2 -2
- package/esm/models/operations/index.d.ts +1 -0
- package/esm/models/operations/index.js +1 -0
- package/esm/models/operations/invokeintern.d.ts +72 -0
- package/esm/models/operations/invokeintern.js +38 -0
- package/esm/models/operations/listbyokkeys.js +2 -2
- package/esm/models/operations/listembeddingsmodels.js +2 -2
- package/esm/models/operations/listendpoints.js +2 -2
- package/esm/models/operations/listendpointszdr.js +2 -2
- package/esm/models/operations/listfiles.js +3 -3
- package/esm/models/operations/listguardrailkeyassignments.js +2 -2
- package/esm/models/operations/listguardrailmemberassignments.js +2 -2
- package/esm/models/operations/listguardrails.js +2 -2
- package/esm/models/operations/listkeyassignments.js +2 -2
- package/esm/models/operations/listmemberassignments.js +2 -2
- package/esm/models/operations/listmodelsuser.js +2 -2
- package/esm/models/operations/listobservabilitydestinations.js +2 -2
- package/esm/models/operations/listpresets.js +2 -2
- package/esm/models/operations/listpresetversions.js +2 -2
- package/esm/models/operations/listscimgroupmappings.js +2 -2
- package/esm/models/operations/listscimgroups.js +2 -2
- package/esm/models/operations/listworkspacemembers.js +2 -2
- package/esm/models/operations/listworkspaces.js +2 -2
- package/esm/models/operations/sendchatcompletionrequest.js +5 -5
- package/esm/models/operations/storeinternvaultsecret.js +2 -2
- package/esm/models/operations/storevaultsecret.js +2 -2
- package/esm/models/operations/submitgenerationfeedback.js +2 -2
- package/esm/models/operations/updatebyokkey.js +2 -2
- package/esm/models/operations/updateguardrail.js +2 -2
- package/esm/models/operations/updateintern.js +2 -2
- package/esm/models/operations/updateobservabilitydestination.js +2 -2
- package/esm/models/operations/updatescimgroupmapping.js +2 -2
- package/esm/models/operations/updateworkspace.js +2 -2
- package/esm/models/operations/uploadfile.js +2 -2
- package/esm/models/operations/upsertworkspacebudget.js +3 -3
- package/esm/models/outputcustomtoolcallitem.d.ts +2 -26
- package/esm/models/outputcustomtoolcallitem.js +1 -28
- package/esm/models/outputfunctioncallitem.d.ts +1 -44
- package/esm/models/outputfunctioncallitem.js +1 -64
- package/esm/models/outputitems.d.ts +2 -6
- package/esm/models/outputitems.js +2 -2
- package/esm/sdk/interns.d.ts +13 -0
- package/esm/sdk/interns.js +16 -0
- package/jsr.json +1 -1
- package/package.json +11 -9
- package/scripts/unbarrel-imports.js +296 -0
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { InputsUnion } from '../models/inputsunion.js';
|
|
2
|
+
import type { OpenResponsesResult } from '../models/openresponsesresult.js';
|
|
3
|
+
import type { ResponsesRequest } from '../models/responsesrequest.js';
|
|
2
4
|
import type { APITool, Tool, ToolExecutionResult } from './tool-types.js';
|
|
3
5
|
/**
|
|
4
6
|
* Options for tool execution
|
|
@@ -10,10 +12,10 @@ export interface ToolExecutionOptions {
|
|
|
10
12
|
* Result of the tool execution loop
|
|
11
13
|
*/
|
|
12
14
|
export interface ToolOrchestrationResult {
|
|
13
|
-
finalResponse:
|
|
14
|
-
allResponses:
|
|
15
|
+
finalResponse: OpenResponsesResult;
|
|
16
|
+
allResponses: OpenResponsesResult[];
|
|
15
17
|
toolExecutionResults: ToolExecutionResult<Tool>[];
|
|
16
|
-
conversationInput:
|
|
18
|
+
conversationInput: InputsUnion;
|
|
17
19
|
}
|
|
18
20
|
/**
|
|
19
21
|
* Execute tool calls and manage multi-turn conversations
|
|
@@ -27,7 +29,7 @@ export interface ToolOrchestrationResult {
|
|
|
27
29
|
* @param options - Execution options
|
|
28
30
|
* @returns Result containing final response and all execution data
|
|
29
31
|
*/
|
|
30
|
-
export declare function executeToolLoop(sendRequest: (input:
|
|
32
|
+
export declare function executeToolLoop(sendRequest: (input: InputsUnion, tools: APITool[]) => Promise<OpenResponsesResult>, initialInput: InputsUnion, initialRequest: ResponsesRequest, tools: Tool[], apiTools: APITool[], options?: ToolExecutionOptions): Promise<ToolOrchestrationResult>;
|
|
31
33
|
/**
|
|
32
34
|
* Convert tool execution results to a map for easy lookup
|
|
33
35
|
*/
|
package/esm/lib/tool-types.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { $ZodObject, $ZodShape, $ZodType, infer as zodInfer } from 'zod/v4/core';
|
|
2
|
-
import type
|
|
3
|
-
import type {
|
|
2
|
+
import type { FunctionCallItem } from '../models/functioncallitem.js';
|
|
3
|
+
import type { FunctionCallOutputItem } from '../models/functioncalloutputitem.js';
|
|
4
|
+
import type { InputsUnion } from '../models/inputsunion.js';
|
|
5
|
+
import type { OpenResponsesResult, Usage } from '../models/openresponsesresult.js';
|
|
6
|
+
import type { ResponsesRequest } from '../models/responsesrequest.js';
|
|
7
|
+
import type { StreamEvents } from '../models/streamevents.js';
|
|
4
8
|
import type { ModelResult } from './model-result.js';
|
|
5
9
|
/**
|
|
6
10
|
* Tool type enum for enhanced tools
|
|
@@ -14,11 +18,11 @@ export declare enum ToolType {
|
|
|
14
18
|
*/
|
|
15
19
|
export interface TurnContext {
|
|
16
20
|
/** The specific tool call being executed (only available during tool execution) */
|
|
17
|
-
toolCall?:
|
|
21
|
+
toolCall?: FunctionCallItem;
|
|
18
22
|
/** Number of tool execution turns so far (1-indexed: first turn = 1, 0 = initial request) */
|
|
19
23
|
numberOfTurns: number;
|
|
20
24
|
/** The full request being sent to the API (only available during tool execution) */
|
|
21
|
-
turnRequest?:
|
|
25
|
+
turnRequest?: ResponsesRequest;
|
|
22
26
|
}
|
|
23
27
|
/**
|
|
24
28
|
* Extract context schema type from a tool definition
|
|
@@ -83,7 +87,7 @@ export declare const SHARED_CONTEXT_KEY: "shared";
|
|
|
83
87
|
*/
|
|
84
88
|
export type NextTurnParamsContext = {
|
|
85
89
|
/** Current input (messages) */
|
|
86
|
-
input:
|
|
90
|
+
input: InputsUnion;
|
|
87
91
|
/** Current model selection */
|
|
88
92
|
model: string;
|
|
89
93
|
/** Current models array */
|
|
@@ -315,8 +319,8 @@ export interface StepResult<TTools extends readonly Tool[] = readonly Tool[]> {
|
|
|
315
319
|
readonly text: string;
|
|
316
320
|
readonly toolCalls: TypedToolCallUnion<TTools>[];
|
|
317
321
|
readonly toolResults: ToolExecutionResultUnion<TTools>[];
|
|
318
|
-
readonly response:
|
|
319
|
-
readonly usage?:
|
|
322
|
+
readonly response: OpenResponsesResult;
|
|
323
|
+
readonly usage?: Usage | null | undefined;
|
|
320
324
|
readonly finishReason?: string | undefined;
|
|
321
325
|
readonly warnings?: Warning[] | undefined;
|
|
322
326
|
readonly experimental_providerMetadata?: Record<string, unknown> | undefined;
|
|
@@ -388,7 +392,7 @@ export type ToolResultEvent<TResult = unknown, TPreliminaryResults = unknown> =
|
|
|
388
392
|
*/
|
|
389
393
|
export type ToolCallOutputEvent = {
|
|
390
394
|
type: 'tool.call_output';
|
|
391
|
-
output:
|
|
395
|
+
output: FunctionCallOutputItem;
|
|
392
396
|
timestamp: number;
|
|
393
397
|
};
|
|
394
398
|
/**
|
|
@@ -459,7 +463,7 @@ export type ChatStreamEvent<TEvent = unknown> = {
|
|
|
459
463
|
delta: string;
|
|
460
464
|
} | {
|
|
461
465
|
type: 'message.complete';
|
|
462
|
-
response:
|
|
466
|
+
response: OpenResponsesResult;
|
|
463
467
|
} | {
|
|
464
468
|
type: 'tool.preliminary_result';
|
|
465
469
|
toolCallId: string;
|
|
@@ -505,7 +509,7 @@ export interface ConversationState<TTools extends readonly Tool[] = readonly Too
|
|
|
505
509
|
/** Unique identifier for this conversation */
|
|
506
510
|
id: string;
|
|
507
511
|
/** Full message history */
|
|
508
|
-
messages:
|
|
512
|
+
messages: InputsUnion;
|
|
509
513
|
/** Previous response ID for chaining (OpenRouter server-side optimization) */
|
|
510
514
|
previousResponseId?: string;
|
|
511
515
|
/** Tool calls awaiting human approval */
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { FunctionCallItem } from '../models/functioncallitem.js';
|
|
2
|
+
import type { InputsUnion, InputsUnion1 } from '../models/inputsunion.js';
|
|
3
|
+
import type { ResponsesRequest } from '../models/responsesrequest.js';
|
|
2
4
|
import type { TurnContext } from './tool-types.js';
|
|
3
5
|
/**
|
|
4
6
|
* Options for building a turn context
|
|
@@ -7,9 +9,9 @@ export interface BuildTurnContextOptions {
|
|
|
7
9
|
/** Number of turns so far (1-indexed for tool execution, 0 for initial request) */
|
|
8
10
|
numberOfTurns: number;
|
|
9
11
|
/** The specific tool call being executed (optional for initial/async resolution contexts) */
|
|
10
|
-
toolCall?:
|
|
12
|
+
toolCall?: FunctionCallItem;
|
|
11
13
|
/** The full request being sent to the API (optional for initial/async resolution contexts) */
|
|
12
|
-
turnRequest?:
|
|
14
|
+
turnRequest?: ResponsesRequest;
|
|
13
15
|
}
|
|
14
16
|
/**
|
|
15
17
|
* Build a turn context for tool execution or async parameter resolution
|
|
@@ -46,5 +48,5 @@ export declare function buildTurnContext(options: BuildTurnContextOptions): Turn
|
|
|
46
48
|
* // Returns: [{ role: "user", content: "Hello!" }]
|
|
47
49
|
* ```
|
|
48
50
|
*/
|
|
49
|
-
export declare function normalizeInputToArray(input:
|
|
51
|
+
export declare function normalizeInputToArray(input: InputsUnion): Array<InputsUnion1>;
|
|
50
52
|
//# sourceMappingURL=turn-context.d.ts.map
|
package/esm/lib/turn-context.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { EasyInputMessageRoleUser } from '../models/easyinputmessage.js';
|
|
2
2
|
/**
|
|
3
3
|
* Build a turn context for tool execution or async parameter resolution
|
|
4
4
|
*
|
|
@@ -49,7 +49,7 @@ export function normalizeInputToArray(input) {
|
|
|
49
49
|
if (typeof input === 'string') {
|
|
50
50
|
// Construct object with all required fields - type is optional
|
|
51
51
|
const message = {
|
|
52
|
-
role:
|
|
52
|
+
role: EasyInputMessageRoleUser.User,
|
|
53
53
|
content: input,
|
|
54
54
|
};
|
|
55
55
|
return [message];
|
|
@@ -12,30 +12,30 @@ export type CustomToolCallItem = {
|
|
|
12
12
|
/**
|
|
13
13
|
* True when the model called a tool declared with `async: true` and may continue its turn before the output is returned. Return the result in a later request as a `function_call_output` with this `call_id`.
|
|
14
14
|
*/
|
|
15
|
-
async?: boolean | undefined;
|
|
15
|
+
async?: boolean | null | undefined;
|
|
16
16
|
callId: string;
|
|
17
|
-
id?: string | undefined;
|
|
17
|
+
id?: string | null | undefined;
|
|
18
18
|
input: string;
|
|
19
19
|
name: string;
|
|
20
20
|
/**
|
|
21
21
|
* Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)
|
|
22
22
|
*/
|
|
23
|
-
namespace?: string | undefined;
|
|
23
|
+
namespace?: string | null | undefined;
|
|
24
|
+
status?: ToolCallStatus | null | undefined;
|
|
24
25
|
type: CustomToolCallItemType;
|
|
25
|
-
status?: ToolCallStatus | undefined;
|
|
26
26
|
};
|
|
27
27
|
/** @internal */
|
|
28
28
|
export declare const CustomToolCallItemType$outboundSchema: z.ZodEnum<typeof CustomToolCallItemType>;
|
|
29
29
|
/** @internal */
|
|
30
30
|
export type CustomToolCallItem$Outbound = {
|
|
31
|
-
async?: boolean | undefined;
|
|
31
|
+
async?: boolean | null | undefined;
|
|
32
32
|
call_id: string;
|
|
33
|
-
id?: string | undefined;
|
|
33
|
+
id?: string | null | undefined;
|
|
34
34
|
input: string;
|
|
35
35
|
name: string;
|
|
36
|
-
namespace?: string | undefined;
|
|
36
|
+
namespace?: string | null | undefined;
|
|
37
|
+
status?: string | null | undefined;
|
|
37
38
|
type: string;
|
|
38
|
-
status?: string | undefined;
|
|
39
39
|
};
|
|
40
40
|
/** @internal */
|
|
41
41
|
export declare const CustomToolCallItem$outboundSchema: z.ZodType<CustomToolCallItem$Outbound, CustomToolCallItem>;
|
|
@@ -12,14 +12,14 @@ export const CustomToolCallItemType = {
|
|
|
12
12
|
export const CustomToolCallItemType$outboundSchema = z.enum(CustomToolCallItemType);
|
|
13
13
|
/** @internal */
|
|
14
14
|
export const CustomToolCallItem$outboundSchema = z.object({
|
|
15
|
-
async: z.boolean().optional(),
|
|
15
|
+
async: z.nullable(z.boolean()).optional(),
|
|
16
16
|
callId: z.string(),
|
|
17
|
-
id: z.string().optional(),
|
|
17
|
+
id: z.nullable(z.string()).optional(),
|
|
18
18
|
input: z.string(),
|
|
19
19
|
name: z.string(),
|
|
20
|
-
namespace: z.string().optional(),
|
|
20
|
+
namespace: z.nullable(z.string()).optional(),
|
|
21
|
+
status: z.nullable(ToolCallStatus$outboundSchema).optional(),
|
|
21
22
|
type: CustomToolCallItemType$outboundSchema,
|
|
22
|
-
status: ToolCallStatus$outboundSchema.optional(),
|
|
23
23
|
}).transform((v) => {
|
|
24
24
|
return remap$(v, {
|
|
25
25
|
callId: "call_id",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import
|
|
7
|
+
import { BadGatewayResponseErrorData$inboundSchema as models_BadGatewayResponseErrorData$inboundSchema } from "../badgatewayresponseerrordata.js";
|
|
8
8
|
import { OpenRouterError } from "./openroutererror.js";
|
|
9
9
|
/**
|
|
10
10
|
* Bad Gateway - Provider/upstream API failure
|
|
@@ -26,7 +26,7 @@ export class BadGatewayResponseError extends OpenRouterError {
|
|
|
26
26
|
}
|
|
27
27
|
/** @internal */
|
|
28
28
|
export const BadGatewayResponseError$inboundSchema = z.object({
|
|
29
|
-
error:
|
|
29
|
+
error: models_BadGatewayResponseErrorData$inboundSchema,
|
|
30
30
|
openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
|
|
31
31
|
user_id: z.nullable(z.string()).optional(),
|
|
32
32
|
request$: z.custom(x => x instanceof Request),
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import
|
|
7
|
+
import { BadRequestResponseErrorData$inboundSchema as models_BadRequestResponseErrorData$inboundSchema } from "../badrequestresponseerrordata.js";
|
|
8
8
|
import { OpenRouterError } from "./openroutererror.js";
|
|
9
9
|
/**
|
|
10
10
|
* Bad Request - Invalid request parameters or malformed input
|
|
@@ -26,7 +26,7 @@ export class BadRequestResponseError extends OpenRouterError {
|
|
|
26
26
|
}
|
|
27
27
|
/** @internal */
|
|
28
28
|
export const BadRequestResponseError$inboundSchema = z.object({
|
|
29
|
-
error:
|
|
29
|
+
error: models_BadRequestResponseErrorData$inboundSchema,
|
|
30
30
|
openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
|
|
31
31
|
user_id: z.nullable(z.string()).optional(),
|
|
32
32
|
request$: z.custom(x => x instanceof Request),
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import
|
|
7
|
+
import { ConflictResponseErrorData$inboundSchema as models_ConflictResponseErrorData$inboundSchema } from "../conflictresponseerrordata.js";
|
|
8
8
|
import { OpenRouterError } from "./openroutererror.js";
|
|
9
9
|
/**
|
|
10
10
|
* Conflict - Resource conflict or concurrent modification
|
|
@@ -26,7 +26,7 @@ export class ConflictResponseError extends OpenRouterError {
|
|
|
26
26
|
}
|
|
27
27
|
/** @internal */
|
|
28
28
|
export const ConflictResponseError$inboundSchema = z.object({
|
|
29
|
-
error:
|
|
29
|
+
error: models_ConflictResponseErrorData$inboundSchema,
|
|
30
30
|
openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
|
|
31
31
|
user_id: z.nullable(z.string()).optional(),
|
|
32
32
|
request$: z.custom(x => x instanceof Request),
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import
|
|
7
|
+
import { EdgeNetworkTimeoutResponseErrorData$inboundSchema as models_EdgeNetworkTimeoutResponseErrorData$inboundSchema } from "../edgenetworktimeoutresponseerrordata.js";
|
|
8
8
|
import { OpenRouterError } from "./openroutererror.js";
|
|
9
9
|
/**
|
|
10
10
|
* Infrastructure Timeout - Provider request timed out at edge network
|
|
@@ -26,7 +26,7 @@ export class EdgeNetworkTimeoutResponseError extends OpenRouterError {
|
|
|
26
26
|
}
|
|
27
27
|
/** @internal */
|
|
28
28
|
export const EdgeNetworkTimeoutResponseError$inboundSchema = z.object({
|
|
29
|
-
error:
|
|
29
|
+
error: models_EdgeNetworkTimeoutResponseErrorData$inboundSchema,
|
|
30
30
|
openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
|
|
31
31
|
user_id: z.nullable(z.string()).optional(),
|
|
32
32
|
request$: z.custom(x => x instanceof Request),
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import
|
|
7
|
+
import { ForbiddenResponseErrorData$inboundSchema as models_ForbiddenResponseErrorData$inboundSchema } from "../forbiddenresponseerrordata.js";
|
|
8
8
|
import { OpenRouterError } from "./openroutererror.js";
|
|
9
9
|
/**
|
|
10
10
|
* Forbidden - Authentication successful but insufficient permissions
|
|
@@ -26,7 +26,7 @@ export class ForbiddenResponseError extends OpenRouterError {
|
|
|
26
26
|
}
|
|
27
27
|
/** @internal */
|
|
28
28
|
export const ForbiddenResponseError$inboundSchema = z.object({
|
|
29
|
-
error:
|
|
29
|
+
error: models_ForbiddenResponseErrorData$inboundSchema,
|
|
30
30
|
openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
|
|
31
31
|
user_id: z.nullable(z.string()).optional(),
|
|
32
32
|
request$: z.custom(x => x instanceof Request),
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import
|
|
7
|
+
import { GatewayTimeoutResponseErrorData$inboundSchema as models_GatewayTimeoutResponseErrorData$inboundSchema } from "../gatewaytimeoutresponseerrordata.js";
|
|
8
8
|
import { OpenRouterError } from "./openroutererror.js";
|
|
9
9
|
/**
|
|
10
10
|
* Gateway Timeout - Provider did not respond before the upstream deadline
|
|
@@ -26,7 +26,7 @@ export class GatewayTimeoutResponseError extends OpenRouterError {
|
|
|
26
26
|
}
|
|
27
27
|
/** @internal */
|
|
28
28
|
export const GatewayTimeoutResponseError$inboundSchema = z.object({
|
|
29
|
-
error:
|
|
29
|
+
error: models_GatewayTimeoutResponseErrorData$inboundSchema,
|
|
30
30
|
openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
|
|
31
31
|
user_id: z.nullable(z.string()).optional(),
|
|
32
32
|
request$: z.custom(x => x instanceof Request),
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import
|
|
7
|
+
import { GoneResponseErrorData$inboundSchema as models_GoneResponseErrorData$inboundSchema } from "../goneresponseerrordata.js";
|
|
8
8
|
import { OpenRouterError } from "./openroutererror.js";
|
|
9
9
|
/**
|
|
10
10
|
* Gone - Endpoint has been permanently removed or deprecated
|
|
@@ -26,7 +26,7 @@ export class GoneResponseError extends OpenRouterError {
|
|
|
26
26
|
}
|
|
27
27
|
/** @internal */
|
|
28
28
|
export const GoneResponseError$inboundSchema = z.object({
|
|
29
|
-
error:
|
|
29
|
+
error: models_GoneResponseErrorData$inboundSchema,
|
|
30
30
|
openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
|
|
31
31
|
user_id: z.nullable(z.string()).optional(),
|
|
32
32
|
request$: z.custom(x => x instanceof Request),
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import
|
|
7
|
+
import { InternalServerResponseErrorData$inboundSchema as models_InternalServerResponseErrorData$inboundSchema } from "../internalserverresponseerrordata.js";
|
|
8
8
|
import { OpenRouterError } from "./openroutererror.js";
|
|
9
9
|
/**
|
|
10
10
|
* Internal Server Error - Unexpected server error
|
|
@@ -26,7 +26,7 @@ export class InternalServerResponseError extends OpenRouterError {
|
|
|
26
26
|
}
|
|
27
27
|
/** @internal */
|
|
28
28
|
export const InternalServerResponseError$inboundSchema = z.object({
|
|
29
|
-
error:
|
|
29
|
+
error: models_InternalServerResponseErrorData$inboundSchema,
|
|
30
30
|
openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
|
|
31
31
|
user_id: z.nullable(z.string()).optional(),
|
|
32
32
|
request$: z.custom(x => x instanceof Request),
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @generated-id: bb73eae2fe73
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
|
-
import
|
|
6
|
+
import { InternChatError$inboundSchema as models_InternChatError$inboundSchema } from "../internchaterror.js";
|
|
7
7
|
import { OpenRouterError } from "./openroutererror.js";
|
|
8
8
|
/**
|
|
9
9
|
* A refusal before the stream opens. Once the response is `200` and streaming, failures arrive as a chunk with `finish_reason: "error"` instead.
|
|
@@ -20,7 +20,7 @@ export class InternChatErrorResponse extends OpenRouterError {
|
|
|
20
20
|
}
|
|
21
21
|
/** @internal */
|
|
22
22
|
export const InternChatErrorResponse$inboundSchema = z.object({
|
|
23
|
-
error:
|
|
23
|
+
error: models_InternChatError$inboundSchema,
|
|
24
24
|
request$: z.custom(x => x instanceof Request),
|
|
25
25
|
response$: z.custom(x => x instanceof Response),
|
|
26
26
|
body$: z.string(),
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @generated-id: 31cfc72977f7
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
|
-
import
|
|
6
|
+
import { InternLifecycleErrorError$inboundSchema as models_InternLifecycleErrorError$inboundSchema } from "../internlifecycleerror.js";
|
|
7
7
|
import { OpenRouterError } from "./openroutererror.js";
|
|
8
8
|
/**
|
|
9
9
|
* Intern lifecycle request failure.
|
|
@@ -20,7 +20,7 @@ export class InternLifecycleError extends OpenRouterError {
|
|
|
20
20
|
}
|
|
21
21
|
/** @internal */
|
|
22
22
|
export const InternLifecycleError$inboundSchema = z.object({
|
|
23
|
-
error: z.lazy(() =>
|
|
23
|
+
error: z.lazy(() => models_InternLifecycleErrorError$inboundSchema),
|
|
24
24
|
request$: z.custom(x => x instanceof Request),
|
|
25
25
|
response$: z.custom(x => x instanceof Response),
|
|
26
26
|
body$: z.string(),
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import
|
|
7
|
+
import { NotFoundResponseErrorData$inboundSchema as models_NotFoundResponseErrorData$inboundSchema } from "../notfoundresponseerrordata.js";
|
|
8
8
|
import { OpenRouterError } from "./openroutererror.js";
|
|
9
9
|
/**
|
|
10
10
|
* Not Found - Resource does not exist
|
|
@@ -26,7 +26,7 @@ export class NotFoundResponseError extends OpenRouterError {
|
|
|
26
26
|
}
|
|
27
27
|
/** @internal */
|
|
28
28
|
export const NotFoundResponseError$inboundSchema = z.object({
|
|
29
|
-
error:
|
|
29
|
+
error: models_NotFoundResponseErrorData$inboundSchema,
|
|
30
30
|
openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
|
|
31
31
|
user_id: z.nullable(z.string()).optional(),
|
|
32
32
|
request$: z.custom(x => x instanceof Request),
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import
|
|
7
|
+
import { ErrorEnum$inboundSchema as models_ErrorEnum$inboundSchema } from "../oautherrorresponse.js";
|
|
8
8
|
import { OpenRouterError } from "./openroutererror.js";
|
|
9
9
|
/**
|
|
10
10
|
* RFC 6749 §5.2 error response.
|
|
@@ -23,7 +23,7 @@ export class OAuthErrorResponse extends OpenRouterError {
|
|
|
23
23
|
}
|
|
24
24
|
/** @internal */
|
|
25
25
|
export const OAuthErrorResponse$inboundSchema = z.object({
|
|
26
|
-
error:
|
|
26
|
+
error: models_ErrorEnum$inboundSchema,
|
|
27
27
|
error_description: z.string(),
|
|
28
28
|
request$: z.custom(x => x instanceof Request),
|
|
29
29
|
response$: z.custom(x => x instanceof Response),
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import
|
|
7
|
+
import { PayloadTooLargeResponseErrorData$inboundSchema as models_PayloadTooLargeResponseErrorData$inboundSchema } from "../payloadtoolargeresponseerrordata.js";
|
|
8
8
|
import { OpenRouterError } from "./openroutererror.js";
|
|
9
9
|
/**
|
|
10
10
|
* Payload Too Large - Request payload exceeds size limits
|
|
@@ -26,7 +26,7 @@ export class PayloadTooLargeResponseError extends OpenRouterError {
|
|
|
26
26
|
}
|
|
27
27
|
/** @internal */
|
|
28
28
|
export const PayloadTooLargeResponseError$inboundSchema = z.object({
|
|
29
|
-
error:
|
|
29
|
+
error: models_PayloadTooLargeResponseErrorData$inboundSchema,
|
|
30
30
|
openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
|
|
31
31
|
user_id: z.nullable(z.string()).optional(),
|
|
32
32
|
request$: z.custom(x => x instanceof Request),
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import
|
|
7
|
+
import { PaymentRequiredResponseErrorData$inboundSchema as models_PaymentRequiredResponseErrorData$inboundSchema } from "../paymentrequiredresponseerrordata.js";
|
|
8
8
|
import { OpenRouterError } from "./openroutererror.js";
|
|
9
9
|
/**
|
|
10
10
|
* Payment Required - Insufficient credits or quota to complete request
|
|
@@ -26,7 +26,7 @@ export class PaymentRequiredResponseError extends OpenRouterError {
|
|
|
26
26
|
}
|
|
27
27
|
/** @internal */
|
|
28
28
|
export const PaymentRequiredResponseError$inboundSchema = z.object({
|
|
29
|
-
error:
|
|
29
|
+
error: models_PaymentRequiredResponseErrorData$inboundSchema,
|
|
30
30
|
openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
|
|
31
31
|
user_id: z.nullable(z.string()).optional(),
|
|
32
32
|
request$: z.custom(x => x instanceof Request),
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import
|
|
7
|
+
import { ProviderOverloadedResponseErrorData$inboundSchema as models_ProviderOverloadedResponseErrorData$inboundSchema } from "../provideroverloadedresponseerrordata.js";
|
|
8
8
|
import { OpenRouterError } from "./openroutererror.js";
|
|
9
9
|
/**
|
|
10
10
|
* Provider Overloaded - Provider is temporarily overloaded
|
|
@@ -26,7 +26,7 @@ export class ProviderOverloadedResponseError extends OpenRouterError {
|
|
|
26
26
|
}
|
|
27
27
|
/** @internal */
|
|
28
28
|
export const ProviderOverloadedResponseError$inboundSchema = z.object({
|
|
29
|
-
error:
|
|
29
|
+
error: models_ProviderOverloadedResponseErrorData$inboundSchema,
|
|
30
30
|
openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
|
|
31
31
|
user_id: z.nullable(z.string()).optional(),
|
|
32
32
|
request$: z.custom(x => x instanceof Request),
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import
|
|
7
|
+
import { RequestTimeoutResponseErrorData$inboundSchema as models_RequestTimeoutResponseErrorData$inboundSchema } from "../requesttimeoutresponseerrordata.js";
|
|
8
8
|
import { OpenRouterError } from "./openroutererror.js";
|
|
9
9
|
/**
|
|
10
10
|
* Request Timeout - Operation exceeded time limit
|
|
@@ -26,7 +26,7 @@ export class RequestTimeoutResponseError extends OpenRouterError {
|
|
|
26
26
|
}
|
|
27
27
|
/** @internal */
|
|
28
28
|
export const RequestTimeoutResponseError$inboundSchema = z.object({
|
|
29
|
-
error:
|
|
29
|
+
error: models_RequestTimeoutResponseErrorData$inboundSchema,
|
|
30
30
|
openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
|
|
31
31
|
user_id: z.nullable(z.string()).optional(),
|
|
32
32
|
request$: z.custom(x => x instanceof Request),
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import
|
|
7
|
+
import { ServiceUnavailableResponseErrorData$inboundSchema as models_ServiceUnavailableResponseErrorData$inboundSchema } from "../serviceunavailableresponseerrordata.js";
|
|
8
8
|
import { OpenRouterError } from "./openroutererror.js";
|
|
9
9
|
/**
|
|
10
10
|
* Service Unavailable - Service temporarily unavailable
|
|
@@ -26,7 +26,7 @@ export class ServiceUnavailableResponseError extends OpenRouterError {
|
|
|
26
26
|
}
|
|
27
27
|
/** @internal */
|
|
28
28
|
export const ServiceUnavailableResponseError$inboundSchema = z.object({
|
|
29
|
-
error:
|
|
29
|
+
error: models_ServiceUnavailableResponseErrorData$inboundSchema,
|
|
30
30
|
openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
|
|
31
31
|
user_id: z.nullable(z.string()).optional(),
|
|
32
32
|
request$: z.custom(x => x instanceof Request),
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import
|
|
7
|
+
import { TooManyRequestsResponseErrorData$inboundSchema as models_TooManyRequestsResponseErrorData$inboundSchema } from "../toomanyrequestsresponseerrordata.js";
|
|
8
8
|
import { OpenRouterError } from "./openroutererror.js";
|
|
9
9
|
/**
|
|
10
10
|
* Too Many Requests - Rate limit exceeded
|
|
@@ -26,7 +26,7 @@ export class TooManyRequestsResponseError extends OpenRouterError {
|
|
|
26
26
|
}
|
|
27
27
|
/** @internal */
|
|
28
28
|
export const TooManyRequestsResponseError$inboundSchema = z.object({
|
|
29
|
-
error:
|
|
29
|
+
error: models_TooManyRequestsResponseErrorData$inboundSchema,
|
|
30
30
|
openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
|
|
31
31
|
user_id: z.nullable(z.string()).optional(),
|
|
32
32
|
request$: z.custom(x => x instanceof Request),
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import
|
|
7
|
+
import { UnauthorizedResponseErrorData$inboundSchema as models_UnauthorizedResponseErrorData$inboundSchema } from "../unauthorizedresponseerrordata.js";
|
|
8
8
|
import { OpenRouterError } from "./openroutererror.js";
|
|
9
9
|
/**
|
|
10
10
|
* Unauthorized - Authentication required or invalid credentials
|
|
@@ -26,7 +26,7 @@ export class UnauthorizedResponseError extends OpenRouterError {
|
|
|
26
26
|
}
|
|
27
27
|
/** @internal */
|
|
28
28
|
export const UnauthorizedResponseError$inboundSchema = z.object({
|
|
29
|
-
error:
|
|
29
|
+
error: models_UnauthorizedResponseErrorData$inboundSchema,
|
|
30
30
|
openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
|
|
31
31
|
user_id: z.nullable(z.string()).optional(),
|
|
32
32
|
request$: z.custom(x => x instanceof Request),
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import
|
|
7
|
+
import { UnprocessableEntityResponseErrorData$inboundSchema as models_UnprocessableEntityResponseErrorData$inboundSchema } from "../unprocessableentityresponseerrordata.js";
|
|
8
8
|
import { OpenRouterError } from "./openroutererror.js";
|
|
9
9
|
/**
|
|
10
10
|
* Unprocessable Entity - Semantic validation failure
|
|
@@ -26,7 +26,7 @@ export class UnprocessableEntityResponseError extends OpenRouterError {
|
|
|
26
26
|
}
|
|
27
27
|
/** @internal */
|
|
28
28
|
export const UnprocessableEntityResponseError$inboundSchema = z.object({
|
|
29
|
-
error:
|
|
29
|
+
error: models_UnprocessableEntityResponseErrorData$inboundSchema,
|
|
30
30
|
openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
|
|
31
31
|
user_id: z.nullable(z.string()).optional(),
|
|
32
32
|
request$: z.custom(x => x instanceof Request),
|
|
@@ -19,23 +19,23 @@ export type FunctionCallItem = {
|
|
|
19
19
|
/**
|
|
20
20
|
* True when the model called a tool declared with `async: true` and may continue its turn before the output is returned. Return the result in a later request as a `function_call_output` with this `call_id`.
|
|
21
21
|
*/
|
|
22
|
-
async?: boolean | undefined;
|
|
22
|
+
async?: boolean | null | undefined;
|
|
23
23
|
callId: string;
|
|
24
|
-
id
|
|
24
|
+
id?: string | null | undefined;
|
|
25
25
|
name: string;
|
|
26
26
|
/**
|
|
27
27
|
* Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)
|
|
28
28
|
*/
|
|
29
|
-
namespace?: string | undefined;
|
|
30
|
-
status?: ToolCallStatus | undefined;
|
|
29
|
+
namespace?: string | null | undefined;
|
|
30
|
+
status?: ToolCallStatus | null | undefined;
|
|
31
31
|
/**
|
|
32
32
|
* EXPERIMENTAL — subject to change without notice. String id that matches the `call_id` of the `openrouter:subagent` server tool call that spawned the subagent. Present on every `function_call` item the subagent projects; absent on ordinary function calls.
|
|
33
33
|
*/
|
|
34
|
-
subagentId?: string | undefined;
|
|
34
|
+
subagentId?: string | null | undefined;
|
|
35
35
|
/**
|
|
36
36
|
* EXPERIMENTAL — subject to change without notice. The subagent's output items produced on this turn. Treat this as an opaque object; you must replay it in the request so that the subagent can continue execution of the tool with the same context. If a subagent created multiple parallel tool calls, only the first tool call will have this field. The other tool calls will only have `subagent_id`. Present only if the tool call originates from a subagent spawned by the `openrouter:subagent` server tool.
|
|
37
37
|
*/
|
|
38
|
-
subagentItems?: Array<FunctionCallItemSubagentItem> | undefined;
|
|
38
|
+
subagentItems?: Array<FunctionCallItemSubagentItem> | null | undefined;
|
|
39
39
|
type: FunctionCallItemType;
|
|
40
40
|
};
|
|
41
41
|
/** @internal */
|
|
@@ -51,14 +51,14 @@ export declare const FunctionCallItemType$outboundSchema: z.ZodEnum<typeof Funct
|
|
|
51
51
|
/** @internal */
|
|
52
52
|
export type FunctionCallItem$Outbound = {
|
|
53
53
|
arguments: string;
|
|
54
|
-
async?: boolean | undefined;
|
|
54
|
+
async?: boolean | null | undefined;
|
|
55
55
|
call_id: string;
|
|
56
|
-
id
|
|
56
|
+
id?: string | null | undefined;
|
|
57
57
|
name: string;
|
|
58
|
-
namespace?: string | undefined;
|
|
59
|
-
status?: string | undefined;
|
|
60
|
-
subagent_id?: string | undefined;
|
|
61
|
-
subagent_items?: Array<FunctionCallItemSubagentItem$Outbound> | undefined;
|
|
58
|
+
namespace?: string | null | undefined;
|
|
59
|
+
status?: string | null | undefined;
|
|
60
|
+
subagent_id?: string | null | undefined;
|
|
61
|
+
subagent_items?: Array<FunctionCallItemSubagentItem$Outbound> | null | undefined;
|
|
62
62
|
type: string;
|
|
63
63
|
};
|
|
64
64
|
/** @internal */
|