UNPKG

@mariozechner/pi-agent

Version:

General-purpose agent with transport abstraction, state management, and attachment support

25 lines 1.09 kB
import { type Message } from "@mariozechner/pi-ai"; import type { AgentRunConfig, AgentTransport } from "./types.js"; export interface ProviderTransportOptions { /** * Function to retrieve API key for a given provider. * If not provided, transport will try to use environment variables. */ getApiKey?: (provider: string) => Promise<string | undefined> | string | undefined; /** * Optional CORS proxy URL for browser environments. * If provided, all requests will be routed through this proxy. * Format: "https://proxy.example.com" */ corsProxyUrl?: string; } /** * Transport that calls LLM providers directly. * Optionally routes calls through a CORS proxy if configured. */ export declare class ProviderTransport implements AgentTransport { private options; constructor(options?: ProviderTransportOptions); run(messages: Message[], userMessage: Message, cfg: AgentRunConfig, signal?: AbortSignal): AsyncGenerator<import("@mariozechner/pi-ai").AgentEvent, void, unknown>; } //# sourceMappingURL=ProviderTransport.d.ts.map