Fix embedding provider not respecting batch size

This commit is contained in:
Hieu Pham 2024-12-21 12:24:15 -08:00 • committed by GitHub
parent 5f4ac7ae50
commit f60a39e944
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -809,12 +809,12 @@ export abstract class BaseLLM implements ILLM {
if (this.shouldUseOpenAIAdapter("embed") && this.openaiAdapter) {
const result = await this.openaiAdapter.embed({
model: this.model,
input: chunks,
input: batch,
});
return result.data.map((chunk) => chunk.embedding);
return result.data.map((batch) => batch.embedding);
}
return await this._embed(chunks);
return await this._embed(batch);
},
);