Skip to content

Commit

Permalink
feat: doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
plutoless committed Sep 4, 2024
1 parent 5654f03 commit 31cb2be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions playground/src/common/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const apiStartService = async (config: StartRequestConfig): Promise<any>
}

export const apiStopService = async (channel: string) => {
// the request will be rewrite at next.config.mjs to send to $AGENT_SERVER_URL
// the request will be rewrite at middleware.tsx to send to $AGENT_SERVER_URL
const url = `/api/agents/stop`
const data = {
request_id: genUUID(),
Expand All @@ -76,6 +76,7 @@ export const apiStopService = async (channel: string) => {
}

export const apiGetDocumentList = async () => {
// the request will be rewrite at middleware.tsx to send to $AGENT_SERVER_URL
const url = `/api/vector/document/preset/list`
let resp: any = await fetch(url, {
method: "GET",
Expand All @@ -91,7 +92,7 @@ export const apiGetDocumentList = async () => {
}

export const apiUpdateDocument = async (options: { channel: string, collection: string, fileName: string }) => {
// the request will be rewrite at next.config.mjs to send to $AGENT_SERVER_URL
// the request will be rewrite at middleware.tsx to send to $AGENT_SERVER_URL
const url = `/api/vector/document/update`
const { channel, collection, fileName } = options
const data = {
Expand All @@ -114,7 +115,7 @@ export const apiUpdateDocument = async (options: { channel: string, collection:

// ping/pong
export const apiPing = async (channel: string) => {
// the request will be rewrite at next.config.mjs to send to $AGENT_SERVER_URL
// the request will be rewrite at middleware.tsx to send to $AGENT_SERVER_URL
const url = `/api/agents/ping`
const data = {
request_id: genUUID(),
Expand Down
1 change: 1 addition & 0 deletions playground/src/components/pdfSelect/upload/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const PdfUpload = (props: PdfSelectProps) => {
accept: "application/pdf",
maxCount: 1,
showUploadList: false,
// the request will be rewrite at middleware.tsx to send to $AGENT_SERVER_URL
action: `/api/vector/document/upload`,
data: {
channel_name: channel,
Expand Down

0 comments on commit 31cb2be

Please sign in to comment.