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

Function getOllamaClient

src/tools/semantic-navigate.ts:55–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53let ollamaClient: OllamaChatClient | null = null;
54
55async function getOllamaClient(): Promise<OllamaChatClient> {
56 if (!ollamaClient) {
57 const { Ollama } = await import("ollama");
58 ollamaClient = new Ollama({ host: process.env.OLLAMA_HOST }) as unknown as OllamaChatClient;
59 }
60 return ollamaClient;
61}
62
63async function fetchEmbeddings(inputs: string[]): Promise<number[][]> {
64 return fetchEmbedding(inputs);

Callers 1

chatCompletionFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected