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%)
572 lines
11 KiB
Markdown
572 lines
11 KiB
Markdown
# AIA V2.1 <20>𡒊垢 API 霈曇恣
|
||
|
||
> **<2A><>𧋦**嚗间2.1
|
||
> **<2A>𥕦遣<F0A595A6>交<EFBFBD>**嚗?026-01-11
|
||
> **<2A>箇<EFBFBD>頝臬<E9A09D>**嚗䫤/api/v1/aia`
|
||
|
||
---
|
||
|
||
## <20><> API 璁<><E79281>
|
||
|
||
| <20>寞<EFBFBD> | 頝臬<E9A09D> | <20>讛膩 | 霈方<E99C88> |
|
||
|------|------|------|------|
|
||
| GET | `/agents` | <20>瑕<EFBFBD><E79195>箄<EFBFBD>雿枏<E99BBF>銵?| <20>?|
|
||
| GET | `/agents/:id` | <20>瑕<EFBFBD><E79195>箄<EFBFBD>雿栞祕<E6A09E>?| <20>?|
|
||
| POST | `/intent/route` | <20>誩㦛頝舐眏 | <20>?|
|
||
| GET | `/conversations` | <20>瑕<EFBFBD>撖寡<E69296><E5AFA1>𡑒” | <20>?|
|
||
| POST | `/conversations` | <20>𥕦遣撖寡<E69296> | <20>?|
|
||
| GET | `/conversations/:id` | <20>瑕<EFBFBD>撖寡<E69296>霂行<E99C82> | <20>?|
|
||
| DELETE | `/conversations/:id` | <20>𣳇膄撖寡<E69296> | <20>?|
|
||
| POST | `/conversations/:id/messages/stream` | <20>煾<EFBFBD><E785BE><EFBFBD><EFBFBD>荔<EFBFBD>瘚<EFBFBD><E7989A>嚗?| <20>?|
|
||
| POST | `/conversations/:id/attachments` | 銝𠹺<E98A9D><F0A0B9BA><EFBFBD>辣 | <20>?|
|
||
| GET | `/projects` | <20>瑕<EFBFBD>憿寧𤌍<E5AFA7>𡑒” | <20>?|
|
||
| GET | `/projects/:id` | <20>瑕<EFBFBD>憿寧𤌍霂行<E99C82> | <20>?|
|
||
|
||
---
|
||
|
||
## <20><> 霈方<E99C88>
|
||
|
||
<EFBFBD><EFBFBD><EFBFBD>?API <20><>閬<EFBFBD>銁霂瑟<E99C82>憭港葉<E6B8AF>箏蒂 JWT Token嚗?
|
||
|
||
```
|
||
Authorization: Bearer <token>
|
||
```
|
||
|
||
---
|
||
|
||
## <20><> API 霂衣<E99C82>摰帋<E691B0>
|
||
|
||
### 1. <20>箄<EFBFBD>雿梶㮾<E6A2B6>?
|
||
|
||
#### 1.1 <20>瑕<EFBFBD><E79195>箄<EFBFBD>雿枏<E99BBF>銵?
|
||
|
||
```http
|
||
GET /api/v1/aia/agents
|
||
```
|
||
|
||
**<EFBFBD>亥砭<EFBFBD><EFBFBD>㺭**嚗?
|
||
|
||
| <20><>㺭 | 蝐餃<E89D90> | 敹<>‵ | <20>讛膩 |
|
||
|------|------|------|------|
|
||
| stage | string | <20>?| 蝑偦<E89D91>厰𧫴畾蛛<E795BE>`design`, `data`, `analysis`, `write`, `publish` |
|
||
|
||
**<EFBFBD>滚<EFBFBD>**嚗?
|
||
|
||
```json
|
||
{
|
||
"code": 0,
|
||
"data": {
|
||
"agents": [
|
||
{
|
||
"id": "research-design",
|
||
"name": "蝘𤑳<E89D98>霈曇恣撠誩𨭌<E8AAA9>?,
|
||
"description": "撣桀𨭌<EFBFBD>典<EFBFBD><EFBFBD>鞟<EFBFBD>蝛嗆䲮獢<EFBFBD>挽霈~<EFBFBD><EFBFBD><EFBFBD><EFBFBD>格<EFBFBD>蝝U<EFBFBD><EFBFBD>䲮瘜訫郎<EFBFBD><EFBFBD>紡",
|
||
"icon": "<EFBFBD>𥈡",
|
||
"stage": "design",
|
||
"color": "#3B82F6",
|
||
"knowledgeBaseId": "kb-001",
|
||
"isTool": false
|
||
},
|
||
{
|
||
"id": "dc-tool",
|
||
"name": "<EFBFBD>唳旿<EFBFBD><EFBFBD><EFBFBD>撌亙<EFBFBD>",
|
||
"description": "頝唾蓮<EFBFBD>唳㺭<EFBFBD>桅<EFBFBD><EFBFBD><EFBFBD>芋<EFBFBD>?,
|
||
"icon": "<22><>",
|
||
"stage": "data",
|
||
"color": "#8B5CF6",
|
||
"targetModule": "/data-collection",
|
||
"isTool": true
|
||
}
|
||
]
|
||
}
|
||
}
|
||
```
|
||
|
||
#### 1.2 <20>瑕<EFBFBD><E79195>箄<EFBFBD>雿栞祕<E6A09E>?
|
||
|
||
```http
|
||
GET /api/v1/aia/agents/:id
|
||
```
|
||
|
||
**<EFBFBD>滚<EFBFBD>**嚗?
|
||
|
||
```json
|
||
{
|
||
"code": 0,
|
||
"data": {
|
||
"id": "research-design",
|
||
"name": "蝘𤑳<E89D98>霈曇恣撠誩𨭌<E8AAA9>?,
|
||
"description": "撣桀𨭌<EFBFBD>典<EFBFBD><EFBFBD>鞟<EFBFBD>蝛嗆䲮獢<EFBFBD>挽霈~<EFBFBD><EFBFBD><EFBFBD><EFBFBD>格<EFBFBD>蝝U<EFBFBD><EFBFBD>䲮瘜訫郎<EFBFBD><EFBFBD>紡",
|
||
"icon": "<EFBFBD>𥈡",
|
||
"stage": "design",
|
||
"color": "#3B82F6",
|
||
"knowledgeBaseId": "kb-001",
|
||
"systemPrompt": "雿䭾糓銝<EFBFBD>銝芯<EFBFBD>銝𡁶<EFBFBD><EFBFBD>餃郎蝘𤑳<EFBFBD>霈曇恣銝枏振...",
|
||
"welcomeMessage": "<EFBFBD>典末嚗<EFBFBD><EFBFBD><EFBFBD>舐<EFBFBD><EFBFBD>磰挽霈∪<EFBFBD><EFBFBD>拇<EFBFBD>嚗峕<EFBFBD><EFBFBD>臭誑撣格<EFBFBD>嚗䨵n- 霈曇恣<EFBFBD>𠉛弦<EFBFBD>寞<EFBFBD>\n- 璉<EFBFBD>蝝Y㮾<EFBFBD>單<EFBFBD><EFBFBD>娉n- <EFBFBD><EFBFBD>紡<EFBFBD>𠉛弦<EFBFBD>寞<EFBFBD>",
|
||
"suggestedQuestions": [
|
||
"憒<EFBFBD><EFBFBD>霈曇恣銝<EFBFBD>銝析CT<EFBFBD>𠉛弦嚗?,
|
||
"撣格<E692A3>璉<EFBFBD>蝝Z<E89D9D>5撟渡<E6929F>撠輻<E692A0><E8BCBB>𠉛弦<F0A0899B><E5BCA6>讃",
|
||
"隞<>銋<EFBFBD><E98A8B><EFBFBD>萎<EFBFBD>雿輻鍂<E8BCBB>曉<EFBFBD><E69B89>扯<EFBFBD><E689AF><EFBFBD>龪<EFBFBD>㵪<EFBFBD>"
|
||
]
|
||
}
|
||
}
|
||
```
|
||
|
||
---
|
||
|
||
### 2. <20>誩㦛頝舐眏
|
||
|
||
#### 2.1 <20>箄<EFBFBD><E7AE84>誩㦛霂<E3A69B><E99C82>
|
||
|
||
```http
|
||
POST /api/v1/aia/intent/route
|
||
```
|
||
|
||
**霂瑟<E99C82>雿?*嚗?
|
||
|
||
```json
|
||
{
|
||
"query": "撣格<EFBFBD><EFBFBD><EFBFBD><EFBFBD>銝<EFBFBD>銝贝<EFBFBD>隞賣㺭<EFBFBD>?
|
||
}
|
||
```
|
||
|
||
**<EFBFBD>滚<EFBFBD>**嚗?
|
||
|
||
```json
|
||
{
|
||
"code": 0,
|
||
"data": {
|
||
"agentId": "data-analysis",
|
||
"agentName": "蝏蠘恣<E8A098><E681A3><EFBFBD>撠誩𨭌<E8AAA9>?,
|
||
"confidence": 0.92,
|
||
"prefillPrompt": "霂瑕葬<EFBFBD>穃<EFBFBD><EFBFBD>鞱<EFBFBD>隞賣㺭<EFBFBD>殷<EFBFBD><EFBFBD><EFBFBD>𡠺<EFBFBD>讛膩<EFBFBD>抒<EFBFBD>霈∪<EFBFBD><EFBFBD>詨<EFBFBD><EFBFBD>批<EFBFBD><EFBFBD>?
|
||
}
|
||
}
|
||
```
|
||
|
||
---
|
||
|
||
### 3. 撖寡<E69296>蝞∠<E89D9E>
|
||
|
||
#### 3.1 <20>瑕<EFBFBD>撖寡<E69296><E5AFA1>𡑒”
|
||
|
||
```http
|
||
GET /api/v1/aia/conversations
|
||
```
|
||
|
||
**<EFBFBD>亥砭<EFBFBD><EFBFBD>㺭**嚗?
|
||
|
||
| <20><>㺭 | 蝐餃<E89D90> | 敹<>‵ | <20>讛膩 |
|
||
|------|------|------|------|
|
||
| agentId | string | <20>?| <20>㗇惣<E39787>賭<EFBFBD>蝑偦<E89D91>?|
|
||
| projectId | string | <20>?| <20>厰★<E58EB0>桃<EFBFBD><E6A183>㚁<EFBFBD>NULL 銵函內<E587BD>𡁶鍂撖寡<E69296>嚗?|
|
||
| page | number | <20>?| 憿萇<E686BF>嚗屸<E59A97>霈?1 |
|
||
| pageSize | number | <20>?| 瘥誯△<E8AAAF>圈<EFBFBD>嚗屸<E59A97>霈?20 |
|
||
|
||
**<EFBFBD>滚<EFBFBD>**嚗?
|
||
|
||
```json
|
||
{
|
||
"code": 0,
|
||
"data": {
|
||
"conversations": [
|
||
{
|
||
"id": "conv-001",
|
||
"title": "RCT<43>𠉛弦霈曇恣<E69B87>刻砭",
|
||
"agentId": "research-design",
|
||
"agentName": "蝘𤑳<E89D98>霈曇恣撠誩𨭌<E8AAA9>?,
|
||
"projectId": null,
|
||
"messageCount": 12,
|
||
"lastMessage": "憟賜<EFBFBD>嚗峕<EFBFBD><EFBFBD>亙葬<EFBFBD>刻挽霈∠<EFBFBD>蝛嗆䲮獢?..",
|
||
"createdAt": "2026-01-11T10:00:00Z",
|
||
"updatedAt": "2026-01-11T12:30:00Z"
|
||
}
|
||
],
|
||
"pagination": {
|
||
"total": 25,
|
||
"page": 1,
|
||
"pageSize": 20,
|
||
"totalPages": 2
|
||
}
|
||
}
|
||
}
|
||
```
|
||
|
||
#### 3.2 <20>𥕦遣撖寡<E69296>
|
||
|
||
```http
|
||
POST /api/v1/aia/conversations
|
||
```
|
||
|
||
**霂瑟<E99C82>雿?*嚗?
|
||
|
||
```json
|
||
{
|
||
"agentId": "research-design",
|
||
"projectId": null,
|
||
"title": "<EFBFBD>啣笆霂?
|
||
}
|
||
```
|
||
|
||
**<EFBFBD>滚<EFBFBD>**嚗?
|
||
|
||
```json
|
||
{
|
||
"code": 0,
|
||
"data": {
|
||
"id": "conv-002",
|
||
"title": "<22>啣笆霂?,
|
||
"agentId": "research-design",
|
||
"projectId": null,
|
||
"createdAt": "2026-01-11T14:00:00Z"
|
||
}
|
||
}
|
||
```
|
||
|
||
#### 3.3 <20>瑕<EFBFBD>撖寡<E69296>霂行<E99C82>嚗<EFBFBD>鉄<EFBFBD><E98984>蟮瘨<E89FAE><E798A8>嚗?
|
||
|
||
```http
|
||
GET /api/v1/aia/conversations/:id
|
||
```
|
||
|
||
**<EFBFBD>亥砭<EFBFBD><EFBFBD>㺭**嚗?
|
||
|
||
| <20><>㺭 | 蝐餃<E89D90> | 敹<>‵ | <20>讛膩 |
|
||
|------|------|------|------|
|
||
| limit | number | <20>?| <20>瑕<EFBFBD><E79195><EFBFBD>餈𤨩<E9A488>⊥<EFBFBD><E28AA5>荔<EFBFBD>暺䁅恕 50 |
|
||
|
||
**<EFBFBD>滚<EFBFBD>**嚗?
|
||
|
||
```json
|
||
{
|
||
"code": 0,
|
||
"data": {
|
||
"id": "conv-001",
|
||
"title": "RCT<43>𠉛弦霈曇恣<E69B87>刻砭",
|
||
"agentId": "research-design",
|
||
"agentName": "蝘𤑳<E89D98>霈曇恣撠誩𨭌<E8AAA9>?,
|
||
"projectId": null,
|
||
"createdAt": "2026-01-11T10:00:00Z",
|
||
"updatedAt": "2026-01-11T12:30:00Z",
|
||
"messages": [
|
||
{
|
||
"id": "msg-001",
|
||
"role": "user",
|
||
"content": "撣格<EFBFBD>霈曇恣銝<EFBFBD>銝芸<EFBFBD>鈭𡒊<EFBFBD>撠輻<EFBFBD><EFBFBD><EFBFBD>CT<EFBFBD>𠉛弦",
|
||
"attachments": [],
|
||
"createdAt": "2026-01-11T10:00:00Z"
|
||
},
|
||
{
|
||
"id": "msg-002",
|
||
"role": "assistant",
|
||
"content": "憟賜<EFBFBD>嚗峕<EFBFBD><EFBFBD>亙葬<EFBFBD>刻挽霈∩<EFBFBD>銝芰<EFBFBD>撠輻<EFBFBD>RCT<EFBFBD>𠉛弦<EFBFBD>寞<EFBFBD>...",
|
||
"thinkingContent": "<EFBFBD>冽<EFBFBD><EFBFBD>唾挽霈﹕CT<EFBFBD>𠉛弦嚗屸<EFBFBD>閬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>嚗?嚗厩<EFBFBD>蝛嗥𤌍<EFBFBD>?2嚗匧<EFBFBD><EFBFBD>埝<EFBFBD><EFBFBD>?3嚗㗇甅<EFBFBD>祇<EFBFBD> 4嚗厰<EFBFBD><EFBFBD>箏<EFBFBD><EFBFBD>寞<EFBFBD> 5嚗厩𤩅瘜?6嚗厩<EFBFBD>撅<EFBFBD><EFBFBD><EFBFBD><EFBFBD>...",
|
||
"model": "deepseek-v3",
|
||
"tokens": 1250,
|
||
"createdAt": "2026-01-11T10:00:30Z"
|
||
}
|
||
]
|
||
}
|
||
}
|
||
```
|
||
|
||
#### 3.4 <20>𣳇膄撖寡<E69296>
|
||
|
||
```http
|
||
DELETE /api/v1/aia/conversations/:id
|
||
```
|
||
|
||
**<EFBFBD>滚<EFBFBD>**嚗?
|
||
|
||
```json
|
||
{
|
||
"code": 0,
|
||
"data": {
|
||
"deleted": true
|
||
}
|
||
}
|
||
```
|
||
|
||
---
|
||
|
||
### 4. 瘨<><E798A8><EFBFBD>煾<EFBFBD><E785BE><EFBFBD>瘚<EFBFBD><E7989A>嚗?
|
||
|
||
#### 4.1 <20>煾<EFBFBD><E785BE><EFBFBD><EFBFBD>臬僎<E887AC>瑕<EFBFBD>瘚<EFBFBD><E7989A><EFBFBD>滚<EFBFBD>
|
||
|
||
```http
|
||
POST /api/v1/aia/conversations/:id/messages/stream
|
||
```
|
||
|
||
**霂瑟<E99C82>憭?*嚗?
|
||
|
||
```
|
||
Content-Type: application/json
|
||
Accept: text/event-stream
|
||
```
|
||
|
||
**霂瑟<E99C82>雿?*嚗?
|
||
|
||
```json
|
||
{
|
||
"content": "撣格<E692A3><E6A0BC><EFBFBD><EFBFBD>餈嗘遢<E59798>唳旿",
|
||
"attachmentIds": ["att-001", "att-002"],
|
||
"enableDeepThinking": true
|
||
}
|
||
```
|
||
|
||
**<EFBFBD>滚<EFBFBD>嚗𠄎SE <20>澆<EFBFBD>嚗?*嚗?
|
||
|
||
```
|
||
event: thinking_start
|
||
data: {}
|
||
|
||
event: thinking_delta
|
||
data: {"content": "<22>冽<EFBFBD>銝𠹺<E98A9D>鈭<EFBFBD>㺭<EFBFBD>格<EFBFBD>隞塚<E99A9E><E5A19A><EFBFBD>閬?}
|
||
|
||
event: thinking_delta
|
||
data: {"content": "餈𥡝<E9A488><F0A5A19D>讛膩<E8AE9B>抒<EFBFBD>霈∪<E99C88><E288AA>?.."}
|
||
|
||
event: thinking_end
|
||
data: {"duration": 3200}
|
||
|
||
event: message_start
|
||
data: {"id": "msg-003"}
|
||
|
||
event: delta
|
||
data: {"content": "<22>寞旿<E5AF9E>其<EFBFBD>隡删<E99AA1><E588A0>唳旿嚗?}
|
||
|
||
event: delta
|
||
data: {"content": "<22>烐䔉銝箸<E98A9D>餈𥡝<E9A488><F0A5A19D><EFBFBD><EFBFBD>..."}
|
||
|
||
event: message_end
|
||
data: {"id": "msg-003", "tokens": 850, "model": "deepseek-v3"}
|
||
|
||
event: done
|
||
data: {}
|
||
```
|
||
|
||
**SSE 鈭衤辣蝐餃<E89D90>**嚗?
|
||
|
||
| 鈭衤辣 | <20>讛膩 | <20>唳旿<E594B3>澆<EFBFBD> |
|
||
|------|------|---------|
|
||
| `thinking_start` | 撘<>憪𧢲楛摨行<E691A8>肽<EFBFBD>?| `{}` |
|
||
| `thinking_delta` | <20>肽<EFBFBD><E882BD><EFBFBD>摰寧<E691B0>畾?| `{"content": "..."}` |
|
||
| `thinking_end` | <20>肽<EFBFBD><E882BD><EFBFBD><EFBFBD>?| `{"duration": number}` |
|
||
| `message_start` | 撘<>憪讠<E686AA><E8AEA0>𣂼<EFBFBD>憭?| `{"id": "..."}` |
|
||
| `delta` | <20>𧼮<EFBFBD><F0A7BCAE><EFBFBD>捆<EFBFBD><E68D86>挾 | `{"content": "..."}` |
|
||
| `message_end` | <20>𧼮<EFBFBD>蝏𤘪<E89D8F> | `{"id": "...", "tokens": number, "model": "..."}` |
|
||
| `error` | <20>𤑳<EFBFBD><F0A491B3>躰秤 | `{"code": "...", "message": "..."}` |
|
||
| `done` | 瘚<><E7989A><EFBFBD>?| `{}` |
|
||
|
||
---
|
||
|
||
### 5. <20><>辣銝𠹺<E98A9D>
|
||
|
||
#### 5.1 銝𠹺<E98A9D><F0A0B9BA><EFBFBD>辣
|
||
|
||
```http
|
||
POST /api/v1/aia/conversations/:id/attachments
|
||
```
|
||
|
||
**霂瑟<E99C82>憭?*嚗?
|
||
|
||
```
|
||
Content-Type: multipart/form-data
|
||
```
|
||
|
||
**霂瑟<E99C82>雿橒<E99BBF>FormData嚗?*嚗?
|
||
|
||
| 摮埈挾 | 蝐餃<E89D90> | 敹<>‵ | <20>讛膩 |
|
||
|------|------|------|------|
|
||
| file | File | <20>?| <20><>辣嚗㇊DF/Word/TXT/Excel嚗峕<E59A97>憭?0MB嚗?|
|
||
|
||
**<EFBFBD>滚<EFBFBD>**嚗?
|
||
|
||
```json
|
||
{
|
||
"code": 0,
|
||
"data": {
|
||
"id": "att-001",
|
||
"filename": "<22>𠉛弦<F0A0899B>唳旿.xlsx",
|
||
"mimeType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||
"size": 1024000,
|
||
"ossUrl": "https://oss.example.com/attachments/att-001.xlsx",
|
||
"textExtracted": true,
|
||
"tokenCount": 15000,
|
||
"truncated": false,
|
||
"createdAt": "2026-01-11T14:00:00Z"
|
||
}
|
||
}
|
||
```
|
||
|
||
**<EFBFBD>躰秤<EFBFBD>?*嚗?
|
||
|
||
| <20>躰秤<E8BAB0>?| <20>讛膩 |
|
||
|--------|------|
|
||
| `ATTACHMENT_TOO_LARGE` | <20><>辣頞<E8BEA3><E9A09E> 20MB |
|
||
| `ATTACHMENT_TYPE_NOT_SUPPORTED` | 銝齿𣈲<E9BDBF><F0A388B2><EFBFBD><EFBFBD><EFBFBD>辣蝐餃<E89D90> |
|
||
| `ATTACHMENT_LIMIT_EXCEEDED` | <20><>辣<EFBFBD>圈<EFBFBD>頞<EFBFBD><E9A09E>銝𢠃<E98A9D>嚗?銝迎<E98A9D> |
|
||
| `TEXT_EXTRACTION_FAILED` | <20><>𧋦<EFBFBD>𣂼<EFBFBD>憭梯揖 |
|
||
|
||
---
|
||
|
||
### 6. 憿寧𤌍蝞∠<E89D9E>
|
||
|
||
#### 6.1 <20>瑕<EFBFBD>憿寧𤌍<E5AFA7>𡑒”
|
||
|
||
```http
|
||
GET /api/v1/aia/projects
|
||
```
|
||
|
||
**<EFBFBD>滚<EFBFBD>**嚗?
|
||
|
||
```json
|
||
{
|
||
"code": 0,
|
||
"data": {
|
||
"projects": [
|
||
{
|
||
"id": "proj-001",
|
||
"name": "蝟硋倏<E7A18B><E5808F><EFBFBD>蝛園★<E59C92>?,
|
||
"description": "2<EFBFBD>讠<EFBFBD>撠輻<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>瘣餅䲮撘誩僕憸<EFBFBD><EFBFBD>蝛?,
|
||
"conversationCount": 5,
|
||
"createdAt": "2026-01-01T10:00:00Z",
|
||
"updatedAt": "2026-01-11T12:00:00Z"
|
||
}
|
||
]
|
||
}
|
||
}
|
||
```
|
||
|
||
---
|
||
|
||
## <20>圲 <20>躰秤憭<E7A7A4><E686AD>
|
||
|
||
### <20>躰秤<E8BAB0>滚<EFBFBD><E6BB9A>澆<EFBFBD>
|
||
|
||
```json
|
||
{
|
||
"code": -1,
|
||
"error": {
|
||
"code": "CONVERSATION_NOT_FOUND",
|
||
"message": "撖寡<EFBFBD>銝滚<EFBFBD><EFBFBD>?
|
||
}
|
||
}
|
||
```
|
||
|
||
### <20>𡁶鍂<F0A181B6>躰秤<E8BAB0>?
|
||
|
||
| <20>躰秤<E8BAB0>?| HTTP <20>嗆<EFBFBD><E59786><EFBFBD> | <20>讛膩 |
|
||
|--------|------------|------|
|
||
| `UNAUTHORIZED` | 401 | <20>芣<EFBFBD><E88AA3>?|
|
||
| `FORBIDDEN` | 403 | <20>䭾<EFBFBD><E4ADBE>?|
|
||
| `NOT_FOUND` | 404 | 韏<><E99F8F>銝滚<E98A9D><E6BB9A>?|
|
||
| `VALIDATION_ERROR` | 400 | <20><>㺭撉諹<E69289>憭梯揖 |
|
||
| `INTERNAL_ERROR` | 500 | <20>滚𦛚<E6BB9A>典<EFBFBD><E585B8>券<EFBFBD>霂?|
|
||
| `LLM_ERROR` | 500 | LLM 靚<>鍂憭梯揖 |
|
||
| `RATE_LIMITED` | 429 | 霂瑟<E99C82>餈<EFBFBD><E9A488>憸𤑳<E686B8> |
|
||
|
||
---
|
||
|
||
## <20><> <20>唳旿璅∪<E79285>
|
||
|
||
### Attachment嚗<74><E59A97>隞塚<E99A9E>
|
||
|
||
```typescript
|
||
interface Attachment {
|
||
id: string; // <20><>辣ID
|
||
filename: string; // <20>笔<EFBFBD><E7AC94><EFBFBD>辣<EFBFBD>?
|
||
mimeType: string; // MIME 蝐餃<E89D90>
|
||
size: number; // <20><>辣憭批<E686AD>嚗<EFBFBD><E59A97><EFBFBD><EFBFBD><EFBFBD>
|
||
ossUrl: string; // OSS 摮睃<E691AE><E79D83>啣<EFBFBD>
|
||
textContent?: string; // <20>𣂼<EFBFBD><F0A382BC><EFBFBD><EFBFBD><EFBFBD>砍<EFBFBD>摰對<E691B0>摮睃<E691AE><E79D83>嗆⏛<E59786>哨<EFBFBD>
|
||
tokenCount: number; // <20><>𧋦 Token <20>?
|
||
truncated: boolean; // <20>臬炏鋡急⏛<E680A5>哨<EFBFBD>頞<EFBFBD><E9A09E>30K tokens嚗?
|
||
createdAt: string; // <20>𥕦遣<F0A595A6>園𡢿
|
||
}
|
||
```
|
||
|
||
### Message嚗<65><E59A97><EFBFBD>荔<EFBFBD>
|
||
|
||
```typescript
|
||
interface Message {
|
||
id: string;
|
||
conversationId: string;
|
||
role: 'user' | 'assistant';
|
||
content: string;
|
||
thinkingContent?: string; // 瘛勗漲<E58B97>肽<EFBFBD><E882BD><EFBFBD>摰?
|
||
attachments?: Attachment[];
|
||
model?: string;
|
||
tokens?: number;
|
||
isPinned: boolean;
|
||
createdAt: string;
|
||
}
|
||
```
|
||
|
||
---
|
||
|
||
## <20>妒 瘚贝<E7989A>蝷箔<E89DB7>嚗㇌EST Client嚗?
|
||
|
||
```http
|
||
### <EFBFBD>瑕<EFBFBD><EFBFBD>箄<EFBFBD>雿枏<EFBFBD>銵?
|
||
GET {{baseUrl}}/api/v1/aia/agents
|
||
Authorization: Bearer {{token}}
|
||
|
||
### <EFBFBD>誩㦛頝舐眏
|
||
POST {{baseUrl}}/api/v1/aia/intent/route
|
||
Authorization: Bearer {{token}}
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"query": "撣格<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>唳旿"
|
||
}
|
||
|
||
### <EFBFBD>𥕦遣撖寡<EFBFBD>
|
||
POST {{baseUrl}}/api/v1/aia/conversations
|
||
Authorization: Bearer {{token}}
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"agentId": "research-design",
|
||
"title": "瘚贝<EFBFBD>撖寡<EFBFBD>"
|
||
}
|
||
|
||
### <EFBFBD>煾<EFBFBD><EFBFBD><EFBFBD><EFBFBD>荔<EFBFBD>瘚<EFBFBD><EFBFBD>嚗?
|
||
POST {{baseUrl}}/api/v1/aia/conversations/{{conversationId}}/messages/stream
|
||
Authorization: Bearer {{token}}
|
||
Content-Type: application/json
|
||
Accept: text/event-stream
|
||
|
||
{
|
||
"content": "撣格<EFBFBD>霈曇恣銝<EFBFBD>銝析CT<EFBFBD>𠉛弦",
|
||
"enableDeepThinking": true
|
||
}
|
||
|
||
### 銝𠹺<EFBFBD><EFBFBD><EFBFBD>辣
|
||
POST {{baseUrl}}/api/v1/aia/conversations/{{conversationId}}/attachments
|
||
Authorization: Bearer {{token}}
|
||
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary
|
||
|
||
------WebKitFormBoundary
|
||
Content-Disposition: form-data; name="file"; filename="data.xlsx"
|
||
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
||
|
||
< ./data.xlsx
|
||
------WebKitFormBoundary--
|
||
```
|
||
|
||
---
|
||
|
||
## <20><> <20>湔鰵<E6B994>亙<EFBFBD>
|
||
|
||
| <20>交<EFBFBD> | <20><>𧋦 | <20><>捆 |
|
||
|------|------|------|
|
||
| 2026-01-11 | V1.0 | <20>𥕦遣 API 霈曇恣<E69B87><E681A3>﹝ |
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|