Compare commits
5 Commits
b8cc8fee67
...
602a337923
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
602a337923 | ||
|
|
fe9e185a9a | ||
|
|
3901a47da0 | ||
|
|
dc5998cf72 | ||
|
|
993940e810 |
@@ -1,6 +1,6 @@
|
|||||||
import {cd, path} from 'zx'
|
import {cd, path} from 'zx'
|
||||||
import {trim} from "licia";
|
import {trim} from "licia";
|
||||||
import {run_deploy, run_package, run_upload} from '../../bin/library.js'
|
import {run_deploy, run_package, run_upload_normal} from '../../bin/library.js'
|
||||||
|
|
||||||
// 切换目录
|
// 切换目录
|
||||||
cd(trim(path.dirname(import.meta.dirname)))
|
cd(trim(path.dirname(import.meta.dirname)))
|
||||||
@@ -8,7 +8,7 @@ cd(trim(path.dirname(import.meta.dirname)))
|
|||||||
try {
|
try {
|
||||||
await run_deploy('service-ai-core')
|
await run_deploy('service-ai-core')
|
||||||
await run_package('service-ai-chat')
|
await run_package('service-ai-chat')
|
||||||
await run_upload('service-ai-chat')
|
await run_upload_normal('service-ai-chat')
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
}
|
}
|
||||||
@@ -11,29 +11,29 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ant-design/icons": "^6.0.0",
|
"@ant-design/icons": "^6.0.0",
|
||||||
"@ant-design/pro-components": "^2.8.7",
|
"@ant-design/pro-components": "^2.8.7",
|
||||||
"@ant-design/x": "^1.2.0",
|
"@ant-design/x": "^1.4.0",
|
||||||
"@echofly/fetch-event-source": "^3.0.2",
|
"@echofly/fetch-event-source": "^3.0.2",
|
||||||
"@fortawesome/fontawesome-free": "^6.7.2",
|
"@fortawesome/fontawesome-free": "^6.7.2",
|
||||||
"@tinyflow-ai/react": "^0.1.6",
|
"@tinyflow-ai/react": "^0.1.10",
|
||||||
"amis": "^6.12.0",
|
"amis": "^6.12.0",
|
||||||
"antd": "^5.25.0",
|
"antd": "^5.25.3",
|
||||||
"axios": "^1.9.0",
|
"axios": "^1.9.0",
|
||||||
"licia": "^1.48.0",
|
"licia": "^1.48.0",
|
||||||
"markdown-it": "^14.1.0",
|
"markdown-it": "^14.1.0",
|
||||||
"react": "^18.2.0",
|
"react": "^18.3.1",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.3.1",
|
||||||
"react-router": "^7.5.3",
|
"react-router": "^7.6.1",
|
||||||
"styled-components": "^6.1.18"
|
"styled-components": "^6.1.18"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/markdown-it": "^14.1.2",
|
"@types/markdown-it": "^14.1.2",
|
||||||
"@types/react": "^18.2.0",
|
"@types/react": "^18.3.23",
|
||||||
"@types/react-dom": "^18.2.0",
|
"@types/react-dom": "^18.3.7",
|
||||||
"@vitejs/plugin-react-swc": "^3.9.0",
|
"@vitejs/plugin-react-swc": "^3.10.0",
|
||||||
"globals": "^16.0.0",
|
"globals": "^16.2.0",
|
||||||
"sass": "^1.87.0",
|
"sass": "^1.89.0",
|
||||||
"typescript": "~5.8.3",
|
"typescript": "~5.8.3",
|
||||||
"typescript-eslint": "^8.30.1",
|
"typescript-eslint": "^8.33.0",
|
||||||
"vite": "^6.3.5"
|
"vite": "^6.3.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1264
service-web/client/pnpm-lock.yaml
generated
1264
service-web/client/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,11 @@
|
|||||||
import {ClearOutlined, UserOutlined} from '@ant-design/icons'
|
import {ClearOutlined, FileOutlined, UserOutlined} from '@ant-design/icons'
|
||||||
import {Bubble, Sender, useXAgent, useXChat, Welcome} from '@ant-design/x'
|
import {Bubble, Sender, useXAgent, useXChat, Welcome} from '@ant-design/x'
|
||||||
import {fetchEventSource} from '@echofly/fetch-event-source'
|
import {fetchEventSource} from '@echofly/fetch-event-source'
|
||||||
import {Button, Divider, Flex, Switch, Tooltip, Typography} from 'antd'
|
import {Button, Divider, Flex, Popover, Radio, Switch, Tooltip, Typography} from 'antd'
|
||||||
import markdownIt from 'markdown-it'
|
import markdownIt from 'markdown-it'
|
||||||
import {useRef, useState} from 'react'
|
import {useRef, useState} from 'react'
|
||||||
import styled from 'styled-components'
|
import styled from 'styled-components'
|
||||||
|
import {commonInfo} from '../../util/amis.tsx'
|
||||||
|
|
||||||
const md = markdownIt({html: true, breaks: true})
|
const md = markdownIt({html: true, breaks: true})
|
||||||
const ConversationDiv = styled.div`
|
const ConversationDiv = styled.div`
|
||||||
@@ -49,7 +50,7 @@ function Conversation() {
|
|||||||
|
|
||||||
const [agent] = useXAgent<{ role: string, content: string }>({
|
const [agent] = useXAgent<{ role: string, content: string }>({
|
||||||
request: async (info, callbacks) => {
|
request: async (info, callbacks) => {
|
||||||
await fetchEventSource('http://127.0.0.1:8080/chat/async', {
|
await fetchEventSource(`${commonInfo.baseAiChatUrl}/chat/async`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': 'Basic QXhoRWJzY3dzSkRiWU1IMjpjWXhnM2I0UHRXb1ZENVNqRmF5V3h0blNWc2p6UnNnNA==',
|
'Authorization': 'Basic QXhoRWJzY3dzSkRiWU1IMjpjWXhnM2I0UHRXb1ZENVNqRmF5V3h0blNWc2p6UnNnNA==',
|
||||||
@@ -105,13 +106,9 @@ function Conversation() {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
messageRender: content => {
|
messageRender: content => {
|
||||||
let split = content.split('</think>')
|
|
||||||
if (split.length > 1) {
|
|
||||||
content = `${split[0]}</think>${md.render(split[1])}`
|
|
||||||
}
|
|
||||||
return (
|
return (
|
||||||
<Typography>
|
<Typography>
|
||||||
<div dangerouslySetInnerHTML={{__html: content}}/>
|
<div dangerouslySetInnerHTML={{__html: md.render(content)}}/>
|
||||||
</Typography>
|
</Typography>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
@@ -164,6 +161,28 @@ function Conversation() {
|
|||||||
disabled={messages.length > 0}
|
disabled={messages.length > 0}
|
||||||
/>
|
/>
|
||||||
<Divider type="vertical"/>
|
<Divider type="vertical"/>
|
||||||
|
<Popover
|
||||||
|
title="选择知识库"
|
||||||
|
trigger="hover"
|
||||||
|
content={<Radio.Group
|
||||||
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
flexDirection: 'column',
|
||||||
|
gap: 10,
|
||||||
|
}}
|
||||||
|
options={[
|
||||||
|
{value: 1, label: '测试'},
|
||||||
|
{value: 2, label: 'Hudi'},
|
||||||
|
{value: 3, label: 'Apache Hudi'},
|
||||||
|
]}
|
||||||
|
/>}
|
||||||
|
>
|
||||||
|
<Button
|
||||||
|
icon={<FileOutlined/>}
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
/>
|
||||||
|
</Popover>
|
||||||
<Tooltip title="清空对话">
|
<Tooltip title="清空对话">
|
||||||
<Button
|
<Button
|
||||||
icon={<ClearOutlined/>}
|
icon={<ClearOutlined/>}
|
||||||
@@ -172,6 +191,7 @@ function Conversation() {
|
|||||||
onClick={() => setMessages([])}
|
onClick={() => setMessages([])}
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
<Divider type="vertical"/>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Flex align="center">
|
<Flex align="center">
|
||||||
{agent.isRequesting() ? (
|
{agent.isRequesting() ? (
|
||||||
|
|||||||
@@ -62,6 +62,42 @@ const DataDetail: React.FC = () => {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
type: 'action',
|
||||||
|
icon: 'fa fa-magnifying-glass',
|
||||||
|
label: '',
|
||||||
|
tooltip: '命中测试',
|
||||||
|
tooltipPlacement: 'top',
|
||||||
|
actionType: 'dialog',
|
||||||
|
dialog: {
|
||||||
|
title: '命中测试',
|
||||||
|
size: 'lg',
|
||||||
|
actions: [],
|
||||||
|
body: [
|
||||||
|
{
|
||||||
|
type: 'input-text',
|
||||||
|
addOn: {
|
||||||
|
type: 'action',
|
||||||
|
label: '检索',
|
||||||
|
icon: 'fa fa-magnifying-glass',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '182e8657-5352-42ad-9ab4-8252d33eef91',
|
||||||
|
type: 'crud',
|
||||||
|
source: '${search_items}',
|
||||||
|
...crudCommonOptions(),
|
||||||
|
canAccessSuperData: false,
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
name: 'text',
|
||||||
|
label: '内容',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,8 +5,10 @@ import 'amis/lib/helper.css'
|
|||||||
import 'amis/sdk/iconfont.css'
|
import 'amis/sdk/iconfont.css'
|
||||||
import '@fortawesome/fontawesome-free/css/all.min.css'
|
import '@fortawesome/fontawesome-free/css/all.min.css'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
import {isEqual} from 'licia'
|
||||||
|
|
||||||
export const commonInfo = {
|
export const commonInfo = {
|
||||||
|
debug: isEqual(import.meta.env.MODE, 'development'),
|
||||||
baseUrl: 'http://132.126.207.130:35690/hudi_services/service_web',
|
baseUrl: 'http://132.126.207.130:35690/hudi_services/service_web',
|
||||||
baseAiChatUrl: 'http://132.126.207.130:35690/hudi_services/ai_chat',
|
baseAiChatUrl: 'http://132.126.207.130:35690/hudi_services/ai_chat',
|
||||||
baseAiKnowledgeUrl: 'http://132.126.207.130:35690/hudi_services/ai_knowledge',
|
baseAiKnowledgeUrl: 'http://132.126.207.130:35690/hudi_services/ai_knowledge',
|
||||||
@@ -79,7 +81,7 @@ export const amisRender = (schema: Schema, data: Record<any, any> = {}) => {
|
|||||||
theme: theme,
|
theme: theme,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
enableAMISDebug: true,
|
enableAMISDebug: commonInfo.debug,
|
||||||
fetcher: async (api: any) => {
|
fetcher: async (api: any) => {
|
||||||
let {url, method, data, responseType, config, headers} = api
|
let {url, method, data, responseType, config, headers} = api
|
||||||
config = config || {}
|
config = config || {}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import react from '@vitejs/plugin-react-swc'
|
import react from '@vitejs/plugin-react-swc'
|
||||||
import {defineConfig, UserConfig} from 'vite'
|
import {defineConfig, type UserConfig} from 'vite'
|
||||||
|
|
||||||
// https://vite.dev/config/
|
// https://vite.dev/config/
|
||||||
export default defineConfig(({mode}) => {
|
export default defineConfig(({mode}) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user