Skip to content

Commit f81f25f

Browse files
committed
bug: fix upload document error (#310)
1 parent ab6aeb7 commit f81f25f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

usecases/ai/rag-toolkit/edge-ui/src/api/datasets.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
"use server";
55

66
import { revalidateTag } from "next/cache";
7-
import { API } from "../utils/api";
7+
import { FetchAPI } from "../utils/api";
88
import { constructURL } from "../utils/common";
99
import { type APIResponse } from "../types/api";
1010

11+
const API = new FetchAPI(`http://${process.env.NEXT_PUBLIC_LLM_API_URL ?? "localhost"}:${process.env.NEXT_PUBLIC_LLM_API_PORT ?? "8011"}`);
12+
1113
export const createTextEmbeddingsAPI = async (
1214
chunkSize: number,
1315
chunkOverlap: number,

usecases/ai/rag-toolkit/edge-ui/src/components/documents/dialogs/AddDocumentDialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ export default function AddDocumentDialog({
3030
const [isUploading, setIsUploading] = useState<boolean>(false);
3131
const [isUploadError, setIsUploadError] = useState<boolean>(false);
3232
const [selectedFiles, setSelectedFiles] = useState<CustomFile[]>([]);
33-
const [chunkSize, setChunkSize] = useState<number>(1024);
33+
const [chunkSize, setChunkSize] = useState<number>(512);
3434
const [chunkOverlap, setChunkOverlap] = useState<number>(0);
3535
const createTextEmbeddings = useCreateTextEmbeddings();
3636

3737
const resetState = (): void => {
38-
setChunkSize(1024);
38+
setChunkSize(512);
3939
setChunkOverlap(0);
4040
setIsUploading(false);
4141
setIsUploadError(false);

0 commit comments

Comments
 (0)