mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 23:41:12 +08:00
Docs: Updated Converse with chat assistant (#16117)
### What problem does this PR solve? Miscellaneous editorial updates to the API reference. ### Type of change - [x] Documentation Update
This commit is contained in:
@@ -64,7 +64,7 @@ The following v0.24.0 REST API paths are deprecated. They remain available throu
|
||||
Creates a model response for a given chat conversation.
|
||||
|
||||
:::caution DEPRECATED
|
||||
The previous endpoint `POST /api/v1/chats_openai/{chat_id}/chat/completions` is deprecated. Please use this endpoint instead.
|
||||
`POST /api/v1/chats_openai/{chat_id}/chat/completions` is deprecated. Use this endpoint instead.
|
||||
:::
|
||||
|
||||
This API follows the same request and response format as OpenAI's API. It allows you to interact with the model in a manner similar to how you would with [OpenAI's API](https://platform.openai.com/docs/api-reference/chat/create).
|
||||
@@ -2400,7 +2400,7 @@ Failure:
|
||||
Updates content or configurations for a specified chunk.
|
||||
|
||||
:::caution DEPRECATED
|
||||
The previous endpoint `PUT /api/v1/datasets/{dataset_id}/documents/{document_id}/chunks/{chunk_id}` is deprecated. Please use this endpoint instead.
|
||||
`PUT /api/v1/datasets/{dataset_id}/documents/{document_id}/chunks/{chunk_id}` is deprecated. Use this endpoint instead.
|
||||
:::
|
||||
|
||||
#### Request
|
||||
@@ -3623,7 +3623,7 @@ Failure:
|
||||
Updates a session of a specified chat assistant.
|
||||
|
||||
:::caution DEPRECATED
|
||||
The previous endpoint `PUT /api/v1/chats/{chat_id}/sessions/{session_id}` is deprecated. Please use this endpoint instead.
|
||||
`PUT /api/v1/chats/{chat_id}/sessions/{session_id}` is deprecated. Use this endpoint instead.
|
||||
:::
|
||||
|
||||
#### Request
|
||||
@@ -4052,7 +4052,7 @@ Failure:
|
||||
Starts a chat completion request. The same endpoint supports three modes:
|
||||
|
||||
:::caution DEPRECATED
|
||||
The previous endpoint `POST /api/v1/chats/{chat_id}/completions` is deprecated. Please use this endpoint instead.
|
||||
`POST /api/v1/chats/{chat_id}/completions` is deprecated. Use this endpoint instead.
|
||||
:::
|
||||
|
||||
- No `chat_id`: talk directly with the tenant's default chat model.
|
||||
@@ -4136,7 +4136,7 @@ curl --request POST \
|
||||
- `"question"`: (*Body Parameter*), `string`
|
||||
Latest user question. This is equivalent to passing `messages: [{"role": "user", "content": question}]`.
|
||||
- `"stream"`: (*Body Parameter*), `boolean`
|
||||
Indicates whether to output responses in a streaming way:
|
||||
Enables streaming output:
|
||||
- `true`: Enable streaming (default).
|
||||
- `false`: Disable streaming.
|
||||
- `"chat_id"`: (*Body Parameter*)
|
||||
@@ -4147,8 +4147,10 @@ curl --request POST \
|
||||
Optional model override when a specific chat model should be used for this request.
|
||||
- `"pass_all_history_messages"`: (*Body Parameter*), `boolean`
|
||||
When `chat_id` and `session_id` are provided, defaults to `false`, so the server uses stored session history and only the latest user message from the request. Set to `true` to replace/use the submitted full `messages` history, and overrides the stored session history.
|
||||
- `"legacy"`: (*Body Parameter*), `boolean`
|
||||
When `true`, streaming responses use the v0.23.0-compatible format. The streamed `answer` is cumulative, and `start_to_think` / `end_to_think` are omitted from the emitted chunks.
|
||||
- `"legacy"`: (*Body Parameter*), `boolean`
|
||||
Defaults to `false`. Enables backward compatibility with RAGFlow v0.23.0 for streaming responses. When set to `true`:
|
||||
- Cumulative output: The `"answer"` field in each chunk returns the entire text generated so far, rather than just the new tokens (deltas).
|
||||
- No reasoning markers: The `start_to_think` and `end_to_think` signals are stripped from the stream.
|
||||
|
||||
#### Response
|
||||
|
||||
@@ -4596,14 +4598,14 @@ Failure:
|
||||
|
||||
### Converse with agent
|
||||
|
||||
**POST** `/api/v1/agents/{agent_id}/completions`
|
||||
**POST** `/api/v1/agents/chat/completions`
|
||||
|
||||
Asks a specified agent a question to start an AI-powered conversation.
|
||||
|
||||
Uses a single completion endpoint for all agent conversations.
|
||||
|
||||
:::caution DEPRECATED
|
||||
The API is deprecated. Please use `POST /api/v1/agents/chat/completions` instead.
|
||||
`POST /api/v1/agents/{agent_id}/completions` is deprecated. Use this endpoint instead.
|
||||
:::
|
||||
|
||||
#### Request
|
||||
@@ -4628,7 +4630,6 @@ Use this mode for the native agent API.
|
||||
- `"files"`: `list[object]` (optional)
|
||||
- `"user_id"`: `string` (optional)
|
||||
- `"return_trace"`: `boolean` (optional, default `false`)
|
||||
- `"release"`: `boolean` (optional, default `false`)
|
||||
- `"chat_template_kwargs": object` (optional)
|
||||
|
||||
#### Streaming events to handle
|
||||
@@ -5354,7 +5355,7 @@ Failure:
|
||||
Generates five to ten alternative question strings from the user's original query to retrieve more relevant search results.
|
||||
|
||||
:::caution DEPRECATED
|
||||
The previous endpoint `POST /api/v1/sessions/related_questions` is deprecated. Please use this endpoint instead.
|
||||
`POST /api/v1/sessions/related_questions` is deprecated. Use this endpoint instead.
|
||||
:::
|
||||
|
||||
This operation requires a `Bearer Login Token`, which typically expires with in 24 hours. You can find it in the Request Headers in your browser easily as shown below:
|
||||
@@ -6777,7 +6778,7 @@ Failure
|
||||
Check the health status of RAGFlow's dependencies (database, Redis, document engine, object storage).
|
||||
|
||||
:::caution DEPRECATED
|
||||
The previous endpoint `GET /v1/system/healthz` is deprecated. Please use this endpoint instead.
|
||||
`GET /v1/system/healthz` is deprecated. Use this endpoint instead.
|
||||
:::
|
||||
|
||||
#### Request
|
||||
@@ -6860,7 +6861,7 @@ Explanation:
|
||||
curl --request POST \
|
||||
--url http://{address}/api/v1/files \
|
||||
--header 'Content-Type: multipart/form-data' \
|
||||
--header 'Authorization: Bearer <YOUR_API_KEY>' \
|
||||
--header 'Authorization: Bearer <YOUR_API_KEY>' \
|
||||
--form 'file=@./test1.txt' \
|
||||
--form 'file=@./test2.pdf' \
|
||||
--form 'parent_id={folder_id}'
|
||||
@@ -7007,7 +7008,7 @@ Failure:
|
||||
curl --request GET \
|
||||
--url 'http://{address}/api/v1/agents/attachments/{attachment_id}/download?ext=pdf' \
|
||||
--header 'Authorization: Bearer <YOUR_API_KEY>' \
|
||||
--output ./downloaded_attachment.pdf
|
||||
--output ./downloaded_attachment.pdf
|
||||
```
|
||||
|
||||
##### Request parameters
|
||||
@@ -7067,7 +7068,7 @@ Failure:
|
||||
```bash
|
||||
curl --request POST \
|
||||
--url http://{address}/api/v1/files \
|
||||
--header 'Content-Type: application/json' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--header 'Authorization: Bearer <YOUR_API_KEY>' \
|
||||
--data '{
|
||||
"name": "New Folder",
|
||||
@@ -7143,7 +7144,7 @@ Failure:
|
||||
|
||||
##### Request parameters
|
||||
|
||||
- `parent_id`: (*Filter parameter*), `string`
|
||||
- `parent_id`: (*Filter parameter*), `string`
|
||||
The folder ID to list files from. If not specified, the root folder is used by default.
|
||||
- `keywords`: (*Filter parameter*), `string`
|
||||
Search keyword to filter files by name.
|
||||
@@ -7222,7 +7223,7 @@ Failure:
|
||||
|
||||
##### Request parameters
|
||||
|
||||
- `file_id`: (*Path parameter*), `string`, *Required*
|
||||
- `file_id`: (*Path parameter*), `string`, *Required*
|
||||
The ID of the file whose immediate parent folder to retrieve.
|
||||
|
||||
#### Response
|
||||
@@ -7279,7 +7280,7 @@ Failure:
|
||||
|
||||
##### Request parameters
|
||||
|
||||
- `file_id`: (*Path parameter*), `string`, *Required*
|
||||
- `file_id`: (*Path parameter*), `string`, *Required*
|
||||
The ID of the file whose parent folders to retrieve.
|
||||
|
||||
#### Response
|
||||
@@ -7342,7 +7343,7 @@ Failure:
|
||||
--url http://{address}/api/v1/files \
|
||||
--header 'Content-Type: application/json' \
|
||||
--header 'Authorization: Bearer <YOUR_API_KEY>' \
|
||||
--data '{
|
||||
--data '{
|
||||
"ids": ["file_id_1", "file_id_2"]
|
||||
}'
|
||||
```
|
||||
@@ -7409,7 +7410,7 @@ Failure:
|
||||
```
|
||||
|
||||
##### Request parameters
|
||||
|
||||
|
||||
- `file_id`: (*Path parameter*), `string`, *Required*
|
||||
The ID of the file to download.
|
||||
|
||||
@@ -7457,7 +7458,7 @@ Failure:
|
||||
- `"new_name"`: `string`, *Optional*
|
||||
|
||||
##### Request examples
|
||||
|
||||
|
||||
Move files to a folder:
|
||||
|
||||
```bash
|
||||
@@ -7560,7 +7561,7 @@ or
|
||||
curl --request POST \
|
||||
--url http://{address}/api/v1/files/link-to-datasets \
|
||||
--header 'Content-Type: application/json' \
|
||||
--header 'Authorization: Bearer <YOUR_API_KEY>' \
|
||||
--header 'Authorization: Bearer <YOUR_API_KEY>' \
|
||||
--data '{
|
||||
"file_ids": ["file_id_1", "file_id_2"],
|
||||
"kb_ids": ["dataset_id_1", "dataset_id_2"]
|
||||
|
||||
Reference in New Issue
Block a user