diff --git a/datacenter/app/agents/[agentId]/page.tsx b/datacenter/app/agents/[agentId]/page.tsx
index 113bbb6a7..7409f4c75 100644
--- a/datacenter/app/agents/[agentId]/page.tsx
+++ b/datacenter/app/agents/[agentId]/page.tsx
@@ -11,14 +11,27 @@ const AgentPage = (props) => {
ready: !!props.params?.agentId
});
- const { handleChatSubmit, history } = useAgentChat({
- queryAgentURL: `/v1/chat/completions`,
- queryBody: {}
+ const { history, handleChatSubmit } = useAgentChat({
+ queryAgentURL: `http://30.183.154.8:5000/v1/chat/completions`,
+ queryBody: {
+ conv_uid: props.params?.agentId,
+ chat_mode: 'chat_normal'
+ },
+ initHistory: historyList?.data
});
return (
-
+ {
+ const searchParams = new URLSearchParams(window.location.search);
+ searchParams.delete('initMessage');
+ window.history.replaceState(null, null, `?${searchParams.toString()}`);
+ }}
+ messages={history || []}
+ onSubmit={handleChatSubmit}
+ />
)
}
diff --git a/datacenter/app/datastores/documents/page.tsx b/datacenter/app/datastores/documents/page.tsx
index f1612aaa1..e5c8575dd 100644
--- a/datacenter/app/datastores/documents/page.tsx
+++ b/datacenter/app/datastores/documents/page.tsx
@@ -10,6 +10,7 @@ import {
Box,
Stack,
Input,
+ Textarea,
Chip,
styled
} from '@/lib/mui'
@@ -61,6 +62,8 @@ const Documents = () => {
const [documents, setDocuments] = useState([])
const [webPageUrl, setWebPageUrl] = useState('')
const [documentName, setDocumentName] = useState('')
+ const [textSource, setTextSource] = useState('');
+ const [text, setText] = useState('');
const [originFileObj, setOriginFileObj] = useState(null)
const props: UploadProps = {
name: 'file',
@@ -264,7 +267,6 @@ const Documents = () => {
onChange={(e: any) => setDocumentName(e.target.value)}
sx={{ marginBottom: '20px' }}
/>
- Web Page URL:
{documentType === 'webPage' ? (
<>
Web Page URL:
@@ -293,7 +295,20 @@ const Documents = () => {
>
) : (
- <>>
+ <>
+ Text Source(Optional):
+ setTextSource(e.target.value)}
+ sx={{ marginBottom: '20px' }}
+ />
+ Text:
+