Update OllamaEmbeddingsProvider.ts (#1839)
This commit is contained in:
parent
6611d8a6e7
commit
7cb15acfe2
1 changed files with 7 additions and 1 deletions
|
|
@ -10,7 +10,13 @@ async function embedOne(
|
|||
customFetch: FetchFunction,
|
||||
) {
|
||||
const embedding = await withExponentialBackoff<number[]>(async () => {
|
||||
const resp = await customFetch(new URL("api/embeddings", options.apiBase), {
|
||||
let apiBase = options.apiBase!;
|
||||
|
||||
if (!apiBase.endsWith("/")) {
|
||||
apiBase += "/";
|
||||
}
|
||||
|
||||
const resp = await customFetch(new URL("api/embeddings", apiBase), {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
model: options.model,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue