Adapting the backend to the new structure (#162)
* Adapting the backend to the new structure Signed-off-by: Yue, Wenjiao <wenjiao.yue@intel.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: Yue, Wenjiao <wenjiao.yue@intel.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -1 +1 @@
|
||||
BASIC_URL = 'http://x.x.x.x:yyyy'
|
||||
DOC_BASE_URL = 'http://x.x.x.x:yyyy'
|
||||
@@ -15,7 +15,7 @@
|
||||
import { SSE } from "sse.js";
|
||||
import { env } from "$env/dynamic/public";
|
||||
|
||||
const BASIC_URL = env.BASIC_URL;
|
||||
const DOC_BASE_URL = env.DOC_BASE_URL;
|
||||
|
||||
async function fetchPostRes(url, init) {
|
||||
try {
|
||||
@@ -29,7 +29,7 @@ async function fetchPostRes(url, init) {
|
||||
}
|
||||
|
||||
export async function fetchKnowledgeBaseId(file: Blob, fileName: string) {
|
||||
const url = `${BASIC_URL}/doc_upload`;
|
||||
const url = `${DOC_BASE_URL}/doc_upload`;
|
||||
const formData = new FormData();
|
||||
formData.append("file", file, fileName);
|
||||
|
||||
@@ -46,10 +46,10 @@ export async function fetchTextStream(query: string, urlSuffix: string, params:
|
||||
if (params === "doc_id") {
|
||||
payload = { doc_id: query };
|
||||
} else if (params === "text") {
|
||||
payload = { text: query };
|
||||
payload = { query: query };
|
||||
}
|
||||
|
||||
let url = `${BASIC_URL}${urlSuffix}`;
|
||||
let url = `${DOC_BASE_URL}`;
|
||||
console.log("url", url);
|
||||
|
||||
return new SSE(url, {
|
||||
|
||||
@@ -13,8 +13,11 @@
|
||||
// limitations under the License.
|
||||
|
||||
import { sveltekit } from "@sveltejs/kit/vite";
|
||||
import { defineConfig } from "vite";
|
||||
import type { UserConfig } from "vite";
|
||||
|
||||
export default defineConfig({
|
||||
const config: UserConfig = {
|
||||
plugins: [sveltekit()],
|
||||
});
|
||||
server: {},
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
||||
Reference in New Issue
Block a user