import type { OpenClawConfig } from "../config/types.openclaw.js"; import type { SecretInput } from "../config/types.secrets.js"; export type EmbeddingInput = | string | { text: string; parts?: Array< { type: "text"; text: string } | { type: "inline-data"; mimeType: string; data: string } >; }; export type EmbeddingProviderCallOptions = { signal?: AbortSignal; inputType?: "query" | "document" | "semantic" | "classification" | "clustering"; }; export type EmbeddingProviderRuntime = { id: string; cacheKeyData?: Record; inlineQueryTimeoutMs?: number; inlineBatchTimeoutMs?: number; }; export type EmbeddingProvider = { id: string; model: string; dimensions?: number; maxInputTokens?: number; embed: (input: EmbeddingInput, options?: EmbeddingProviderCallOptions) => Promise; embedBatch: ( inputs: EmbeddingInput[], options?: EmbeddingProviderCallOptions, ) => Promise; close?: () => Promise | void; }; export type EmbeddingProviderCreateOptions = { config: OpenClawConfig; agentDir?: string; provider?: string; remote?: { baseUrl?: string; apiKey?: SecretInput; headers?: Record; }; model: string; inputType?: string; queryInputType?: string; documentInputType?: string; local?: { modelPath?: string; modelCacheDir?: string; }; dimensions?: number; taskType?: string; }; export type EmbeddingProviderCreateResult = { provider: EmbeddingProvider | null; runtime?: EmbeddingProviderRuntime; }; export type EmbeddingProviderAdapter = { id: string; defaultModel?: string; transport?: "local" | "remote"; authProviderId?: string; create: (options: EmbeddingProviderCreateOptions) => Promise; formatSetupError?: (err: unknown) => string; }; export type RegisteredEmbeddingProvider = { adapter: EmbeddingProviderAdapter; ownerPluginId?: string; };