@ai2070/l0
Version:
L0: The Missing Reliability Substrate for AI
24 lines • 1.81 kB
TypeScript
import type { L0Event, L0Adapter } from "../types/l0";
import type { Agent } from "@mastra/core/agent";
import type { MastraModelOutput } from "@mastra/core/stream";
export interface MastraAdapterOptions {
includeUsage?: boolean;
includeToolCalls?: boolean;
includeReasoning?: boolean;
}
export type MastraMessageInput = string | Array<{
role: "user" | "assistant" | "system";
content: string;
}>;
export declare function wrapMastraStream(streamResult: MastraModelOutput<any>, options?: MastraAdapterOptions): AsyncGenerator<L0Event>;
export declare function mastraStream(agent: Agent<any, any, any>, messages: MastraMessageInput, streamOptions?: Record<string, any>, adapterOptions?: MastraAdapterOptions): () => Promise<AsyncGenerator<L0Event>>;
export declare function mastraText(agent: Agent<any, any, any>, prompt: string, options?: Record<string, any> & MastraAdapterOptions): () => Promise<AsyncGenerator<L0Event>>;
export declare function mastraStructured<TSchema>(agent: Agent<any, any, any>, prompt: string, schema: TSchema, options?: Record<string, any> & MastraAdapterOptions): () => Promise<AsyncGenerator<L0Event>>;
export declare function wrapMastraFullStream(streamResult: MastraModelOutput<any>, options?: MastraAdapterOptions): AsyncGenerator<L0Event>;
export declare function isMastraStream(obj: unknown): obj is MastraModelOutput<any>;
export declare function extractMastraText(streamResult: MastraModelOutput<any>): Promise<string>;
export declare function extractMastraObject<T>(streamResult: MastraModelOutput<any>): Promise<T>;
export declare const mastraAdapter: L0Adapter<MastraModelOutput<any>, MastraAdapterOptions>;
export type { Agent } from "@mastra/core/agent";
export type { MastraModelOutput } from "@mastra/core/stream";
//# sourceMappingURL=mastra.d.ts.map