NAC_Blockchain/docs/api/API_REFERENCE.md

125 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# NAC AI推理引擎 API文档
## 基础信息
**服务地址**http://chat.newassetchain.io
**直接访问**http://43.224.155.27:8800
**版本**v2.0.0
**更新时间**2026-03-05 02:21:48
---
## 接口列表
### 1. AI问答接口
**POST** `/api/inference/ask`
**请求体**
```json
{
"question": "如何用Charter编写RWA上链合约",
"language": "zh",
"sessionId": "session-uuid",
"jurisdiction": "HK",
"assetType": "real_estate",
"includeDiagram": true,
"mode": "general"
}
```
**language参数**9种语言
- `zh` 中文
- `en` English
- `ar` العربية
- `ja` 日本語
- `ko` 한국어
- `fr` Français
- `ru` Русский
- `es` Español
- `pt` Português
**响应体**
```json
{
"success": true,
"data": {
"answer": "**Charter智能合约语言**\n\nCharter是NAC公链的原生...",
"intent": "definition",
"confidence": 0.93,
"sources": [
{"id": "doc_001", "name": "Charter语言规范", "category": "nac_tech"}
],
"suggestions": ["Charter与Solidity对比", "Charter操作码列表"],
"diagram": null,
"processingMs": 45
}
}
```
---
### 2. 合规验证接口
**POST** `/api/compliance/validate`
**请求体**
```json
{
"assetType": "real_estate",
"jurisdiction": "HK",
"assetValue": 5000000,
"description": "香港九龙商业地产"
}
```
---
### 3. 资产估值接口
**POST** `/api/valuation/appraise`
**请求体**
```json
{
"assetId": "asset-001",
"assetType": "real_estate",
"marketValue": 5000000,
"jurisdiction": "HK",
"currency": "HKD"
}
```
---
### 4. 健康检查
**GET** `/health`
```json
{"service": "nac-chat-ui", "status": "healthy", "port": 8800}
```
---
### 5. 服务状态
**GET** `/api/status`
```json
{
"success": true,
"services": [
{"name": "nac-ai-inference", "port": 8703, "status": "online"},
{"name": "nac-ai-compliance", "port": 8701, "status": "online"},
{"name": "nac-ai-valuation", "port": 8702, "status": "online"}
],
"knowledgeBase": {"total": 2780, "compliance": 560, "techDocs": 2220}
}
```
---
*最后更新2026-03-05 02:21:48*