(text: string)
| 40 | } |
| 41 | |
| 42 | async embedQuery(text: string): Promise<number[]> { |
| 43 | if (this.provider === "cohere" && this.cfg) { |
| 44 | return embedCohereQuery(text, this.cfg, this.log); |
| 45 | } |
| 46 | const vecs = await this.embedBatch([text]); |
| 47 | return vecs[0]; |
| 48 | } |
| 49 | |
| 50 | private async embedBatch(texts: string[]): Promise<number[][]> { |
| 51 | const provider = this.provider; |
no test coverage detected