Create and manage knowledge bases with documents and URLs to enhance Streaming Avatar AI responses, providing contextual information for more accurate and relevant interactions
_id
: Knowledge base unique identifier (string)team_id
: Team identifier (string, required)uid
: User identifier (number)user_type
: User type (number, 1=internal user, 2=external user)from
: Source type (number, 1=system, 2=user)name
: Knowledge base name (string, optional, max 100 characters)prologue
: Opening message/greeting text (string, optional, max 100 characters) - can be used with TTS repeat mode for personalized AI assistant introductionsprompt
: AI prompt instructions (string, optional, max 10,000 characters)docs
: Array of document objects (array, optional)urls
: Array of URL strings (array, optional)create_time
: Creation timestamp (number)update_time
: Last update timestamp (number)Parameter | Type | Required | Description |
---|---|---|---|
Authorization | String | Yes | Bearer token for API authentication. Obtain from GetToken endpoint. |
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
page | Number | No | 1 | Page number, minimum 1 |
size | Number | No | 10 | Items per page, range 1-100 |
name | String | No | - | Filter by knowledge base name |
from | Number | No | 2 | Filter by source type |
Parameter | Type | Description |
---|---|---|
code | Integer | Interface returns business status code (1000: success) |
msg | String | Interface returns status information |
data | Array | Array of knowledge base objects |
Parameter | Type | Required | Description |
---|---|---|---|
Authorization | String | Yes | Bearer token for API authentication. Obtain from GetToken endpoint. |
Parameter | Type | Required | Description |
---|---|---|---|
name | String | No | Knowledge base name, max 100 characters |
prologue | String | No | Opening message/greeting text, max 100 characters (recommended for TTS playback) |
prompt | String | No | AI instructions, max 10,000 characters |
docs | Array | No | Array of document objects |
urls | Array | No | Array of URL strings |
Parameter | Type | Description |
---|---|---|
code | Integer | Interface returns business status code (1000: success) |
msg | String | Interface returns status information |
data | Object | Created knowledge base object |
Parameter | Type | Required | Description |
---|---|---|---|
Authorization | String | Yes | Bearer token for API authentication. Obtain from GetToken endpoint. |
Parameter | Type | Required | Description |
---|---|---|---|
id | String | Yes | Knowledge base ID |
Parameter | Type | Description |
---|---|---|
code | Integer | Interface returns business status code (1000: success) |
msg | String | Interface returns status information |
data | Object | Knowledge base object details |
Parameter | Type | Required | Description |
---|---|---|---|
Authorization | String | Yes | Bearer token for API authentication. Obtain from GetToken endpoint. |
Parameter | Type | Required | Description |
---|---|---|---|
id | String | Yes | Knowledge base ID to update |
name | String | No | Updated name, max 100 characters |
prologue | String | No | Updated opening message/greeting text, max 100 characters |
prompt | String | No | Updated AI instructions, max 10,000 characters |
docs | Array | No | Updated document array |
urls | Array | No | Updated URL array |
Parameter | Type | Description |
---|---|---|
code | Integer | Interface returns business status code (1000: success) |
msg | String | Interface returns status information |
data | Object | Updated knowledge base object |
Parameter | Type | Required | Description |
---|---|---|---|
Authorization | String | Yes | Bearer token for API authentication. Obtain from GetToken endpoint. |
Parameter | Type | Required | Description |
---|---|---|---|
id | String | Yes | Knowledge base ID to delete |
Parameter | Type | Description |
---|---|---|
code | Integer | Interface returns business status code (1000: success) |
msg | String | Interface returns status information |
knowledge_id
parameter when creating a Streaming Avatar session. This enables the AI to access documents and URLs from your knowledge base, resulting in more informed and accurate responses during real-time interactions.
Reference: Create Streaming Avatar Session
Example Integration:
knowledge_id
is provided, the system automatically:
Code | Description |
---|---|
1000 | Success |
1003 | Parameter validation error |
1232 | Knowledge not found |
1233 | Knowledge already exists |
1234 | Knowledge creation error |
1235 | Knowledge update error |
1236 | Knowledge detail error |
File.size
property for client-side file uploads