File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,17 @@ export async function ingestData(config, options) {
1212 throw new Error ( "Configuration missing. Run 'npx mongodb-rag init' first." ) ;
1313 }
1414
15+ // Set environment variables from config if they're not already set
16+ if ( ! process . env . EMBEDDING_API_KEY && config . apiKey ) {
17+ process . env . EMBEDDING_API_KEY = config . apiKey ;
18+ }
19+ if ( ! process . env . EMBEDDING_PROVIDER && ( config . embedding ?. provider || config . provider ) ) {
20+ process . env . EMBEDDING_PROVIDER = config . embedding ?. provider || config . provider ;
21+ }
22+ if ( ! process . env . EMBEDDING_MODEL && ( config . embedding ?. model || config . model ) ) {
23+ process . env . EMBEDDING_MODEL = config . embedding ?. model || config . model ;
24+ }
25+
1526 try {
1627 let documents = [ ] ;
1728 const isDevelopment = process . env . NODE_ENV === 'development' || process . env . NODE_ENV === 'test' ;
You can’t perform that action at this time.
0 commit comments