feat(aia): Complete AIA V2.0 with universal streaming capabilities
Major Changes: - Add StreamingService with OpenAI Compatible format - Upgrade Chat component V2 with Ant Design X integration - Implement AIA module with 12 intelligent agents - Update API routes to unified /api/v1 prefix - Update system documentation Backend (~1300 lines): - common/streaming: OpenAI Compatible adapter - modules/aia: 12 agents, conversation service, streaming integration - Update route versions (RVW, PKB to v1) Frontend (~3500 lines): - modules/aia: AgentHub + ChatWorkspace (100% prototype restoration) - shared/Chat: AIStreamChat, ThinkingBlock, useAIStream Hook - Update API endpoints to v1 Documentation: - AIA module status guide - Universal capabilities catalog - System overview updates - All module documentation sync Tested: Stream response verified, authentication working Status: AIA V2.0 core completed (85%)
This commit is contained in:
@@ -46,3 +46,4 @@ export default apiClient;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -209,3 +209,4 @@ export { AuthContext };
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -245,3 +245,4 @@ export async function logout(): Promise<void> {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -11,3 +11,4 @@ export * from './api';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -35,3 +35,4 @@ export async function fetchUserModules(): Promise<string[]> {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -104,3 +104,4 @@ export interface AuthContextType extends AuthState {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* PKB个人知识库 API(v2版本)
|
||||
* 更新API路径为 /api/v2/pkb/knowledge
|
||||
* PKB个人知识库 API
|
||||
* API路径: /api/v1/pkb/knowledge
|
||||
*/
|
||||
|
||||
import axios from 'axios';
|
||||
@@ -9,7 +9,7 @@ import { getAccessToken } from '../../../framework/auth/api';
|
||||
const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || 'http://localhost:3000';
|
||||
|
||||
const api = axios.create({
|
||||
baseURL: `${API_BASE_URL}/api/v2/pkb/knowledge`,
|
||||
baseURL: `${API_BASE_URL}/api/v1/pkb/knowledge`,
|
||||
timeout: 30000,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
@@ -136,10 +136,10 @@ export const BatchModeComplete: React.FC<BatchModeCompleteProps> = ({
|
||||
|
||||
try {
|
||||
// 调用批处理API(使用v2新版API)
|
||||
// 完整路径: /api/v2/pkb/batch-tasks/batch/execute
|
||||
// 完整路径: /api/v1/pkb/batch-tasks/batch/execute
|
||||
// 请求体格式必须匹配后端 ExecuteBatchBody 接口
|
||||
const token = getAccessToken();
|
||||
const response = await fetch('/api/v2/pkb/batch-tasks/batch/execute', {
|
||||
const response = await fetch('/api/v1/pkb/batch-tasks/batch/execute', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -180,7 +180,7 @@ export const BatchModeComplete: React.FC<BatchModeCompleteProps> = ({
|
||||
const pollInterval = setInterval(async () => {
|
||||
try {
|
||||
const pollToken = getAccessToken();
|
||||
const statusRes = await fetch(`/api/v2/pkb/batch-tasks/batch/tasks/${taskId}`, {
|
||||
const statusRes = await fetch(`/api/v1/pkb/batch-tasks/batch/tasks/${taskId}`, {
|
||||
headers: pollToken ? { 'Authorization': `Bearer ${pollToken}` } : {},
|
||||
});
|
||||
if (!statusRes.ok) {
|
||||
@@ -220,7 +220,7 @@ export const BatchModeComplete: React.FC<BatchModeCompleteProps> = ({
|
||||
// 获取最终结果
|
||||
try {
|
||||
const resultToken = getAccessToken();
|
||||
const resultsRes = await fetch(`/api/v2/pkb/batch-tasks/batch/tasks/${taskId}/results`, {
|
||||
const resultsRes = await fetch(`/api/v1/pkb/batch-tasks/batch/tasks/${taskId}/results`, {
|
||||
headers: resultToken ? { 'Authorization': `Bearer ${resultToken}` } : {},
|
||||
});
|
||||
console.log('[BatchMode] 获取结果响应状态:', resultsRes.status);
|
||||
|
||||
@@ -145,13 +145,13 @@ export const DeepReadMode: React.FC<DeepReadModeProps> = ({
|
||||
timestamp: Date.now(),
|
||||
}]}
|
||||
providerConfig={{
|
||||
apiEndpoint: '/api/v2/pkb/chat/stream',
|
||||
apiEndpoint: '/api/v1/pkb/chat/stream',
|
||||
requestFn: async (message: string) => {
|
||||
// 🔑 关键:传递 fullTextDocumentIds 而不是 documentIds
|
||||
// fullTextDocumentIds 会触发全文加载模式,AI可以看到完整文献
|
||||
// documentIds 只是过滤RAG检索结果,AI只能看到片段
|
||||
const token = getAccessToken();
|
||||
const response = await fetch('/api/v2/pkb/chat/stream', {
|
||||
const response = await fetch('/api/v1/pkb/chat/stream', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
@@ -112,10 +112,10 @@ export const FullTextMode: React.FC<FullTextModeProps> = ({ kbId, documents }) =
|
||||
}]}
|
||||
customMessageRenderer={renderMessageContent}
|
||||
providerConfig={{
|
||||
apiEndpoint: '/api/v2/pkb/chat/stream',
|
||||
apiEndpoint: '/api/v1/pkb/chat/stream',
|
||||
requestFn: async (message: string) => {
|
||||
const token = getAccessToken();
|
||||
const response = await fetch('/api/v2/pkb/chat/stream', {
|
||||
const response = await fetch('/api/v1/pkb/chat/stream', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
@@ -294,3 +294,4 @@ export default KnowledgePage;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -49,3 +49,4 @@ export interface BatchTemplate {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import apiClient from '../../../common/api/axios';
|
||||
import type { ReviewTask, ReviewReport, ApiResponse, AgentType } from '../types';
|
||||
|
||||
const API_BASE = '/api/v2/rvw';
|
||||
const API_BASE = '/api/v1/rvw';
|
||||
|
||||
// 获取任务列表
|
||||
export async function getTasks(status?: string): Promise<ReviewTask[]> {
|
||||
|
||||
@@ -127,3 +127,4 @@ export default function AgentModal({ visible, taskCount, onClose, onConfirm }: A
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -47,3 +47,4 @@ export default function BatchToolbar({ selectedCount, onRunBatch, onClearSelecti
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -70,3 +70,4 @@ export default function FilterChips({ filters, counts, onFilterChange }: FilterC
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -60,3 +60,4 @@ export default function Header({ onUpload }: HeaderProps) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -114,3 +114,4 @@ export default function ReportDetail({ report, onBack }: ReportDetailProps) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -42,3 +42,4 @@ export default function ScoreRing({ score, size = 'medium', showLabel = true }:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -77,3 +77,4 @@ export default function Sidebar({ currentView, onViewChange, onSettingsClick }:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -19,3 +19,4 @@ export { default as TaskDetail } from './TaskDetail';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -288,3 +288,4 @@ export default function Dashboard() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -237,3 +237,4 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -370,3 +370,4 @@ export default function LoginPage() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -338,3 +338,4 @@ export default TenantListPage;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -247,3 +247,4 @@ export async function fetchModuleList(): Promise<ModuleInfo[]> {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user