From 8ccfd2b072c188f737417398f05bdf5688326ba8 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Tue, 23 Apr 2024 22:47:23 -0700 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20use=20custom=20requestOpti?= =?UTF-8?q?ons=20with=20CohereEmbeddingsProvider?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/indexing/embeddings/CohereEmbeddingsProvider.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/indexing/embeddings/CohereEmbeddingsProvider.ts b/core/indexing/embeddings/CohereEmbeddingsProvider.ts index 05e248792..0668d49c4 100644 --- a/core/indexing/embeddings/CohereEmbeddingsProvider.ts +++ b/core/indexing/embeddings/CohereEmbeddingsProvider.ts @@ -1,4 +1,4 @@ -import fetch, { Response } from "node-fetch"; +import { Response } from "node-fetch"; import { EmbedOptions } from "../.."; import { withExponentialBackoff } from "../../util/withExponentialBackoff"; import BaseEmbeddingsProvider from "./BaseEmbeddingsProvider"; @@ -35,7 +35,7 @@ class CohereEmbeddingsProvider extends BaseEmbeddingsProvider { batchedChunks.map(async (batch) => { const fetchWithBackoff = () => withExponentialBackoff(() => - fetch(new URL("embed", this.options.apiBase), { + this.fetch(new URL("embed", this.options.apiBase), { method: "POST", body: JSON.stringify({ texts: batch,