Enhance API documentation by adding new endpoints for ASR preview, assistant configuration retrieval, and knowledge base management. Update existing assistant and tool definitions for improved clarity and functionality. Remove outdated sections from history records documentation, ensuring a streamlined reference for users.
This commit is contained in:
@@ -258,6 +258,68 @@ POST /api/v1/llm/{id}/chat
|
||||
|
||||
---
|
||||
|
||||
### 8. 预览模型输出
|
||||
|
||||
```http
|
||||
POST /api/v1/llm/{id}/preview
|
||||
```
|
||||
|
||||
预览模型输出,支持 text(chat) 与 embedding 两类模型。
|
||||
|
||||
**Request Body:**
|
||||
|
||||
```json
|
||||
{
|
||||
"message": "请介绍一下你自己",
|
||||
"system_prompt": "你是一个专业的AI助手",
|
||||
"max_tokens": 512,
|
||||
"temperature": 0.7
|
||||
}
|
||||
```
|
||||
|
||||
**Response (text model):**
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"reply": "您好!我是一个...",
|
||||
"usage": {
|
||||
"prompt_tokens": 20,
|
||||
"completion_tokens": 50,
|
||||
"total_tokens": 70
|
||||
},
|
||||
"latency_ms": 1500,
|
||||
"error": null
|
||||
}
|
||||
```
|
||||
|
||||
**Response (embedding model):**
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"reply": "Embedding generated successfully. dims=1536. head=[0.012345, -0.023456, ...]",
|
||||
"usage": {
|
||||
"prompt_tokens": 10,
|
||||
"total_tokens": 10
|
||||
},
|
||||
"latency_ms": 800,
|
||||
"error": null
|
||||
}
|
||||
```
|
||||
|
||||
**Fields 说明:**
|
||||
|
||||
| 字段 | 类型 | 必填 | 说明 |
|
||||
|------|------|------|------|
|
||||
| message | string | 是 | 用户消息/嵌入文本 |
|
||||
| system_prompt | string | 否 | 系统提示词 (仅 text 模型) |
|
||||
| max_tokens | int | 否 | 最大生成 token 数 (默认 512) |
|
||||
| temperature | float | 否 | 温度参数 |
|
||||
| api_key | string | 否 | 覆盖模型配置的 API Key |
|
||||
|
||||
---
|
||||
|
||||
## Schema 定义
|
||||
|
||||
```python
|
||||
|
||||
Reference in New Issue
Block a user