Update nexus wiki content

This commit is contained in:
2026-05-03 05:42:06 +08:00
parent 90f3811b83
commit 111bc65b7b
707 changed files with 32306 additions and 7289 deletions

View File

@@ -0,0 +1,35 @@
---
title: "ChatCompletions"
type: concept
tags:
- "openai"
- "api"
- "chat"
sources: []
last_updated: 2026-04-20
---
## Overview
Chat Completions 是 OpenAI 标准的聊天补全 API 格式,通过 `POST /v1/chat/completions` 端点调用。Hermes Agent 的 API Server 默认使用此模式,无需额外配置。
## Key Characteristics
- **请求格式**`{"model": "...", "messages": [...]}`
- **响应格式**:返回 `choices[].message` 完整回复
- **历史管理**:每次请求携带完整对话历史
- **工具调用**:支持 `tools` / `tool_calls` 参数
- **流式输出**:支持 `stream: true`,实时推送 token
## vs Responses API
| 特性 | Chat Completions | Responses API |
|---|---|---|
| 状态管理 | 客户端携带历史 | 服务端 `previous_response_id` |
| 事件流 | 逐 token 块 | 结构化事件text_delta, function_call |
| 稳定性 | 稳定(默认) | 实验性 |
| 适用场景 | 通用对话 | 需要服务端状态追踪的场景 |
## See Also
- [[APIServer]]
- [[ResponsesAPI]]