feat(frontend): Day 21 knowledge base management frontend completed
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { useParams } from 'react-router-dom'
|
||||
import { useState, useEffect } from 'react'
|
||||
import { Card, Typography, Space, Alert, Spin, message } from 'antd'
|
||||
import { Space, Alert, Spin, message } from 'antd'
|
||||
import { RobotOutlined } from '@ant-design/icons'
|
||||
import { agentApi, type AgentConfig } from '../api/agentApi'
|
||||
import conversationApi, { type Conversation, type Message } from '../api/conversationApi'
|
||||
@@ -9,8 +9,6 @@ import MessageInput from '../components/chat/MessageInput'
|
||||
import ModelSelector, { type ModelType } from '../components/chat/ModelSelector'
|
||||
import { useProjectStore } from '../stores/useProjectStore'
|
||||
|
||||
const { Title, Paragraph } = Typography
|
||||
|
||||
const AgentChatPage = () => {
|
||||
const { agentId } = useParams()
|
||||
const { currentProject } = useProjectStore()
|
||||
@@ -71,10 +69,8 @@ const AgentChatPage = () => {
|
||||
title: `与${agent.name}的对话`,
|
||||
})
|
||||
|
||||
if (response.success && response.data) {
|
||||
setConversation(response.data)
|
||||
setMessages([])
|
||||
}
|
||||
setConversation(response.data.data || null)
|
||||
setMessages([])
|
||||
} catch (err) {
|
||||
console.error('Failed to create conversation:', err)
|
||||
message.error('创建对话失败')
|
||||
|
||||
Reference in New Issue
Block a user