@agentpaid/mcp-use
Version:
A utility library for integrating Model Context Protocol (MCP) with LangChain, Zod, and related tools. Provides helpers for schema conversion, event streaming, and SDK usage.
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