agents
Version:
A home for your AI agents
47 lines (45 loc) • 1.59 kB
TypeScript
import {
F as ChannelMessageSurface,
h as DeliveryResult,
o as ChannelChunk,
u as ChannelMessage
} from "../channel-Bnm4S7T2.js";
import { n as ChannelHost } from "../index-BB0kqhIz.js";
import { TextStreamPart, Tool, ToolSet } from "ai";
//#region src/channels/ai-sdk.d.ts
type SendMessageTool = Tool<ChannelMessage, DeliveryResult>;
/** Model-facing options controlled by the caller creating the tool. */
type CreateSendMessageToolOptions = Pick<
SendMessageTool,
| "description"
| "inputExamples"
| "metadata"
| "needsApproval"
| "providerOptions"
| "strict"
>;
/**
* Adapt one Host-resolved surface to an AI SDK tool.
*
* The caller chooses the key used in its ToolSet and owns model-facing policy
* such as the description, examples, metadata, and approval requirement.
*/
declare function createSendMessageTool(
host: ChannelHost,
surface: ChannelMessageSurface,
options?: CreateSendMessageToolOptions
): Tool<ChannelMessage, DeliveryResult>;
/**
* Project an AI SDK `fullStream` onto neutral Channel chunks.
*
* Parts a Channel cannot express are dropped, which keeps provider part
* shapes out of `ChannelChunk`. An `error` or `abort` part errors the returned
* stream, so a generation that fails part-way reaches a Channel as the
* abnormal ending it is rather than as a complete answer.
*/
declare function toChannelChunks(
fullStream: AsyncIterable<TextStreamPart<ToolSet>>
): ReadableStream<ChannelChunk>;
//#endregion
export { CreateSendMessageToolOptions, createSendMessageTool, toChannelChunks };
//# sourceMappingURL=ai-sdk.d.ts.map