文本与对话
使用 Chat Completions 或 Responses 完成文本生成和多轮对话。
概述
AGTCloud 提供文本生成和多轮对话能力。选择模型后,可以通过 Chat Completions、Responses 或模型支持的其他文本协议发起请求。
核心能力
- 文本生成:根据指令生成、改写或补充内容。
- 多轮对话:通过消息历史或响应状态继续上下文。
- 摘要与分类:提取重点或按照指定类别整理内容。
- 信息提取:从输入文本中提取需要的字段和结论。
- 高级能力:Streaming、Tool Calling 和 Structured Output 的支持范围取决于模型与协议。
精选模型
| 模型 | 供应商 | 亮点 |
|---|---|---|
| DeepSeek | DeepSeek | 适合通用对话、推理与代码任务 |
| Qwen | 阿里巴巴 | 兼顾中文、多语言与内容生成场景 |
| Kimi | Moonshot AI | 面向长文本理解、总结与多轮对话 |
| GLM | 智谱 AI | 适合中英文对话、写作与信息提取 |
API 接入
Base URL
https://api.agtcloud.cn/v1Chat Completions
curl 'https://api.agtcloud.cn/v1/chat/completions' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer your-api-key' \
--data '{
"model": "MODEL_ID",
"messages": [
{"role": "system", "content": "回答保持简洁。"},
{"role": "user", "content": "用一句话介绍 AGTCloud。"}
]
}'Responses
curl 'https://api.agtcloud.cn/v1/responses' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer your-api-key' \
--data '{
"model": "MODEL_ID",
"input": "用一句话介绍 AGTCloud。"
}'常用参数
| 参数 | 类型 | 说明 |
|---|---|---|
model | string | 两类接口使用的模型 ID |
messages | array | Chat Completions 的消息列表 |
input | string / array | Responses 的文本或 Input Items |
stream | boolean | 启用流式响应 |
temperature | number | 调整生成随机性,支持范围取决于模型 |
previous_response_id | string | Responses 用于继续已有响应状态 |
Chat Completions 使用 messages,Responses 使用 input。完整参数以对应 API Reference 为准;需要比较 Anthropic Messages、Gemini Generate Content 等入口时,请查看协议选择。