|
|
|
|
|
|
|
|
The name of the embedding model to use. For example: `"BAAI/bge-zh-v1.5"` |
|
|
The name of the embedding model to use. For example: `"BAAI/bge-zh-v1.5"` |
|
|
|
|
|
|
|
|
- `"permission"`: (*Body parameter*), `string` |
|
|
- `"permission"`: (*Body parameter*), `string` |
|
|
Specifies who can access the dataset to create. You can set it only to `"me"` for now. |
|
|
|
|
|
|
|
|
Specifies who can access the dataset to create. Available options: |
|
|
|
|
|
- `"me"`: (Default) Only you can manage the dataset. |
|
|
|
|
|
- `"team"`: All team members can manage the dataset. |
|
|
|
|
|
|
|
|
- `"chunk_method"`: (*Body parameter*), `enum<string>` |
|
|
- `"chunk_method"`: (*Body parameter*), `enum<string>` |
|
|
The chunking method of the dataset to create. Available options: |
|
|
The chunking method of the dataset to create. Available options: |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
## Create session |
|
|
|
|
|
|
|
|
## Create session with chat assistant |
|
|
|
|
|
|
|
|
**POST** `/api/v1/chats/{chat_id}/sessions` |
|
|
**POST** `/api/v1/chats/{chat_id}/sessions` |
|
|
|
|
|
|
|
|
Creates a chat session. |
|
|
|
|
|
|
|
|
Creates a session with a chat assistant. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
**PUT** `/api/v1/chats/{chat_id}/sessions/{session_id}` |
|
|
**PUT** `/api/v1/chats/{chat_id}/sessions/{session_id}` |
|
|
|
|
|
|
|
|
Updates a chat session. |
|
|
|
|
|
|
|
|
Updates a session of a specified chat assistant. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
**DELETE** `/api/v1/chats/{chat_id}/sessions` |
|
|
**DELETE** `/api/v1/chats/{chat_id}/sessions` |
|
|
|
|
|
|
|
|
Deletes sessions by ID. |
|
|
|
|
|
|
|
|
Deletes sessions of a chat assistant by ID. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--- |
|
|
--- |
|
|
|
|
|
|
|
|
## Converse |
|
|
|
|
|
|
|
|
## Converse with chat assistant |
|
|
|
|
|
|
|
|
**POST** `/api/v1/chats/{chat_id}/completions` |
|
|
**POST** `/api/v1/chats/{chat_id}/completions` |
|
|
|
|
|
|
|
|
Asks a question to start an AI-powered conversation. |
|
|
|
|
|
|
|
|
Asks a specified chat assistant a question to start an AI-powered conversation. |
|
|
|
|
|
|
|
|
|
|
|
:::tip NOTE |
|
|
|
|
|
|
|
|
|
|
|
- In streaming mode, not all responses include a reference, as this depends on the system's judgement. |
|
|
|
|
|
- In streaming mode, the last message is an empty message: |
|
|
|
|
|
|
|
|
|
|
|
```text |
|
|
|
|
|
data: |
|
|
|
|
|
{ |
|
|
|
|
|
"code": 0, |
|
|
|
|
|
"data": true |
|
|
|
|
|
} |
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
::: |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- `chat_id`: (*Path parameter*) |
|
|
- `chat_id`: (*Path parameter*) |
|
|
The ID of the associated chat assistant. |
|
|
The ID of the associated chat assistant. |
|
|
- `"question"`: (*Body Parameter*), `string` *Required* |
|
|
|
|
|
|
|
|
- `"question"`: (*Body Parameter*), `string`, *Required* |
|
|
The question to start an AI-powered conversation. |
|
|
The question to start an AI-powered conversation. |
|
|
- `"stream"`: (*Body Parameter*), `boolean` |
|
|
- `"stream"`: (*Body Parameter*), `boolean` |
|
|
Indicates whether to output responses in a streaming way: |
|
|
Indicates whether to output responses in a streaming way: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Success: |
|
|
Success: |
|
|
|
|
|
|
|
|
```text |
|
|
|
|
|
|
|
|
```json |
|
|
data:{ |
|
|
data:{ |
|
|
"code": 0, |
|
|
"code": 0, |
|
|
"data": { |
|
|
"data": { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
## Create agent session |
|
|
|
|
|
|
|
|
--- |
|
|
|
|
|
|
|
|
|
|
|
## Create session with an agent |
|
|
|
|
|
|
|
|
**POST** `/api/v1/agents/{agent_id}/sessions` |
|
|
**POST** `/api/v1/agents/{agent_id}/sessions` |
|
|
|
|
|
|
|
|
Creates an agent session. |
|
|
|
|
|
|
|
|
Creates a session with an agent. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### Request parameters |
|
|
#### Request parameters |
|
|
|
|
|
|
|
|
- `agent_id`: (*Path parameter*) |
|
|
|
|
|
|
|
|
- `agent_id`: (*Path parameter*) |
|
|
The ID of the associated agent assistant. |
|
|
The ID of the associated agent assistant. |
|
|
|
|
|
|
|
|
### Response |
|
|
### Response |
|
|
|
|
|
|
|
|
"id": "7869e9e49c1711ef92840242ac120006", |
|
|
"id": "7869e9e49c1711ef92840242ac120006", |
|
|
"message": [ |
|
|
"message": [ |
|
|
{ |
|
|
{ |
|
|
"content": "Hello! I am the HR responsible for recruitment at Infineon. I learned that you are an expert in this field, and I took the liberty of reaching out to you. There is an opportunity I would like to share with you. RAGFlow is currently looking for a senior engineer for your position. I was wondering if you might be interested?", |
|
|
|
|
|
|
|
|
"content": "Hello! I am a recruiter at InfiniFlow. I learned that you are an expert in the field, and took the liberty of reaching out to you. There is an opportunity I would like to share with you. RAGFlow is currently looking for a senior engineer for your position. I was wondering if you might be interested?", |
|
|
"role": "assistant" |
|
|
"role": "assistant" |
|
|
} |
|
|
} |
|
|
], |
|
|
], |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
--- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Converse through agent |
|
|
|
|
|
|
|
|
## Converse with agent |
|
|
|
|
|
|
|
|
**POST** `/api/v1/agents/{agent_id}/completions` |
|
|
**POST** `/api/v1/agents/{agent_id}/completions` |
|
|
####### |
|
|
|
|
|
Asks a question to start an AI-powered conversation. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Asks a specified agent a question to start an AI-powered conversation. |
|
|
|
|
|
|
|
|
|
|
|
:::tip NOTE |
|
|
|
|
|
|
|
|
|
|
|
- In streaming mode, not all responses include a reference, as this depends on the system's judgement. |
|
|
|
|
|
- In streaming mode, the last message is an empty message: |
|
|
|
|
|
|
|
|
|
|
|
```text |
|
|
|
|
|
data: |
|
|
|
|
|
{ |
|
|
|
|
|
"code": 0, |
|
|
|
|
|
"data": true |
|
|
|
|
|
} |
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
::: |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### Request Parameters |
|
|
#### Request Parameters |
|
|
|
|
|
|
|
|
- `agent_id`: (*Path parameter*) |
|
|
|
|
|
|
|
|
- `agent_id`: (*Path parameter*), `string` |
|
|
The ID of the associated agent assistant. |
|
|
The ID of the associated agent assistant. |
|
|
- `"question"`: (*Body Parameter*), `string` *Required* |
|
|
|
|
|
|
|
|
- `"question"`: (*Body Parameter*), `string`, *Required* |
|
|
The question to start an AI-powered conversation. |
|
|
The question to start an AI-powered conversation. |
|
|
- `"stream"`: (*Body Parameter*), `boolean` |
|
|
- `"stream"`: (*Body Parameter*), `boolean` |
|
|
Indicates whether to output responses in a streaming way: |
|
|
|
|
|
|
|
|
Indicates whether to output responses in a streaming way: |
|
|
- `true`: Enable streaming. |
|
|
- `true`: Enable streaming. |
|
|
- `false`: Disable streaming (default). |
|
|
- `false`: Disable streaming (default). |
|
|
- `"session_id"`: (*Body Parameter*) |
|
|
- `"session_id"`: (*Body Parameter*) |
|
|
The ID of session. If it is not provided, a new session will be generated. |
|
|
|
|
|
|
|
|
The ID of the session. If it is not provided, a new session will be generated. |
|
|
|
|
|
|
|
|
### Response |
|
|
### Response |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
data:{ |
|
|
data:{ |
|
|
"code": 0, |
|
|
"code": 0, |
|
|
"message": "", |
|
|
|
|
|
"data": { |
|
|
"data": { |
|
|
"answer": "Hello", |
|
|
"answer": "Hello", |
|
|
"reference": [], |
|
|
"reference": [], |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
data:{ |
|
|
data:{ |
|
|
"code": 0, |
|
|
"code": 0, |
|
|
"message": "", |
|
|
|
|
|
"data": { |
|
|
"data": { |
|
|
"answer": "Hello!", |
|
|
"answer": "Hello!", |
|
|
"reference": [], |
|
|
"reference": [], |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
data:{ |
|
|
data:{ |
|
|
"code": 0, |
|
|
"code": 0, |
|
|
"message": "", |
|
|
|
|
|
"data": { |
|
|
"data": { |
|
|
"answer": "Hello! How", |
|
|
"answer": "Hello! How", |
|
|
"reference": [], |
|
|
"reference": [], |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
data:{ |
|
|
data:{ |
|
|
"code": 0, |
|
|
"code": 0, |
|
|
"message": "", |
|
|
|
|
|
"data": { |
|
|
"data": { |
|
|
"answer": "Hello! How can", |
|
|
"answer": "Hello! How can", |
|
|
"reference": [], |
|
|
"reference": [], |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
data:{ |
|
|
data:{ |
|
|
"code": 0, |
|
|
"code": 0, |
|
|
"message": "", |
|
|
|
|
|
"data": { |
|
|
"data": { |
|
|
"answer": "Hello! How can I", |
|
|
"answer": "Hello! How can I", |
|
|
"reference": [], |
|
|
"reference": [], |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
data:{ |
|
|
data:{ |
|
|
"code": 0, |
|
|
"code": 0, |
|
|
"message": "", |
|
|
|
|
|
"data": { |
|
|
"data": { |
|
|
"answer": "Hello! How can I assist", |
|
|
"answer": "Hello! How can I assist", |
|
|
"reference": [], |
|
|
"reference": [], |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
data:{ |
|
|
data:{ |
|
|
"code": 0, |
|
|
"code": 0, |
|
|
"message": "", |
|
|
|
|
|
"data": { |
|
|
"data": { |
|
|
"answer": "Hello! How can I assist you", |
|
|
"answer": "Hello! How can I assist you", |
|
|
"reference": [], |
|
|
"reference": [], |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
data:{ |
|
|
data:{ |
|
|
"code": 0, |
|
|
"code": 0, |
|
|
"message": "", |
|
|
|
|
|
"data": { |
|
|
"data": { |
|
|
"answer": "Hello! How can I assist you today", |
|
|
"answer": "Hello! How can I assist you today", |
|
|
"reference": [], |
|
|
"reference": [], |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
data:{ |
|
|
data:{ |
|
|
"code": 0, |
|
|
"code": 0, |
|
|
"message": "", |
|
|
|
|
|
"data": { |
|
|
"data": { |
|
|
"answer": "Hello! How can I assist you today?", |
|
|
"answer": "Hello! How can I assist you today?", |
|
|
"reference": [], |
|
|
"reference": [], |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
data:{ |
|
|
data:{ |
|
|
"code": 0, |
|
|
"code": 0, |
|
|
"message": "", |
|
|
|
|
|
"data": { |
|
|
"data": { |
|
|
"answer": "Hello! How can I assist you today?", |
|
|
"answer": "Hello! How can I assist you today?", |
|
|
"reference": [], |
|
|
"reference": [], |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
data:{ |
|
|
data:{ |
|
|
"code": 0, |
|
|
"code": 0, |
|
|
"message": "", |
|
|
|
|
|
"data": true |
|
|
"data": true |
|
|
} |
|
|
} |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
"code": 102, |
|
|
"code": 102, |
|
|
"message": "`question` is required." |
|
|
"message": "`question` is required." |
|
|
} |
|
|
} |
|
|
``` |
|
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
--- |