@mastra/server 1.79.0-alpha.6 → 1.79.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_types/@internal_core/dist/storage/index.d.ts +3 -1
- package/dist/_types/@mastra_schema-compat/dist/_types/@internal_ai-sdk-v5/dist/index.d.ts +206 -873
- package/dist/_types/@mastra_schema-compat/dist/_types/@internal_ai-v6/dist/index.d.ts +770 -95
- package/dist/{a2a-BSJETR5U.cjs → a2a-B465DD1u.cjs} +2 -2
- package/dist/{a2a-BSJETR5U.cjs.map → a2a-B465DD1u.cjs.map} +1 -1
- package/dist/{a2a-CxaRILAd.js → a2a-CHBSYHxu.js} +2 -2
- package/dist/{a2a-CxaRILAd.js.map → a2a-CHBSYHxu.js.map} +1 -1
- package/dist/{agents-BgeSrhey.cjs → agents-DoNMSCMt.cjs} +3 -2
- package/dist/{agents-BgeSrhey.cjs.map → agents-DoNMSCMt.cjs.map} +1 -1
- package/dist/{agents-wamaX7m2.js → agents-X1E7fW3p.js} +3 -2
- package/dist/{agents-wamaX7m2.js.map → agents-X1E7fW3p.js.map} +1 -1
- package/dist/{api-schema-manifest-BvSJV0wS.js → api-schema-manifest-CXmfl718.js} +3 -3
- package/dist/{api-schema-manifest-BvSJV0wS.js.map → api-schema-manifest-CXmfl718.js.map} +1 -1
- package/dist/{api-schema-manifest-BIpRlCSx.cjs → api-schema-manifest-D06vSmIN.cjs} +3 -3
- package/dist/{api-schema-manifest-BIpRlCSx.cjs.map → api-schema-manifest-D06vSmIN.cjs.map} +1 -1
- package/dist/{background-tasks-B-OILmJH.cjs → background-tasks-CabImVak.cjs} +2 -2
- package/dist/{background-tasks-B-OILmJH.cjs.map → background-tasks-CabImVak.cjs.map} +1 -1
- package/dist/{background-tasks-DMYMVNPH.js → background-tasks-oBaLtnCn.js} +2 -2
- package/dist/{background-tasks-DMYMVNPH.js.map → background-tasks-oBaLtnCn.js.map} +1 -1
- package/dist/{builder-registry-DMTPXlGU.cjs → builder-registry-D0frV8lQ.cjs} +2 -2
- package/dist/{builder-registry-DMTPXlGU.cjs.map → builder-registry-D0frV8lQ.cjs.map} +1 -1
- package/dist/{builder-registry-C359s4sm.js → builder-registry-DOkLe8ES.js} +2 -2
- package/dist/{builder-registry-C359s4sm.js.map → builder-registry-DOkLe8ES.js.map} +1 -1
- package/dist/{channels-xMAW55J_.js → channels-BOxgHvzI.js} +2 -2
- package/dist/{channels-xMAW55J_.js.map → channels-BOxgHvzI.js.map} +1 -1
- package/dist/{channels-B0IpCxzk.cjs → channels-CBIopVWd.cjs} +2 -2
- package/dist/{channels-B0IpCxzk.cjs.map → channels-CBIopVWd.cjs.map} +1 -1
- package/dist/{dist-C73zZOMu.cjs → dist-BGzSzjTX.cjs} +3609 -5990
- package/dist/dist-BGzSzjTX.cjs.map +1 -0
- package/dist/{dist-D1sYzHK2.js → dist-BeXd4jq2.js} +3610 -5991
- package/dist/dist-BeXd4jq2.js.map +1 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/{dynamic-workflows-BVW4SyS5.cjs → dynamic-workflows-DXlkr-jK.cjs} +2 -2
- package/dist/{dynamic-workflows-BVW4SyS5.cjs.map → dynamic-workflows-DXlkr-jK.cjs.map} +1 -1
- package/dist/{dynamic-workflows-BozgXVuX.js → dynamic-workflows-Rr_6ac1y.js} +2 -2
- package/dist/{dynamic-workflows-BozgXVuX.js.map → dynamic-workflows-Rr_6ac1y.js.map} +1 -1
- package/dist/{editor-builder-CP7URDqM.cjs → editor-builder-BclcHxN6.cjs} +2 -2
- package/dist/{editor-builder-CP7URDqM.cjs.map → editor-builder-BclcHxN6.cjs.map} +1 -1
- package/dist/{editor-builder-r_s-wAA5.js → editor-builder-D16kc1P6.js} +3 -3
- package/dist/{editor-builder-r_s-wAA5.js.map → editor-builder-D16kc1P6.js.map} +1 -1
- package/dist/{editor-builder-C2dwLp86.cjs → editor-builder-DXHiPX1A.cjs} +3 -3
- package/dist/{editor-builder-C2dwLp86.cjs.map → editor-builder-DXHiPX1A.cjs.map} +1 -1
- package/dist/{editor-builder-C5xHbYcZ.js → editor-builder-s9WqPJgA.js} +2 -2
- package/dist/{editor-builder-C5xHbYcZ.js.map → editor-builder-s9WqPJgA.js.map} +1 -1
- package/dist/{observability-new-endpoints-BovUkwp1.js → observability-new-endpoints-DMbbmOzO.js} +4 -2
- package/dist/observability-new-endpoints-DMbbmOzO.js.map +1 -0
- package/dist/{observability-new-endpoints-CXbVKROm.cjs → observability-new-endpoints-s3ccgoif.cjs} +4 -2
- package/dist/observability-new-endpoints-s3ccgoif.cjs.map +1 -0
- package/dist/{route-builder-TBkBU65d.cjs → route-builder-BNZs643f.cjs} +121 -15
- package/dist/{route-builder-TBkBU65d.cjs.map → route-builder-BNZs643f.cjs.map} +1 -1
- package/dist/{route-builder-Ce6eRhL5.js → route-builder-BfQYtclb.js} +121 -15
- package/dist/{route-builder-Ce6eRhL5.js.map → route-builder-BfQYtclb.js.map} +1 -1
- package/dist/{routes-C5zubsU0.cjs → routes-BTqI1f9k.cjs} +11 -11
- package/dist/{routes-C5zubsU0.cjs.map → routes-BTqI1f9k.cjs.map} +1 -1
- package/dist/{routes-BKh16So9.js → routes-kj3891v4.js} +11 -11
- package/dist/{routes-BKh16So9.js.map → routes-kj3891v4.js.map} +1 -1
- package/dist/{schedules-e8TCoKCD.js → schedules-BQYgaz66.js} +2 -2
- package/dist/{schedules-e8TCoKCD.js.map → schedules-BQYgaz66.js.map} +1 -1
- package/dist/{schedules-55nFQfsJ.cjs → schedules-Bj-giFbc.cjs} +2 -2
- package/dist/{schedules-55nFQfsJ.cjs.map → schedules-Bj-giFbc.cjs.map} +1 -1
- package/dist/server/handlers/a2a.cjs +1 -1
- package/dist/server/handlers/a2a.js +1 -1
- package/dist/server/handlers/agent-builder.cjs +3 -3
- package/dist/server/handlers/agent-builder.js +3 -3
- package/dist/server/handlers/agent-controller.cjs +1 -1
- package/dist/server/handlers/agent-controller.js +1 -1
- package/dist/server/handlers/agent-versions.cjs +1 -1
- package/dist/server/handlers/agent-versions.js +1 -1
- package/dist/server/handlers/agents.cjs +32 -16
- package/dist/server/handlers/agents.cjs.map +1 -1
- package/dist/server/handlers/agents.d.ts +8 -0
- package/dist/server/handlers/agents.d.ts.map +1 -1
- package/dist/server/handlers/agents.js +32 -16
- package/dist/server/handlers/agents.js.map +1 -1
- package/dist/server/handlers/auth.cjs +1 -1
- package/dist/server/handlers/auth.js +1 -1
- package/dist/server/handlers/background-tasks.cjs +1 -1
- package/dist/server/handlers/background-tasks.js +1 -1
- package/dist/server/handlers/builder-registry.cjs +1 -1
- package/dist/server/handlers/builder-registry.js +1 -1
- package/dist/server/handlers/channels.cjs +1 -1
- package/dist/server/handlers/channels.js +1 -1
- package/dist/server/handlers/conversations.cjs +1 -1
- package/dist/server/handlers/conversations.js +1 -1
- package/dist/server/handlers/datasets.cjs +1 -1
- package/dist/server/handlers/datasets.js +1 -1
- package/dist/server/handlers/dynamic-workflows.cjs +1 -1
- package/dist/server/handlers/dynamic-workflows.js +1 -1
- package/dist/server/handlers/editor-builder.cjs +1 -1
- package/dist/server/handlers/editor-builder.js +1 -1
- package/dist/server/handlers/favorites-enrichment.cjs +1 -1
- package/dist/server/handlers/favorites-enrichment.js +1 -1
- package/dist/server/handlers/logs.cjs +1 -1
- package/dist/server/handlers/logs.js +1 -1
- package/dist/server/handlers/mcp-client-versions.cjs +1 -1
- package/dist/server/handlers/mcp-client-versions.js +1 -1
- package/dist/server/handlers/mcp.cjs +1 -1
- package/dist/server/handlers/mcp.js +1 -1
- package/dist/server/handlers/memory.cjs +1 -1
- package/dist/server/handlers/memory.js +1 -1
- package/dist/server/handlers/observability-new-endpoints.cjs +1 -1
- package/dist/server/handlers/observability-new-endpoints.js +1 -1
- package/dist/server/handlers/observability-shared.cjs +1 -1
- package/dist/server/handlers/observability-shared.js +1 -1
- package/dist/server/handlers/observability.cjs +2 -2
- package/dist/server/handlers/observability.js +2 -2
- package/dist/server/handlers/plans.cjs +2 -2
- package/dist/server/handlers/plans.js +2 -2
- package/dist/server/handlers/processor-providers.cjs +1 -1
- package/dist/server/handlers/processor-providers.js +1 -1
- package/dist/server/handlers/processors.cjs +1 -1
- package/dist/server/handlers/processors.js +1 -1
- package/dist/server/handlers/prompt-block-versions.cjs +1 -1
- package/dist/server/handlers/prompt-block-versions.js +1 -1
- package/dist/server/handlers/responses.cjs +1 -1
- package/dist/server/handlers/responses.js +1 -1
- package/dist/server/handlers/schedules.cjs +1 -1
- package/dist/server/handlers/schedules.js +1 -1
- package/dist/server/handlers/scorer-versions.cjs +1 -1
- package/dist/server/handlers/scorer-versions.js +1 -1
- package/dist/server/handlers/scores.cjs +1 -1
- package/dist/server/handlers/scores.js +1 -1
- package/dist/server/handlers/stored-agent-favorites.cjs +2 -2
- package/dist/server/handlers/stored-agent-favorites.js +2 -2
- package/dist/server/handlers/stored-agents.cjs +2 -2
- package/dist/server/handlers/stored-agents.js +2 -2
- package/dist/server/handlers/stored-mcp-clients.cjs +1 -1
- package/dist/server/handlers/stored-mcp-clients.js +1 -1
- package/dist/server/handlers/stored-prompt-blocks.cjs +1 -1
- package/dist/server/handlers/stored-prompt-blocks.js +1 -1
- package/dist/server/handlers/stored-scorers.cjs +1 -1
- package/dist/server/handlers/stored-scorers.js +1 -1
- package/dist/server/handlers/stored-skill-favorites.cjs +2 -2
- package/dist/server/handlers/stored-skill-favorites.js +2 -2
- package/dist/server/handlers/stored-skills.cjs +2 -2
- package/dist/server/handlers/stored-skills.js +2 -2
- package/dist/server/handlers/stored-workspaces.cjs +1 -1
- package/dist/server/handlers/stored-workspaces.js +1 -1
- package/dist/server/handlers/system.cjs +2 -2
- package/dist/server/handlers/system.js +2 -2
- package/dist/server/handlers/tool-providers.cjs +1 -1
- package/dist/server/handlers/tool-providers.js +1 -1
- package/dist/server/handlers/tools.cjs +2 -2
- package/dist/server/handlers/tools.js +2 -2
- package/dist/server/handlers/vector.cjs +1 -1
- package/dist/server/handlers/vector.js +1 -1
- package/dist/server/handlers/workflow-builder.cjs +1 -1
- package/dist/server/handlers/workflow-builder.js +1 -1
- package/dist/server/handlers/workflows.cjs +2 -2
- package/dist/server/handlers/workflows.js +2 -2
- package/dist/server/handlers/workspace.cjs +1 -1
- package/dist/server/handlers/workspace.js +1 -1
- package/dist/server/handlers.cjs +2 -2
- package/dist/server/handlers.js +2 -2
- package/dist/server/schemas/agents.d.ts +2 -0
- package/dist/server/schemas/agents.d.ts.map +1 -1
- package/dist/server/schemas/index.cjs +2 -2
- package/dist/server/schemas/index.js +2 -2
- package/dist/server/server-adapter/index.cjs +8 -3
- package/dist/server/server-adapter/index.cjs.map +1 -1
- package/dist/server/server-adapter/index.d.ts.map +1 -1
- package/dist/server/server-adapter/index.js +8 -3
- package/dist/server/server-adapter/index.js.map +1 -1
- package/dist/server/server-adapter/openapi-utils.d.ts +19 -1
- package/dist/server/server-adapter/openapi-utils.d.ts.map +1 -1
- package/dist/{workflow-builder-Dx24RhD3.cjs → workflow-builder-Brj3IArM.cjs} +4 -4
- package/dist/{workflow-builder-Dx24RhD3.cjs.map → workflow-builder-Brj3IArM.cjs.map} +1 -1
- package/dist/{workflow-builder-CsHPDWWL.js → workflow-builder-DOa1Vx6w.js} +4 -4
- package/dist/{workflow-builder-CsHPDWWL.js.map → workflow-builder-DOa1Vx6w.js.map} +1 -1
- package/package.json +5 -5
- package/dist/dist-C73zZOMu.cjs.map +0 -1
- package/dist/dist-D1sYzHK2.js.map +0 -1
- package/dist/observability-new-endpoints-BovUkwp1.js.map +0 -1
- package/dist/observability-new-endpoints-CXbVKROm.cjs.map +0 -1
|
@@ -17,8 +17,13 @@ export declare abstract class AbstractChat<UI_MESSAGE extends UIMessage> {
|
|
|
17
17
|
private onFinish?;
|
|
18
18
|
private onData?;
|
|
19
19
|
private sendAutomaticallyWhen?;
|
|
20
|
+
private pendingApprovalMessageId;
|
|
20
21
|
private activeResponse;
|
|
22
|
+
private activeResumeRequest;
|
|
23
|
+
private resumableStreamState;
|
|
21
24
|
private jobExecutor;
|
|
25
|
+
private activeStopCount;
|
|
26
|
+
private stopGeneration;
|
|
22
27
|
constructor({ generateId, id, transport, messageMetadataSchema, dataPartSchemas, state, onError, onToolCall, onFinish, onData, sendAutomaticallyWhen, }: Omit<ChatInit<UI_MESSAGE>, 'messages'> & {
|
|
23
28
|
state: ChatState<UI_MESSAGE>;
|
|
24
29
|
});
|
|
@@ -81,11 +86,15 @@ export declare abstract class AbstractChat<UI_MESSAGE extends UIMessage> {
|
|
|
81
86
|
/** @deprecated Use addToolOutput */
|
|
82
87
|
addToolResult: ChatAddToolOutputFunction<UI_MESSAGE>;
|
|
83
88
|
/**
|
|
84
|
-
* Abort the current request
|
|
89
|
+
* Abort the current request, keep the generated tokens if any, and wait for
|
|
90
|
+
* the request pipeline to finish.
|
|
85
91
|
*/
|
|
86
92
|
stop: () => Promise<void>;
|
|
87
93
|
private shouldSendAutomatically;
|
|
94
|
+
private runAutomaticRequest;
|
|
95
|
+
private makeRequestForToolApproval;
|
|
88
96
|
private makeRequest;
|
|
97
|
+
private makeRequestImpl;
|
|
89
98
|
}
|
|
90
99
|
|
|
91
100
|
/**
|
|
@@ -138,7 +147,7 @@ export declare function addToolInputExamplesMiddleware({ prefix, format, remove,
|
|
|
138
147
|
* You can implement your own Agent by implementing the `Agent` interface,
|
|
139
148
|
* or use the `ToolLoopAgent` class.
|
|
140
149
|
*/
|
|
141
|
-
export declare interface Agent<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends
|
|
150
|
+
export declare interface Agent<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends OutputInterface = never> {
|
|
142
151
|
/**
|
|
143
152
|
* The specification version of the agent interface. This will enable
|
|
144
153
|
* us to evolve the agent interface and retain backwards compatibility.
|
|
@@ -308,6 +317,7 @@ declare namespace _ai_sdk_provider_utils {
|
|
|
308
317
|
dynamicTool,
|
|
309
318
|
executeTool,
|
|
310
319
|
extractResponseHeaders,
|
|
320
|
+
fetchWithValidatedEndpoint,
|
|
311
321
|
fetchWithValidatedRedirects,
|
|
312
322
|
generateId,
|
|
313
323
|
getErrorMessage,
|
|
@@ -476,6 +486,124 @@ declare type BaseToolCall = {
|
|
|
476
486
|
*/
|
|
477
487
|
export declare function bindTelemetryIntegration(integration: TelemetryIntegration): TelemetryIntegration;
|
|
478
488
|
|
|
489
|
+
declare interface BrowserbaseFetchConfig {
|
|
490
|
+
/** Whether to follow HTTP redirects (default: false). */
|
|
491
|
+
allowRedirects?: boolean;
|
|
492
|
+
/** Whether to bypass TLS certificate verification (default: false). */
|
|
493
|
+
allowInsecureSsl?: boolean;
|
|
494
|
+
/** Whether to route the request through Browserbase proxies (default: false). */
|
|
495
|
+
proxies?: boolean;
|
|
496
|
+
/** Output format for the response content (default: raw). */
|
|
497
|
+
format?: BrowserbaseFetchFormat;
|
|
498
|
+
/**
|
|
499
|
+
* JSON Schema describing the desired response content. Only used when format
|
|
500
|
+
* is json.
|
|
501
|
+
*/
|
|
502
|
+
schema?: Record<string, unknown>;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
declare interface BrowserbaseFetchError {
|
|
506
|
+
error: 'api_error' | 'configuration_error' | 'execution_error' | 'invalid_input' | 'rate_limit' | 'timeout' | 'unknown';
|
|
507
|
+
statusCode?: number;
|
|
508
|
+
message: string;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
declare type BrowserbaseFetchFormat = 'raw' | 'json' | 'markdown';
|
|
512
|
+
|
|
513
|
+
declare interface BrowserbaseFetchInput {
|
|
514
|
+
/** URL of the page to fetch. */
|
|
515
|
+
url: string;
|
|
516
|
+
/** Whether to follow HTTP redirects. */
|
|
517
|
+
allow_redirects?: boolean;
|
|
518
|
+
/** Whether to bypass TLS certificate verification. */
|
|
519
|
+
allow_insecure_ssl?: boolean;
|
|
520
|
+
/** Whether to route the request through Browserbase proxies. */
|
|
521
|
+
proxies?: boolean;
|
|
522
|
+
/** Output format for the response content. */
|
|
523
|
+
format?: BrowserbaseFetchFormat;
|
|
524
|
+
/**
|
|
525
|
+
* JSON Schema describing the desired response content. Only used when format
|
|
526
|
+
* is json.
|
|
527
|
+
*/
|
|
528
|
+
schema?: Record<string, unknown>;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
declare type BrowserbaseFetchOutput = BrowserbaseFetchError | BrowserbaseFetchResponse;
|
|
532
|
+
|
|
533
|
+
declare interface BrowserbaseFetchResponse {
|
|
534
|
+
/** Unique identifier for the fetch request. */
|
|
535
|
+
id: string;
|
|
536
|
+
/**
|
|
537
|
+
* Response body. Raw and markdown responses return strings; JSON extraction
|
|
538
|
+
* returns an object matching the requested schema.
|
|
539
|
+
*/
|
|
540
|
+
content: string | Record<string, unknown>;
|
|
541
|
+
/** MIME type of the response. */
|
|
542
|
+
contentType: string;
|
|
543
|
+
/** Character encoding of the response. */
|
|
544
|
+
encoding: string;
|
|
545
|
+
/** Response headers from the fetched page. */
|
|
546
|
+
headers: Record<string, string>;
|
|
547
|
+
/** HTTP status code returned by the fetched page. */
|
|
548
|
+
statusCode: number;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
declare const browserbaseFetchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<BrowserbaseFetchInput, BrowserbaseFetchOutput, BrowserbaseFetchConfig>;
|
|
552
|
+
|
|
553
|
+
declare interface BrowserbaseSearchConfig {
|
|
554
|
+
/**
|
|
555
|
+
* Default maximum number of results to return (1-25, default: 10).
|
|
556
|
+
*/
|
|
557
|
+
numResults?: number;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
declare interface BrowserbaseSearchError {
|
|
561
|
+
error: 'api_error' | 'configuration_error' | 'execution_error' | 'invalid_input' | 'rate_limit' | 'timeout' | 'unknown';
|
|
562
|
+
statusCode?: number;
|
|
563
|
+
message: string;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
declare interface BrowserbaseSearchInput {
|
|
567
|
+
/**
|
|
568
|
+
* Web search query (1-200 characters).
|
|
569
|
+
*/
|
|
570
|
+
query: string;
|
|
571
|
+
/**
|
|
572
|
+
* Maximum number of results to return (1-25, default: 10).
|
|
573
|
+
*/
|
|
574
|
+
num_results?: number;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
declare type BrowserbaseSearchOutput = BrowserbaseSearchError | BrowserbaseSearchResponse;
|
|
578
|
+
|
|
579
|
+
declare interface BrowserbaseSearchResponse {
|
|
580
|
+
/** The search query that was executed. */
|
|
581
|
+
query: string;
|
|
582
|
+
/** Unique identifier for the request. */
|
|
583
|
+
requestId: string;
|
|
584
|
+
/** Search results. */
|
|
585
|
+
results: BrowserbaseSearchResult[];
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
declare interface BrowserbaseSearchResult {
|
|
589
|
+
/** Unique identifier for the result. */
|
|
590
|
+
id: string;
|
|
591
|
+
/** Title of the search result. */
|
|
592
|
+
title: string;
|
|
593
|
+
/** URL of the search result. */
|
|
594
|
+
url: string;
|
|
595
|
+
/** Author of the content, when available. */
|
|
596
|
+
author?: string;
|
|
597
|
+
/** Favicon URL, when available. */
|
|
598
|
+
favicon?: string;
|
|
599
|
+
/** Image URL, when available. */
|
|
600
|
+
image?: string;
|
|
601
|
+
/** Publication date in ISO 8601 format, when available. */
|
|
602
|
+
publishedDate?: string;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
declare const browserbaseSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<BrowserbaseSearchInput, BrowserbaseSearchOutput, BrowserbaseSearchConfig>;
|
|
606
|
+
|
|
479
607
|
/**
|
|
480
608
|
* Common model information used across callback events.
|
|
481
609
|
*/
|
|
@@ -754,6 +882,12 @@ export declare type ChatStatus = 'submitted' | 'streaming' | 'ready' | 'error';
|
|
|
754
882
|
* @template UI_MESSAGE - The UI message type extending UIMessage
|
|
755
883
|
*/
|
|
756
884
|
export declare interface ChatTransport<UI_MESSAGE extends UIMessage> {
|
|
885
|
+
/**
|
|
886
|
+
* Whether reconnecting returns the complete response from its beginning.
|
|
887
|
+
* Complete replays must reset the streaming message state before processing
|
|
888
|
+
* the first start chunk.
|
|
889
|
+
*/
|
|
890
|
+
readonly resumeStreamIsReplay?: boolean;
|
|
757
891
|
/**
|
|
758
892
|
* Sends messages to the chat API endpoint and returns a streaming response.
|
|
759
893
|
*
|
|
@@ -802,6 +936,7 @@ export declare interface ChatTransport<UI_MESSAGE extends UIMessage> {
|
|
|
802
936
|
*
|
|
803
937
|
* @param options - Configuration object containing:
|
|
804
938
|
* @param options.chatId - Unique identifier for the chat session to reconnect to
|
|
939
|
+
* @param options.abortSignal - Signal to abort the reconnection request if needed
|
|
805
940
|
* @param options.headers - Additional HTTP headers to include in the reconnection request
|
|
806
941
|
* @param options.body - Additional JSON properties to include in the request body
|
|
807
942
|
* @param options.metadata - Custom metadata to attach to the request
|
|
@@ -815,6 +950,8 @@ export declare interface ChatTransport<UI_MESSAGE extends UIMessage> {
|
|
|
815
950
|
reconnectToStream: (options: {
|
|
816
951
|
/** Unique identifier for the chat session to reconnect to */
|
|
817
952
|
chatId: string;
|
|
953
|
+
/** Signal to abort the reconnection request if needed */
|
|
954
|
+
abortSignal?: AbortSignal;
|
|
818
955
|
} & ChatRequestOptions) => Promise<ReadableStream<UIMessageChunk> | null>;
|
|
819
956
|
}
|
|
820
957
|
|
|
@@ -852,9 +989,10 @@ export declare type CompletionRequestOptions = {
|
|
|
852
989
|
* @param options.onError - Optional callback to handle errors that occur during consumption.
|
|
853
990
|
* @returns A promise that resolves when the stream is fully consumed.
|
|
854
991
|
*/
|
|
855
|
-
export declare function consumeStream({ stream, onError, }: {
|
|
992
|
+
export declare function consumeStream({ stream, onError, abortSignal, }: {
|
|
856
993
|
stream: ReadableStream;
|
|
857
994
|
onError?: (error: unknown) => void;
|
|
995
|
+
abortSignal?: AbortSignal;
|
|
858
996
|
}): Promise<void>;
|
|
859
997
|
|
|
860
998
|
declare type ConsumeStreamOptions = {
|
|
@@ -1007,7 +1145,7 @@ export declare function cosineSimilarity(vector1: number[], vector2: number[]):
|
|
|
1007
1145
|
* Runs the agent and stream the output as a UI message stream.
|
|
1008
1146
|
*
|
|
1009
1147
|
* @param agent - The agent to run.
|
|
1010
|
-
* @param uiMessages - The input UI messages.
|
|
1148
|
+
* @param uiMessages - The input UI messages. Defaults to originalMessages.
|
|
1011
1149
|
* @param abortSignal - The abort signal. Optional.
|
|
1012
1150
|
* @param timeout - Timeout in milliseconds. Optional.
|
|
1013
1151
|
* @param options - The options for the agent.
|
|
@@ -1016,9 +1154,9 @@ export declare function cosineSimilarity(vector1: number[], vector2: number[]):
|
|
|
1016
1154
|
*
|
|
1017
1155
|
* @returns The UI message stream.
|
|
1018
1156
|
*/
|
|
1019
|
-
export declare function createAgentUIStream<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends
|
|
1157
|
+
export declare function createAgentUIStream<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends OutputInterface = never, MESSAGE_METADATA = unknown>({ agent, uiMessages, options, abortSignal, timeout, experimental_transform, onStepFinish, ...uiMessageStreamOptions }: {
|
|
1020
1158
|
agent: Agent<CALL_OPTIONS, TOOLS, OUTPUT>;
|
|
1021
|
-
uiMessages
|
|
1159
|
+
uiMessages?: unknown[];
|
|
1022
1160
|
abortSignal?: AbortSignal;
|
|
1023
1161
|
timeout?: TimeoutConfiguration;
|
|
1024
1162
|
options?: CALL_OPTIONS;
|
|
@@ -1030,7 +1168,7 @@ export declare function createAgentUIStream<CALL_OPTIONS = never, TOOLS extends
|
|
|
1030
1168
|
* Runs the agent and returns a response object with a UI message stream.
|
|
1031
1169
|
*
|
|
1032
1170
|
* @param agent - The agent to run.
|
|
1033
|
-
* @param uiMessages - The input UI messages.
|
|
1171
|
+
* @param uiMessages - The input UI messages. Defaults to originalMessages.
|
|
1034
1172
|
* @param abortSignal - Abort signal. Optional.
|
|
1035
1173
|
* @param timeout - Timeout in milliseconds. Optional.
|
|
1036
1174
|
* @param options - The options for the agent. Optional.
|
|
@@ -1039,13 +1177,14 @@ export declare function createAgentUIStream<CALL_OPTIONS = never, TOOLS extends
|
|
|
1039
1177
|
* @param headers - Additional headers for the response. Optional.
|
|
1040
1178
|
* @param status - The status code for the response. Optional.
|
|
1041
1179
|
* @param statusText - The status text for the response. Optional.
|
|
1180
|
+
* @param keepAliveMs - Optional interval for sending SSE keep-alive comments.
|
|
1042
1181
|
* @param consumeSseStream - Whether to consume the SSE stream. Optional.
|
|
1043
1182
|
*
|
|
1044
1183
|
* @returns The response object.
|
|
1045
1184
|
*/
|
|
1046
|
-
export declare function createAgentUIStreamResponse<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends
|
|
1185
|
+
export declare function createAgentUIStreamResponse<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends OutputInterface = never, MESSAGE_METADATA = unknown>({ headers, status, statusText, keepAliveMs, consumeSseStream, ...options }: {
|
|
1047
1186
|
agent: Agent<CALL_OPTIONS, TOOLS, OUTPUT>;
|
|
1048
|
-
uiMessages
|
|
1187
|
+
uiMessages?: unknown[];
|
|
1049
1188
|
abortSignal?: AbortSignal;
|
|
1050
1189
|
timeout?: TimeoutConfiguration;
|
|
1051
1190
|
options?: CALL_OPTIONS;
|
|
@@ -1204,7 +1343,7 @@ export declare type CreateUIMessage<UI_MESSAGE extends UIMessage> = Omit<UI_MESS
|
|
|
1204
1343
|
export declare function createUIMessageStream<UI_MESSAGE extends UIMessage>({ execute, onError, // prevent leaking server error details to the client by default
|
|
1205
1344
|
originalMessages, onStepFinish, onFinish, generateId, }: {
|
|
1206
1345
|
execute: (options: {
|
|
1207
|
-
writer:
|
|
1346
|
+
writer: UIMessageStreamWriterWithOutcome<UI_MESSAGE>;
|
|
1208
1347
|
}) => Promise<void> | void;
|
|
1209
1348
|
onError?: (error: unknown) => string;
|
|
1210
1349
|
/**
|
|
@@ -1228,11 +1367,12 @@ export declare function createUIMessageStream<UI_MESSAGE extends UIMessage>({ ex
|
|
|
1228
1367
|
* @param options.statusText - The HTTP status text for the response.
|
|
1229
1368
|
* @param options.headers - Additional HTTP headers to include in the response.
|
|
1230
1369
|
* @param options.stream - The UI message chunk stream to send.
|
|
1370
|
+
* @param options.keepAliveMs - Optional interval for sending SSE keep-alive comments.
|
|
1231
1371
|
* @param options.consumeSseStream - Optional callback to consume a copy of the SSE stream independently.
|
|
1232
1372
|
*
|
|
1233
1373
|
* @returns A `Response` object with the UI message stream as the body.
|
|
1234
1374
|
*/
|
|
1235
|
-
export declare function createUIMessageStreamResponse({ status, statusText, headers, stream, consumeSseStream, }: UIMessageStreamResponseInit & {
|
|
1375
|
+
export declare function createUIMessageStreamResponse({ status, statusText, headers, stream, keepAliveMs, consumeSseStream, }: UIMessageStreamResponseInit & {
|
|
1236
1376
|
stream: ReadableStream<UIMessageChunk>;
|
|
1237
1377
|
}): Response;
|
|
1238
1378
|
|
|
@@ -1317,7 +1457,15 @@ declare type DeepPartialInternal<T> = T extends null | undefined | string | numb
|
|
|
1317
1457
|
declare const DEFAULT_MAX_DOWNLOAD_SIZE: number;
|
|
1318
1458
|
|
|
1319
1459
|
export declare class DefaultChatTransport<UI_MESSAGE extends UIMessage> extends HttpChatTransport<UI_MESSAGE> {
|
|
1320
|
-
|
|
1460
|
+
readonly resumeStreamIsReplay: boolean;
|
|
1461
|
+
constructor({ resumeStreamIsReplay, ...options }?: HttpChatTransportInitOptions<UI_MESSAGE> & {
|
|
1462
|
+
/**
|
|
1463
|
+
* Whether resumed streams replay the response from the beginning.
|
|
1464
|
+
* Defaults to true. Set to false for endpoints that only continue the
|
|
1465
|
+
* interrupted response, even when they emit a start chunk.
|
|
1466
|
+
*/
|
|
1467
|
+
resumeStreamIsReplay?: boolean;
|
|
1468
|
+
});
|
|
1321
1469
|
protected processResponseStream(stream: ReadableStream<Uint8Array<ArrayBufferLike>>): ReadableStream<UIMessageChunk>;
|
|
1322
1470
|
}
|
|
1323
1471
|
|
|
@@ -1411,7 +1559,7 @@ declare class DelayedPromise<T> {
|
|
|
1411
1559
|
* });
|
|
1412
1560
|
* ```
|
|
1413
1561
|
*/
|
|
1414
|
-
export declare class DirectChatTransport<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends
|
|
1562
|
+
export declare class DirectChatTransport<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends OutputInterface = never, UI_MESSAGE extends UIMessage<unknown, never, InferUITools<TOOLS>> = UIMessage<unknown, never, InferUITools<TOOLS>>> implements ChatTransport<UI_MESSAGE> {
|
|
1415
1563
|
private readonly agent;
|
|
1416
1564
|
private readonly agentOptions;
|
|
1417
1565
|
private readonly uiMessageStreamOptions;
|
|
@@ -1429,7 +1577,7 @@ export declare class DirectChatTransport<CALL_OPTIONS = never, TOOLS extends Too
|
|
|
1429
1577
|
/**
|
|
1430
1578
|
* Options for the `DirectChatTransport` class.
|
|
1431
1579
|
*/
|
|
1432
|
-
export declare type DirectChatTransportOptions<CALL_OPTIONS, TOOLS extends ToolSet, OUTPUT extends
|
|
1580
|
+
export declare type DirectChatTransportOptions<CALL_OPTIONS, TOOLS extends ToolSet, OUTPUT extends OutputInterface, UI_MESSAGE extends UIMessage<unknown, never, InferUITools<TOOLS>>> = {
|
|
1433
1581
|
/**
|
|
1434
1582
|
* The agent to use for generating responses.
|
|
1435
1583
|
*/
|
|
@@ -1553,6 +1701,13 @@ export declare type DynamicToolResult = {
|
|
|
1553
1701
|
|
|
1554
1702
|
export declare type DynamicToolUIPart = {
|
|
1555
1703
|
type: 'dynamic-tool';
|
|
1704
|
+
/**
|
|
1705
|
+
* `false` when a static tool part was normalized to a dynamic tool part
|
|
1706
|
+
* because its current tool schema was unavailable or incompatible.
|
|
1707
|
+
*
|
|
1708
|
+
* This preserves its static origin across persistence boundaries.
|
|
1709
|
+
*/
|
|
1710
|
+
dynamic?: false;
|
|
1556
1711
|
/**
|
|
1557
1712
|
* Name of the tool that is being called.
|
|
1558
1713
|
*/
|
|
@@ -1570,6 +1725,15 @@ export declare type DynamicToolUIPart = {
|
|
|
1570
1725
|
} & ({
|
|
1571
1726
|
state: 'input-streaming';
|
|
1572
1727
|
input?: unknown;
|
|
1728
|
+
/**
|
|
1729
|
+
* The raw tool input text received so far.
|
|
1730
|
+
*
|
|
1731
|
+
* This is used to continue input streaming when a message is persisted
|
|
1732
|
+
* and later resumed.
|
|
1733
|
+
*/
|
|
1734
|
+
rawInput?: string;
|
|
1735
|
+
/** Encoding of `rawInput`. Defaults to JSON when omitted. */
|
|
1736
|
+
inputEncoding?: 'json' | 'text';
|
|
1573
1737
|
output?: never;
|
|
1574
1738
|
errorText?: never;
|
|
1575
1739
|
callProviderMetadata?: ProviderMetadata;
|
|
@@ -1590,8 +1754,10 @@ export declare type DynamicToolUIPart = {
|
|
|
1590
1754
|
approval: {
|
|
1591
1755
|
id: string;
|
|
1592
1756
|
approved?: never;
|
|
1757
|
+
descriptor?: unknown;
|
|
1593
1758
|
reason?: never;
|
|
1594
1759
|
signature?: string;
|
|
1760
|
+
inputSchemaInput?: unknown;
|
|
1595
1761
|
};
|
|
1596
1762
|
} | {
|
|
1597
1763
|
state: 'approval-responded';
|
|
@@ -1602,8 +1768,10 @@ export declare type DynamicToolUIPart = {
|
|
|
1602
1768
|
approval: {
|
|
1603
1769
|
id: string;
|
|
1604
1770
|
approved: boolean;
|
|
1771
|
+
descriptor?: unknown;
|
|
1605
1772
|
reason?: string;
|
|
1606
1773
|
signature?: string;
|
|
1774
|
+
inputSchemaInput?: unknown;
|
|
1607
1775
|
};
|
|
1608
1776
|
} | {
|
|
1609
1777
|
state: 'output-available';
|
|
@@ -1616,8 +1784,10 @@ export declare type DynamicToolUIPart = {
|
|
|
1616
1784
|
approval?: {
|
|
1617
1785
|
id: string;
|
|
1618
1786
|
approved: true;
|
|
1787
|
+
descriptor?: unknown;
|
|
1619
1788
|
reason?: string;
|
|
1620
1789
|
signature?: string;
|
|
1790
|
+
inputSchemaInput?: unknown;
|
|
1621
1791
|
};
|
|
1622
1792
|
} | {
|
|
1623
1793
|
state: 'output-error';
|
|
@@ -1629,8 +1799,10 @@ export declare type DynamicToolUIPart = {
|
|
|
1629
1799
|
approval?: {
|
|
1630
1800
|
id: string;
|
|
1631
1801
|
approved: true;
|
|
1802
|
+
descriptor?: unknown;
|
|
1632
1803
|
reason?: string;
|
|
1633
1804
|
signature?: string;
|
|
1805
|
+
inputSchemaInput?: unknown;
|
|
1634
1806
|
};
|
|
1635
1807
|
} | {
|
|
1636
1808
|
state: 'output-denied';
|
|
@@ -1641,8 +1813,10 @@ export declare type DynamicToolUIPart = {
|
|
|
1641
1813
|
approval: {
|
|
1642
1814
|
id: string;
|
|
1643
1815
|
approved: false;
|
|
1816
|
+
descriptor?: unknown;
|
|
1644
1817
|
reason?: string;
|
|
1645
1818
|
signature?: string;
|
|
1819
|
+
inputSchemaInput?: unknown;
|
|
1646
1820
|
};
|
|
1647
1821
|
});
|
|
1648
1822
|
|
|
@@ -2024,8 +2198,9 @@ declare type EmbeddingModelV3Result = {
|
|
|
2024
2198
|
* Embed several values using an embedding model. The type of the value is defined
|
|
2025
2199
|
* by the embedding model.
|
|
2026
2200
|
*
|
|
2027
|
-
* `embedMany` automatically splits large requests into smaller chunks
|
|
2028
|
-
* has a limit on
|
|
2201
|
+
* `embedMany` automatically splits large requests into smaller chunks when the
|
|
2202
|
+
* model has a limit on either the number of embeddings or the UTF-8 input bytes
|
|
2203
|
+
* that can be processed in a single call.
|
|
2029
2204
|
*
|
|
2030
2205
|
* @param model - The embedding model to use.
|
|
2031
2206
|
* @param values - The values that should be embedded.
|
|
@@ -2174,6 +2349,12 @@ export declare class EmptyResponseBodyError extends AISDKError {
|
|
|
2174
2349
|
static isInstance(error: unknown): error is EmptyResponseBodyError;
|
|
2175
2350
|
}
|
|
2176
2351
|
|
|
2352
|
+
declare type EnforcedToolChoice = Extract<LanguageModelV3ToolChoice, {
|
|
2353
|
+
type: 'required';
|
|
2354
|
+
} | {
|
|
2355
|
+
type: 'tool';
|
|
2356
|
+
}>;
|
|
2357
|
+
|
|
2177
2358
|
declare type EnrichedStreamPart<TOOLS extends ToolSet, PARTIAL_OUTPUT> = {
|
|
2178
2359
|
part: TextStreamPart<TOOLS>;
|
|
2179
2360
|
partialOutput: PARTIAL_OUTPUT | undefined;
|
|
@@ -2555,9 +2736,10 @@ export declare function experimental_generateVideo({ model: modelArg, prompt: pr
|
|
|
2555
2736
|
*/
|
|
2556
2737
|
maxVideosPerCall?: number;
|
|
2557
2738
|
/**
|
|
2558
|
-
* Aspect ratio of the videos to generate. Must have the format
|
|
2739
|
+
* Aspect ratio of the videos to generate. Must have the format
|
|
2740
|
+
* `{width}:{height}`, or `'adaptive'` to inherit the ratio from the input media.
|
|
2559
2741
|
*/
|
|
2560
|
-
aspectRatio?: `${number}:${number}
|
|
2742
|
+
aspectRatio?: `${number}:${number}` | 'adaptive';
|
|
2561
2743
|
/**
|
|
2562
2744
|
* Resolution of the videos to generate. Must have the format `{width}x{height}`.
|
|
2563
2745
|
*/
|
|
@@ -2825,38 +3007,82 @@ declare function extractResponseHeaders(response: Response): {
|
|
|
2825
3007
|
declare type FetchFunction = typeof globalThis.fetch;
|
|
2826
3008
|
|
|
2827
3009
|
/**
|
|
2828
|
-
* Fetches
|
|
3010
|
+
* Fetches one validated URL without following redirects.
|
|
3011
|
+
*
|
|
3012
|
+
* On Node.js, the default fetch validates and pins DNS results at connect time.
|
|
3013
|
+
* An injected fetch is responsible for equivalent connect-time validation.
|
|
3014
|
+
* Redirects are rejected by default. Callers using `redirect: 'manual'` must
|
|
3015
|
+
* validate the Location target before issuing another request.
|
|
3016
|
+
*/
|
|
3017
|
+
declare function fetchWithValidatedEndpoint({ url, init, fetch: customFetch, trustedOrigin, redirect, }: {
|
|
3018
|
+
url: string | URL;
|
|
3019
|
+
init?: RequestInit;
|
|
3020
|
+
fetch?: FetchFunction;
|
|
3021
|
+
/**
|
|
3022
|
+
* A developer-configured origin that may legitimately resolve to a private
|
|
3023
|
+
* address. This must never be derived from untrusted response data.
|
|
3024
|
+
*/
|
|
3025
|
+
trustedOrigin?: string;
|
|
3026
|
+
redirect?: 'error' | 'manual';
|
|
3027
|
+
}): Promise<Response>;
|
|
3028
|
+
|
|
3029
|
+
/**
|
|
3030
|
+
* Fetches a URL while enforcing the download guard on every hop.
|
|
2829
3031
|
*
|
|
2830
3032
|
* Redirects are followed manually (`redirect: 'manual'`) so each hop is
|
|
2831
3033
|
* validated with {@link validateDownloadUrl} *before* it is requested. Relying
|
|
2832
3034
|
* on the default `redirect: 'follow'` would issue the request to a redirect
|
|
2833
3035
|
* target (e.g. an internal address) before we ever see its URL, defeating the
|
|
2834
|
-
*
|
|
3036
|
+
* guard.
|
|
3037
|
+
*
|
|
3038
|
+
* Request headers are also protected: {@link sanitizeRequestHeaders} strips
|
|
3039
|
+
* proxy/metadata/cookie/hop-by-hop headers before the first request, and all
|
|
3040
|
+
* caller headers except `User-Agent` are dropped on a cross-origin redirect.
|
|
3041
|
+
* Credentials and custom headers are preserved on the first hop for backwards
|
|
3042
|
+
* compatibility. The caller must ensure that the initial URL may receive them.
|
|
3043
|
+
* The fetch spec only strips `Authorization` on cross-origin redirects because
|
|
3044
|
+
* in a browser, CORS preflighting protects custom headers; there is no CORS on
|
|
3045
|
+
* the server, so provider API keys carried in custom headers (e.g. `x-key`)
|
|
3046
|
+
* must be dropped here as well.
|
|
2835
3047
|
*
|
|
2836
3048
|
* A `redirect: 'manual'` request yields an unreadable opaque response in the
|
|
2837
3049
|
* browser (and in other spec-compliant fetch implementations), so the redirect
|
|
2838
3050
|
* target cannot be validated here. In a real browser this is safe to follow
|
|
2839
|
-
* natively because
|
|
2840
|
-
* cannot reach a server's internal network or
|
|
2841
|
-
* runtime we cannot validate the hop, so we fail
|
|
2842
|
-
* blindly and bypass the
|
|
3051
|
+
* natively because reaching an internal network is not possible (fetch is
|
|
3052
|
+
* constrained by CORS and cannot reach a server's internal network or
|
|
3053
|
+
* cloud-metadata). On any other runtime we cannot validate the hop, so we fail
|
|
3054
|
+
* closed rather than follow it blindly and bypass the guard.
|
|
3055
|
+
*
|
|
3056
|
+
* A hop that is same-origin with `trustedOrigin` (the developer-configured
|
|
3057
|
+
* provider endpoint) skips target validation: that origin is exactly what an
|
|
3058
|
+
* unvalidated, config-derived request would fetch anyway, and validating it
|
|
3059
|
+
* would break legitimate self-hosted / localhost deployments whose response
|
|
3060
|
+
* URLs point back at the configured host. Hops on any other origin are always
|
|
3061
|
+
* validated.
|
|
2843
3062
|
*
|
|
2844
3063
|
* The returned response is the final (non-redirect) response. The caller is
|
|
2845
3064
|
* responsible for checking `response.ok` and reading the body.
|
|
2846
3065
|
*
|
|
2847
3066
|
* On Node.js, the default fetch resolves every hostname through a validating
|
|
2848
3067
|
* lookup hook and passes those exact addresses to the connector, preventing
|
|
2849
|
-
* hostname-to-private-IP and DNS-rebinding bypasses.
|
|
3068
|
+
* hostname-to-private-IP and DNS-rebinding bypasses. An injected fetch is
|
|
3069
|
+
* responsible for equivalent connect-time validation. Other runtimes should
|
|
2850
3070
|
* constrain egress at the network layer when handling untrusted URLs.
|
|
2851
3071
|
*
|
|
2852
3072
|
* @throws DownloadError if a hop is unsafe, the redirect limit is exceeded, or
|
|
2853
3073
|
* a redirect cannot be validated on a non-browser runtime.
|
|
2854
3074
|
*/
|
|
2855
|
-
declare function fetchWithValidatedRedirects({ url, headers, abortSignal, maxRedirects, }: {
|
|
3075
|
+
declare function fetchWithValidatedRedirects({ url, headers, abortSignal, maxRedirects, fetch: customFetch, trustedOrigin, }: {
|
|
2856
3076
|
url: string;
|
|
2857
3077
|
headers?: HeadersInit;
|
|
2858
3078
|
abortSignal?: AbortSignal;
|
|
2859
3079
|
maxRedirects?: number;
|
|
3080
|
+
fetch?: FetchFunction;
|
|
3081
|
+
/**
|
|
3082
|
+
* A developer-configured origin (e.g. the provider's `baseURL`) whose hops
|
|
3083
|
+
* skip target validation. Must never be derived from response data.
|
|
3084
|
+
*/
|
|
3085
|
+
trustedOrigin?: string;
|
|
2860
3086
|
}): Promise<Response>;
|
|
2861
3087
|
|
|
2862
3088
|
/**
|
|
@@ -2939,7 +3165,7 @@ declare interface GatewayCreditsResponse {
|
|
|
2939
3165
|
totalUsed: string;
|
|
2940
3166
|
}
|
|
2941
3167
|
|
|
2942
|
-
declare type GatewayEmbeddingModelId = 'alibaba/qwen3-embedding-0.6b' | 'alibaba/qwen3-embedding-4b' | 'alibaba/qwen3-embedding-8b' | 'amazon/titan-embed-text-v2' | 'cohere/embed-v4.0' | 'google/gemini-embedding-001' | 'google/gemini-embedding-2' | 'google/text-embedding-005' | 'google/text-multilingual-embedding-002' | 'mistral/codestral-embed' | 'mistral/mistral-embed' | 'openai/text-embedding-3-large' | 'openai/text-embedding-3-small' | 'openai/text-embedding-ada-002' | 'voyage/voyage-3-large' | 'voyage/voyage-3.5' | 'voyage/voyage-3.5-lite' | 'voyage/voyage-4' | 'voyage/voyage-4-large' | 'voyage/voyage-4-lite' | 'voyage/voyage-code-2' | 'voyage/voyage-code-3' | 'voyage/voyage-finance-2' | 'voyage/voyage-law-2' | (string & {});
|
|
3168
|
+
declare type GatewayEmbeddingModelId = 'alibaba/qwen3-embedding-0.6b' | 'alibaba/qwen3-embedding-4b' | 'alibaba/qwen3-embedding-8b' | 'amazon/titan-embed-text-v2' | 'cohere/embed-v4.0' | 'cohere/embed-v5.0-fast' | 'cohere/embed-v5.0-pro' | 'google/gemini-embedding-001' | 'google/gemini-embedding-2' | 'google/text-embedding-005' | 'google/text-multilingual-embedding-002' | 'mistral/codestral-embed' | 'mistral/mistral-embed' | 'openai/text-embedding-3-large' | 'openai/text-embedding-3-small' | 'openai/text-embedding-ada-002' | 'perplexity/pplx-embed-v1-0.6b' | 'perplexity/pplx-embed-v1-4b' | 'voyage/voyage-3-large' | 'voyage/voyage-3.5' | 'voyage/voyage-3.5-lite' | 'voyage/voyage-4' | 'voyage/voyage-4-large' | 'voyage/voyage-4-lite' | 'voyage/voyage-code-2' | 'voyage/voyage-code-3' | 'voyage/voyage-finance-2' | 'voyage/voyage-law-2' | (string & {});
|
|
2943
3169
|
|
|
2944
3170
|
declare interface GatewayFetchMetadataResponse {
|
|
2945
3171
|
models: GatewayLanguageModelEntry[];
|
|
@@ -2989,7 +3215,7 @@ declare interface GatewayGenerationInfoParams {
|
|
|
2989
3215
|
id: string;
|
|
2990
3216
|
}
|
|
2991
3217
|
|
|
2992
|
-
declare type GatewayImageModelId = 'bfl/flux-2-flex' | 'bfl/flux-2-klein-4b' | 'bfl/flux-2-klein-9b' | 'bfl/flux-2-max' | 'bfl/flux-2-pro' | 'bfl/flux-kontext-max' | 'bfl/flux-kontext-pro' | 'bfl/flux-pro-1.0-fill' | 'bfl/flux-pro-1.1' | 'bfl/flux-pro-1.1-ultra' | 'bytedance/seedream-4.0' | 'bytedance/seedream-4.5' | 'bytedance/seedream-5.0-lite' | 'bytedance/seedream-5.0-pro' | '
|
|
3218
|
+
declare type GatewayImageModelId = 'bfl/flux-2-flex' | 'bfl/flux-2-klein-4b' | 'bfl/flux-2-klein-9b' | 'bfl/flux-2-max' | 'bfl/flux-2-pro' | 'bfl/flux-3-image' | 'bfl/flux-kontext-max' | 'bfl/flux-kontext-pro' | 'bfl/flux-pro-1.0-fill' | 'bfl/flux-pro-1.1' | 'bfl/flux-pro-1.1-ultra' | 'bytedance/seedream-4.0' | 'bytedance/seedream-4.5' | 'bytedance/seedream-5.0-lite' | 'bytedance/seedream-5.0-pro' | 'meta/muse-image-1.0' | 'microsoft/mai-image-2.6' | 'microsoft/mai-image-2.6-flash' | 'openai/gpt-image-1' | 'openai/gpt-image-1-mini' | 'openai/gpt-image-1.5' | 'openai/gpt-image-2' | 'openai/gpt-image-2.5-flare' | 'openai/gpt-image-2.5-sunburst' | 'prodia/flux-fast-schnell' | 'recraft/recraft-v2' | 'recraft/recraft-v3' | 'recraft/recraft-v4' | 'recraft/recraft-v4-pro' | 'recraft/recraft-v4.1' | 'recraft/recraft-v4.1-flash' | 'recraft/recraft-v4.1-pro' | 'recraft/recraft-v4.1-utility' | 'recraft/recraft-v4.1-utility-pro' | 'spacexai/grok-imagine-image' | 'spacexai/grok-imagine-image-2.0' | 'topaz/wonder-3.5' | (string & {});
|
|
2993
3219
|
|
|
2994
3220
|
declare interface GatewayLanguageModelEntry {
|
|
2995
3221
|
/**
|
|
@@ -3040,7 +3266,7 @@ declare interface GatewayLanguageModelEntry {
|
|
|
3040
3266
|
|
|
3041
3267
|
declare type GatewayLanguageModelSpecification = Pick<LanguageModelV3, 'specificationVersion' | 'provider' | 'modelId'>;
|
|
3042
3268
|
|
|
3043
|
-
export declare type GatewayModelId = 'alibaba/qwen-3-14b' | 'alibaba/qwen-3-235b' | 'alibaba/qwen-3-30b' | 'alibaba/qwen-3-32b' | 'alibaba/
|
|
3269
|
+
export declare type GatewayModelId = 'alibaba/qwen-3-14b' | 'alibaba/qwen-3-235b' | 'alibaba/qwen-3-30b' | 'alibaba/qwen-3-32b' | 'alibaba/qwen3-coder' | 'alibaba/qwen3-coder-30b-a3b' | 'alibaba/qwen3-coder-next' | 'alibaba/qwen3-max-thinking' | 'alibaba/qwen3-next-80b-a3b-instruct' | 'alibaba/qwen3-next-80b-a3b-thinking' | 'alibaba/qwen3-vl-instruct' | 'alibaba/qwen3.5-flash' | 'alibaba/qwen3.5-plus' | 'alibaba/qwen3.6-27b' | 'alibaba/qwen3.6-plus' | 'alibaba/qwen3.7-flash' | 'alibaba/qwen3.7-max' | 'alibaba/qwen3.7-plus' | 'alibaba/qwen3.8-2.4t-a95b' | 'alibaba/qwen3.8-27b' | 'alibaba/qwen3.8-flash' | 'alibaba/qwen3.8-max' | 'alibaba/qwen3.8-max-0902' | 'alibaba/qwen3.8-max-prime' | 'alibaba/qwen3.8-omni-flash' | 'amazon/nova-2-lite' | 'amazon/nova-lite' | 'amazon/nova-micro' | 'amazon/nova-pro' | 'anthropic/claude-fable-5' | 'anthropic/claude-fable-5-batch' | 'anthropic/claude-fable-5.1' | 'anthropic/claude-fable-5.1-batch' | 'anthropic/claude-haiku-4.5' | 'anthropic/claude-haiku-4.5-batch' | 'anthropic/claude-haiku-5.5' | 'anthropic/claude-haiku-5.5-batch' | 'anthropic/claude-opus-4.5' | 'anthropic/claude-opus-4.5-batch' | 'anthropic/claude-opus-4.6' | 'anthropic/claude-opus-4.6-batch' | 'anthropic/claude-opus-4.7' | 'anthropic/claude-opus-4.7-batch' | 'anthropic/claude-opus-4.8' | 'anthropic/claude-opus-4.8-batch' | 'anthropic/claude-opus-4.8-fast' | 'anthropic/claude-opus-5' | 'anthropic/claude-opus-5-batch' | 'anthropic/claude-opus-5-fast' | 'anthropic/claude-opus-5.5' | 'anthropic/claude-opus-5.5-batch' | 'anthropic/claude-opus-5.5-fast' | 'anthropic/claude-sonnet-4.5' | 'anthropic/claude-sonnet-4.5-batch' | 'anthropic/claude-sonnet-4.6' | 'anthropic/claude-sonnet-4.6-batch' | 'anthropic/claude-sonnet-5' | 'anthropic/claude-sonnet-5-batch' | 'anthropic/claude-sonnet-5.5' | 'anthropic/claude-sonnet-5.5-batch' | 'arcee-ai/trinity-large-thinking' | 'bytedance/seed-1.6' | 'bytedance/seed-1.8' | 'bytedance/seed-2.1-turbo' | 'callstack/apex' | 'cohere/command-a' | 'deepseek/deepseek-r1' | 'deepseek/deepseek-v3.1' | 'deepseek/deepseek-v3.2' | 'deepseek/deepseek-v3.2-thinking' | 'deepseek/deepseek-v4-flash' | 'deepseek/deepseek-v4-flash-0731' | 'deepseek/deepseek-v4-flash-vision-exp' | 'deepseek/deepseek-v4-pro' | 'deepseek/deepseek-v4-pro-0813' | 'deepseek/deepseek-v4.1-flash' | 'deepseek/deepseek-v4.1-flash-fast' | 'fireworks/ember-1' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-flash-batch' | 'google/gemini-2.5-flash-image' | 'google/gemini-2.5-flash-lite' | 'google/gemini-2.5-flash-lite-batch' | 'google/gemini-2.5-pro' | 'google/gemini-2.5-pro-batch' | 'google/gemini-3-flash' | 'google/gemini-3-flash-batch' | 'google/gemini-3-pro-image' | 'google/gemini-3.1-flash-image' | 'google/gemini-3.1-flash-image-preview' | 'google/gemini-3.1-flash-lite' | 'google/gemini-3.1-flash-lite-batch' | 'google/gemini-3.1-flash-lite-image' | 'google/gemini-3.1-pro-preview' | 'google/gemini-3.1-pro-preview-batch' | 'google/gemini-3.5-flash' | 'google/gemini-3.5-flash-batch' | 'google/gemini-3.5-flash-lite' | 'google/gemini-3.5-flash-lite-batch' | 'google/gemini-3.6-flash' | 'google/gemini-3.6-flash-batch' | 'google/gemini-3.7-flash' | 'google/gemini-3.7-flash-batch' | 'google/gemini-3.8-flash' | 'google/gemini-4-argon' | 'google/gemini-nano-banana-2.1' | 'google/gemini-omni-flash-preview' | 'google/gemma-4-26b-a4b-it' | 'google/gemma-4-31b-it' | 'inception/mercury-2' | 'inception/mercury-2.5' | 'inception/mercury-coder-small' | 'inclusionai/ling-3.0-flash' | 'inclusionai/ling-3.0-flash-fin' | 'inclusionai/ling-3.0-flash-sante' | 'inclusionai/ling-3.0-flash-vl' | 'inclusionai/ling-3.1-flash' | 'inference-net/schematron-v2-small' | 'inference-net/schematron-v2-turbo' | 'interfaze/interfaze-beta' | 'liquid/lfm2.5-24b-a2b' | 'meituan/longcat-2.5-preview' | 'meta/llama-3.1-70b' | 'meta/llama-3.1-8b' | 'meta/llama-3.3-70b' | 'meta/llama-4-maverick' | 'meta/llama-4-scout' | 'meta/muse-glimmer-30b' | 'meta/muse-spark-1.1' | 'meta/muse-spark-1.2' | 'meta/muse-spark-1.2-contributor' | 'meta/muse-spark-1.3' | 'meta/muse-spark-1.3-contributor' | 'meta/muse-spark-open' | 'meta/muse-wonder-1.0' | 'minimax/minimax-m2' | 'minimax/minimax-m2.1' | 'minimax/minimax-m2.1-lightning' | 'minimax/minimax-m2.5' | 'minimax/minimax-m2.5-highspeed' | 'minimax/minimax-m2.7' | 'minimax/minimax-m2.7-highspeed' | 'minimax/minimax-m3' | 'mistral/codestral' | 'mistral/ministral-14b' | 'mistral/ministral-3b' | 'mistral/ministral-8b' | 'mistral/mistral-large-3' | 'mistral/mistral-large-4' | 'mistral/mistral-medium-3.5' | 'mistral/mistral-nemo' | 'mistral/mistral-small' | 'mixedbread/toast-1' | 'moonshotai/kimi-k2' | 'moonshotai/kimi-k2.5' | 'moonshotai/kimi-k2.6' | 'moonshotai/kimi-k2.7-code' | 'moonshotai/kimi-k2.7-code-highspeed' | 'moonshotai/kimi-k3' | 'moonshotai/kimi-k3-fast' | 'morph/morph-v3-fast' | 'morph/morph-v3-large' | 'nvidia/nemotron-3-nano-30b-a3b' | 'nvidia/nemotron-3-super-120b-a12b' | 'nvidia/nemotron-3-ultra-550b-a55b' | 'nvidia/nemotron-3.5-lightning' | 'nvidia/nemotron-3.5-lightning-free' | 'nvidia/nemotron-3.5-super-vl' | 'nvidia/nemotron-nano-12b-v2-vl' | 'nvidia/nemotron-nano-9b-v2' | 'openai/gpt-3.5-turbo' | 'openai/gpt-4-turbo' | 'openai/gpt-4.1' | 'openai/gpt-4.1-batch' | 'openai/gpt-4.1-fast' | 'openai/gpt-4.1-mini' | 'openai/gpt-4.1-mini-batch' | 'openai/gpt-4.1-mini-fast' | 'openai/gpt-4.1-nano' | 'openai/gpt-4.1-nano-batch' | 'openai/gpt-4.1-nano-fast' | 'openai/gpt-4o' | 'openai/gpt-4o-batch' | 'openai/gpt-4o-fast' | 'openai/gpt-4o-mini' | 'openai/gpt-4o-mini-batch' | 'openai/gpt-4o-mini-fast' | 'openai/gpt-5' | 'openai/gpt-5-batch' | 'openai/gpt-5-codex' | 'openai/gpt-5-fast' | 'openai/gpt-5-mini' | 'openai/gpt-5-mini-batch' | 'openai/gpt-5-mini-fast' | 'openai/gpt-5-nano' | 'openai/gpt-5-nano-batch' | 'openai/gpt-5-pro' | 'openai/gpt-5-pro-batch' | 'openai/gpt-5.1-codex' | 'openai/gpt-5.1-codex-max' | 'openai/gpt-5.1-codex-mini' | 'openai/gpt-5.1-thinking' | 'openai/gpt-5.1-thinking-fast' | 'openai/gpt-5.2' | 'openai/gpt-5.2-batch' | 'openai/gpt-5.2-codex' | 'openai/gpt-5.2-fast' | 'openai/gpt-5.2-pro' | 'openai/gpt-5.3-codex' | 'openai/gpt-5.3-codex-fast' | 'openai/gpt-5.4' | 'openai/gpt-5.4-batch' | 'openai/gpt-5.4-fast' | 'openai/gpt-5.4-mini' | 'openai/gpt-5.4-mini-batch' | 'openai/gpt-5.4-mini-fast' | 'openai/gpt-5.4-nano' | 'openai/gpt-5.4-nano-batch' | 'openai/gpt-5.4-pro' | 'openai/gpt-5.5' | 'openai/gpt-5.5-batch' | 'openai/gpt-5.5-fast' | 'openai/gpt-5.5-pro' | 'openai/gpt-5.5-pro-batch' | 'openai/gpt-5.6-luna' | 'openai/gpt-5.6-luna-batch' | 'openai/gpt-5.6-luna-fast' | 'openai/gpt-5.6-sol' | 'openai/gpt-5.6-sol-batch' | 'openai/gpt-5.6-sol-fast' | 'openai/gpt-5.6-terra' | 'openai/gpt-5.6-terra-batch' | 'openai/gpt-5.6-terra-fast' | 'openai/gpt-6-astra' | 'openai/gpt-6-astra-batch' | 'openai/gpt-6-astra-fast' | 'openai/gpt-6-luna' | 'openai/gpt-6-luna-batch' | 'openai/gpt-6-luna-fast' | 'openai/gpt-6-sol' | 'openai/gpt-6-sol-batch' | 'openai/gpt-6-sol-fast' | 'openai/gpt-6.1-sol' | 'openai/gpt-6.1-sol-batch' | 'openai/gpt-6.1-sol-fast' | 'openai/gpt-oss-120b' | 'openai/gpt-oss-20b' | 'openai/gpt-oss-safeguard-120b' | 'openai/gpt-oss-safeguard-20b' | 'openai/o1' | 'openai/o3' | 'openai/o3-fast' | 'openai/o3-mini' | 'openai/o3-pro' | 'openai/o4-mini' | 'openai/o4-mini-fast' | 'perplexity/sonar' | 'poolside/laguna-s-2.1' | 'poolside/laguna-s-2.1-free' | 'quiverai/arrow-2' | 'quiverai/arrow-2-telos' | 'reflection/beam' | 'reflection/beam-free' | 'sakana/fugu-max' | 'sakana/fugu-ultra' | 'sakana/fugu-ultra-v2' | 'sakana/namazu' | 'spacexai/grok-4.1-fast-non-reasoning' | 'spacexai/grok-4.1-fast-reasoning' | 'spacexai/grok-4.20-multi-agent' | 'spacexai/grok-4.20-multi-agent-batch' | 'spacexai/grok-4.20-multi-agent-beta' | 'spacexai/grok-4.20-non-reasoning' | 'spacexai/grok-4.20-non-reasoning-batch' | 'spacexai/grok-4.20-non-reasoning-beta' | 'spacexai/grok-4.20-reasoning' | 'spacexai/grok-4.20-reasoning-batch' | 'spacexai/grok-4.20-reasoning-beta' | 'spacexai/grok-4.3' | 'spacexai/grok-4.3-batch' | 'spacexai/grok-4.5' | 'spacexai/grok-4.6' | 'spacexai/grok-4.7' | 'spacexai/grok-build-0.1' | 'stealth/cat-jam' | 'stealth/glyph-cluster' | 'stepfun/step-3.7-flash' | 'stepfun/step-5-preview' | 'tencent/hy-mt2-lite' | 'tencent/hy-mt2-plus' | 'tencent/hy-mt2-pro' | 'tencent/hy3' | 'tencent/hy4-preview' | 'thinkingmachines/inkling' | 'thinkingmachines/inkling-small' | 'xiaomi/mimo-v2.5' | 'xiaomi/mimo-v2.5-pro' | 'xiaomi/mimo-v2.6-flash' | 'xiaomi/mimo-v2.6-pro' | 'xiaomi/mimo-v2.6-pro-ultraspeed' | 'zai/glm-4.5' | 'zai/glm-4.5-air' | 'zai/glm-4.5v' | 'zai/glm-4.6' | 'zai/glm-4.7' | 'zai/glm-4.7-flash' | 'zai/glm-4.7-flashx' | 'zai/glm-5' | 'zai/glm-5-turbo' | 'zai/glm-5.1' | 'zai/glm-5.2' | 'zai/glm-5.2-fast' | 'zai/glm-5.3' | 'zai/glm-5.3-fast' | 'zai/glm-5.3-flash' | 'zai/glm-5.3-flashx' | 'zai/glm-5v-turbo' | (string & {});
|
|
3044
3270
|
|
|
3045
3271
|
declare interface GatewayProvider extends ProviderV3 {
|
|
3046
3272
|
(modelId: GatewayModelId): LanguageModelV3;
|
|
@@ -3152,9 +3378,9 @@ declare interface GatewayProviderSettings {
|
|
|
3152
3378
|
metadataCacheRefreshMillis?: number;
|
|
3153
3379
|
}
|
|
3154
3380
|
|
|
3155
|
-
declare type GatewayRerankingModelId = 'cohere/rerank-v3.5' | 'cohere/rerank-v4-fast' | 'cohere/rerank-v4-pro' | 'voyage/rerank-2.5' | 'voyage/rerank-2.5-lite' | (string & {});
|
|
3381
|
+
declare type GatewayRerankingModelId = 'cohere/rerank-v3.5' | 'cohere/rerank-v4-fast' | 'cohere/rerank-v4-pro' | 'voyage/rerank-2.5' | 'voyage/rerank-2.5-lite' | 'voyage/rerank-3' | 'voyage/rerank-3-lite' | (string & {});
|
|
3156
3382
|
|
|
3157
|
-
declare type GatewaySpeechModelId = 'openai/tts-1' | 'openai/tts-1-hd' | '
|
|
3383
|
+
declare type GatewaySpeechModelId = 'fish-audio/drama-3' | 'fish-audio/s1' | 'fish-audio/s2-pro' | 'fish-audio/s2.1-pro' | 'google/gemini-3.8-flash-lite-tts' | 'google/gemini-3.8-flash-tts' | 'microsoft/mai-voice-2' | 'microsoft/mai-voice-2-flash' | 'microsoft/mai-voice-2.1' | 'microsoft/mai-voice-2.1-flash' | 'openai/tts-1' | 'openai/tts-1-hd' | 'spacexai/grok-tts' | (string & {});
|
|
3158
3384
|
|
|
3159
3385
|
declare interface GatewaySpendReportParams {
|
|
3160
3386
|
/** Start date in YYYY-MM-DD format (inclusive) */
|
|
@@ -3218,6 +3444,20 @@ declare interface GatewaySpendReportRow {
|
|
|
3218
3444
|
* Gateway-specific provider-defined tools.
|
|
3219
3445
|
*/
|
|
3220
3446
|
declare const gatewayTools: {
|
|
3447
|
+
/**
|
|
3448
|
+
* Fetch page content using Browserbase's lightweight Fetch API.
|
|
3449
|
+
*
|
|
3450
|
+
* Supports raw, Markdown, and schema-driven JSON output as well as redirects,
|
|
3451
|
+
* proxy routing, and TLS controls.
|
|
3452
|
+
*/
|
|
3453
|
+
browserbaseFetch: (config?: BrowserbaseFetchConfig) => ReturnType<typeof browserbaseFetchToolFactory>;
|
|
3454
|
+
/**
|
|
3455
|
+
* Search the web using Browserbase's Search API for fast, structured results.
|
|
3456
|
+
*
|
|
3457
|
+
* Returns titles, URLs, and available publication metadata without requiring
|
|
3458
|
+
* a browser session.
|
|
3459
|
+
*/
|
|
3460
|
+
browserbaseSearch: (config?: BrowserbaseSearchConfig) => ReturnType<typeof browserbaseSearchToolFactory>;
|
|
3221
3461
|
/**
|
|
3222
3462
|
* Search the web using Exa for current information and token-efficient
|
|
3223
3463
|
* excerpts optimized for agent workflows.
|
|
@@ -3243,11 +3483,20 @@ declare const gatewayTools: {
|
|
|
3243
3483
|
* domain, language, date range, and recency filters.
|
|
3244
3484
|
*/
|
|
3245
3485
|
perplexitySearch: (config?: PerplexitySearchConfig) => ReturnType<typeof perplexitySearchToolFactory>;
|
|
3486
|
+
/**
|
|
3487
|
+
* Search the web and Tako's curated knowledge graph in one call for
|
|
3488
|
+
* token-efficient web excerpts and structured data results grounded in
|
|
3489
|
+
* premium sources, each with an embed-ready visualization.
|
|
3490
|
+
*
|
|
3491
|
+
* Supports effort, per-source web and data controls, localization, and inline
|
|
3492
|
+
* contents for agents that need to reason over underlying data.
|
|
3493
|
+
*/
|
|
3494
|
+
takoSearch: (config?: TakoSearchConfig) => ReturnType<typeof takoSearchToolFactory>;
|
|
3246
3495
|
};
|
|
3247
3496
|
|
|
3248
|
-
declare type GatewayTranscriptionModelId = 'openai/gpt-4o-mini-transcribe' | 'openai/gpt-4o-transcribe' | 'openai/gpt-realtime-whisper' | 'openai/whisper-1' | '
|
|
3497
|
+
declare type GatewayTranscriptionModelId = 'fish-audio/transcribe-1' | 'google/gemini-3.5-transcribe' | 'google/gemini-3.5-transcribe-live' | 'microsoft/mai-transcribe-2' | 'microsoft/mai-transcribe-2-streaming' | 'openai/gpt-4o-mini-transcribe' | 'openai/gpt-4o-transcribe' | 'openai/gpt-realtime-whisper' | 'openai/whisper-1' | 'spacexai/grok-stt' | (string & {});
|
|
3249
3498
|
|
|
3250
|
-
declare type GatewayVideoModelId = 'alibaba/wan-v2.5-t2v-preview' | 'alibaba/wan-v2.6-i2v' | 'alibaba/wan-v2.6-i2v-flash' | 'alibaba/wan-v2.6-r2v' | 'alibaba/wan-v2.6-r2v-flash' | 'alibaba/wan-v2.6-t2v' | 'alibaba/wan-v2.7-r2v' | 'alibaba/wan-v2.7-t2v' | 'bytedance/seedance-2.0' | 'bytedance/seedance-2.0-fast' | 'bytedance/seedance-v1.0-pro' | 'bytedance/seedance-v1.0-pro-fast' | 'bytedance/seedance-v1.5-pro' | 'google/veo-3.0-fast-generate-001' | 'google/veo-3.0-generate-001' | 'google/veo-3.1-fast-generate-001' | 'google/veo-3.1-generate-001' | 'google/veo-3.1-lite-generate-001' | 'klingai/kling-v2.5-turbo-i2v' | 'klingai/kling-v2.5-turbo-t2v' | 'klingai/kling-v2.6-i2v' | 'klingai/kling-v2.6-motion-control' | 'klingai/kling-v2.6-t2v' | 'klingai/kling-v3.0-i2v' | 'klingai/kling-v3.0-motion-control' | 'klingai/kling-v3.0-t2v' | 'minimax/minimax-h3' | '
|
|
3499
|
+
declare type GatewayVideoModelId = 'alibaba/wan-v2.5-t2v-preview' | 'alibaba/wan-v2.6-i2v' | 'alibaba/wan-v2.6-i2v-flash' | 'alibaba/wan-v2.6-r2v' | 'alibaba/wan-v2.6-r2v-flash' | 'alibaba/wan-v2.6-t2v' | 'alibaba/wan-v2.7-r2v' | 'alibaba/wan-v2.7-t2v' | 'alibaba/wan-v3.0-video' | 'alibaba/wan-v3.0-video-prime' | 'bfl/flux-3-video' | 'bytedance/seedance-2.0' | 'bytedance/seedance-2.0-fast' | 'bytedance/seedance-2.0-mini' | 'bytedance/seedance-2.5' | 'bytedance/seedance-v1.0-pro' | 'bytedance/seedance-v1.0-pro-fast' | 'bytedance/seedance-v1.5-pro' | 'google/veo-3.0-fast-generate-001' | 'google/veo-3.0-generate-001' | 'google/veo-3.1-fast-generate-001' | 'google/veo-3.1-generate-001' | 'google/veo-3.1-lite-generate-001' | 'heygen/heygen-video-1' | 'klingai/kling-v2.5-turbo-i2v' | 'klingai/kling-v2.5-turbo-t2v' | 'klingai/kling-v2.6-i2v' | 'klingai/kling-v2.6-motion-control' | 'klingai/kling-v2.6-t2v' | 'klingai/kling-v3.0-i2v' | 'klingai/kling-v3.0-motion-control' | 'klingai/kling-v3.0-t2v' | 'minimax/minimax-h3' | 'minimax/minimax-h3-max' | 'spacexai/grok-imagine-video' | 'spacexai/grok-imagine-video-1.5' | 'spacexai/grok-imagine-video-1.5-lite' | 'topaz/proteus' | 'topaz/starlight-precise-2.6' | (string & {});
|
|
3251
3500
|
|
|
3252
3501
|
/**
|
|
3253
3502
|
* A generated audio file.
|
|
@@ -3299,7 +3548,7 @@ export declare const generateId: IdGenerator;
|
|
|
3299
3548
|
* @param seed - Seed for the image generation.
|
|
3300
3549
|
* @param providerOptions - Additional provider-specific options that are passed through to the provider
|
|
3301
3550
|
* as body parameters.
|
|
3302
|
-
* @param maxRetries - Maximum number of retries. Set to 0 to disable retries. Default: 2.
|
|
3551
|
+
* @param maxRetries - Maximum number of retries per image model call, including retries after unclassified empty responses. Empty responses marked as not retryable by the provider are not retried. Set to 0 to disable retries. Default: 2.
|
|
3303
3552
|
* @param abortSignal - An optional abort signal that can be used to cancel the call.
|
|
3304
3553
|
* @param headers - Additional HTTP headers to be sent with the request. Only applicable for HTTP-based providers.
|
|
3305
3554
|
*
|
|
@@ -3350,7 +3599,9 @@ export declare function generateImage({ model: modelArg, prompt: promptArg, n, m
|
|
|
3350
3599
|
*/
|
|
3351
3600
|
providerOptions?: ProviderOptions;
|
|
3352
3601
|
/**
|
|
3353
|
-
* Maximum number of retries per image model call
|
|
3602
|
+
* Maximum number of retries per image model call, including retries after
|
|
3603
|
+
* unclassified empty responses. Empty responses marked as not retryable by
|
|
3604
|
+
* the provider are not retried. Set to 0 to disable retries.
|
|
3354
3605
|
*
|
|
3355
3606
|
* @default 2
|
|
3356
3607
|
*/
|
|
@@ -3635,7 +3886,7 @@ export declare interface GenerateObjectResult<OBJECT> {
|
|
|
3635
3886
|
* @returns
|
|
3636
3887
|
* A result object that contains the generated text, the results of the tool calls, and additional information.
|
|
3637
3888
|
*/
|
|
3638
|
-
export declare function generateText<TOOLS extends ToolSet, OUTPUT extends
|
|
3889
|
+
export declare function generateText<TOOLS extends ToolSet, OUTPUT extends OutputInterface = OutputInterface<string, string>>({ model: modelArg, tools, toolChoice, system, prompt, messages, allowSystemInMessages, maxRetries: maxRetriesArg, abortSignal, timeout, headers, stopWhen, experimental_output, output, experimental_telemetry: telemetry, providerOptions, experimental_activeTools, activeTools, experimental_prepareStep, prepareStep, experimental_repairToolCall: repairToolCall, experimental_download: download, experimental_context, experimental_toolApprovalSecret, experimental_include: include, _internal: { generateId }, experimental_onStart: onStart, experimental_onStepStart: onStepStart, experimental_onToolCallStart: onToolCallStart, experimental_onToolCallFinish: onToolCallFinish, onStepFinish, onFinish, ...settings }: CallSettings & Prompt & {
|
|
3639
3890
|
/**
|
|
3640
3891
|
* The language model to use.
|
|
3641
3892
|
*/
|
|
@@ -3800,7 +4051,7 @@ export declare type GenerateTextOnFinishCallback<TOOLS extends ToolSet> = (event
|
|
|
3800
4051
|
*
|
|
3801
4052
|
* @param event - The event object containing generation configuration.
|
|
3802
4053
|
*/
|
|
3803
|
-
export declare type GenerateTextOnStartCallback<TOOLS extends ToolSet = ToolSet, OUTPUT extends
|
|
4054
|
+
export declare type GenerateTextOnStartCallback<TOOLS extends ToolSet = ToolSet, OUTPUT extends OutputInterface = OutputInterface> = (event: OnStartEvent<TOOLS, OUTPUT, GenerateTextIncludeSettings>) => PromiseLike<void> | void;
|
|
3804
4055
|
|
|
3805
4056
|
/**
|
|
3806
4057
|
* Callback that is set using the `onStepFinish` option.
|
|
@@ -3821,7 +4072,7 @@ export declare type GenerateTextOnStepFinishCallback<TOOLS extends ToolSet> = (e
|
|
|
3821
4072
|
*
|
|
3822
4073
|
* @param event - The event object containing step configuration.
|
|
3823
4074
|
*/
|
|
3824
|
-
export declare type GenerateTextOnStepStartCallback<TOOLS extends ToolSet = ToolSet, OUTPUT extends
|
|
4075
|
+
export declare type GenerateTextOnStepStartCallback<TOOLS extends ToolSet = ToolSet, OUTPUT extends OutputInterface = OutputInterface> = (event: OnStepStartEvent<TOOLS, OUTPUT, GenerateTextIncludeSettings>) => PromiseLike<void> | void;
|
|
3825
4076
|
|
|
3826
4077
|
/**
|
|
3827
4078
|
* Callback that is set using the `experimental_onToolCallFinish` option.
|
|
@@ -3851,7 +4102,7 @@ export declare type GenerateTextOnToolCallStartCallback<TOOLS extends ToolSet =
|
|
|
3851
4102
|
* The result of a `generateText` call.
|
|
3852
4103
|
* It contains the generated text, the tool calls that were made during the generation, and the results of the tool calls.
|
|
3853
4104
|
*/
|
|
3854
|
-
export declare interface GenerateTextResult<TOOLS extends ToolSet, OUTPUT extends
|
|
4105
|
+
export declare interface GenerateTextResult<TOOLS extends ToolSet, OUTPUT extends OutputInterface> {
|
|
3855
4106
|
/**
|
|
3856
4107
|
* The content that was generated in the last step.
|
|
3857
4108
|
*/
|
|
@@ -3969,7 +4220,8 @@ export declare interface GenerateTextResult<TOOLS extends ToolSet, OUTPUT extend
|
|
|
3969
4220
|
* The generated output according to the `output` specification.
|
|
3970
4221
|
*
|
|
3971
4222
|
* @throws {NoOutputGeneratedError} When no output is available, for example
|
|
3972
|
-
* when the final step
|
|
4223
|
+
* when the final step finishes with a `tool-calls` reason, or when it
|
|
4224
|
+
* contains no text and does not finish with a `stop` reason.
|
|
3973
4225
|
*/
|
|
3974
4226
|
readonly output: InferGenerateOutput<OUTPUT>;
|
|
3975
4227
|
}
|
|
@@ -4009,13 +4261,44 @@ export declare interface GenerateVideoResult {
|
|
|
4009
4261
|
|
|
4010
4262
|
declare function getErrorMessage(error: unknown | undefined): string;
|
|
4011
4263
|
|
|
4012
|
-
declare const getFromApi: <T>({ url, headers, successfulResponseHandler, failedResponseHandler, abortSignal, fetch, }: {
|
|
4264
|
+
declare const getFromApi: <T>({ url, headers, successfulResponseHandler, failedResponseHandler, abortSignal, fetch, validateUrl, credentialedOrigin, trustedOrigin, }: {
|
|
4013
4265
|
url: string;
|
|
4014
4266
|
headers?: Record<string, string | undefined>;
|
|
4015
4267
|
failedResponseHandler: ResponseHandler<Error>;
|
|
4016
4268
|
successfulResponseHandler: ResponseHandler<T>;
|
|
4017
4269
|
abortSignal?: AbortSignal;
|
|
4018
4270
|
fetch?: FetchFunction;
|
|
4271
|
+
/**
|
|
4272
|
+
* Set `true` when `url` is untrusted (e.g. taken from a provider response
|
|
4273
|
+
* body): it is routed through {@link fetchWithValidatedRedirects}, which
|
|
4274
|
+
* rejects private/loopback/link-local targets and re-validates redirect
|
|
4275
|
+
* hops; blocked URLs throw `DownloadError`. Set `false` only for URLs built
|
|
4276
|
+
* from a developer-configured endpoint.
|
|
4277
|
+
*
|
|
4278
|
+
* Optional for backwards compatibility with existing callers; omitting it
|
|
4279
|
+
* behaves like `false` (no validation).
|
|
4280
|
+
*/
|
|
4281
|
+
validateUrl?: boolean;
|
|
4282
|
+
/**
|
|
4283
|
+
* When set, `headers` are sent only if `url` is same-origin with this origin
|
|
4284
|
+
* (the user-agent suffix is always kept). Pass the provider's configured
|
|
4285
|
+
* base URL alongside `validateUrl: true` so credentials never ride a request
|
|
4286
|
+
* to a response-supplied host on a different origin (e.g. a CDN). Redirects
|
|
4287
|
+
* that later cross origin drop all caller headers regardless (see
|
|
4288
|
+
* {@link fetchWithValidatedRedirects}).
|
|
4289
|
+
*/
|
|
4290
|
+
credentialedOrigin?: string;
|
|
4291
|
+
/**
|
|
4292
|
+
* A developer-configured origin (e.g. the provider's `baseURL`) that is
|
|
4293
|
+
* exempt from URL validation when `validateUrl` is `true`. A response URL
|
|
4294
|
+
* (or redirect hop) that is same-origin with it is fetched without target
|
|
4295
|
+
* validation — it points at exactly the host a config-derived
|
|
4296
|
+
* `validateUrl: false` request would fetch anyway, so blocking it would
|
|
4297
|
+
* only break legitimate self-hosted / localhost deployments whose response
|
|
4298
|
+
* URLs point back at the configured host. Hops on any other origin are
|
|
4299
|
+
* still validated. Must never be derived from response data.
|
|
4300
|
+
*/
|
|
4301
|
+
trustedOrigin?: string;
|
|
4019
4302
|
}) => Promise<{
|
|
4020
4303
|
value: T;
|
|
4021
4304
|
rawValue?: unknown;
|
|
@@ -4653,19 +4936,19 @@ export { InferAgentUIMessage }
|
|
|
4653
4936
|
/**
|
|
4654
4937
|
* Infers the element type from an array output specification.
|
|
4655
4938
|
*/
|
|
4656
|
-
declare type InferElementOutput<OUTPUT extends
|
|
4939
|
+
declare type InferElementOutput<OUTPUT extends OutputInterface> = OUTPUT extends OutputInterface<any, any, infer ELEMENT> ? ELEMENT : never;
|
|
4657
4940
|
|
|
4658
4941
|
/**
|
|
4659
4942
|
* Infers the complete output type from the output specification.
|
|
4660
4943
|
*/
|
|
4661
|
-
export declare type InferGenerateOutput<OUTPUT extends
|
|
4944
|
+
export declare type InferGenerateOutput<OUTPUT extends OutputInterface> = OUTPUT extends OutputInterface<infer COMPLETE_OUTPUT, any, any> ? COMPLETE_OUTPUT : never;
|
|
4662
4945
|
|
|
4663
4946
|
export declare type InferSchema<SCHEMA> = SCHEMA extends ZodSchema<infer T> ? T : SCHEMA extends StandardSchema<infer T> ? T : SCHEMA extends LazySchema<infer T> ? T : SCHEMA extends Schema<infer T> ? T : never;
|
|
4664
4947
|
|
|
4665
4948
|
/**
|
|
4666
4949
|
* Infers the partial output type from the output specification.
|
|
4667
4950
|
*/
|
|
4668
|
-
export declare type InferStreamOutput<OUTPUT extends
|
|
4951
|
+
export declare type InferStreamOutput<OUTPUT extends OutputInterface> = OUTPUT extends OutputInterface<any, infer PARTIAL_OUTPUT, any> ? PARTIAL_OUTPUT : never;
|
|
4669
4952
|
|
|
4670
4953
|
/**
|
|
4671
4954
|
* Infer the input type of a tool.
|
|
@@ -4722,7 +5005,7 @@ declare function injectJsonInstructionIntoMessages({ messages, schema, schemaPre
|
|
|
4722
5005
|
}): LanguageModelV3Prompt;
|
|
4723
5006
|
|
|
4724
5007
|
export declare class InvalidArgumentError extends AISDKError {
|
|
4725
|
-
private readonly [symbol$
|
|
5008
|
+
private readonly [symbol$j];
|
|
4726
5009
|
readonly parameter: string;
|
|
4727
5010
|
readonly value: unknown;
|
|
4728
5011
|
constructor({ parameter, value, message, }: {
|
|
@@ -4784,7 +5067,7 @@ export declare class InvalidResponseDataError extends AISDKError {
|
|
|
4784
5067
|
}
|
|
4785
5068
|
|
|
4786
5069
|
export declare class InvalidStreamPartError extends AISDKError {
|
|
4787
|
-
private readonly [symbol$
|
|
5070
|
+
private readonly [symbol$i];
|
|
4788
5071
|
readonly chunk: SingleRequestTextStreamPart<any>;
|
|
4789
5072
|
constructor({ chunk, message, }: {
|
|
4790
5073
|
chunk: SingleRequestTextStreamPart<any>;
|
|
@@ -4794,7 +5077,7 @@ export declare class InvalidStreamPartError extends AISDKError {
|
|
|
4794
5077
|
}
|
|
4795
5078
|
|
|
4796
5079
|
export declare class InvalidToolApprovalError extends AISDKError {
|
|
4797
|
-
private readonly [symbol$
|
|
5080
|
+
private readonly [symbol$h];
|
|
4798
5081
|
readonly approvalId: string;
|
|
4799
5082
|
constructor({ approvalId }: {
|
|
4800
5083
|
approvalId: string;
|
|
@@ -4803,7 +5086,7 @@ export declare class InvalidToolApprovalError extends AISDKError {
|
|
|
4803
5086
|
}
|
|
4804
5087
|
|
|
4805
5088
|
export declare class InvalidToolApprovalSignatureError extends AISDKError {
|
|
4806
|
-
private readonly [symbol$
|
|
5089
|
+
private readonly [symbol$g];
|
|
4807
5090
|
readonly approvalId: string;
|
|
4808
5091
|
readonly toolCallId: string;
|
|
4809
5092
|
constructor({ approvalId, toolCallId, reason, }: {
|
|
@@ -4815,7 +5098,7 @@ export declare class InvalidToolApprovalSignatureError extends AISDKError {
|
|
|
4815
5098
|
}
|
|
4816
5099
|
|
|
4817
5100
|
export declare class InvalidToolInputError extends AISDKError {
|
|
4818
|
-
private readonly [symbol$
|
|
5101
|
+
private readonly [symbol$l];
|
|
4819
5102
|
readonly toolName: string;
|
|
4820
5103
|
readonly toolInput: string;
|
|
4821
5104
|
constructor({ toolInput, toolName, cause, message, }: {
|
|
@@ -6459,6 +6742,12 @@ declare type LanguageModelV3StreamPart = {
|
|
|
6459
6742
|
type: 'tool-input-start';
|
|
6460
6743
|
id: string;
|
|
6461
6744
|
toolName: string;
|
|
6745
|
+
/**
|
|
6746
|
+
* Encoding of the input deltas. Defaults to JSON when omitted.
|
|
6747
|
+
* Text deltas concatenate to a raw string. The final tool-call input
|
|
6748
|
+
* must still be JSON-encoded, regardless of the delta encoding.
|
|
6749
|
+
*/
|
|
6750
|
+
inputEncoding?: 'json' | 'text';
|
|
6462
6751
|
providerMetadata?: SharedV3ProviderMetadata;
|
|
6463
6752
|
providerExecuted?: boolean;
|
|
6464
6753
|
dynamic?: boolean;
|
|
@@ -6610,8 +6899,9 @@ declare type LanguageModelV3ToolCall = {
|
|
|
6610
6899
|
*/
|
|
6611
6900
|
toolName: string;
|
|
6612
6901
|
/**
|
|
6613
|
-
*
|
|
6614
|
-
*
|
|
6902
|
+
* JSON-encoded tool input. Must match the input schema of the tool.
|
|
6903
|
+
* String inputs must also be JSON-encoded, even when input deltas use text
|
|
6904
|
+
* encoding.
|
|
6615
6905
|
*/
|
|
6616
6906
|
input: string;
|
|
6617
6907
|
/**
|
|
@@ -6971,7 +7261,9 @@ export declare function lastAssistantMessageIsCompleteWithApprovalResponses({ me
|
|
|
6971
7261
|
/**
|
|
6972
7262
|
* Check if the last message is an assistant message with completed tool calls.
|
|
6973
7263
|
* The last step of the message must have at least one tool invocation and
|
|
6974
|
-
* all tool invocations must have a result.
|
|
7264
|
+
* all tool invocations must have a result. Completed model text may follow
|
|
7265
|
+
* the tool invocation because client-side tool results update parts in place,
|
|
7266
|
+
* but trailing text without a completed stream state prevents resubmission.
|
|
6975
7267
|
*/
|
|
6976
7268
|
export declare function lastAssistantMessageIsCompleteWithToolCalls({ messages, }: {
|
|
6977
7269
|
messages: UIMessage[];
|
|
@@ -7124,7 +7416,7 @@ export declare class MessageConversionError extends AISDKError {
|
|
|
7124
7416
|
}
|
|
7125
7417
|
|
|
7126
7418
|
export declare class MissingToolResultsError extends AISDKError {
|
|
7127
|
-
private readonly [symbol$
|
|
7419
|
+
private readonly [symbol$e];
|
|
7128
7420
|
readonly toolCallIds: string[];
|
|
7129
7421
|
constructor({ toolCallIds }: {
|
|
7130
7422
|
toolCallIds: string[];
|
|
@@ -7160,7 +7452,7 @@ export declare class NoContentGeneratedError extends AISDKError {
|
|
|
7160
7452
|
* - The model generated a response that could not be parsed.
|
|
7161
7453
|
*/
|
|
7162
7454
|
export declare class NoImageGeneratedError extends AISDKError {
|
|
7163
|
-
private readonly [symbol$
|
|
7455
|
+
private readonly [symbol$d_2];
|
|
7164
7456
|
/**
|
|
7165
7457
|
* The response metadata for each call.
|
|
7166
7458
|
*/
|
|
@@ -7185,7 +7477,7 @@ export declare class NoImageGeneratedError extends AISDKError {
|
|
|
7185
7477
|
* - `text`: The text that was generated by the model. This can be the raw text or the tool call text, depending on the model.
|
|
7186
7478
|
*/
|
|
7187
7479
|
export declare class NoObjectGeneratedError extends AISDKError {
|
|
7188
|
-
private readonly [symbol$
|
|
7480
|
+
private readonly [symbol$c_2];
|
|
7189
7481
|
/**
|
|
7190
7482
|
* The text that was generated by the model. This can be the raw text or the tool call text, depending on the model.
|
|
7191
7483
|
*/
|
|
@@ -7217,7 +7509,7 @@ export declare class NoObjectGeneratedError extends AISDKError {
|
|
|
7217
7509
|
* Thrown when no LLM output was generated, e.g. because of errors.
|
|
7218
7510
|
*/
|
|
7219
7511
|
export declare class NoOutputGeneratedError extends AISDKError {
|
|
7220
|
-
private readonly [symbol$
|
|
7512
|
+
private readonly [symbol$b_2];
|
|
7221
7513
|
constructor({ message, cause, }?: {
|
|
7222
7514
|
message?: string;
|
|
7223
7515
|
cause?: Error;
|
|
@@ -7238,7 +7530,7 @@ declare function normalizeHeaders(headers: HeadersInit | Record<string, string |
|
|
|
7238
7530
|
* Error that is thrown when no speech audio was generated.
|
|
7239
7531
|
*/
|
|
7240
7532
|
export declare class NoSpeechGeneratedError extends AISDKError {
|
|
7241
|
-
private readonly [symbol$
|
|
7533
|
+
private readonly [symbol$a];
|
|
7242
7534
|
readonly responses: Array<SpeechModelResponseMetadata>;
|
|
7243
7535
|
constructor(options: {
|
|
7244
7536
|
responses: Array<SpeechModelResponseMetadata>;
|
|
@@ -7274,7 +7566,7 @@ export declare class NoSuchProviderError extends NoSuchModelError {
|
|
|
7274
7566
|
}
|
|
7275
7567
|
|
|
7276
7568
|
export declare class NoSuchToolError extends AISDKError {
|
|
7277
|
-
private readonly [symbol$
|
|
7569
|
+
private readonly [symbol$k];
|
|
7278
7570
|
readonly toolName: string;
|
|
7279
7571
|
readonly availableTools: string[] | undefined;
|
|
7280
7572
|
constructor({ toolName, availableTools, message, }: {
|
|
@@ -7289,7 +7581,7 @@ export declare class NoSuchToolError extends AISDKError {
|
|
|
7289
7581
|
* Error that is thrown when no transcript was generated.
|
|
7290
7582
|
*/
|
|
7291
7583
|
export declare class NoTranscriptGeneratedError extends AISDKError {
|
|
7292
|
-
private readonly [symbol$
|
|
7584
|
+
private readonly [symbol$9_2];
|
|
7293
7585
|
readonly responses: Array<TranscriptionModelResponseMetadata>;
|
|
7294
7586
|
constructor(options: {
|
|
7295
7587
|
responses: Array<TranscriptionModelResponseMetadata>;
|
|
@@ -7298,7 +7590,7 @@ export declare class NoTranscriptGeneratedError extends AISDKError {
|
|
|
7298
7590
|
}
|
|
7299
7591
|
|
|
7300
7592
|
export declare class NoVideoGeneratedError extends AISDKError {
|
|
7301
|
-
private readonly [symbol$
|
|
7593
|
+
private readonly [symbol$8_2];
|
|
7302
7594
|
readonly responses: Array<VideoModelResponseMetadata>;
|
|
7303
7595
|
constructor({ message, cause, responses, }: {
|
|
7304
7596
|
message?: string;
|
|
@@ -7369,7 +7661,7 @@ export declare type OnFinishEvent<TOOLS extends ToolSet = ToolSet> = StepResult<
|
|
|
7369
7661
|
*
|
|
7370
7662
|
* Called when the generation operation begins, before any LLM calls.
|
|
7371
7663
|
*/
|
|
7372
|
-
export declare interface OnStartEvent<TOOLS extends ToolSet = ToolSet, OUTPUT extends
|
|
7664
|
+
export declare interface OnStartEvent<TOOLS extends ToolSet = ToolSet, OUTPUT extends OutputInterface = OutputInterface, INCLUDE = {
|
|
7373
7665
|
requestBody?: boolean;
|
|
7374
7666
|
responseBody?: boolean;
|
|
7375
7667
|
}> {
|
|
@@ -7452,7 +7744,7 @@ export declare type OnStepFinishEvent<TOOLS extends ToolSet = ToolSet> = StepRes
|
|
|
7452
7744
|
* Called when a step (LLM call) begins, before the provider is called.
|
|
7453
7745
|
* Each step represents a single LLM invocation.
|
|
7454
7746
|
*/
|
|
7455
|
-
export declare interface OnStepStartEvent<TOOLS extends ToolSet = ToolSet, OUTPUT extends
|
|
7747
|
+
export declare interface OnStepStartEvent<TOOLS extends ToolSet = ToolSet, OUTPUT extends OutputInterface = OutputInterface, INCLUDE = {
|
|
7456
7748
|
requestBody?: boolean;
|
|
7457
7749
|
responseBody?: boolean;
|
|
7458
7750
|
}> {
|
|
@@ -7584,7 +7876,7 @@ export declare namespace Output {
|
|
|
7584
7876
|
};
|
|
7585
7877
|
}
|
|
7586
7878
|
|
|
7587
|
-
declare interface
|
|
7879
|
+
export declare interface OutputInterface<OUTPUT = any, PARTIAL = any, ELEMENT = any> {
|
|
7588
7880
|
/**
|
|
7589
7881
|
* The name of the output mode.
|
|
7590
7882
|
*/
|
|
@@ -7963,7 +8255,7 @@ declare const perplexitySearchToolFactory: _ai_sdk_provider_utils.ProviderToolFa
|
|
|
7963
8255
|
*
|
|
7964
8256
|
* @param response - The Node.js ServerResponse object to pipe to.
|
|
7965
8257
|
* @param agent - The agent to run.
|
|
7966
|
-
* @param uiMessages - The input UI messages.
|
|
8258
|
+
* @param uiMessages - The input UI messages. Defaults to originalMessages.
|
|
7967
8259
|
* @param abortSignal - Abort signal. Optional.
|
|
7968
8260
|
* @param timeout - Timeout in milliseconds. Optional.
|
|
7969
8261
|
* @param options - The options for the agent. Optional.
|
|
@@ -7972,12 +8264,13 @@ declare const perplexitySearchToolFactory: _ai_sdk_provider_utils.ProviderToolFa
|
|
|
7972
8264
|
* @param headers - Additional headers for the response. Optional.
|
|
7973
8265
|
* @param status - The status code for the response. Optional.
|
|
7974
8266
|
* @param statusText - The status text for the response. Optional.
|
|
8267
|
+
* @param keepAliveMs - Optional interval for sending SSE keep-alive comments.
|
|
7975
8268
|
* @param consumeSseStream - Whether to consume the SSE stream. Optional.
|
|
7976
8269
|
*/
|
|
7977
|
-
export declare function pipeAgentUIStreamToResponse<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends
|
|
8270
|
+
export declare function pipeAgentUIStreamToResponse<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends OutputInterface = never, MESSAGE_METADATA = unknown>({ response, headers, status, statusText, keepAliveMs, consumeSseStream, ...options }: {
|
|
7978
8271
|
response: ServerResponse;
|
|
7979
8272
|
agent: Agent<CALL_OPTIONS, TOOLS, OUTPUT>;
|
|
7980
|
-
uiMessages
|
|
8273
|
+
uiMessages?: unknown[];
|
|
7981
8274
|
abortSignal?: AbortSignal;
|
|
7982
8275
|
timeout?: TimeoutConfiguration;
|
|
7983
8276
|
options?: CALL_OPTIONS;
|
|
@@ -8012,10 +8305,11 @@ export declare function pipeTextStreamToResponse({ response, status, statusText,
|
|
|
8012
8305
|
* @param options.statusText - The HTTP status text for the response.
|
|
8013
8306
|
* @param options.headers - Additional HTTP headers to include in the response.
|
|
8014
8307
|
* @param options.stream - The UI message chunk stream to send.
|
|
8308
|
+
* @param options.keepAliveMs - Optional interval for sending SSE keep-alive comments.
|
|
8015
8309
|
* @param options.consumeSseStream - Optional callback to consume a copy of the SSE stream independently.
|
|
8016
8310
|
* @returns A promise that resolves when the stream has been written.
|
|
8017
8311
|
*/
|
|
8018
|
-
export declare function pipeUIMessageStreamToResponse({ response, status, statusText, headers, stream, consumeSseStream, }: {
|
|
8312
|
+
export declare function pipeUIMessageStreamToResponse({ response, status, statusText, headers, stream, keepAliveMs, consumeSseStream, }: {
|
|
8019
8313
|
response: ServerResponse;
|
|
8020
8314
|
stream: ReadableStream<UIMessageChunk>;
|
|
8021
8315
|
} & UIMessageStreamResponseInit): Promise<void>;
|
|
@@ -8281,7 +8575,7 @@ export declare type Provider = {
|
|
|
8281
8575
|
*
|
|
8282
8576
|
* @throws {NoSuchModelError} If no such model exists.
|
|
8283
8577
|
*/
|
|
8284
|
-
rerankingModel(modelId: string): RerankingModel;
|
|
8578
|
+
rerankingModel?(modelId: string): RerankingModel;
|
|
8285
8579
|
};
|
|
8286
8580
|
|
|
8287
8581
|
/**
|
|
@@ -8564,6 +8858,10 @@ declare interface ReasoningPart {
|
|
|
8564
8858
|
*/
|
|
8565
8859
|
export declare type ReasoningUIPart = {
|
|
8566
8860
|
type: 'reasoning';
|
|
8861
|
+
/**
|
|
8862
|
+
* The reasoning part ID.
|
|
8863
|
+
*/
|
|
8864
|
+
id?: string;
|
|
8567
8865
|
/**
|
|
8568
8866
|
* The reasoning text.
|
|
8569
8867
|
*/
|
|
@@ -8956,16 +9254,7 @@ declare function safeValidateTypes<OBJECT>({ value, schema, context, }: {
|
|
|
8956
9254
|
* but instead of throwing it returns `{ success: true, data }`
|
|
8957
9255
|
* or `{ success: false, error }`.
|
|
8958
9256
|
*/
|
|
8959
|
-
export declare function safeValidateUIMessages<UI_MESSAGE extends UIMessage>(
|
|
8960
|
-
messages: unknown;
|
|
8961
|
-
metadataSchema?: FlexibleSchema<UIMessage['metadata']>;
|
|
8962
|
-
dataSchemas?: {
|
|
8963
|
-
[NAME in keyof InferUIMessageData<UI_MESSAGE> & string]?: FlexibleSchema<InferUIMessageData<UI_MESSAGE>[NAME]>;
|
|
8964
|
-
};
|
|
8965
|
-
tools?: {
|
|
8966
|
-
[NAME in keyof InferUIMessageTools<UI_MESSAGE> & string]?: Tool<InferUIMessageTools<UI_MESSAGE>[NAME]['input'], InferUIMessageTools<UI_MESSAGE>[NAME]['output']>;
|
|
8967
|
-
};
|
|
8968
|
-
}): Promise<SafeValidateUIMessagesResult<UI_MESSAGE>>;
|
|
9257
|
+
export declare function safeValidateUIMessages<UI_MESSAGE extends UIMessage>(options: ValidateUIMessagesOptions<UI_MESSAGE>): Promise<SafeValidateUIMessagesResult<UI_MESSAGE>>;
|
|
8969
9258
|
|
|
8970
9259
|
export declare type SafeValidateUIMessagesResult<UI_MESSAGE extends UIMessage> = {
|
|
8971
9260
|
success: true;
|
|
@@ -9005,8 +9294,10 @@ declare function secureJsonParse(text: string): any;
|
|
|
9005
9294
|
export declare class SerialJobExecutor {
|
|
9006
9295
|
private queue;
|
|
9007
9296
|
private isProcessing;
|
|
9297
|
+
private idleWaiters;
|
|
9008
9298
|
private processQueue;
|
|
9009
9299
|
run(job: Job): Promise<void>;
|
|
9300
|
+
waitForIdle(): Promise<void>;
|
|
9010
9301
|
}
|
|
9011
9302
|
|
|
9012
9303
|
declare type SharedV2Headers = Record<string, string>;
|
|
@@ -9252,7 +9543,7 @@ declare type SingleRequestTextStreamPart<TOOLS extends ToolSet> = {
|
|
|
9252
9543
|
/**
|
|
9253
9544
|
* Smooths text and reasoning streaming output.
|
|
9254
9545
|
*
|
|
9255
|
-
* @param delayInMs - The delay in milliseconds between each chunk. Defaults to 10ms. Can be set to `null` to skip the delay.
|
|
9546
|
+
* @param delayInMs - The delay in milliseconds between each chunk. Defaults to 10ms. Can be set to `null` to skip the delay. The delay is skipped while the document is hidden (e.g. browser background tabs), where timer throttling would otherwise stall the stream.
|
|
9256
9547
|
* @param chunking - Controls how the text is chunked for streaming. Use "word" to stream word by word (default), "line" to stream line by line, provide a custom RegExp pattern for custom chunking, provide an Intl.Segmenter for locale-aware word segmentation (recommended for CJK languages), or provide a custom ChunkDetector function.
|
|
9257
9548
|
*
|
|
9258
9549
|
* @returns A transform stream that smooths text streaming output.
|
|
@@ -10585,7 +10876,7 @@ declare interface StreamOptions {
|
|
|
10585
10876
|
* @returns
|
|
10586
10877
|
* A result object for accessing different stream types and additional information.
|
|
10587
10878
|
*/
|
|
10588
|
-
export declare function streamText<TOOLS extends ToolSet, OUTPUT extends
|
|
10879
|
+
export declare function streamText<TOOLS extends ToolSet, OUTPUT extends OutputInterface = OutputInterface<string, string, never>>({ model, tools, toolChoice, system, prompt, messages, allowSystemInMessages, maxRetries, abortSignal, timeout, headers, stopWhen, experimental_output, output, experimental_telemetry: telemetry, prepareStep, providerOptions, experimental_activeTools, activeTools, experimental_repairToolCall: repairToolCall, experimental_transform: transform, experimental_download: download, includeRawChunks, onChunk, onError, onFinish, onAbort, onStepFinish, experimental_onStart: onStart, experimental_onStepStart: onStepStart, experimental_onToolCallStart: onToolCallStart, experimental_onToolCallFinish: onToolCallFinish, experimental_context, experimental_toolApprovalSecret, experimental_include: include, _internal: { now, generateId }, ...settings }: CallSettings & Prompt & {
|
|
10589
10880
|
/**
|
|
10590
10881
|
* The language model to use.
|
|
10591
10882
|
*/
|
|
@@ -10686,7 +10977,7 @@ export declare function streamText<TOOLS extends ToolSet, OUTPUT extends Output_
|
|
|
10686
10977
|
*
|
|
10687
10978
|
* The usage is the combined usage of all steps.
|
|
10688
10979
|
*/
|
|
10689
|
-
onFinish?: StreamTextOnFinishCallback<TOOLS
|
|
10980
|
+
onFinish?: StreamTextOnFinishCallback<NoInfer<TOOLS>, NoInfer<OUTPUT>>;
|
|
10690
10981
|
onAbort?: StreamTextOnAbortCallback<TOOLS>;
|
|
10691
10982
|
/**
|
|
10692
10983
|
* Callback that is called when each step (LLM call) is finished, including intermediate steps.
|
|
@@ -10750,6 +11041,14 @@ export declare function streamText<TOOLS extends ToolSet, OUTPUT extends Output_
|
|
|
10750
11041
|
};
|
|
10751
11042
|
}): StreamTextResult<TOOLS, OUTPUT>;
|
|
10752
11043
|
|
|
11044
|
+
export declare type StreamTextEndEvent<TOOLS extends ToolSet = ToolSet, OUTPUT extends OutputInterface = OutputInterface> = OnFinishEvent<TOOLS> & {
|
|
11045
|
+
/**
|
|
11046
|
+
* The parsed output when an output setting was provided and parsing
|
|
11047
|
+
* succeeded.
|
|
11048
|
+
*/
|
|
11049
|
+
readonly output?: InferGenerateOutput<OUTPUT>;
|
|
11050
|
+
};
|
|
11051
|
+
|
|
10753
11052
|
/**
|
|
10754
11053
|
* Include settings for streamText (requestBody only).
|
|
10755
11054
|
*/
|
|
@@ -10780,6 +11079,8 @@ export declare type StreamTextOnChunkCallback<TOOLS extends ToolSet> = (event: {
|
|
|
10780
11079
|
}>;
|
|
10781
11080
|
}) => PromiseLike<void> | void;
|
|
10782
11081
|
|
|
11082
|
+
export declare type StreamTextOnEndCallback<TOOLS extends ToolSet = ToolSet, OUTPUT extends OutputInterface = OutputInterface> = (event: StreamTextEndEvent<TOOLS, OUTPUT>) => PromiseLike<void> | void;
|
|
11083
|
+
|
|
10783
11084
|
/**
|
|
10784
11085
|
* Callback that is set using the `onError` option.
|
|
10785
11086
|
*
|
|
@@ -10794,7 +11095,7 @@ export declare type StreamTextOnErrorCallback = (event: {
|
|
|
10794
11095
|
*
|
|
10795
11096
|
* @param event - The event that is passed to the callback.
|
|
10796
11097
|
*/
|
|
10797
|
-
export declare type StreamTextOnFinishCallback<TOOLS extends ToolSet
|
|
11098
|
+
export declare type StreamTextOnFinishCallback<TOOLS extends ToolSet = ToolSet, OUTPUT extends OutputInterface = OutputInterface> = StreamTextOnEndCallback<TOOLS, OUTPUT>;
|
|
10798
11099
|
|
|
10799
11100
|
/**
|
|
10800
11101
|
* Callback that is set using the `experimental_onStart` option.
|
|
@@ -10805,7 +11106,7 @@ export declare type StreamTextOnFinishCallback<TOOLS extends ToolSet> = (event:
|
|
|
10805
11106
|
*
|
|
10806
11107
|
* @param event - The event object containing generation configuration.
|
|
10807
11108
|
*/
|
|
10808
|
-
export declare type StreamTextOnStartCallback<TOOLS extends ToolSet = ToolSet, OUTPUT extends
|
|
11109
|
+
export declare type StreamTextOnStartCallback<TOOLS extends ToolSet = ToolSet, OUTPUT extends OutputInterface = OutputInterface> = (event: OnStartEvent<TOOLS, OUTPUT, StreamTextIncludeSettings>) => PromiseLike<void> | void;
|
|
10809
11110
|
|
|
10810
11111
|
/**
|
|
10811
11112
|
* Callback that is set using the `onStepFinish` option.
|
|
@@ -10823,7 +11124,7 @@ export declare type StreamTextOnStepFinishCallback<TOOLS extends ToolSet> = (eve
|
|
|
10823
11124
|
*
|
|
10824
11125
|
* @param event - The event object containing step configuration.
|
|
10825
11126
|
*/
|
|
10826
|
-
export declare type StreamTextOnStepStartCallback<TOOLS extends ToolSet = ToolSet, OUTPUT extends
|
|
11127
|
+
export declare type StreamTextOnStepStartCallback<TOOLS extends ToolSet = ToolSet, OUTPUT extends OutputInterface = OutputInterface> = (event: OnStepStartEvent<TOOLS, OUTPUT, StreamTextIncludeSettings>) => PromiseLike<void> | void;
|
|
10827
11128
|
|
|
10828
11129
|
export declare type StreamTextOnToolCallFinishCallback<TOOLS extends ToolSet = ToolSet> = (event: OnToolCallFinishEvent<TOOLS>) => PromiseLike<void> | void;
|
|
10829
11130
|
|
|
@@ -10832,7 +11133,7 @@ export declare type StreamTextOnToolCallStartCallback<TOOLS extends ToolSet = To
|
|
|
10832
11133
|
/**
|
|
10833
11134
|
* A result object for accessing different stream types and additional information.
|
|
10834
11135
|
*/
|
|
10835
|
-
export declare interface StreamTextResult<TOOLS extends ToolSet, OUTPUT extends
|
|
11136
|
+
export declare interface StreamTextResult<TOOLS extends ToolSet, OUTPUT extends OutputInterface> {
|
|
10836
11137
|
/**
|
|
10837
11138
|
* The content that was generated in the last step.
|
|
10838
11139
|
*
|
|
@@ -11133,6 +11434,8 @@ declare const symbol$j: unique symbol;
|
|
|
11133
11434
|
|
|
11134
11435
|
declare const symbol$k: unique symbol;
|
|
11135
11436
|
|
|
11437
|
+
declare const symbol$l: unique symbol;
|
|
11438
|
+
|
|
11136
11439
|
declare const symbol: unique symbol;
|
|
11137
11440
|
|
|
11138
11441
|
declare const symbol_2: unique symbol;
|
|
@@ -11159,13 +11462,260 @@ export declare type SystemModelMessage = {
|
|
|
11159
11462
|
|
|
11160
11463
|
export declare const systemModelMessageSchema: z.ZodType<SystemModelMessage>;
|
|
11161
11464
|
|
|
11465
|
+
declare interface TakoCard {
|
|
11466
|
+
card_id?: string | null;
|
|
11467
|
+
title?: string | null;
|
|
11468
|
+
description?: string | null;
|
|
11469
|
+
semantic_description?: string | null;
|
|
11470
|
+
webpage_url?: string | null;
|
|
11471
|
+
image_url?: string | null;
|
|
11472
|
+
embed_url?: string | null;
|
|
11473
|
+
sources?: Array<{
|
|
11474
|
+
source_name?: string | null;
|
|
11475
|
+
source_description?: string | null;
|
|
11476
|
+
source_index: 'data' | 'web';
|
|
11477
|
+
source_text?: string | null;
|
|
11478
|
+
url?: string | null;
|
|
11479
|
+
}> | null;
|
|
11480
|
+
methodologies?: Array<{
|
|
11481
|
+
methodology_name: string | null;
|
|
11482
|
+
methodology_description: string | null;
|
|
11483
|
+
}> | null;
|
|
11484
|
+
source_indexes?: Array<'data' | 'web'> | null;
|
|
11485
|
+
card_type?: string | null;
|
|
11486
|
+
relevance?: 'High' | 'Low' | 'Medium' | null;
|
|
11487
|
+
content?: TakoResultContent | null;
|
|
11488
|
+
exportable?: boolean;
|
|
11489
|
+
nodes?: Array<{
|
|
11490
|
+
id: string;
|
|
11491
|
+
type: 'entity' | 'metric';
|
|
11492
|
+
name: string;
|
|
11493
|
+
description?: string | null;
|
|
11494
|
+
}> | null;
|
|
11495
|
+
metric_definitions?: Array<{
|
|
11496
|
+
name: string;
|
|
11497
|
+
definition: string;
|
|
11498
|
+
}> | null;
|
|
11499
|
+
data_freshness?: {
|
|
11500
|
+
coverage_end?: string | null;
|
|
11501
|
+
data_as_of?: string | null;
|
|
11502
|
+
last_updated?: string | null;
|
|
11503
|
+
} | null;
|
|
11504
|
+
}
|
|
11505
|
+
|
|
11506
|
+
declare type TakoContentFormat = 'card_json' | 'csv' | 'json_compact' | 'json_records';
|
|
11507
|
+
|
|
11508
|
+
declare type TakoDatasetCell = boolean | number | string | null;
|
|
11509
|
+
|
|
11510
|
+
declare interface TakoDataSourceConfig {
|
|
11511
|
+
/**
|
|
11512
|
+
* Maximum number of data results to return (1-20). When includeContents is
|
|
11513
|
+
* true, each additional result adds its own data surcharge.
|
|
11514
|
+
*/
|
|
11515
|
+
count?: number;
|
|
11516
|
+
/**
|
|
11517
|
+
* Inline rows for each data result. This adds a data surcharge based on row
|
|
11518
|
+
* count and dataset source. To estimate cost, search with includeContents
|
|
11519
|
+
* disabled and inspect cards.content.export_pricing. This applies to every
|
|
11520
|
+
* returned card; limit sources.data.count and sources.data.maxRows to control
|
|
11521
|
+
* cost.
|
|
11522
|
+
*/
|
|
11523
|
+
includeContents?: boolean;
|
|
11524
|
+
/** Requested delivery mode for card data. Search cards are always inlined. */
|
|
11525
|
+
mode?: 'inline' | 'url';
|
|
11526
|
+
/** Serialization for inlined card data. */
|
|
11527
|
+
contentFormat?: TakoContentFormat;
|
|
11528
|
+
/**
|
|
11529
|
+
* Maximum rows to inline per result. Omit to use the allowance in
|
|
11530
|
+
* cards.content.export_pricing. A data surcharge applies per 1,000 exported
|
|
11531
|
+
* rows; lower values reduce cost.
|
|
11532
|
+
*/
|
|
11533
|
+
maxRows?: number;
|
|
11534
|
+
/** Data Graph node IDs to prioritize. */
|
|
11535
|
+
nodeIds?: string[];
|
|
11536
|
+
/** Return only cards matching nodeIds. Requires at least one node ID. */
|
|
11537
|
+
strict?: boolean;
|
|
11538
|
+
}
|
|
11539
|
+
|
|
11540
|
+
declare interface TakoResultContent {
|
|
11541
|
+
content_format?: TakoContentFormat | null;
|
|
11542
|
+
cost?: number;
|
|
11543
|
+
data?: string | null;
|
|
11544
|
+
records?: Array<Record<string, TakoDatasetCell>> | null;
|
|
11545
|
+
dataset?: {
|
|
11546
|
+
columns: Array<{
|
|
11547
|
+
name: string;
|
|
11548
|
+
type: 'boolean' | 'date' | 'datetime' | 'number' | 'string';
|
|
11549
|
+
unit?: string | null;
|
|
11550
|
+
}>;
|
|
11551
|
+
rows: TakoDatasetCell[][];
|
|
11552
|
+
total_rows: number;
|
|
11553
|
+
truncated: boolean;
|
|
11554
|
+
ref: string;
|
|
11555
|
+
sources: Array<{
|
|
11556
|
+
name: string;
|
|
11557
|
+
index?: 'data' | 'web';
|
|
11558
|
+
}>;
|
|
11559
|
+
provenance?: 'query' | 'web_extraction';
|
|
11560
|
+
} | null;
|
|
11561
|
+
card_data?: Record<string, unknown> | null;
|
|
11562
|
+
card_data_schema?: Record<string, unknown> | null;
|
|
11563
|
+
url?: string | null;
|
|
11564
|
+
expires_at?: string | null;
|
|
11565
|
+
total_rows?: number | null;
|
|
11566
|
+
truncated?: boolean;
|
|
11567
|
+
export_pricing?: {
|
|
11568
|
+
baseline_usd: number;
|
|
11569
|
+
free_rows: number;
|
|
11570
|
+
max_rows_ceiling: number;
|
|
11571
|
+
row_cpm_usd: number;
|
|
11572
|
+
} | null;
|
|
11573
|
+
manifest?: Array<{
|
|
11574
|
+
dtype?: 'boolean' | 'date' | 'datetime' | 'number' | 'string' | null;
|
|
11575
|
+
entity?: string | null;
|
|
11576
|
+
metric?: string | null;
|
|
11577
|
+
name?: string | null;
|
|
11578
|
+
unit?: string | null;
|
|
11579
|
+
}> | null;
|
|
11580
|
+
}
|
|
11581
|
+
|
|
11582
|
+
declare interface TakoSearchConfig {
|
|
11583
|
+
/** Search effort. fast is the default balanced option. */
|
|
11584
|
+
effort?: TakoSearchEffort;
|
|
11585
|
+
/** Sources to search. Omit to search both curated data and the web. */
|
|
11586
|
+
sources?: {
|
|
11587
|
+
data?: TakoDataSourceConfig;
|
|
11588
|
+
web?: TakoWebSourceConfig;
|
|
11589
|
+
};
|
|
11590
|
+
/** End-user coordinates for localized results. */
|
|
11591
|
+
location?: {
|
|
11592
|
+
latitude: number;
|
|
11593
|
+
longitude: number;
|
|
11594
|
+
};
|
|
11595
|
+
/** ISO 3166-1 alpha-2 country code. */
|
|
11596
|
+
countryCode?: string;
|
|
11597
|
+
/** BCP-47 locale. */
|
|
11598
|
+
locale?: string;
|
|
11599
|
+
/** IANA timezone. */
|
|
11600
|
+
timezone?: string;
|
|
11601
|
+
/** Settings that control card rendering. */
|
|
11602
|
+
outputSettings?: {
|
|
11603
|
+
imageDarkMode?: boolean;
|
|
11604
|
+
/** Instant-effort only. */
|
|
11605
|
+
forceRefresh?: boolean;
|
|
11606
|
+
};
|
|
11607
|
+
/** Maximum related search suggestions to include (1-20). */
|
|
11608
|
+
includeRelated?: number;
|
|
11609
|
+
}
|
|
11610
|
+
|
|
11611
|
+
declare type TakoSearchEffort = 'deep' | 'fast' | 'instant';
|
|
11612
|
+
|
|
11613
|
+
declare interface TakoSearchError {
|
|
11614
|
+
error: 'api_error' | 'configuration_error' | 'execution_error' | 'invalid_input' | 'rate_limit' | 'timeout' | 'unknown_tool';
|
|
11615
|
+
statusCode?: number;
|
|
11616
|
+
message: string;
|
|
11617
|
+
}
|
|
11618
|
+
|
|
11619
|
+
declare interface TakoSearchInput {
|
|
11620
|
+
query: string;
|
|
11621
|
+
effort?: TakoSearchEffort;
|
|
11622
|
+
sources?: {
|
|
11623
|
+
data?: {
|
|
11624
|
+
count?: number;
|
|
11625
|
+
include_contents?: boolean;
|
|
11626
|
+
mode?: 'inline' | 'url';
|
|
11627
|
+
content_format?: TakoContentFormat;
|
|
11628
|
+
max_rows?: number;
|
|
11629
|
+
node_ids?: string[];
|
|
11630
|
+
strict?: boolean;
|
|
11631
|
+
};
|
|
11632
|
+
web?: {
|
|
11633
|
+
count?: number;
|
|
11634
|
+
include_contents?: boolean;
|
|
11635
|
+
category?: 'finance' | 'news' | 'sports';
|
|
11636
|
+
include_domains?: string[];
|
|
11637
|
+
exclude_domains?: string[];
|
|
11638
|
+
snippet_max_chars?: number;
|
|
11639
|
+
highlights?: boolean;
|
|
11640
|
+
article_content_max_chars?: number;
|
|
11641
|
+
published_after?: string;
|
|
11642
|
+
published_before?: string;
|
|
11643
|
+
};
|
|
11644
|
+
};
|
|
11645
|
+
location?: {
|
|
11646
|
+
latitude: number;
|
|
11647
|
+
longitude: number;
|
|
11648
|
+
};
|
|
11649
|
+
country_code?: string;
|
|
11650
|
+
locale?: string;
|
|
11651
|
+
timezone?: string;
|
|
11652
|
+
output_settings?: {
|
|
11653
|
+
image_dark_mode?: boolean;
|
|
11654
|
+
force_refresh?: boolean;
|
|
11655
|
+
};
|
|
11656
|
+
include_related?: number;
|
|
11657
|
+
}
|
|
11658
|
+
|
|
11659
|
+
declare type TakoSearchOutput = TakoSearchError | TakoSearchResponse;
|
|
11660
|
+
|
|
11661
|
+
declare interface TakoSearchResponse {
|
|
11662
|
+
request_id: string;
|
|
11663
|
+
cards?: TakoCard[];
|
|
11664
|
+
web_results?: TakoWebResult[];
|
|
11665
|
+
usage?: {
|
|
11666
|
+
total_cost_usd: number;
|
|
11667
|
+
compute?: {
|
|
11668
|
+
cost_usd: number;
|
|
11669
|
+
} | null;
|
|
11670
|
+
data?: {
|
|
11671
|
+
cost_usd: number;
|
|
11672
|
+
datasets: number;
|
|
11673
|
+
} | null;
|
|
11674
|
+
} | null;
|
|
11675
|
+
related?: Array<Record<string, unknown>> | null;
|
|
11676
|
+
}
|
|
11677
|
+
|
|
11678
|
+
declare const takoSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<TakoSearchInput, TakoSearchOutput, TakoSearchConfig>;
|
|
11679
|
+
|
|
11680
|
+
declare interface TakoWebResult {
|
|
11681
|
+
title: string;
|
|
11682
|
+
url: string;
|
|
11683
|
+
snippet?: string | null;
|
|
11684
|
+
source_name?: string | null;
|
|
11685
|
+
publish_date?: string | null;
|
|
11686
|
+
content?: TakoResultContent | null;
|
|
11687
|
+
}
|
|
11688
|
+
|
|
11689
|
+
declare interface TakoWebSourceConfig {
|
|
11690
|
+
/** Maximum number of web results to return (1-20). */
|
|
11691
|
+
count?: number;
|
|
11692
|
+
/** Inline extracted web page text. This can add a data charge. */
|
|
11693
|
+
includeContents?: boolean;
|
|
11694
|
+
/** Optional web-result category filter. */
|
|
11695
|
+
category?: 'finance' | 'news' | 'sports';
|
|
11696
|
+
/** Only return results from these bare domains. */
|
|
11697
|
+
includeDomains?: string[];
|
|
11698
|
+
/** Exclude results from these bare domains. */
|
|
11699
|
+
excludeDomains?: string[];
|
|
11700
|
+
/** Maximum characters in each web-result snippet. */
|
|
11701
|
+
snippetMaxChars?: number;
|
|
11702
|
+
/** Include highlighted passages in web results. Defaults to true in AI Gateway. */
|
|
11703
|
+
highlights?: boolean;
|
|
11704
|
+
/** Maximum extracted characters per web page when including contents. */
|
|
11705
|
+
articleContentMaxChars?: number;
|
|
11706
|
+
/** Keep results published on or after this ISO date. */
|
|
11707
|
+
publishedAfter?: string;
|
|
11708
|
+
/** Keep results published on or before this ISO date. */
|
|
11709
|
+
publishedBefore?: string;
|
|
11710
|
+
}
|
|
11711
|
+
|
|
11162
11712
|
/**
|
|
11163
11713
|
* Implement this interface to create custom telemetry integrations.
|
|
11164
11714
|
* Methods can be sync or return a PromiseLike.
|
|
11165
11715
|
*/
|
|
11166
11716
|
export declare interface TelemetryIntegration {
|
|
11167
|
-
onStart?: Listener<OnStartEvent<ToolSet,
|
|
11168
|
-
onStepStart?: Listener<OnStepStartEvent<ToolSet,
|
|
11717
|
+
onStart?: Listener<OnStartEvent<ToolSet, OutputInterface>>;
|
|
11718
|
+
onStepStart?: Listener<OnStepStartEvent<ToolSet, OutputInterface>>;
|
|
11169
11719
|
onToolCallStart?: Listener<OnToolCallStartEvent<ToolSet>>;
|
|
11170
11720
|
onToolCallFinish?: Listener<OnToolCallFinishEvent<ToolSet>>;
|
|
11171
11721
|
onStepFinish?: Listener<OnStepFinishEvent<ToolSet>>;
|
|
@@ -11267,6 +11817,8 @@ export declare type TextStreamPart<TOOLS extends ToolSet> = {
|
|
|
11267
11817
|
type: 'tool-input-start';
|
|
11268
11818
|
id: string;
|
|
11269
11819
|
toolName: string;
|
|
11820
|
+
/** Encoding of the input deltas. Defaults to JSON when omitted. */
|
|
11821
|
+
inputEncoding?: 'json' | 'text';
|
|
11270
11822
|
providerMetadata?: ProviderMetadata;
|
|
11271
11823
|
toolMetadata?: JSONObject;
|
|
11272
11824
|
providerExecuted?: boolean;
|
|
@@ -11580,6 +12132,13 @@ export declare type ToolApprovalResponse = {
|
|
|
11580
12132
|
approved: boolean;
|
|
11581
12133
|
/**
|
|
11582
12134
|
* Optional reason for the approval or denial.
|
|
12135
|
+
*
|
|
12136
|
+
* For denied tool calls, the reason is included in the `execution-denied`
|
|
12137
|
+
* tool result that is sent to the model. For approved tool calls that are
|
|
12138
|
+
* executed by the SDK, the reason remains in the message history: it is not
|
|
12139
|
+
* included in the model prompt and is not exposed through a dedicated tool
|
|
12140
|
+
* execution option. For provider-executed tools, the approval response
|
|
12141
|
+
* (including the reason) is forwarded to the provider.
|
|
11583
12142
|
*/
|
|
11584
12143
|
reason?: string;
|
|
11585
12144
|
/**
|
|
@@ -11618,7 +12177,7 @@ declare interface ToolCall<NAME extends string, INPUT> {
|
|
|
11618
12177
|
}
|
|
11619
12178
|
|
|
11620
12179
|
export declare class ToolCallNotFoundForApprovalError extends AISDKError {
|
|
11621
|
-
private readonly [symbol$
|
|
12180
|
+
private readonly [symbol$f];
|
|
11622
12181
|
readonly toolCallId: string;
|
|
11623
12182
|
readonly approvalId: string;
|
|
11624
12183
|
constructor({ toolCallId, approvalId, }: {
|
|
@@ -11710,6 +12269,45 @@ export declare type ToolChoice<TOOLS extends Record<string, unknown>> = 'auto' |
|
|
|
11710
12269
|
toolName: Extract<keyof TOOLS, string>;
|
|
11711
12270
|
};
|
|
11712
12271
|
|
|
12272
|
+
/**
|
|
12273
|
+
* Thrown when a model response does not satisfy an enforced tool choice.
|
|
12274
|
+
*/
|
|
12275
|
+
export declare class ToolChoiceViolationError extends AISDKError {
|
|
12276
|
+
private readonly [symbol$7_2];
|
|
12277
|
+
/**
|
|
12278
|
+
* The tool choice that the model response did not satisfy.
|
|
12279
|
+
*/
|
|
12280
|
+
readonly toolChoice: EnforcedToolChoice;
|
|
12281
|
+
/**
|
|
12282
|
+
* Reason why the model finished generating the response.
|
|
12283
|
+
*/
|
|
12284
|
+
readonly finishReason: FinishReason;
|
|
12285
|
+
/**
|
|
12286
|
+
* The provider that returned the response.
|
|
12287
|
+
*/
|
|
12288
|
+
readonly provider: string;
|
|
12289
|
+
/**
|
|
12290
|
+
* The model that returned the response.
|
|
12291
|
+
*/
|
|
12292
|
+
readonly modelId: string;
|
|
12293
|
+
/**
|
|
12294
|
+
* The normalized content returned by the model.
|
|
12295
|
+
*
|
|
12296
|
+
* This can be inspected to recover a tool call that the provider returned as
|
|
12297
|
+
* text or reasoning instead of a structured tool call.
|
|
12298
|
+
*/
|
|
12299
|
+
readonly content: Array<LanguageModelV3Content>;
|
|
12300
|
+
constructor({ toolChoice, finishReason, provider, modelId, content, message, }: {
|
|
12301
|
+
toolChoice: EnforcedToolChoice;
|
|
12302
|
+
finishReason: FinishReason;
|
|
12303
|
+
provider: string;
|
|
12304
|
+
modelId: string;
|
|
12305
|
+
content: Array<LanguageModelV3Content>;
|
|
12306
|
+
message?: string;
|
|
12307
|
+
});
|
|
12308
|
+
static isInstance(error: unknown): error is ToolChoiceViolationError;
|
|
12309
|
+
}
|
|
12310
|
+
|
|
11713
12311
|
/**
|
|
11714
12312
|
* Content of a tool message. It is an array of tool result parts.
|
|
11715
12313
|
*/
|
|
@@ -11760,7 +12358,7 @@ export declare interface ToolExecutionOptions {
|
|
|
11760
12358
|
* - A tool call needs approval, or
|
|
11761
12359
|
* - A stop condition is met (default stop condition is stepCountIs(20))
|
|
11762
12360
|
*/
|
|
11763
|
-
declare class ToolLoopAgent<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends
|
|
12361
|
+
declare class ToolLoopAgent<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends OutputInterface = never> implements Agent<CALL_OPTIONS, TOOLS, OUTPUT> {
|
|
11764
12362
|
readonly version = "agent-v1";
|
|
11765
12363
|
private readonly settings;
|
|
11766
12364
|
constructor(settings: ToolLoopAgentSettings<CALL_OPTIONS, TOOLS, OUTPUT>);
|
|
@@ -11793,7 +12391,7 @@ export declare type ToolLoopAgentOnStepFinishCallback<TOOLS extends ToolSet = {}
|
|
|
11793
12391
|
/**
|
|
11794
12392
|
* Configuration options for an agent.
|
|
11795
12393
|
*/
|
|
11796
|
-
declare type ToolLoopAgentSettings<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends
|
|
12394
|
+
declare type ToolLoopAgentSettings<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends OutputInterface = never> = Omit<CallSettings, 'abortSignal'> & {
|
|
11797
12395
|
/**
|
|
11798
12396
|
* The id of the agent.
|
|
11799
12397
|
*/
|
|
@@ -11861,6 +12459,12 @@ declare type ToolLoopAgentSettings<CALL_OPTIONS = never, TOOLS extends ToolSet =
|
|
|
11861
12459
|
* Callback that is called when all steps are finished and the response is complete.
|
|
11862
12460
|
*/
|
|
11863
12461
|
onFinish?: ToolLoopAgentOnFinishCallback<NoInfer<TOOLS>>;
|
|
12462
|
+
/**
|
|
12463
|
+
* Secret for HMAC-signing tool approval requests. When set, the server
|
|
12464
|
+
* signs each approval request at issuance and verifies the signature when
|
|
12465
|
+
* the approval is replayed, preventing client-forged approvals.
|
|
12466
|
+
*/
|
|
12467
|
+
experimental_toolApprovalSecret?: string | Uint8Array;
|
|
11864
12468
|
/**
|
|
11865
12469
|
* Additional provider-specific options. They are passed through
|
|
11866
12470
|
* to the provider from the AI SDK and enable provider-specific
|
|
@@ -11900,7 +12504,7 @@ declare type ToolLoopAgentSettings<CALL_OPTIONS = never, TOOLS extends ToolSet =
|
|
|
11900
12504
|
* }),
|
|
11901
12505
|
* ```
|
|
11902
12506
|
*/
|
|
11903
|
-
prepareCall?: (options: Omit<AgentCallParameters<CALL_OPTIONS, NoInfer<TOOLS>>, 'onStepFinish'> & Pick<ToolLoopAgentSettings<CALL_OPTIONS, TOOLS, OUTPUT>, 'model' | 'tools' | 'maxOutputTokens' | 'temperature' | 'topP' | 'topK' | 'presencePenalty' | 'frequencyPenalty' | 'stopSequences' | 'seed' | 'headers' | 'instructions' | 'allowSystemInMessages' | 'stopWhen' | 'experimental_telemetry' | 'activeTools' | 'providerOptions' | 'experimental_context' | 'experimental_download'>) => MaybePromiseLike<Pick<ToolLoopAgentSettings<CALL_OPTIONS, TOOLS, OUTPUT>, 'model' | 'tools' | 'maxOutputTokens' | 'temperature' | 'topP' | 'topK' | 'presencePenalty' | 'frequencyPenalty' | 'stopSequences' | 'seed' | 'headers' | 'instructions' | 'allowSystemInMessages' | 'stopWhen' | 'experimental_telemetry' | 'activeTools' | 'providerOptions' | 'experimental_context' | 'experimental_download'> & Omit<Prompt, 'system'>>;
|
|
12507
|
+
prepareCall?: (options: Omit<AgentCallParameters<CALL_OPTIONS, NoInfer<TOOLS>>, 'onStepFinish'> & Pick<ToolLoopAgentSettings<CALL_OPTIONS, TOOLS, OUTPUT>, 'model' | 'tools' | 'maxOutputTokens' | 'temperature' | 'topP' | 'topK' | 'presencePenalty' | 'frequencyPenalty' | 'stopSequences' | 'seed' | 'headers' | 'instructions' | 'allowSystemInMessages' | 'stopWhen' | 'experimental_telemetry' | 'activeTools' | 'experimental_toolApprovalSecret' | 'providerOptions' | 'experimental_context' | 'experimental_download'>) => MaybePromiseLike<Pick<ToolLoopAgentSettings<CALL_OPTIONS, TOOLS, OUTPUT>, 'model' | 'tools' | 'maxOutputTokens' | 'temperature' | 'topP' | 'topK' | 'presencePenalty' | 'frequencyPenalty' | 'stopSequences' | 'seed' | 'timeout' | 'headers' | 'instructions' | 'allowSystemInMessages' | 'stopWhen' | 'experimental_telemetry' | 'activeTools' | 'experimental_toolApprovalSecret' | 'providerOptions' | 'experimental_context' | 'experimental_download'> & Omit<Prompt, 'system'>>;
|
|
11904
12508
|
};
|
|
11905
12509
|
export { ToolLoopAgentSettings as Experimental_AgentSettings }
|
|
11906
12510
|
export { ToolLoopAgentSettings }
|
|
@@ -12815,6 +13419,8 @@ export declare type UIMessageChunk<METADATA = unknown, DATA_TYPES extends UIData
|
|
|
12815
13419
|
type: 'tool-approval-request';
|
|
12816
13420
|
approvalId: string;
|
|
12817
13421
|
toolCallId: string;
|
|
13422
|
+
approvalDescriptor?: unknown;
|
|
13423
|
+
inputSchemaInput?: unknown;
|
|
12818
13424
|
signature?: string;
|
|
12819
13425
|
} | {
|
|
12820
13426
|
type: 'tool-output-available';
|
|
@@ -12840,6 +13446,8 @@ export declare type UIMessageChunk<METADATA = unknown, DATA_TYPES extends UIData
|
|
|
12840
13446
|
type: 'tool-input-start';
|
|
12841
13447
|
toolCallId: string;
|
|
12842
13448
|
toolName: string;
|
|
13449
|
+
/** Encoding of the input deltas. Defaults to JSON when omitted. */
|
|
13450
|
+
inputEncoding?: 'json' | 'text';
|
|
12843
13451
|
providerExecuted?: boolean;
|
|
12844
13452
|
providerMetadata?: ProviderMetadata;
|
|
12845
13453
|
toolMetadata?: JSONObject;
|
|
@@ -12933,6 +13541,11 @@ export declare type UIMessageStreamOnFinishCallback<UI_MESSAGE extends UIMessage
|
|
|
12933
13541
|
* Indicates whether the stream was aborted.
|
|
12934
13542
|
*/
|
|
12935
13543
|
isAborted: boolean;
|
|
13544
|
+
/**
|
|
13545
|
+
* The operation-level outcome of the stream. Fatal stream-processing
|
|
13546
|
+
* failures override outcomes declared by the stream owner.
|
|
13547
|
+
*/
|
|
13548
|
+
outcome: UIMessageStreamOutcome;
|
|
12936
13549
|
/**
|
|
12937
13550
|
* The message that was sent to the client as a response
|
|
12938
13551
|
* (including the original message if it was extended).
|
|
@@ -13014,16 +13627,45 @@ export declare type UIMessageStreamOptions<UI_MESSAGE extends UIMessage> = {
|
|
|
13014
13627
|
/**
|
|
13015
13628
|
* Process an error, e.g. to log it. Default to `() => 'An error occurred.'`.
|
|
13016
13629
|
*
|
|
13630
|
+
* Tool execution errors marked `providerExecuted: true` bypass this callback.
|
|
13631
|
+
* Their strings pass through unchanged; other values are JSON-stringified to
|
|
13632
|
+
* preserve provider error data for model-message round trips. Stream errors
|
|
13633
|
+
* and invalid tool calls still use it.
|
|
13634
|
+
*
|
|
13017
13635
|
* @returns error message to include in the data stream.
|
|
13018
13636
|
*/
|
|
13019
13637
|
onError?: (error: unknown) => string;
|
|
13020
13638
|
};
|
|
13021
13639
|
|
|
13640
|
+
/**
|
|
13641
|
+
* The operation-level outcome of a UI message stream.
|
|
13642
|
+
*
|
|
13643
|
+
* This is separate from model finish reasons and individual stream chunks.
|
|
13644
|
+
* Fatal stream-processing failures override outcomes declared by the stream
|
|
13645
|
+
* owner.
|
|
13646
|
+
*/
|
|
13647
|
+
export declare type UIMessageStreamOutcome = {
|
|
13648
|
+
status: 'completed';
|
|
13649
|
+
} | {
|
|
13650
|
+
status: 'failed';
|
|
13651
|
+
error?: unknown;
|
|
13652
|
+
} | {
|
|
13653
|
+
status: 'aborted';
|
|
13654
|
+
} | {
|
|
13655
|
+
status: 'unknown';
|
|
13656
|
+
};
|
|
13657
|
+
|
|
13022
13658
|
/**
|
|
13023
13659
|
* Options for creating a UI message stream response.
|
|
13024
13660
|
* Extends the standard `ResponseInit` with additional streaming options.
|
|
13025
13661
|
*/
|
|
13026
13662
|
declare type UIMessageStreamResponseInit = ResponseInit & {
|
|
13663
|
+
/**
|
|
13664
|
+
* Optional interval in milliseconds for sending SSE keep-alive comments.
|
|
13665
|
+
* When set, an opening comment is sent immediately and additional comments
|
|
13666
|
+
* are sent after the stream has been idle for the configured interval.
|
|
13667
|
+
*/
|
|
13668
|
+
keepAliveMs?: number;
|
|
13027
13669
|
/**
|
|
13028
13670
|
* Optional callback to consume a copy of the SSE stream independently.
|
|
13029
13671
|
* This is useful for logging, debugging, or processing the stream in parallel.
|
|
@@ -13051,6 +13693,18 @@ export declare interface UIMessageStreamWriter<UI_MESSAGE extends UIMessage = UI
|
|
|
13051
13693
|
onError: ErrorHandler | undefined;
|
|
13052
13694
|
}
|
|
13053
13695
|
|
|
13696
|
+
export declare interface UIMessageStreamWriterWithOutcome<UI_MESSAGE extends UIMessage = UIMessage> extends UIMessageStreamWriter<UI_MESSAGE> {
|
|
13697
|
+
/**
|
|
13698
|
+
* Declares the operation-level outcome of the composed stream.
|
|
13699
|
+
*
|
|
13700
|
+
* The first outcome declared through this method is retained. Fatal
|
|
13701
|
+
* execution, merge, error-handling, or downstream processing failures
|
|
13702
|
+
* override declared outcomes. Declaring an outcome does not write a chunk or
|
|
13703
|
+
* close the stream.
|
|
13704
|
+
*/
|
|
13705
|
+
setOutcome(outcome: UIMessageStreamOutcome): void;
|
|
13706
|
+
}
|
|
13707
|
+
|
|
13054
13708
|
export declare type UITool = {
|
|
13055
13709
|
input: unknown;
|
|
13056
13710
|
output: unknown | undefined;
|
|
@@ -13075,6 +13729,15 @@ export declare type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
13075
13729
|
} & ({
|
|
13076
13730
|
state: 'input-streaming';
|
|
13077
13731
|
input?: DeepPartial<asUITool<TOOL>['input']> | undefined;
|
|
13732
|
+
/**
|
|
13733
|
+
* The raw tool input text received so far.
|
|
13734
|
+
*
|
|
13735
|
+
* This is used to continue input streaming when a message is persisted
|
|
13736
|
+
* and later resumed.
|
|
13737
|
+
*/
|
|
13738
|
+
rawInput?: string;
|
|
13739
|
+
/** Encoding of `rawInput`. Defaults to JSON when omitted. */
|
|
13740
|
+
inputEncoding?: 'json' | 'text';
|
|
13078
13741
|
output?: never;
|
|
13079
13742
|
errorText?: never;
|
|
13080
13743
|
callProviderMetadata?: ProviderMetadata;
|
|
@@ -13095,8 +13758,10 @@ export declare type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
13095
13758
|
approval: {
|
|
13096
13759
|
id: string;
|
|
13097
13760
|
approved?: never;
|
|
13761
|
+
descriptor?: unknown;
|
|
13098
13762
|
reason?: never;
|
|
13099
13763
|
signature?: string;
|
|
13764
|
+
inputSchemaInput?: unknown;
|
|
13100
13765
|
};
|
|
13101
13766
|
} | {
|
|
13102
13767
|
state: 'approval-responded';
|
|
@@ -13107,8 +13772,10 @@ export declare type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
13107
13772
|
approval: {
|
|
13108
13773
|
id: string;
|
|
13109
13774
|
approved: boolean;
|
|
13775
|
+
descriptor?: unknown;
|
|
13110
13776
|
reason?: string;
|
|
13111
13777
|
signature?: string;
|
|
13778
|
+
inputSchemaInput?: unknown;
|
|
13112
13779
|
};
|
|
13113
13780
|
} | {
|
|
13114
13781
|
state: 'output-available';
|
|
@@ -13121,8 +13788,10 @@ export declare type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
13121
13788
|
approval?: {
|
|
13122
13789
|
id: string;
|
|
13123
13790
|
approved: true;
|
|
13791
|
+
descriptor?: unknown;
|
|
13124
13792
|
reason?: string;
|
|
13125
13793
|
signature?: string;
|
|
13794
|
+
inputSchemaInput?: unknown;
|
|
13126
13795
|
};
|
|
13127
13796
|
} | {
|
|
13128
13797
|
state: 'output-error';
|
|
@@ -13135,8 +13804,10 @@ export declare type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
13135
13804
|
approval?: {
|
|
13136
13805
|
id: string;
|
|
13137
13806
|
approved: true;
|
|
13807
|
+
descriptor?: unknown;
|
|
13138
13808
|
reason?: string;
|
|
13139
13809
|
signature?: string;
|
|
13810
|
+
inputSchemaInput?: unknown;
|
|
13140
13811
|
};
|
|
13141
13812
|
} | {
|
|
13142
13813
|
state: 'output-denied';
|
|
@@ -13147,8 +13818,10 @@ export declare type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
13147
13818
|
approval: {
|
|
13148
13819
|
id: string;
|
|
13149
13820
|
approved: false;
|
|
13821
|
+
descriptor?: unknown;
|
|
13150
13822
|
reason?: string;
|
|
13151
13823
|
signature?: string;
|
|
13824
|
+
inputSchemaInput?: unknown;
|
|
13152
13825
|
};
|
|
13153
13826
|
});
|
|
13154
13827
|
|
|
@@ -13296,7 +13969,9 @@ declare function validateTypes<OBJECT>({ value, schema, context, }: {
|
|
|
13296
13969
|
* the corresponding schemas are provided. Otherwise, they are assumed to be
|
|
13297
13970
|
* valid.
|
|
13298
13971
|
*/
|
|
13299
|
-
export declare function validateUIMessages<UI_MESSAGE extends UIMessage>(
|
|
13972
|
+
export declare function validateUIMessages<UI_MESSAGE extends UIMessage>(options: ValidateUIMessagesOptions<UI_MESSAGE>): Promise<Array<UI_MESSAGE>>;
|
|
13973
|
+
|
|
13974
|
+
declare type ValidateUIMessagesOptions<UI_MESSAGE extends UIMessage> = {
|
|
13300
13975
|
messages: unknown;
|
|
13301
13976
|
metadataSchema?: FlexibleSchema<UIMessage['metadata']>;
|
|
13302
13977
|
dataSchemas?: {
|
|
@@ -13305,7 +13980,7 @@ export declare function validateUIMessages<UI_MESSAGE extends UIMessage>({ messa
|
|
|
13305
13980
|
tools?: {
|
|
13306
13981
|
[NAME in keyof InferUIMessageTools<UI_MESSAGE> & string]?: Tool<InferUIMessageTools<UI_MESSAGE>[NAME]['input'], InferUIMessageTools<UI_MESSAGE>[NAME]['output']>;
|
|
13307
13982
|
};
|
|
13308
|
-
}
|
|
13983
|
+
};
|
|
13309
13984
|
|
|
13310
13985
|
declare type ValidationResult<OBJECT> = {
|
|
13311
13986
|
success: true;
|
|
@@ -13759,5 +14434,5 @@ export declare function zodSchema<OBJECT>(zodSchema: z4.core.$ZodType<OBJECT, an
|
|
|
13759
14434
|
}): Schema<OBJECT>;
|
|
13760
14435
|
|
|
13761
14436
|
export { }
|
|
13762
|
-
export { GatewayProviderSettings as GatewayProviderSettings, GatewayProvider as GatewayProvider, LazySchema as LazySchema, ZodSchema as ZodSchema, StandardSchema as StandardSchema, ValidationResult as ValidationResult, ParseResult as ParseResult, ProviderOptions as ProviderOptions, ReasoningPart as ReasoningPart, ToolOutputProperties as ToolOutputProperties, ToolResultOutput as ToolResultOutput, ToolNeedsApprovalFunction as ToolNeedsApprovalFunction, TypeValidationContext as TypeValidationContext, EmbeddingModelV2 as EmbeddingModelV2, EmbeddingModelV3Embedding as EmbeddingModelV3Embedding, EmbeddingModelV3Middleware as EmbeddingModelV3Middleware, ImageModelV2 as ImageModelV2, ImageModelV3ProviderMetadata as ImageModelV3ProviderMetadata, ImageModelV2ProviderMetadata as ImageModelV2ProviderMetadata, ImageModelV3Middleware as ImageModelV3Middleware, GlobalProviderModelId as GlobalProviderModelId, LanguageModelV2 as LanguageModelV2, SharedV3Warning as SharedV3Warning, LanguageModelV3Middleware as LanguageModelV3Middleware, SharedV3ProviderMetadata as SharedV3ProviderMetadata, SpeechModelV2 as SpeechModelV2, TranscriptionModelV2 as TranscriptionModelV2, ImageModelV3Usage as ImageModelV3Usage, DeepPartialInternal as DeepPartialInternal, AttributeValue as AttributeValue, Tracer as Tracer, BaseToolCall as BaseToolCall, Source as Source, PrepareStepCallSettings as PrepareStepCallSettings, ResponseMessage as ResponseMessage, LanguageModelV3ToolCall as LanguageModelV3ToolCall, GenerateTextIncludeSettings as GenerateTextIncludeSettings, ValueOf as ValueOf, asUITool as asUITool, _ai_sdk_provider_utils as _ai_sdk_provider_utils, DataUIMessageChunk as DataUIMessageChunk, InferElementOutput as InferElementOutput, ConsumeStreamOptions as ConsumeStreamOptions, StreamTextIncludeSettings as StreamTextIncludeSettings, StreamTextOnAbortCallback as StreamTextOnAbortCallback, CallbackModelInfo as CallbackModelInfo, LanguageModelV3ToolChoice as LanguageModelV3ToolChoice, Listener as Listener, MaybePromiseLike as MaybePromiseLike,
|
|
13763
|
-
export { EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL, EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER, schemaSymbol, symbol$1, symbol$1_2, symbol$2, symbol$2_2, symbol$3, symbol$3_2, symbol$4, symbol$4_2, symbol$5, symbol$5_2, symbol$6, symbol$6_2, symbol$7, symbol$7_2, symbol$8, symbol$8_2, symbol$9, symbol$9_2, symbol$a, symbol$b, symbol$b_2, symbol$c, symbol$c_2, symbol$d, symbol$d_2, symbol$e, symbol$f, symbol$g, symbol$h, symbol$i, symbol$j, symbol$k, symbol, symbol_2, symbol_3 };
|
|
14437
|
+
export { GatewayProviderSettings as GatewayProviderSettings, GatewayProvider as GatewayProvider, LazySchema as LazySchema, ZodSchema as ZodSchema, StandardSchema as StandardSchema, ValidationResult as ValidationResult, ParseResult as ParseResult, ProviderOptions as ProviderOptions, ReasoningPart as ReasoningPart, ToolOutputProperties as ToolOutputProperties, ToolResultOutput as ToolResultOutput, ToolNeedsApprovalFunction as ToolNeedsApprovalFunction, TypeValidationContext as TypeValidationContext, EmbeddingModelV2 as EmbeddingModelV2, EmbeddingModelV3Embedding as EmbeddingModelV3Embedding, EmbeddingModelV3Middleware as EmbeddingModelV3Middleware, ImageModelV2 as ImageModelV2, ImageModelV3ProviderMetadata as ImageModelV3ProviderMetadata, ImageModelV2ProviderMetadata as ImageModelV2ProviderMetadata, ImageModelV3Middleware as ImageModelV3Middleware, GlobalProviderModelId as GlobalProviderModelId, LanguageModelV2 as LanguageModelV2, SharedV3Warning as SharedV3Warning, LanguageModelV3Middleware as LanguageModelV3Middleware, SharedV3ProviderMetadata as SharedV3ProviderMetadata, SpeechModelV2 as SpeechModelV2, TranscriptionModelV2 as TranscriptionModelV2, ImageModelV3Usage as ImageModelV3Usage, DeepPartialInternal as DeepPartialInternal, AttributeValue as AttributeValue, Tracer as Tracer, BaseToolCall as BaseToolCall, Source as Source, PrepareStepCallSettings as PrepareStepCallSettings, ResponseMessage as ResponseMessage, LanguageModelV3ToolCall as LanguageModelV3ToolCall, GenerateTextIncludeSettings as GenerateTextIncludeSettings, ValueOf as ValueOf, asUITool as asUITool, _ai_sdk_provider_utils as _ai_sdk_provider_utils, DataUIMessageChunk as DataUIMessageChunk, InferElementOutput as InferElementOutput, ConsumeStreamOptions as ConsumeStreamOptions, StreamTextIncludeSettings as StreamTextIncludeSettings, StreamTextOnAbortCallback as StreamTextOnAbortCallback, EnrichedStreamPart as EnrichedStreamPart, CallbackModelInfo as CallbackModelInfo, LanguageModelV3ToolChoice as LanguageModelV3ToolChoice, Listener as Listener, MaybePromiseLike as MaybePromiseLike, InferAgentTools as InferAgentTools, UIMessageStreamResponseInit as UIMessageStreamResponseInit, getOriginalFetch as getOriginalFetch, InferUIMessageTools as InferUIMessageTools, InferUIMessageToolCall as InferUIMessageToolCall, UIDataTypesToSchemas as UIDataTypesToSchemas, InferUIMessageData as InferUIMessageData, InferUIMessageMetadata as InferUIMessageMetadata, Resolvable as Resolvable, FetchFunction as FetchFunction, ValidateUIMessagesOptions as ValidateUIMessagesOptions, SingleRequestTextStreamPart as SingleRequestTextStreamPart, EnforcedToolChoice as EnforcedToolChoice, LanguageModelV3Content as LanguageModelV3Content, RetryErrorReason_2 as RetryErrorReason_2, GenerateImagePrompt as GenerateImagePrompt, JSONValue_2 as JSONValue_2, Job as Job, StreamObjectOnErrorCallback as StreamObjectOnErrorCallback, VideoModelResponseMetadata as VideoModelResponseMetadata, VideoModelProviderMetadata as VideoModelProviderMetadata, VideoModel as VideoModel, VideoModelV3FrameType as VideoModelV3FrameType, EmbeddingModelV3CallOptions as EmbeddingModelV3CallOptions, LanguageModelV3CallOptions as LanguageModelV3CallOptions, JSONObject as JSONObject, LanguageModelV3 as LanguageModelV3, EmbeddingModelV3 as EmbeddingModelV3, ImageModelV3 as ImageModelV3, TranscriptionModelV3 as TranscriptionModelV3, SpeechModelV3 as SpeechModelV3, RerankingModelV3 as RerankingModelV3, VideoModelV3 as VideoModelV3, ProviderV2 as ProviderV2, ExtractModelId as ExtractModelId, ExtractLiteralUnion as ExtractLiteralUnion, ProviderV3 as ProviderV3 };
|
|
14438
|
+
export { EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL, EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER, schemaSymbol, symbol$1, symbol$1_2, symbol$2, symbol$2_2, symbol$3, symbol$3_2, symbol$4, symbol$4_2, symbol$5, symbol$5_2, symbol$6, symbol$6_2, symbol$7, symbol$7_2, symbol$8, symbol$8_2, symbol$9, symbol$9_2, symbol$a, symbol$b, symbol$b_2, symbol$c, symbol$c_2, symbol$d, symbol$d_2, symbol$e, symbol$f, symbol$g, symbol$h, symbol$i, symbol$j, symbol$k, symbol$l, symbol, symbol_2, symbol_3 };
|