We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 05ea071 commit a200412Copy full SHA for a200412
src/core/MongoRAG.js
@@ -142,7 +142,14 @@ class MongoRAG {
142
this.embeddingProvider = new OpenAIEmbeddingProvider({ apiKey, ...options });
143
break;
144
case 'ollama':
145
- this.embeddingProvider = new OllamaEmbeddingProvider({ provider: 'ollama', baseUrl: options.baseUrl, model: options.model });
+ 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
+ });
153
154
default:
155
throw new Error(`Unknown embedding provider: ${provider}`);
0 commit comments