Files
apes-Authon-Web/docs/Agent调用文档.md
T

41 lines
796 B
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.
# Agent 调用文档
## 调用 Agent
```javascript
import llmAgentApi from '@/api/llmAgentApi'
llmAgentApi.callAgent(agentId, {
userParams: {
input: '用户输入内容',
imageUrls: ['https://example.com/img1.jpg'], // 可选,图片 URL 列表
videoUrls: ['https://example.com/video1.mp4'] // 可选,视频 URL 列表
}
})
```
### 返回
```javascript
{
code: 1,
data: {
content: '模型输出内容',
tokens: { prompt: 100, completion: 200, total: 300 }
}
}
```
---
## 图片/视频上传
先通过公共接口上传文件获取 URL
```javascript
// 上传接口:POST /api/user-service/common/upload
// 返回:{ code: 1, data: 'https://oss.example.com/file.jpg' }
```
再将 URL 放入 `imageUrls``videoUrls` 数组传给 `callAgent`