Add appendLastPath util function and use it in hypamemory

This commit is contained in:
sub-hub
2024-04-27 22:09:23 +09:00
parent e5a88c4ecb
commit 96622482b3
2 changed files with 32 additions and 5 deletions

View File

@@ -2,6 +2,7 @@ import localforage from "localforage";
import { globalFetch } from "src/ts/storage/globalApi";
import { runEmbedding } from "../transformers";
import { alertError } from "src/ts/alert";
import { appendLastPath } from "src/ts/util";
export class HypaProcesser{
@@ -50,11 +51,7 @@ export class HypaProcesser{
return [0]
}
let replaceUrl = new URL(this.customEmbeddingUrl)
if(replaceUrl.pathname !== '/embeddings'){
replaceUrl.pathname = '/embeddings'
}
const replaceUrl = appendLastPath(this.customEmbeddingUrl,'embeddings')
gf = await globalFetch(replaceUrl.toString(), {
body:{