import { ImageGenerator } from './image.js'; import { AudioGenerator } from './audio.js'; import { Transcription } from './transcription.js'; import { Reranker } from './rerank.js'; import { FileManager } from './files.js'; import type { Agent } from './agent.js'; import type { AgentResponse, AnyTool, AiMiddleware, EmbeddingResult, RerankingResult } from './types.js'; /** * AI facade — static entry point for quick prompts, embeddings, and image generation. * * @example * const response = await AI.prompt('Hello') * const a = AI.agent('You are helpful.') * const result = await AI.embed('Some text') * const image = await AI.image('A sunset').generate() */ export declare class AI { /** Quick prompt with default model */ static prompt(input: string, options?: { model?: string | undefined; }): Promise; /** Create an anonymous agent */ static agent(instructionsOrOptions: string | { instructions: string; tools?: AnyTool[] | undefined; model?: string | undefined; middleware?: AiMiddleware[] | undefined; }): Agent; /** Create an image generator with a fluent API */ static image(prompt: string): ImageGenerator; /** Create a text-to-speech audio generator */ static audio(text: string): AudioGenerator; /** * Create a speech-to-text transcription from raw audio bytes. * * For Node-only path-based loading, use `transcribeFromPath` from `@gemstack/ai-sdk/node`. */ static transcribe(bytes: Uint8Array): Transcription; /** * Rerank documents by relevance to a query. * * Returns a fluent builder when called with just query + documents. * Pass `options` for a one-shot call. * * @example * const result = await AI.rerank('search query', documents) * const result = await AI.rerank('query', docs, { model: 'cohere/rerank-v3.5', topK: 5 }) */ static rerank(query: string, documents: string[]): Reranker; static rerank(query: string, documents: string[], options: { model?: string | undefined; topK?: number | undefined; }): Promise; /** * Get a file manager for a provider. * * @example * const files = AI.files('openai') * const uploaded = await files.upload('./report.pdf', { purpose: 'assistants' }) * const list = await files.list() * await files.delete(uploaded.id) */ static files(provider?: string): FileManager; /** * Generate embeddings for text. * * Large arrays (100+ items) are automatically chunked into batches. * Pass `cache: true` to enable in-memory caching of embeddings. * * @example * const result = await AI.embed('Hello world') * const result = await AI.embed(['text1', 'text2']) * const result = await AI.embed('text', { model: 'openai/text-embedding-3-small' }) * const result = await AI.embed('text', { cache: true }) */ static embed(input: string | string[], options?: { model?: string | undefined; cache?: boolean | undefined; }): Promise; /** * Cache `CachedEmbeddingAdapter` instances keyed by `::` so * the in-memory cache persists across `AI.embed(..., { cache: true })` calls. * * The earlier `WeakMap` keyed on * adapter identity, but every `embed()` call constructed a fresh inner * adapter via `factory.createEmbedding(modelId)` — so the WeakMap lookup * always missed and `{ cache: true }` was a silent no-op. Keying by * `(provider, model)` is the only stable identity we have at this layer. * * Tied to `AiRegistry.reset()` so tests that swap fakes between resets * don't bind to a stale inner adapter. */ private static cachedAdapters; private static getCachedAdapter; } //# sourceMappingURL=facade.d.ts.map