Skip to content

Commit c6afcd9

Browse files
committed
fix: ollamaModel already defined
fix: ollamaModel already defined
1 parent 3e4cb1e commit c6afcd9

File tree

1 file changed

+3
-2
lines changed
  • packages/plugin-node/src/services

1 file changed

+3
-2
lines changed

packages/plugin-node/src/services/llama.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ export class LlamaService extends Service {
164164
private ctx: LlamaContext | undefined;
165165
private sequence: LlamaContextSequence | undefined;
166166
private modelUrl: string;
167+
private ollamaModel: string | undefined;
167168

168169
private messageQueue: QueuedMessage[] = [];
169170
private isProcessing: boolean = false;
@@ -179,6 +180,7 @@ export class LlamaService extends Service {
179180
"https://huggingface.co/NousResearch/Hermes-3-Llama-3.1-8B-GGUF/resolve/main/Hermes-3-Llama-3.1-8B.Q8_0.gguf?download=true";
180181
const modelName = "model.gguf";
181182
this.modelPath = path.join(__dirname, modelName);
183+
this.ollamaModel = process.env.OLLAMA_MODEL;
182184
}
183185

184186
async initialize(runtime: IAgentRuntime): Promise<void> {}
@@ -486,13 +488,12 @@ export class LlamaService extends Service {
486488
throw new Error("Model not initialized. Call initialize() first.");
487489
}
488490

489-
const ollamaModel = process.env.OLLAMA_MODEL;
490491
const ollamaUrl =
491492
process.env.OLLAMA_SERVER_URL || "http://localhost:11434";
492493
const embeddingModel =
493494
process.env.OLLAMA_EMBEDDING_MODEL || "mxbai-embed-large";
494495
elizaLogger.info(
495-
`Using Ollama API for embeddings with model ${embeddingModel} (base: ${ollamaModel})`
496+
`Using Ollama API for embeddings with model ${embeddingModel} (base: ${this.ollamaModel})`
496497
);
497498

498499
const response = await fetch(`${ollamaUrl}/api/embeddings`, {

0 commit comments

Comments
 (0)