Skip to content

Commit a200412

Browse files
committed
update MongoRag
1 parent 05ea071 commit a200412

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/core/MongoRAG.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,14 @@ class MongoRAG {
142142
this.embeddingProvider = new OpenAIEmbeddingProvider({ apiKey, ...options });
143143
break;
144144
case 'ollama':
145-
this.embeddingProvider = new OllamaEmbeddingProvider({ provider: 'ollama', baseUrl: options.baseUrl, model: options.model });
145+
if (!baseUrl) {
146+
throw new Error("Ollama base URL is missing from the config. Run 'npx mongodb-rag edit-config' to set it.");
147+
}
148+
this.embeddingProvider = new OllamaEmbeddingProvider({
149+
provider: 'ollama',
150+
baseUrl,
151+
model: options.model
152+
});
146153
break;
147154
default:
148155
throw new Error(`Unknown embedding provider: ${provider}`);

0 commit comments

Comments
 (0)