Merge pull request #3499 from hicder/patch-2

Fix embedding provider not respecting batch size
This commit is contained in:
Nate Sesti 2024-12-24 08:33:04 -08:00 • committed by GitHub
commit 73a9772253
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 await this._embed(chunks);
return await this._embed(batch);
},
);