create-mf2-app
Version:
The stack AI moves fast with.
1,396 lines (1,390 loc) • 123 kB
TypeScript
/* eslint-disable */
/**
* Generated `api` utility.
*
* THIS CODE IS AUTOMATICALLY GENERATED.
*
* To regenerate, run `npx convex dev`.
* @module
*/
import type * as agents_fashion from "../agents/fashion.js";
import type * as agents_simple from "../agents/simple.js";
import type * as agents_story from "../agents/story.js";
import type * as agents_weather from "../agents/weather.js";
import type * as auth_config from "../auth/config.js";
import type * as auth_users from "../auth/users.js";
import type * as chat_basic from "../chat/basic.js";
import type * as chat_human from "../chat/human.js";
import type * as chat_streamAbort from "../chat/streamAbort.js";
import type * as chat_streaming from "../chat/streaming.js";
import type * as crons from "../crons.js";
import type * as debugging_rawRequestResponseHandler from "../debugging/rawRequestResponseHandler.js";
import type * as email_actions from "../email/actions.js";
import type * as email_events from "../email/events.js";
import type * as email_utils from "../email/utils.js";
import type * as files_addFile from "../files/addFile.js";
import type * as files_autoSave from "../files/autoSave.js";
import type * as files_generateImage from "../files/generateImage.js";
import type * as files_vacuum from "../files/vacuum.js";
import type * as http from "../http.js";
import type * as models from "../models.js";
import type * as payments_cleanup from "../payments/cleanup.js";
import type * as payments_polar from "../payments/polar.js";
import type * as playground from "../playground.js";
import type * as rag_ragAsPrompt from "../rag/ragAsPrompt.js";
import type * as rag_ragAsTools from "../rag/ragAsTools.js";
import type * as rag_tables from "../rag/tables.js";
import type * as rag_utils from "../rag/utils.js";
import type * as rate_limiting_rateLimiting from "../rate_limiting/rateLimiting.js";
import type * as rate_limiting_tables from "../rate_limiting/tables.js";
import type * as rate_limiting_utils from "../rate_limiting/utils.js";
import type * as threads from "../threads.js";
import type * as tools_agentAsTool from "../tools/agentAsTool.js";
import type * as tools_searchMessages from "../tools/searchMessages.js";
import type * as tools_updateThreadTitle from "../tools/updateThreadTitle.js";
import type * as tools_weather from "../tools/weather.js";
import type * as usage_tracking_invoicing from "../usage_tracking/invoicing.js";
import type * as usage_tracking_tables from "../usage_tracking/tables.js";
import type * as usage_tracking_usageHandler from "../usage_tracking/usageHandler.js";
import type * as utils from "../utils.js";
import type * as waitlist_index from "../waitlist/index.js";
import type * as waitlist_tables from "../waitlist/tables.js";
import type * as workflows_chaining from "../workflows/chaining.js";
import type {
ApiFromModules,
FilterApi,
FunctionReference,
} from "convex/server";
/**
* A utility for referencing Convex functions in your app's API.
*
* Usage:
* ```js
* const myFunctionReference = api.myModule.myFunction;
* ```
*/
declare const fullApi: ApiFromModules<{
"agents/fashion": typeof agents_fashion;
"agents/simple": typeof agents_simple;
"agents/story": typeof agents_story;
"agents/weather": typeof agents_weather;
"auth/config": typeof auth_config;
"auth/users": typeof auth_users;
"chat/basic": typeof chat_basic;
"chat/human": typeof chat_human;
"chat/streamAbort": typeof chat_streamAbort;
"chat/streaming": typeof chat_streaming;
crons: typeof crons;
"debugging/rawRequestResponseHandler": typeof debugging_rawRequestResponseHandler;
"email/actions": typeof email_actions;
"email/events": typeof email_events;
"email/utils": typeof email_utils;
"files/addFile": typeof files_addFile;
"files/autoSave": typeof files_autoSave;
"files/generateImage": typeof files_generateImage;
"files/vacuum": typeof files_vacuum;
http: typeof http;
models: typeof models;
"payments/cleanup": typeof payments_cleanup;
"payments/polar": typeof payments_polar;
playground: typeof playground;
"rag/ragAsPrompt": typeof rag_ragAsPrompt;
"rag/ragAsTools": typeof rag_ragAsTools;
"rag/tables": typeof rag_tables;
"rag/utils": typeof rag_utils;
"rate_limiting/rateLimiting": typeof rate_limiting_rateLimiting;
"rate_limiting/tables": typeof rate_limiting_tables;
"rate_limiting/utils": typeof rate_limiting_utils;
threads: typeof threads;
"tools/agentAsTool": typeof tools_agentAsTool;
"tools/searchMessages": typeof tools_searchMessages;
"tools/updateThreadTitle": typeof tools_updateThreadTitle;
"tools/weather": typeof tools_weather;
"usage_tracking/invoicing": typeof usage_tracking_invoicing;
"usage_tracking/tables": typeof usage_tracking_tables;
"usage_tracking/usageHandler": typeof usage_tracking_usageHandler;
utils: typeof utils;
"waitlist/index": typeof waitlist_index;
"waitlist/tables": typeof waitlist_tables;
"workflows/chaining": typeof workflows_chaining;
}>;
declare const fullApiWithMounts: typeof fullApi;
export declare const api: FilterApi<
typeof fullApiWithMounts,
FunctionReference<any, "public">
>;
export declare const internal: FilterApi<
typeof fullApiWithMounts,
FunctionReference<any, "internal">
>;
export declare const components: {
agent: {
apiKeys: {
destroy: FunctionReference<
"mutation",
"internal",
{ apiKey?: string; name?: string },
| "missing"
| "deleted"
| "name mismatch"
| "must provide either apiKey or name"
>;
issue: FunctionReference<
"mutation",
"internal",
{ name?: string },
string
>;
validate: FunctionReference<
"query",
"internal",
{ apiKey: string },
boolean
>;
};
files: {
addFile: FunctionReference<
"mutation",
"internal",
{
filename?: string;
hash: string;
mimeType: string;
storageId: string;
},
{ fileId: string; storageId: string }
>;
copyFile: FunctionReference<
"mutation",
"internal",
{ fileId: string },
null
>;
deleteFiles: FunctionReference<
"mutation",
"internal",
{ fileIds: Array<string>; force?: boolean },
Array<string>
>;
get: FunctionReference<
"query",
"internal",
{ fileId: string },
null | {
_creationTime: number;
_id: string;
filename?: string;
hash: string;
lastTouchedAt: number;
mimeType: string;
refcount: number;
storageId: string;
}
>;
getFilesToDelete: FunctionReference<
"query",
"internal",
{
paginationOpts: {
cursor: string | null;
endCursor?: string | null;
id?: number;
maximumBytesRead?: number;
maximumRowsRead?: number;
numItems: number;
};
},
{
continueCursor: string;
isDone: boolean;
page: Array<{
_creationTime: number;
_id: string;
filename?: string;
hash: string;
lastTouchedAt: number;
mimeType: string;
refcount: number;
storageId: string;
}>;
}
>;
useExistingFile: FunctionReference<
"mutation",
"internal",
{ filename?: string; hash: string },
null | { fileId: string; storageId: string }
>;
};
messages: {
addMessages: FunctionReference<
"mutation",
"internal",
{
agentName?: string;
embeddings?: {
dimension:
| 128
| 256
| 512
| 768
| 1024
| 1408
| 1536
| 2048
| 3072
| 4096;
model: string;
vectors: Array<Array<number> | null>;
};
failPendingSteps?: boolean;
messages: Array<{
error?: string;
fileIds?: Array<string>;
finishReason?:
| "stop"
| "length"
| "content-filter"
| "tool-calls"
| "error"
| "other"
| "unknown";
id?: string;
message:
| {
content:
| string
| Array<
| {
providerOptions?: Record<
string,
Record<string, any>
>;
text: string;
type: "text";
}
| {
image: string | ArrayBuffer;
mimeType?: string;
providerOptions?: Record<
string,
Record<string, any>
>;
type: "image";
}
| {
data: string | ArrayBuffer;
filename?: string;
mimeType: string;
providerOptions?: Record<
string,
Record<string, any>
>;
type: "file";
}
>;
providerOptions?: Record<string, Record<string, any>>;
role: "user";
}
| {
content:
| string
| Array<
| {
providerOptions?: Record<
string,
Record<string, any>
>;
text: string;
type: "text";
}
| {
data: string | ArrayBuffer;
filename?: string;
mimeType: string;
providerOptions?: Record<
string,
Record<string, any>
>;
type: "file";
}
| {
providerOptions?: Record<
string,
Record<string, any>
>;
signature?: string;
text: string;
type: "reasoning";
}
| {
data: string;
providerOptions?: Record<
string,
Record<string, any>
>;
type: "redacted-reasoning";
}
| {
args: any;
providerOptions?: Record<
string,
Record<string, any>
>;
toolCallId: string;
toolName: string;
type: "tool-call";
}
>;
providerOptions?: Record<string, Record<string, any>>;
role: "assistant";
}
| {
content: Array<{
args?: any;
experimental_content?: Array<
| { text: string; type: "text" }
| { data: string; mimeType?: string; type: "image" }
>;
isError?: boolean;
providerOptions?: Record<string, Record<string, any>>;
result: any;
toolCallId: string;
toolName: string;
type: "tool-result";
}>;
providerOptions?: Record<string, Record<string, any>>;
role: "tool";
}
| {
content: string;
providerOptions?: Record<string, Record<string, any>>;
role: "system";
};
model?: string;
provider?: string;
providerMetadata?: Record<string, Record<string, any>>;
reasoning?: string;
reasoningDetails?: Array<
| { signature?: string; text: string; type: "text" }
| { data: string; type: "redacted" }
>;
sources?: Array<{
id: string;
providerOptions?: Record<string, Record<string, any>>;
sourceType: "url";
title?: string;
url: string;
}>;
text?: string;
usage?: {
completionTokens: number;
promptTokens: number;
totalTokens: number;
};
warnings?: Array<
| {
details?: string;
setting: string;
type: "unsupported-setting";
}
| { details?: string; tool: any; type: "unsupported-tool" }
| { message: string; type: "other" }
>;
}>;
pending?: boolean;
promptMessageId?: string;
threadId: string;
userId?: string;
},
{
messages: Array<{
_creationTime: number;
_id: string;
agentName?: string;
embeddingId?: string;
error?: string;
fileIds?: Array<string>;
finishReason?:
| "stop"
| "length"
| "content-filter"
| "tool-calls"
| "error"
| "other"
| "unknown";
id?: string;
message?:
| {
content:
| string
| Array<
| {
providerOptions?: Record<
string,
Record<string, any>
>;
text: string;
type: "text";
}
| {
image: string | ArrayBuffer;
mimeType?: string;
providerOptions?: Record<
string,
Record<string, any>
>;
type: "image";
}
| {
data: string | ArrayBuffer;
filename?: string;
mimeType: string;
providerOptions?: Record<
string,
Record<string, any>
>;
type: "file";
}
>;
providerOptions?: Record<string, Record<string, any>>;
role: "user";
}
| {
content:
| string
| Array<
| {
providerOptions?: Record<
string,
Record<string, any>
>;
text: string;
type: "text";
}
| {
data: string | ArrayBuffer;
filename?: string;
mimeType: string;
providerOptions?: Record<
string,
Record<string, any>
>;
type: "file";
}
| {
providerOptions?: Record<
string,
Record<string, any>
>;
signature?: string;
text: string;
type: "reasoning";
}
| {
data: string;
providerOptions?: Record<
string,
Record<string, any>
>;
type: "redacted-reasoning";
}
| {
args: any;
providerOptions?: Record<
string,
Record<string, any>
>;
toolCallId: string;
toolName: string;
type: "tool-call";
}
>;
providerOptions?: Record<string, Record<string, any>>;
role: "assistant";
}
| {
content: Array<{
args?: any;
experimental_content?: Array<
| { text: string; type: "text" }
| { data: string; mimeType?: string; type: "image" }
>;
isError?: boolean;
providerOptions?: Record<string, Record<string, any>>;
result: any;
toolCallId: string;
toolName: string;
type: "tool-result";
}>;
providerOptions?: Record<string, Record<string, any>>;
role: "tool";
}
| {
content: string;
providerOptions?: Record<string, Record<string, any>>;
role: "system";
};
model?: string;
order: number;
provider?: string;
providerMetadata?: Record<string, Record<string, any>>;
providerOptions?: Record<string, Record<string, any>>;
reasoning?: string;
reasoningDetails?: Array<
| { signature?: string; text: string; type: "text" }
| { data: string; type: "redacted" }
>;
sources?: Array<{
id: string;
providerOptions?: Record<string, Record<string, any>>;
sourceType: "url";
title?: string;
url: string;
}>;
status: "pending" | "success" | "failed";
stepOrder: number;
text?: string;
threadId: string;
tool: boolean;
usage?: {
completionTokens: number;
promptTokens: number;
totalTokens: number;
};
userId?: string;
warnings?: Array<
| {
details?: string;
setting: string;
type: "unsupported-setting";
}
| { details?: string; tool: any; type: "unsupported-tool" }
| { message: string; type: "other" }
>;
}>;
}
>;
commitMessage: FunctionReference<
"mutation",
"internal",
{ messageId: string },
null
>;
deleteByIds: FunctionReference<
"mutation",
"internal",
{ messageIds: Array<string> },
Array<string>
>;
deleteByOrder: FunctionReference<
"mutation",
"internal",
{
endOrder: number;
endStepOrder?: number;
startOrder: number;
startStepOrder?: number;
threadId: string;
},
{ isDone: boolean; lastOrder?: number; lastStepOrder?: number }
>;
getMessagesByIds: FunctionReference<
"query",
"internal",
{ messageIds: Array<string> },
Array<null | {
_creationTime: number;
_id: string;
agentName?: string;
embeddingId?: string;
error?: string;
fileIds?: Array<string>;
finishReason?:
| "stop"
| "length"
| "content-filter"
| "tool-calls"
| "error"
| "other"
| "unknown";
id?: string;
message?:
| {
content:
| string
| Array<
| {
providerOptions?: Record<string, Record<string, any>>;
text: string;
type: "text";
}
| {
image: string | ArrayBuffer;
mimeType?: string;
providerOptions?: Record<string, Record<string, any>>;
type: "image";
}
| {
data: string | ArrayBuffer;
filename?: string;
mimeType: string;
providerOptions?: Record<string, Record<string, any>>;
type: "file";
}
>;
providerOptions?: Record<string, Record<string, any>>;
role: "user";
}
| {
content:
| string
| Array<
| {
providerOptions?: Record<string, Record<string, any>>;
text: string;
type: "text";
}
| {
data: string | ArrayBuffer;
filename?: string;
mimeType: string;
providerOptions?: Record<string, Record<string, any>>;
type: "file";
}
| {
providerOptions?: Record<string, Record<string, any>>;
signature?: string;
text: string;
type: "reasoning";
}
| {
data: string;
providerOptions?: Record<string, Record<string, any>>;
type: "redacted-reasoning";
}
| {
args: any;
providerOptions?: Record<string, Record<string, any>>;
toolCallId: string;
toolName: string;
type: "tool-call";
}
>;
providerOptions?: Record<string, Record<string, any>>;
role: "assistant";
}
| {
content: Array<{
args?: any;
experimental_content?: Array<
| { text: string; type: "text" }
| { data: string; mimeType?: string; type: "image" }
>;
isError?: boolean;
providerOptions?: Record<string, Record<string, any>>;
result: any;
toolCallId: string;
toolName: string;
type: "tool-result";
}>;
providerOptions?: Record<string, Record<string, any>>;
role: "tool";
}
| {
content: string;
providerOptions?: Record<string, Record<string, any>>;
role: "system";
};
model?: string;
order: number;
provider?: string;
providerMetadata?: Record<string, Record<string, any>>;
providerOptions?: Record<string, Record<string, any>>;
reasoning?: string;
reasoningDetails?: Array<
| { signature?: string; text: string; type: "text" }
| { data: string; type: "redacted" }
>;
sources?: Array<{
id: string;
providerOptions?: Record<string, Record<string, any>>;
sourceType: "url";
title?: string;
url: string;
}>;
status: "pending" | "success" | "failed";
stepOrder: number;
text?: string;
threadId: string;
tool: boolean;
usage?: {
completionTokens: number;
promptTokens: number;
totalTokens: number;
};
userId?: string;
warnings?: Array<
| { details?: string; setting: string; type: "unsupported-setting" }
| { details?: string; tool: any; type: "unsupported-tool" }
| { message: string; type: "other" }
>;
}>
>;
getThreadMessages: FunctionReference<
"query",
"internal",
{ deprecated: "Use listMessagesByThreadId instead" },
{
continueCursor: string;
isDone: boolean;
page: Array<{
_creationTime: number;
_id: string;
agentName?: string;
embeddingId?: string;
error?: string;
fileIds?: Array<string>;
finishReason?:
| "stop"
| "length"
| "content-filter"
| "tool-calls"
| "error"
| "other"
| "unknown";
id?: string;
message?:
| {
content:
| string
| Array<
| {
providerOptions?: Record<
string,
Record<string, any>
>;
text: string;
type: "text";
}
| {
image: string | ArrayBuffer;
mimeType?: string;
providerOptions?: Record<
string,
Record<string, any>
>;
type: "image";
}
| {
data: string | ArrayBuffer;
filename?: string;
mimeType: string;
providerOptions?: Record<
string,
Record<string, any>
>;
type: "file";
}
>;
providerOptions?: Record<string, Record<string, any>>;
role: "user";
}
| {
content:
| string
| Array<
| {
providerOptions?: Record<
string,
Record<string, any>
>;
text: string;
type: "text";
}
| {
data: string | ArrayBuffer;
filename?: string;
mimeType: string;
providerOptions?: Record<
string,
Record<string, any>
>;
type: "file";
}
| {
providerOptions?: Record<
string,
Record<string, any>
>;
signature?: string;
text: string;
type: "reasoning";
}
| {
data: string;
providerOptions?: Record<
string,
Record<string, any>
>;
type: "redacted-reasoning";
}
| {
args: any;
providerOptions?: Record<
string,
Record<string, any>
>;
toolCallId: string;
toolName: string;
type: "tool-call";
}
>;
providerOptions?: Record<string, Record<string, any>>;
role: "assistant";
}
| {
content: Array<{
args?: any;
experimental_content?: Array<
| { text: string; type: "text" }
| { data: string; mimeType?: string; type: "image" }
>;
isError?: boolean;
providerOptions?: Record<string, Record<string, any>>;
result: any;
toolCallId: string;
toolName: string;
type: "tool-result";
}>;
providerOptions?: Record<string, Record<string, any>>;
role: "tool";
}
| {
content: string;
providerOptions?: Record<string, Record<string, any>>;
role: "system";
};
model?: string;
order: number;
provider?: string;
providerMetadata?: Record<string, Record<string, any>>;
providerOptions?: Record<string, Record<string, any>>;
reasoning?: string;
reasoningDetails?: Array<
| { signature?: string; text: string; type: "text" }
| { data: string; type: "redacted" }
>;
sources?: Array<{
id: string;
providerOptions?: Record<string, Record<string, any>>;
sourceType: "url";
title?: string;
url: string;
}>;
status: "pending" | "success" | "failed";
stepOrder: number;
text?: string;
threadId: string;
tool: boolean;
usage?: {
completionTokens: number;
promptTokens: number;
totalTokens: number;
};
userId?: string;
warnings?: Array<
| {
details?: string;
setting: string;
type: "unsupported-setting";
}
| { details?: string; tool: any; type: "unsupported-tool" }
| { message: string; type: "other" }
>;
}>;
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
splitCursor?: string | null;
}
>;
listMessagesByThreadId: FunctionReference<
"query",
"internal",
{
excludeToolMessages?: boolean;
isTool?: "use excludeToolMessages instead of this";
order: "asc" | "desc";
paginationOpts?: {
cursor: string | null;
endCursor?: string | null;
id?: number;
maximumBytesRead?: number;
maximumRowsRead?: number;
numItems: number;
};
statuses?: Array<"pending" | "success" | "failed">;
threadId: string;
upToAndIncludingMessageId?: string;
},
{
continueCursor: string;
isDone: boolean;
page: Array<{
_creationTime: number;
_id: string;
agentName?: string;
embeddingId?: string;
error?: string;
fileIds?: Array<string>;
finishReason?:
| "stop"
| "length"
| "content-filter"
| "tool-calls"
| "error"
| "other"
| "unknown";
id?: string;
message?:
| {
content:
| string
| Array<
| {
providerOptions?: Record<
string,
Record<string, any>
>;
text: string;
type: "text";
}
| {
image: string | ArrayBuffer;
mimeType?: string;
providerOptions?: Record<
string,
Record<string, any>
>;
type: "image";
}
| {
data: string | ArrayBuffer;
filename?: string;
mimeType: string;
providerOptions?: Record<
string,
Record<string, any>
>;
type: "file";
}
>;
providerOptions?: Record<string, Record<string, any>>;
role: "user";
}
| {
content:
| string
| Array<
| {
providerOptions?: Record<
string,
Record<string, any>
>;
text: string;
type: "text";
}
| {
data: string | ArrayBuffer;
filename?: string;
mimeType: string;
providerOptions?: Record<
string,
Record<string, any>
>;
type: "file";
}
| {
providerOptions?: Record<
string,
Record<string, any>
>;
signature?: string;
text: string;
type: "reasoning";
}
| {
data: string;
providerOptions?: Record<
string,
Record<string, any>
>;
type: "redacted-reasoning";
}
| {
args: any;
providerOptions?: Record<
string,
Record<string, any>
>;
toolCallId: string;
toolName: string;
type: "tool-call";
}
>;
providerOptions?: Record<string, Record<string, any>>;
role: "assistant";
}
| {
content: Array<{
args?: any;
experimental_content?: Array<
| { text: string; type: "text" }
| { data: string; mimeType?: string; type: "image" }
>;
isError?: boolean;
providerOptions?: Record<string, Record<string, any>>;
result: any;
toolCallId: string;
toolName: string;
type: "tool-result";
}>;
providerOptions?: Record<string, Record<string, any>>;
role: "tool";
}
| {
content: string;
providerOptions?: Record<string, Record<string, any>>;
role: "system";
};
model?: string;
order: number;
provider?: string;
providerMetadata?: Record<string, Record<string, any>>;
providerOptions?: Record<string, Record<string, any>>;
reasoning?: string;
reasoningDetails?: Array<
| { signature?: string; text: string; type: "text" }
| { data: string; type: "redacted" }
>;
sources?: Array<{
id: string;
providerOptions?: Record<string, Record<string, any>>;
sourceType: "url";
title?: string;
url: string;
}>;
status: "pending" | "success" | "failed";
stepOrder: number;
text?: string;
threadId: string;
tool: boolean;
usage?: {
completionTokens: number;
promptTokens: number;
totalTokens: number;
};
userId?: string;
warnings?: Array<
| {
details?: string;
setting: string;
type: "unsupported-setting";
}
| { details?: string; tool: any; type: "unsupported-tool" }
| { message: string; type: "other" }
>;
}>;
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
splitCursor?: string | null;
}
>;
rollbackMessage: FunctionReference<
"mutation",
"internal",
{ error?: string; messageId: string },
null
>;
searchMessages: FunctionReference<
"action",
"internal",
{
beforeMessageId?: string;
embedding?: Array<number>;
embeddingModel?: string;
limit: number;
messageRange?: { after: number; before: number };
searchAllMessagesForUserId?: string;
text?: string;
threadId?: string;
vectorScoreThreshold?: number;
},
Array<{
_creationTime: number;
_id: string;
agentName?: string;
embeddingId?: string;
error?: string;
fileIds?: Array<string>;
finishReason?:
| "stop"
| "length"
| "content-filter"
| "tool-calls"
| "error"
| "other"
| "unknown";
id?: string;
message?:
| {
content:
| string
| Array<
| {
providerOptions?: Record<string, Record<string, any>>;
text: string;
type: "text";
}
| {
image: string | ArrayBuffer;
mimeType?: string;
providerOptions?: Record<string, Record<string, any>>;
type: "image";
}
| {
data: string | ArrayBuffer;
filename?: string;
mimeType: string;
providerOptions?: Record<string, Record<string, any>>;
type: "file";
}
>;
providerOptions?: Record<string, Record<string, any>>;
role: "user";
}
| {
content:
| string
| Array<
| {
providerOptions?: Record<string, Record<string, any>>;
text: string;
type: "text";
}
| {
data: string | ArrayBuffer;
filename?: string;
mimeType: string;
providerOptions?: Record<string, Record<string, any>>;
type: "file";
}
| {
providerOptions?: Record<string, Record<string, any>>;
signature?: string;
text: string;
type: "reasoning";
}
| {
data: string;
providerOptions?: Record<string, Record<string, any>>;
type: "redacted-reasoning";
}
| {
args: any;
providerOptions?: Record<string, Record<string, any>>;
toolCallId: string;
toolName: string;
type: "tool-call";
}
>;
providerOptions?: Record<string, Record<string, any>>;
role: "assistant";
}
| {
content: Array<{
args?: any;
experimental_content?: Array<
| { text: string; type: "text" }
| { data: string; mimeType?: string; type: "image" }
>;
isError?: boolean;
providerOptions?: Record<string, Record<string, any>>;
result: any;
toolCallId: string;
toolName: string;
type: "tool-result";
}>;
providerOptions?: Record<string, Record<string, any>>;
role: "tool";
}
| {
content: string;
providerOptions?: Record<string, Record<string, any>>;
role: "system";
};
model?: string;
order: number;
provider?: string;
providerMetadata?: Record<string, Record<string, any>>;
providerOptions?: Record<string, Record<string, any>>;
reasoning?: string;
reasoningDetails?: Array<
| { signature?: string; text: string; type: "text" }
| { data: string; type: "redacted" }
>;
sources?: Array<{
id: string;
providerOptions?: Record<string, Record<string, any>>;
sourceType: "url";
title?: string;
url: string;
}>;
status: "pending" | "success" | "failed";
stepOrder: number;
text?: string;
threadId: string;
tool: boolean;
usage?: {
completionTokens: number;
promptTokens: number;
totalTokens: number;
};
userId?: string;
warnings?: Array<
| { details?: string; setting: string; type: "unsupported-setting" }
| { details?: string; tool: any; type: "unsupported-tool" }
| { message: string; type: "other" }
>;
}>
>;
textSearch: FunctionReference<
"query",
"internal",
{
beforeMessageId?: string;
limit: number;
searchAllMessagesForUserId?: string;
text: string;
threadId?: string;
},
Array<{
_creationTime: number;
_id: string;
agentName?: string;
embeddingId?: string;
error?: string;
fileIds?: Array<string>;
finishReason?:
| "stop"
| "length"
| "content-filter"
| "tool-calls"
| "error"
| "other"
| "unknown";
id?: string;
message?:
| {
content:
| string
| Array<
| {
providerOptions?: Record<string, Record<string, any>>;
text: string;
type: "text";
}
| {
image: string | ArrayBuffer;
mimeType?: string;
providerOptions?: Record<string, Record<string, any>>;
type: "image";
}
| {
data: string | ArrayBuffer;
filename?: string;
mimeType: string;
providerOptions?: Record<string, Record<string, any>>;
type: "file";
}
>;
providerOptions?: Record<string, Record<string, any>>;
role: "user";
}
| {
content:
| string
| Array<
| {
providerOptions?: Record<string, Record<string, any>>;
text: string;
type: "text";
}
| {
data: string | ArrayBuffer;
filename?: string;
mimeType: string;
providerOptions?: Record<string, Record<string, any>>;
type: "file";
}
| {
providerOptions?: Record<string, Record<string, any>>;
signature?: string;
text: string;
type: "reasoning";
}
| {
data: string;
providerOptions?: Record<string, Record<string, any>>;
type: "redacted-reasoning";
}
| {
args: any;
providerOptions?: Record<string, Record<string, any>>;
toolCallId: string;
toolName: string;
type: "tool-call";
}
>;
providerOptions?: Record<string, Record<string, any>>;
role: "assistant";
}
| {
content: Array<{
args?: any;
experimental_content?: Array<
| { text: string; type: "text" }
| { data: string; mimeType?: string; type: "image" }
>;
isError?: boolean;
providerOptions?: Record<string, Record<string, any>>;
result: any;
toolCallId: string;
toolName: string;
type: "tool-result";
}>;
providerOptions?: Record<string, Record<string, any>>;
role: "tool";
}
| {
content: string;
providerOptions?: Record<string, Record<string, any>>;
role: "system";
};
model?: string;
order: number;
provider?: string;
providerMetadata?: Record<string, Record<string, any>>;
providerOptions?: Record<string, Record<string, any>>;
reasoning?: string;
reasoningDetails?: Array<
| { signature?: string; text: string; type: "text" }
| { data: string; type: "redacted" }
>;
sources?: Array<{
id: string;
providerOptions?: Record<string, Record<string, any>>;
sourceType: "url";
title?: string;
url: string;
}>;
status: "pending" | "success" | "failed";
stepOrder: number;