mcp-use
Version:
Opinionated MCP Framework for TypeScript (@modelcontextprotocol/sdk compatible) - Build MCP Agents, Clients and Servers with support for ChatGPT Apps, Code Mode, OAuth, Notifications, Sampling, Observability and more.
22 lines • 1.08 kB
TypeScript
/**
* AI SDK Integration Utilities
*
* Utility functions for integrating MCPAgent's streamEvents with Vercel AI SDK.
* These utilities help convert stream events to AI SDK compatible formats.
*/
import type { StreamEvent } from "@langchain/core/tracers/log_stream";
/**
* Converts streamEvents to AI SDK compatible stream (basic version)
* Only yields the actual content tokens from chat model streams
*/
export declare function streamEventsToAISDK(streamEvents: AsyncGenerator<StreamEvent, void, void>): AsyncGenerator<string, void, void>;
/**
* Converts async generator to ReadableStream for AI SDK compatibility
*/
export declare function createReadableStreamFromGenerator(generator: AsyncGenerator<string, void, void>): ReadableStream<string>;
/**
* Enhanced adapter that includes tool information along with chat content
* Yields both content tokens and tool usage notifications
*/
export declare function streamEventsToAISDKWithTools(streamEvents: AsyncGenerator<StreamEvent, void, void>): AsyncGenerator<string, void, void>;
//# sourceMappingURL=ai_sdk.d.ts.map