@ai2070/l0
Version:
L0: The Missing Reliability Substrate for AI
20 lines • 1.53 kB
TypeScript
import type { L0Event, L0Adapter } from "../types/l0";
import type Anthropic from "@anthropic-ai/sdk";
import type { RawMessageStreamEvent, MessageCreateParamsBase } from "@anthropic-ai/sdk/resources/messages";
import type { MessageStream } from "@anthropic-ai/sdk/lib/MessageStream";
export type AnthropicStream = MessageStream | AsyncIterable<RawMessageStreamEvent>;
export interface AnthropicAdapterOptions {
includeUsage?: boolean;
includeToolUse?: boolean;
}
export declare function isAnthropicStreamEvent(event: unknown): event is RawMessageStreamEvent;
export declare function isAnthropicStream(input: unknown): input is AnthropicStream;
export declare function wrapAnthropicStream(stream: AnthropicStream, options?: AnthropicAdapterOptions): AsyncGenerator<L0Event>;
export declare const anthropicAdapter: L0Adapter<AnthropicStream, AnthropicAdapterOptions>;
export declare function anthropicStream(client: Anthropic, params: MessageCreateParamsBase, options?: AnthropicAdapterOptions): () => Promise<AsyncGenerator<L0Event>>;
export declare function anthropicText(client: Anthropic, model: string, prompt: string, options?: {
maxTokens?: number;
system?: string;
} & AnthropicAdapterOptions): () => Promise<AsyncGenerator<L0Event>>;
export type { RawMessageStreamEvent, RawMessageStartEvent, RawMessageDeltaEvent, RawContentBlockStartEvent, RawContentBlockDeltaEvent, RawContentBlockStopEvent, MessageCreateParamsBase, } from "@anthropic-ai/sdk/resources/messages";
//# sourceMappingURL=anthropic.d.ts.map