♻️ use custom requestOptions with CohereEmbeddingsProvider
This commit is contained in:
parent
5a40c7c327
commit
8ccfd2b072
1 changed files with 2 additions and 2 deletions
|
|
@ -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<Response>(() =>
|
||||
fetch(new URL("embed", this.options.apiBase), {
|
||||
this.fetch(new URL("embed", this.options.apiBase), {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
texts: batch,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue