mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-03 13:24:08 +00:00
31 lines
831 B
TypeScript
31 lines
831 B
TypeScript
import type { MemoryEmbeddingProviderAdapter } from "openclaw/plugin-sdk/memory-core-host-engine-embeddings";
|
|
import {
|
|
DEFAULT_OLLAMA_EMBEDDING_MODEL,
|
|
createOllamaEmbeddingProvider,
|
|
} from "./embedding-provider.js";
|
|
|
|
export const ollamaMemoryEmbeddingProviderAdapter: MemoryEmbeddingProviderAdapter = {
|
|
id: "ollama",
|
|
defaultModel: DEFAULT_OLLAMA_EMBEDDING_MODEL,
|
|
transport: "remote",
|
|
authProviderId: "ollama",
|
|
create: async (options) => {
|
|
const { provider, client } = await createOllamaEmbeddingProvider({
|
|
...options,
|
|
provider: "ollama",
|
|
fallback: "none",
|
|
});
|
|
return {
|
|
provider,
|
|
runtime: {
|
|
id: "ollama",
|
|
inlineBatchTimeoutMs: 10 * 60_000,
|
|
cacheKeyData: {
|
|
provider: "ollama",
|
|
model: client.model,
|
|
},
|
|
},
|
|
};
|
|
},
|
|
};
|