feat(aia): Complete AIA V2.0 with universal streaming capabilities
Major Updates: - Add StreamingService with OpenAI Compatible format (backend/common/streaming) - Upgrade Chat component V2 with Ant Design X integration - Implement AIA module with 12 intelligent agents - Create AgentHub with 100% prototype V11 restoration - Create ChatWorkspace with streaming response support - Add ThinkingBlock for deep thinking display - Add useAIStream Hook for OpenAI Compatible stream handling Backend Common Capabilities (~400 lines): - OpenAIStreamAdapter: SSE adapter with OpenAI format - StreamingService: unified streaming service - Support content and reasoning_content dual streams - Deep thinking tag processing (<think>...</think>) Frontend Common Capabilities (~2000 lines): - AIStreamChat: modern streaming chat component - ThinkingBlock: collapsible deep thinking display - ConversationList: conversation management with grouping - useAIStream: OpenAI Compatible stream handler Hook - useConversations: conversation state management Hook - Modern design styles (Ultramodern theme) AIA Module Frontend (~1500 lines): - AgentHub: 12 agent cards with timeline design - ChatWorkspace: fullscreen immersive chat interface - AgentCard: theme-colored cards (blue/yellow/teal/purple) - 5 phases, 12 agents configuration - Responsive layout (desktop + mobile) AIA Module Backend (~900 lines): - agentService: 12 agents config with system prompts - conversationService: refactored with StreamingService - attachmentService: file upload skeleton (30k token limit) - 12 API endpoints with authentication - Full CRUD for conversations and messages Documentation: - AIA module status and development guide - Universal capabilities catalog (11 services) - Quick reference card for developers - System overview updates Testing: - Stream response verified (HTTP 200) - Authentication working correctly - Auto conversation creation working - Deep thinking display working - Message input and send working Status: Core features completed (85%), attachment and history loading pending
This commit is contained in:
@@ -1,30 +1,50 @@
|
||||
import Placeholder from '@/shared/components/Placeholder'
|
||||
/**
|
||||
* AIA - AI Intelligent Assistant 模块入口
|
||||
*
|
||||
* 视图管理:
|
||||
* - Hub: 智能体大厅(12个模块展示)
|
||||
* - Chat: 沉浸式对话工作台
|
||||
*/
|
||||
|
||||
import React, { useState } from 'react';
|
||||
import { AgentHub } from './components/AgentHub';
|
||||
import { ChatWorkspace } from './components/ChatWorkspace';
|
||||
import type { AgentConfig } from './types';
|
||||
|
||||
const AIAModule: React.FC = () => {
|
||||
const [currentView, setCurrentView] = useState<'hub' | 'chat'>('hub');
|
||||
const [selectedAgent, setSelectedAgent] = useState<AgentConfig | null>(null);
|
||||
const [initialQuery, setInitialQuery] = useState<string | undefined>();
|
||||
|
||||
// 选择智能体,进入对话
|
||||
const handleAgentSelect = (agent: AgentConfig & { initialQuery?: string }) => {
|
||||
setSelectedAgent(agent);
|
||||
setInitialQuery(agent.initialQuery);
|
||||
setCurrentView('chat');
|
||||
};
|
||||
|
||||
// 返回大厅
|
||||
const handleBack = () => {
|
||||
setCurrentView('hub');
|
||||
setSelectedAgent(null);
|
||||
setInitialQuery(undefined);
|
||||
};
|
||||
|
||||
const AIAModule = () => {
|
||||
return (
|
||||
<Placeholder
|
||||
title="AI智能问答模块"
|
||||
description="后续基于新架构重写,提供更好的用户体验"
|
||||
moduleName="AIA - AI Intelligent Assistant"
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
export default AIAModule
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<>
|
||||
{currentView === 'hub' && (
|
||||
<AgentHub onAgentSelect={handleAgentSelect} />
|
||||
)}
|
||||
|
||||
{currentView === 'chat' && selectedAgent && (
|
||||
<ChatWorkspace
|
||||
agent={selectedAgent}
|
||||
initialQuery={initialQuery}
|
||||
onBack={handleBack}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default AIAModule;
|
||||
|
||||
Reference in New Issue
Block a user