Fix: add legacy agent completion API compatibility (#14582)

### What problem does this PR solve?

add legacy agent completion API compatibility

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
buua436
2026-05-06 14:22:48 +08:00
committed by GitHub
parent 94f8779a00
commit e4aee25b4b
3 changed files with 32 additions and 17 deletions

View File

@@ -4486,15 +4486,8 @@ Asks a specified agent a question to start an AI-powered conversation.
Uses a single completion endpoint for all agent conversations.
- Standard mode: send `agent_id` with `query`.
- OpenAI-compatible mode: send the same endpoint with `"openai-compatible": true`.
:::tip NOTE
- Older agent completion routes have been removed. Use only `/api/v1/agents/chat/completion`.
- In standard streaming mode, not all responses include a reference, as this depends on the workflow result.
- In streaming mode, the server terminates the stream with `[DONE]`.
:::caution DEPRECATED
The previous endpoint `POST /api/v1/agents/{agent_id}/completions` is deprecated. Please use `POST /api/v1/agents/chat/completion` instead.
:::
#### Request