mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-14 06:26:18 +00:00
Merge remote-tracking branch 'origin/new-page-framework' into llm_framework
This commit is contained in:
commit
22da6e9a41
@ -347,6 +347,10 @@ const Documents = () => {
|
|||||||
message.error('Please select a file')
|
message.error('Please select a file')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('doc_name', documentName);
|
||||||
|
formData.append('doc_file', originFileObj);
|
||||||
|
formData.append('doc_type', 'DOCUMENT');
|
||||||
const res = await fetch(
|
const res = await fetch(
|
||||||
`http://localhost:8000/knowledge/${spaceName}/document/upload`,
|
`http://localhost:8000/knowledge/${spaceName}/document/upload`,
|
||||||
{
|
{
|
||||||
@ -354,11 +358,7 @@ const Documents = () => {
|
|||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW'
|
'Content-Type': 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW'
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: formData
|
||||||
doc_name: documentName,
|
|
||||||
doc_file: originFileObj,
|
|
||||||
doc_type: 'DOCUMENT'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
const data = await res.json()
|
const data = await res.json()
|
||||||
|
@ -344,6 +344,10 @@ const Index = () => {
|
|||||||
message.error('Please select a file')
|
message.error('Please select a file')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('doc_name', documentName);
|
||||||
|
formData.append('doc_file', originFileObj);
|
||||||
|
formData.append('doc_type', 'DOCUMENT');
|
||||||
const res = await fetch(
|
const res = await fetch(
|
||||||
`http://localhost:8000/knowledge/${knowledgeSpaceName}/document/upload`,
|
`http://localhost:8000/knowledge/${knowledgeSpaceName}/document/upload`,
|
||||||
{
|
{
|
||||||
@ -351,11 +355,7 @@ const Index = () => {
|
|||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW'
|
'Content-Type': 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW'
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: formData
|
||||||
doc_name: documentName,
|
|
||||||
doc_file: originFileObj,
|
|
||||||
doc_type: 'DOCUMENT'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
const data = await res.json()
|
const data = await res.json()
|
||||||
|
Loading…
Reference in New Issue
Block a user