Skip to content

Commit

Permalink
Create separate two for each api (#143)
Browse files Browse the repository at this point in the history
* Downgrade flowbite-svelte

* Language Translation

* modify code language

* modify response

* update highlight code

* move ui code into CodeTrans folder

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Create separate two for each api

* Modify the name of the URL

Signed-off-by: Yue, Wenjiao <[email protected]>

---------

Signed-off-by: Yue, Wenjiao <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: chen, suyue <[email protected]>
Co-authored-by: lvliang-intel <[email protected]>
  • Loading branch information
4 people authored May 16, 2024
1 parent 3ff57be commit faab721
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
7 changes: 6 additions & 1 deletion ChatQnA/ui/svelte/.env
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
DOC_BASE_URL = 'http://10.7.4.144:8000/v1/rag'
CHAT_BASE_URL = 'http://x.x.x.x'

UPLOAD_FILE_BASE_URL = 'http://x.x.x.x'

PASTE_LINK_BASE_URL = 'http://x.x.x.x'

4 changes: 2 additions & 2 deletions ChatQnA/ui/svelte/src/lib/network/chat/Network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import { env } from "$env/dynamic/public";
import { SSE } from "sse.js";

const DOC_BASE_URL = env.DOC_BASE_URL;
const CHAT_BASE_URL = env.CHAT_BASE_URL;

export async function fetchTextStream(query: string, knowledge_base_id: string) {
let payload = {};
Expand All @@ -24,7 +24,7 @@ export async function fetchTextStream(query: string, knowledge_base_id: string)
payload = {
query: query,
};
url = `${DOC_BASE_URL}/chat_stream`;
url = `${CHAT_BASE_URL}`;

return new SSE(url, {
headers: { "Content-Type": "application/json" },
Expand Down
7 changes: 4 additions & 3 deletions ChatQnA/ui/svelte/src/lib/network/upload/Network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@

import { env } from "$env/dynamic/public";

const DOC_BASE_URL = env.DOC_BASE_URL;
const UPLOAD_FILE_BASE_URL = env.UPLOAD_FILE_BASE_URL;
const PASTE_LINK_BASE_URL = env.PASTE_LINK_BASE_URL;

export async function fetchKnowledgeBaseId(file: Blob, fileName: string) {
const url = `${DOC_BASE_URL}/create`;
const url = `${UPLOAD_FILE_BASE_URL}`;
const formData = new FormData();
formData.append("file", file, fileName);
const init: RequestInit = {
Expand All @@ -36,7 +37,7 @@ export async function fetchKnowledgeBaseId(file: Blob, fileName: string) {
}

export async function fetchKnowledgeBaseIdByPaste(pasteUrlList: any, urlType: string | undefined) {
const url = `${DOC_BASE_URL}/upload_link`;
const url = `${PASTE_LINK_BASE_URL}`;
const data = {
link_list: pasteUrlList,
};
Expand Down

0 comments on commit faab721

Please sign in to comment.