diff --git a/lib/llamaindex-service.ts b/lib/llamaindex-service.ts index 0b129a50..c359d2ac 100644 --- a/lib/llamaindex-service.ts +++ b/lib/llamaindex-service.ts @@ -43,9 +43,9 @@ export class LlamaIndexService implements ILlamaIndexService { private initializeIndexes(): void { try { - // Extract hostname from LLAMACLOUD_API_URL for LlamaCloudIndex - // The SDK expects just the hostname (e.g., 'api.cloud.eu.llamaindex.ai') - const baseUrlHostname = new URL(env.get('LLAMACLOUD_API_URL')!).hostname; + // Extract base URL (with scheme) from LLAMACLOUD_API_URL for LlamaCloudIndex + // The SDK expects the full origin (e.g., 'https://api.cloud.eu.llamaindex.ai') + const baseUrlHostname = new URL(env.get('LLAMACLOUD_API_URL')!).origin; console.log('Initializing LlamaCloud indexes with config:', this.config); if (this.config.indexNames && this.config.indexNames.length > 0) { @@ -176,4 +176,4 @@ export class LlamaIndexService implements ILlamaIndexService { getConfig(): Readonly { return { ...this.config }; } -} \ No newline at end of file +}