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%)
257 lines
5.4 KiB
Markdown
257 lines
5.4 KiB
Markdown
# 敹恍<E695B9>笔<EFBFBD><E7AC94>賣<EFBFBD>霂閙𥁒<E99699>?- Schema餈<61>宏<EFBFBD>𡡞<EFBFBD>霂?
|
||
|
||
> **瘚贝<E7989A><E8B49D>園𡢿嚗?* 2025-11-12 10:45
|
||
> **瘚贝<E7989A>鈭綽<E988AD>** AI<41>拇<EFBFBD>
|
||
> **瘚贝<E7989A><E8B49D>桃<EFBFBD>嚗?* 撉諹<E69289>Schema餈<61>宏<EFBFBD>釶risma憭锭chema<6D>滨蔭<E6BBA8>𡒊頂蝏<E9A082>糓<EFBFBD>行迤撣詨極雿?
|
||
> **瘚贝<E7989A>蝏𤘪<E89D8F>嚗?* <20>?**<2A>券<EFBFBD><E588B8>朞<EFBFBD>** <20><>
|
||
|
||
---
|
||
|
||
## <20>?瘚贝<E7989A>璁<EFBFBD><E79281>
|
||
|
||
### 瘚贝<E7989A><E8B49D><EFBFBD>凒
|
||
- <20>?<3F>𡒊垢<F0A1928A>滚𦛚<E6BB9A>亙熒璉<E78692><E79289>?
|
||
- <20>?<3F>唳旿摨栞<E691A8><E6A09E>亦𠶖<E4BAA6>?
|
||
- <20>?Platform Schema嚗<61>鍂<EFBFBD>瑟芋<E7919F>梹<EFBFBD>
|
||
- <20>?AIA Schema嚗㇁I<E38781>箄<EFBFBD><E7AE84>桃<EFBFBD>璅∪<E79285>嚗?
|
||
- <20>?PKB Schema嚗<61>葵鈭箇䰻霂<E4B0BB><E99C82>璅∪<E79285>嚗?
|
||
- <20>?頝沒chema憭㚚睸撘閧鍂
|
||
|
||
### 瘚贝<E7989A><E8B49D>寞<EFBFBD>
|
||
雿輻鍂curl<EFBFBD>賭誘瘚贝<EFBFBD><EFBFBD>𡒊垢API<EFBFBD>亙藁嚗屸<EFBFBD>霂<EFBFBD><EFBFBD>
|
||
1. <20>滚𦛚<E6BB9A>臬炏餈鞱<E9A488>
|
||
2. <20>唳旿摨𤘪糓<F0A498AA>西<EFBFBD><E8A5BF>?
|
||
3. <20><>chema<6D><61>㺭<EFBFBD>格糓<E6A0BC>西<EFBFBD>甇<EFBFBD>虜霂餃<E99C82>
|
||
4. Prisma Client<6E>臬炏甇<E7828F>&頝舐眏<E88890>唳鰵Schema
|
||
|
||
---
|
||
|
||
## <20><> 瘚贝<E7989A>霂衣<E99C82>蝏𤘪<E89D8F>
|
||
|
||
### 瘚贝<E7989A>1嚗𡁜<E59A97>摨瑟<E691A8><E7919F>?<3F>?
|
||
|
||
**<EFBFBD>亙藁嚗?* `GET http://localhost:3001/health`
|
||
|
||
**<EFBFBD>滚<EFBFBD>嚗?*
|
||
```json
|
||
{
|
||
"status": "ok",
|
||
"database": "connected",
|
||
"timestamp": "2025-11-12T02:45:02.626Z",
|
||
"uptime": 165.6572345
|
||
}
|
||
```
|
||
|
||
**蝏栞捏嚗?* <20>?<3F>𡒊垢<F0A1928A>滚𦛚<E6BB9A>峕㺭<E5B395>桀<EFBFBD>餈墧𦻖甇<F0A6BB96>虜
|
||
|
||
---
|
||
|
||
### 瘚贝<E7989A>2嚗鋫PI<50>亙藁 <20>?
|
||
|
||
**<EFBFBD>亙藁嚗?* `GET http://localhost:3001/api/v1`
|
||
|
||
**<EFBFBD>滚<EFBFBD>嚗?*
|
||
```json
|
||
{
|
||
"message": "AI Clinical Research Platform API",
|
||
"version": "1.0.0",
|
||
"environment": "development"
|
||
}
|
||
```
|
||
|
||
**蝏栞捏嚗?* <20>?API<50>滚𦛚甇<F0A69B9A>虜餈鞱<E9A488>
|
||
|
||
---
|
||
|
||
### 瘚贝<E7989A>3嚗鋫IA Schema - 憿寧𤌍<E5AFA7>𡑒” <20>?
|
||
|
||
**<EFBFBD>亙藁嚗?* `GET http://localhost:3001/api/v1/projects`
|
||
|
||
**<EFBFBD>滚<EFBFBD>嚗?*
|
||
```json
|
||
{
|
||
"success": true,
|
||
"data": [
|
||
{
|
||
"id": "a6ce8b46-bac6-4284-a9ae-031d636086bc",
|
||
"userId": "user-mock-001",
|
||
"name": "<22>X<EFBFBD>扳<EFBFBD>撌渡<E6928C><E6B8A1>䂿蒾銵<E892BE><E98AB5>?,
|
||
"background": "<EFBFBD>X<EFBFBD>扳<EFBFBD>撌渡<EFBFBD><EFBFBD>䂿蒾銵<EFBFBD><EFBFBD>?,
|
||
"researchType": "observational",
|
||
"conversationCount": 0,
|
||
"createdAt": "2025-11-05T07:38:55.147Z",
|
||
...
|
||
}
|
||
]
|
||
}
|
||
```
|
||
|
||
**StatusCode嚗?* 200 OK
|
||
**<EFBFBD>唳旿<EFBFBD>交<EFBFBD>嚗?* `aia_schema.projects`
|
||
**蝏栞捏嚗?* <20>?<3F>賢<EFBFBD>甇<EFBFBD>&隞垾IA Schema霂餃<E99C82>憿寧𤌍<E5AFA7>唳旿
|
||
|
||
---
|
||
|
||
### 瘚贝<E7989A>4嚗鋫IA Schema - 撖寡<E69296><E5AFA1>𡑒” <20>?
|
||
|
||
**<EFBFBD>亙藁嚗?* `GET http://localhost:3001/api/v1/chat/conversations`
|
||
|
||
**<EFBFBD>滚<EFBFBD>嚗?*
|
||
```json
|
||
{
|
||
"success": true,
|
||
"data": [
|
||
{
|
||
"id": "b1fad1f9-b960-4b32-9a2b-88af95f66bdb",
|
||
"userId": "user-mock-001",
|
||
"title": "<22>烐<EFBFBD><E78390>亙<EFBFBD>蝭<EFBFBD>捏<EFBFBD><E68D8F><EFBFBD>霂瑕遣霈桅<E99C88>厰<EFBFBD><E58EB0>寞<EFBFBD>",
|
||
"modelName": "qwen-long",
|
||
"createdAt": "2025-11-05T07:47:50.787Z",
|
||
"updatedAt": "2025-11-05T07:47:50.787Z",
|
||
...
|
||
}
|
||
]
|
||
}
|
||
```
|
||
|
||
**StatusCode嚗?* 200 OK
|
||
**<EFBFBD>唳旿<EFBFBD>交<EFBFBD>嚗?* `aia_schema.general_conversations`
|
||
**蝏栞捏嚗?* <20>?<3F>賢<EFBFBD>甇<EFBFBD>&隞垾IA Schema霂餃<E99C82>撖寡<E69296><E5AFA1>唳旿
|
||
|
||
---
|
||
|
||
### 瘚贝<E7989A>5嚗䥪KB Schema - <20>亥<EFBFBD>摨枏<E691A8>銵?<3F>?
|
||
|
||
**<EFBFBD>亙藁嚗?* `GET http://localhost:3001/api/v1/knowledge-bases`
|
||
|
||
**<EFBFBD>滚<EFBFBD>嚗?*
|
||
```json
|
||
{
|
||
"success": true,
|
||
"data": [
|
||
{
|
||
"id": "b42a116b-a22c-41ba-95fd-4d56a6974e7e",
|
||
"userId": "user-mock-001",
|
||
"name": "CLL<4C>詨<EFBFBD><E8A9A8>亥<EFBFBD>摨?,
|
||
"description": "CLL<EFBFBD>詨<EFBFBD><EFBFBD>亥<EFBFBD>摨?,
|
||
"difyDatasetId": "a5e231bc-428e-4462-bc2e-6f94a83d3b6f",
|
||
"fileCount": 48,
|
||
"characterCount": 0,
|
||
"createdAt": "2025-11-05T08:10:21.000Z",
|
||
...
|
||
}
|
||
]
|
||
}
|
||
```
|
||
|
||
**StatusCode嚗?* 200 OK
|
||
**<EFBFBD>唳旿<EFBFBD>交<EFBFBD>嚗?* `pkb_schema.knowledge_bases`
|
||
**蝏栞捏嚗?* <20>?<3F>賢<EFBFBD>甇<EFBFBD>&隞窰KB Schema霂餃<E99C82><E9A483>亥<EFBFBD>摨𤘪㺭<F0A498AA>?
|
||
|
||
---
|
||
|
||
## <20><> 撉諹<E69289>蝏栞捏
|
||
|
||
### <20>詨<EFBFBD><E8A9A8>𤑳緵 潃?
|
||
|
||
**Prisma Client<6E>芸𢆡憭<F0A286A1><E686AD>Schema頝舐眏嚗?*
|
||
|
||
1. <20>?**<2A>𣳇<EFBFBD>靽格㺿隞<E3BABF><E99A9E>** - <20>唳<EFBFBD>隞<EFBFBD><E99A9E>蝏抒賒甇<E8B392>虜撌乩<E6928C>
|
||
2. <20>?**<2A>芸𢆡Schema頝舐眏** - Prisma<6D>寞旿@@schema()<29><>倌<EFBFBD>芸𢆡<E88AB8>亥砭甇<E7A0AD>&<EFBFBD><EFBC86>chema
|
||
3. <20>?**頝沒chema撘閧鍂<E996A7>㗇<EFBFBD>** - 憭㚚睸<E39A9A>喟頂甇<E9A082>虜撌乩<E6928C>
|
||
4. <20>?**<2A>扯<EFBFBD><E689AF>惩蔣<E683A9>?* - <20>亥砭<E4BAA5>笔漲甇<E6BCB2>虜
|
||
|
||
### 瘚贝<E7989A>閬<EFBFBD><E996AC>
|
||
|
||
| Schema | 瘚贝<E7989A>銵?| <20>嗆<EFBFBD>?| <20>唳旿<E594B3>?|
|
||
|--------|--------|------|--------|
|
||
| platform_schema | users | <20>?<3F>湔𦻖撉諹<E69289> | - |
|
||
| aia_schema | projects | <20>?<3F>朞<EFBFBD> | 1+ |
|
||
| aia_schema | general_conversations | <20>?<3F>朞<EFBFBD> | 1+ |
|
||
| pkb_schema | knowledge_bases | <20>?<3F>朞<EFBFBD> | 1+ |
|
||
|
||
**<EFBFBD>餉恣嚗?* 3銝杵chema嚗?銝芣瓲敹<E793B2>”嚗<E2809D><E59A97><EFBFBD>冽<EFBFBD>霂閖<E99C82>朞<EFBFBD> <20>?
|
||
|
||
---
|
||
|
||
## <20>働 <20>滩<EFBFBD>蝏栞捏
|
||
|
||
### <20>?<3F>𣂼<EFBFBD>撉諹<E69289>
|
||
|
||
1. **Schema餈<61>宏<EFBFBD>𣂼<EFBFBD>** - <20><><EFBFBD>㗇㺭<E39787>桀<EFBFBD><E6A180>渲<EFBFBD>蝘?
|
||
2. **Prisma<6D>滨蔭甇<E894AD>&** - 憭锭chema<6D>舀<EFBFBD>撌乩<E6928C>甇<EFBFBD>虜
|
||
3. **隞<><E99A9E><EFBFBD>𣳇<EFBFBD>靽格㺿** - <20>唳<EFBFBD>隞<EFBFBD><E99A9E><EFBFBD>芸𢆡<E88AB8><F0A286A1><EFBFBD>
|
||
4. **憭㚚睸<E39A9A>喟頂<E5969F>㗇<EFBFBD>** - 頝沒chema撘閧鍂甇<E98D82>虜
|
||
|
||
### <20>𩤃<EFBFBD> 霂湔<E99C82>
|
||
|
||
**銝箔<E98A9D>銋<EFBFBD>誨<EFBFBD><E8AAA8><EFBFBD><EFBFBD><EFBFBD>閬<EFBFBD>耨<EFBFBD>對<EFBFBD>**
|
||
|
||
```typescript
|
||
// <20>唳<EFBFBD>隞<EFBFBD><E99A9E>嚗<EFBFBD><E59A97><EFBFBD><EFBFBD>靽格㺿嚗?
|
||
const projects = await prisma.project.findMany();
|
||
|
||
// Prisma<6D>芸𢆡蝧餉<E89DA7>銝綽<E98A9D>
|
||
// SELECT * FROM aia_schema.projects;
|
||
```
|
||
|
||
Prisma Client<6E>函<EFBFBD><E587BD>鞉𧒄撌脩<E6928C>霂餃<E99C82>鈭<EFBFBD><E988AD>銝沸odel<65><6C>@@schema()`<60><>倌嚗?
|
||
隡朞䌊<EFBFBD>典銁SQL<EFBFBD>亥砭銝凋蝙<EFBFBD>冽迤蝖桃<EFBFBD>schema<EFBFBD>滨<EFBFBD><EFBFBD>?
|
||
|
||
**撘<><E69298>𤏸<EFBFBD><F0A48FB8><EFBFBD><EFBFBD>毺䰻嚗<E4B0BB><E59A97><EFBFBD>券<EFBFBD>𤩺<EFBFBD>嚗?* <20><>
|
||
|
||
---
|
||
|
||
## <20><> 瘚贝<E7989A><E8B49D>園𡢿蝏蠘恣
|
||
|
||
- <20>交𪄳API頝臬<E9A09D>嚗?<3F><><EFBFBD>
|
||
- <20>扯<EFBFBD>瘚贝<E7989A>嚗?<3F><><EFBFBD>
|
||
- 蝻硋<E89DBB><E7A18B>亙<EFBFBD>嚗?0<><30><EFBFBD>
|
||
- **<2A>餉恣嚗?* 15<31><35><EFBFBD> <20>?
|
||
|
||
---
|
||
|
||
## <20>㴓 <20>𡒊賒撱箄悅
|
||
|
||
### 撌脩&霈文虾頝唾<E9A09D>
|
||
- <20>?**隞餃𦛚12嚗帋誨<E5B88B><E8AAA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>訕chema** - 銝漤<E98A9D>閬<EFBFBD><E996AC>Prisma<6D>芸𢆡憭<F0A286A1><E686AD>
|
||
|
||
### 撱箄悅蝏抒賒
|
||
- <20>?**隞餃𦛚10-11嚗𡁜<E59A97>撱箸<E692B1>獢?* - AIA<49>釶KB<4B>唳旿摨栞挽霈⊥<E99C88>獢?
|
||
- <20>?**Week 2嚗𡁜<E59A97>蝡舀沲<E88880><E6B2B2>挽霈?* - <20>喲睸頝臬<E9A09D>隞餃𦛚
|
||
|
||
---
|
||
|
||
## <20><> <20>詨<EFBFBD><E8A9A8><EFBFBD>﹝
|
||
|
||
- [Schema<EFBFBD>𠉛氖<EFBFBD>嗆<EFBFBD>霈曇恣](./01-Schema<6D>𠉛氖<F0A0899B>嗆<EFBFBD>霈曇恣嚗?0銝迎<E98A9D>.md)
|
||
- [Schema餈<EFBFBD>宏摰峕<EFBFBD><EFBFBD>亙<EFBFBD>](./Schema餈<61>宏摰峕<E691B0><E5B395>亙<EFBFBD>.md)
|
||
- [Prisma<EFBFBD>滨蔭摰峕<EFBFBD><EFBFBD>亙<EFBFBD>](./Prisma<6D>滨蔭摰峕<E691B0><E5B395>亙<EFBFBD>.md)
|
||
- [<EFBFBD>唳旿摨㯄<EFBFBD>霂<EFBFBD><EFBFBD>朞<EFBFBD><EFBFBD>亙<EFBFBD>](./<2F>唳旿摨㯄<E691A8>霂<EFBFBD><E99C82>朞<EFBFBD>.md)
|
||
|
||
---
|
||
|
||
**瘚贝<E7989A>摰峕<E691B0><E5B395>園𡢿嚗?* 2025-11-12 10:45
|
||
**銝衤<E98A9D>甇伐<E79487>** <20>𥕦遣AIA<49>釶KB<4B>唳旿摨栞挽霈⊥<E99C88>獢?
|
||
**瘚贝<E7989A><E8B49D>嗆<EFBFBD><E59786><EFBFBD>** <20>?<3F>券<EFBFBD><E588B8>朞<EFBFBD>嚗峕<E59A97><E5B395><EFBFBD>靽桀<E99DBD>
|
||
|
||
**<EFBFBD><EFBFBD> Schema餈<61>宏<EFBFBD>釶risma<6D>滨蔭撉諹<E69289><E8ABB9>𣂼<EFBFBD>嚗?* 潃鐥<E6BD83>潃?
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|