Refactor: completion -> completions (#14584)

### What problem does this PR solve?

Keep only /completions, deprecated /completion

### Type of change

- [x] Refactoring
This commit is contained in:
Wang Qi
2026-05-06 17:19:22 +08:00
committed by GitHub
parent a190a6d67f
commit f32034e83e
10 changed files with 24 additions and 22 deletions

View File

@ -4487,13 +4487,13 @@ Asks a specified agent a question to start an AI-powered conversation.
Uses a single completion endpoint for all agent conversations.
:::caution DEPRECATED
The previous endpoint `POST /api/v1/agents/{agent_id}/completions` is deprecated. Please use `POST /api/v1/agents/chat/completion` instead.
The API is deprecated. Please use `POST /api/v1/agents/chat/completions` instead.
:::
#### Request
- Method: POST
- URL: `/api/v1/agents/chat/completion`
- URL: `/api/v1/agents/chat/completions`
- Headers:
- `'content-Type: application/json'`
- `'Authorization: Bearer <YOUR_API_KEY>'`
@ -4534,7 +4534,7 @@ If the **Begin** component does not take parameters:
```bash
curl --request POST \
--url http://{address}/api/v1/agents/chat/completion \
--url http://{address}/api/v1/agents/chat/completions \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--data-binary '
@ -4549,7 +4549,7 @@ curl --request POST \
```bash
curl --request POST \
--url http://{address}/api/v1/agents/chat/completion \
--url http://{address}/api/v1/agents/chat/completions \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--data-binary '
@ -4586,7 +4586,7 @@ To continue an existing session:
```bash
curl --request POST \
--url http://{address}/api/v1/agents/chat/completion \
--url http://{address}/api/v1/agents/chat/completions \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--data-binary '
@ -4692,7 +4692,7 @@ Streaming request:
```bash
curl --request POST \
--url http://{address}/api/v1/agents/chat/completion \
--url http://{address}/api/v1/agents/chat/completions \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--data-binary '
@ -4713,7 +4713,7 @@ Non-stream request with existing session:
```bash
curl --request POST \
--url http://{address}/api/v1/agents/chat/completion \
--url http://{address}/api/v1/agents/chat/completions \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--data-binary '
@ -7806,14 +7806,14 @@ Failure:
```bash
curl --request POST \
--url http://{address}/api/v1/searches/{search_id}/completions \
--header 'Content-Type: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <YOUR_LOGIN_TOKEN>' \
--data '{
"question": "What is retrieval-augmented generation?"
}'
```
##### Request parameters
##### Request parameters
- `search_id`: (*Path parameter*), `string`, *Required*
The ID of the search app.
@ -7825,7 +7825,7 @@ Generates an answer using the saved search app configuration and returns the res
#### Response
Success (streaming):
```text
data: {"code": 0, "message": "", "data": {"answer": "...", "reference": {...}}}