import { SharedObject, UnavailabilityError } from "expo-modules-core"; import type { GenerateObjectConfig, InferSchema, Schema, SessionConfig, LLMSessionEvents, LLMPrompt, ToolConfig } from "./ExpoLocalLlm.types"; export declare class NativeModuleUnavailableError extends UnavailabilityError { constructor(operation: string); } export declare class LLMSession extends SharedObject { respond: (prompt: LLMPrompt, requestId?: string) => Promise; /** * Streams a response, emitting `token`/`partial` events along the way. * Resolves with the final text when the stream completes, or with the * partial text produced so far if the stream is cancelled via * `cancelStream()`. Rejects if the stream fails. */ streamResponse: (prompt: LLMPrompt, requestId?: string) => Promise; cancelStream: () => Promise; /** * Clears the conversation transcript while keeping instructions, tools, * schema, and generation options. Cancels any in-flight stream. Cheap — * the model weights are OS-shared; only the conversation state is rebuilt. */ reset: () => void; registerTool: (config: ToolConfig) => void; unregisterTool: (name: string) => void; resolveToolCall: (callId: string, result: string) => void; rejectToolCall: (callId: string, error: string) => void; } export declare function createLLMSession(config?: SessionConfig): LLMSession; /** * One-shot, stateless generation: creates a session, responds once, and * releases the session. Use this for classification/extraction calls where * conversation history is unwanted — no session bookkeeping, no transcript * accumulation across calls. * * Throws `UnavailabilityError` when the native module is missing; rejects * with the native error when the model is not available. Callers that need * an availability check first can use `ExpoLocalLlmModule.getAvailability()`. */ export declare function generate(prompt: LLMPrompt, config?: SessionConfig): Promise; export declare function generateObject(prompt: LLMPrompt, config: GenerateObjectConfig): Promise>; //# sourceMappingURL=LLMSession.d.ts.map