MCPcopy Index your code
hub / github.com/forloopcodes/contextplus / getOllamaClient

Function getOllamaClient

src/core/embeddings.ts:98–104  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

96let ollamaClient: OllamaEmbedClient | null = null;
97
98async function getOllamaClient(): Promise<OllamaEmbedClient> {
99 if (!ollamaClient) {
100 const { Ollama } = await import("ollama");
101 ollamaClient = new Ollama({ host: process.env.OLLAMA_HOST }) as unknown as OllamaEmbedClient;
102 }
103 return ollamaClient;
104}
105
106async function callOllamaEmbed(input: string[], signal: AbortSignal): Promise<number[][]> {
107 const client = await getOllamaClient();

Callers 1

callOllamaEmbedFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected