refactor(ai): 移除chat,合并chat和knowledge为web
以后有需要再拆分
This commit is contained in:
@@ -42,7 +42,7 @@ function Conversation() {
|
||||
|
||||
const [agent] = useXAgent<ChatMessage>({
|
||||
request: async (info, callbacks) => {
|
||||
await fetchEventSource(`${commonInfo.baseAiChatUrl}/chat/async`, {
|
||||
await fetchEventSource(`${commonInfo.baseAiUrl}/chat/async`, {
|
||||
method: 'POST',
|
||||
headers: commonInfo.authorizationHeaders,
|
||||
body: JSON.stringify(info.messages),
|
||||
|
||||
@@ -24,7 +24,7 @@ const DataDetail: React.FC = () => {
|
||||
{
|
||||
type: 'service',
|
||||
className: 'inline',
|
||||
api: `${commonInfo.baseAiKnowledgeUrl}/knowledge/name?id=${knowledge_id}`,
|
||||
api: `${commonInfo.baseAiUrl}/knowledge/name?id=${knowledge_id}`,
|
||||
body: {
|
||||
type: 'tpl',
|
||||
tpl: '${name}',
|
||||
@@ -38,7 +38,7 @@ const DataDetail: React.FC = () => {
|
||||
body: [
|
||||
{
|
||||
type: 'crud',
|
||||
api: `${commonInfo.baseAiKnowledgeUrl}/knowledge/group/list?knowledge_id=${knowledge_id}`,
|
||||
api: `${commonInfo.baseAiUrl}/knowledge/group/list?knowledge_id=${knowledge_id}`,
|
||||
...crudCommonOptions(),
|
||||
headerToolbar: [
|
||||
'reload',
|
||||
@@ -146,7 +146,7 @@ const DataDetail: React.FC = () => {
|
||||
level: 'link',
|
||||
size: 'sm',
|
||||
actionType: 'ajax',
|
||||
api: `get:${commonInfo.baseAiKnowledgeUrl}/knowledge/group/delete?id=\${id}`,
|
||||
api: `get:${commonInfo.baseAiUrl}/knowledge/group/delete?id=\${id}`,
|
||||
confirmText: '确认删除',
|
||||
confirmTitle: '删除',
|
||||
},
|
||||
|
||||
@@ -23,7 +23,7 @@ const DataImport: React.FC = () => {
|
||||
{
|
||||
type: 'service',
|
||||
className: 'inline',
|
||||
api: `${commonInfo.baseAiKnowledgeUrl}/knowledge/name?id=${knowledge_id}`,
|
||||
api: `${commonInfo.baseAiUrl}/knowledge/name?id=${knowledge_id}`,
|
||||
body: {
|
||||
type: 'tpl',
|
||||
tpl: '${name}',
|
||||
@@ -109,7 +109,7 @@ const DataImport: React.FC = () => {
|
||||
// 500MB 524288000
|
||||
// 1GB 1073741824
|
||||
maxSize: 104857600,
|
||||
receiver: `${commonInfo.baseAiKnowledgeUrl}/upload`
|
||||
receiver: `${commonInfo.baseAiUrl}/upload`
|
||||
// useChunk: true,
|
||||
// startChunkApi: `post:${commonInfo.baseAiKnowledgeUrl}/upload/start`,
|
||||
// chunkApi: `post:${commonInfo.baseAiKnowledgeUrl}/upload/slice`,
|
||||
@@ -130,7 +130,7 @@ const DataImport: React.FC = () => {
|
||||
level: 'secondary',
|
||||
api: {
|
||||
method: 'post',
|
||||
url: `${commonInfo.baseAiKnowledgeUrl}/knowledge/preview_text`,
|
||||
url: `${commonInfo.baseAiUrl}/knowledge/preview_text`,
|
||||
dataType: 'form',
|
||||
data: {
|
||||
mode: '${mode|default:undefined}',
|
||||
@@ -148,7 +148,7 @@ const DataImport: React.FC = () => {
|
||||
actionType: 'ajax',
|
||||
api: {
|
||||
method: 'post',
|
||||
url: `${commonInfo.baseAiKnowledgeUrl}/knowledge/submit_text`,
|
||||
url: `${commonInfo.baseAiUrl}/knowledge/submit_text`,
|
||||
dataType: 'form',
|
||||
data: {
|
||||
id: knowledge_id,
|
||||
|
||||
@@ -18,7 +18,7 @@ const DataDetail: React.FC = () => {
|
||||
{
|
||||
type: 'service',
|
||||
className: 'inline',
|
||||
api: `${commonInfo.baseAiKnowledgeUrl}/knowledge/name?id=${knowledge_id}`,
|
||||
api: `${commonInfo.baseAiUrl}/knowledge/name?id=${knowledge_id}`,
|
||||
body: {
|
||||
type: 'tpl',
|
||||
tpl: '${name}',
|
||||
@@ -32,7 +32,7 @@ const DataDetail: React.FC = () => {
|
||||
body: [
|
||||
{
|
||||
type: 'crud',
|
||||
api: `${commonInfo.baseAiKnowledgeUrl}/knowledge/segment/list?knowledge_id=${knowledge_id}&group_id=${group_id}`,
|
||||
api: `${commonInfo.baseAiUrl}/knowledge/segment/list?knowledge_id=${knowledge_id}&group_id=${group_id}`,
|
||||
...crudCommonOptions(),
|
||||
headerToolbar: [
|
||||
'reload',
|
||||
|
||||
@@ -25,7 +25,7 @@ const Knowledge: React.FC = () => {
|
||||
body: [
|
||||
{
|
||||
type: 'crud',
|
||||
api: `${commonInfo.baseAiKnowledgeUrl}/knowledge/list`,
|
||||
api: `${commonInfo.baseAiUrl}/knowledge/list`,
|
||||
...crudCommonOptions(),
|
||||
headerToolbar: [
|
||||
'reload',
|
||||
@@ -42,7 +42,7 @@ const Knowledge: React.FC = () => {
|
||||
body: {
|
||||
type: 'form',
|
||||
api: {
|
||||
url: `${commonInfo.baseAiKnowledgeUrl}/knowledge/add`,
|
||||
url: `${commonInfo.baseAiUrl}/knowledge/add`,
|
||||
dataType: 'form',
|
||||
},
|
||||
body: [
|
||||
@@ -148,7 +148,7 @@ const Knowledge: React.FC = () => {
|
||||
actionType: 'ajax',
|
||||
api: {
|
||||
method: 'get',
|
||||
url: `${commonInfo.baseAiKnowledgeUrl}/knowledge/delete`,
|
||||
url: `${commonInfo.baseAiUrl}/knowledge/delete`,
|
||||
headers: {
|
||||
'Authorization': 'Basic QXhoRWJzY3dzSkRiWU1IMjpjWXhnM2I0UHRXb1ZENVNqRmF5V3h0blNWc2p6UnNnNA==',
|
||||
},
|
||||
|
||||
@@ -10,9 +10,8 @@ import {isEqual} from 'licia'
|
||||
export const commonInfo = {
|
||||
debug: isEqual(import.meta.env.MODE, 'development'),
|
||||
baseUrl: 'http://132.126.207.130:35690/hudi_services/service_web',
|
||||
baseAiChatUrl: 'http://localhost:8080',
|
||||
// baseAiKnowledgeUrl: 'http://132.126.207.130:35690/hudi_services/ai_knowledge',
|
||||
baseAiKnowledgeUrl: 'http://localhost:8080',
|
||||
baseAiUrl: 'http://localhost:8080',
|
||||
// baseUrl: '/hudi_services/service_web',
|
||||
authorizationHeaders: {
|
||||
'Authorization': 'Basic QXhoRWJzY3dzSkRiWU1IMjpjWXhnM2I0UHRXb1ZENVNqRmF5V3h0blNWc2p6UnNnNA==',
|
||||
|
||||
Reference in New Issue
Block a user