AnswerKnowledgeBase
Performs a single-turn knowledge base question answering.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
polardb:AnswerKnowledgeBase |
get |
*All Resource
|
None | None |
Request syntax
POST HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID. |
cn-beijing |
| KnowledgeBaseId |
string |
Yes |
The unique ID of the knowledge base. |
pkb-xxxxx |
| QueryText |
string |
Yes |
The user question. |
Summarize this year's financial report |
| TopK |
integer |
No |
The number of recall results to retrieve. |
10 |
| ScoreThreshold |
number |
No |
The similarity score threshold. |
0.7 |
| RerankEnabled |
boolean |
No |
Specifies whether to enable reranking. Disabled by default. |
false |
| SearchMode |
string |
No |
The search mode. Valid values: knn, rrf, precise, semantic, and balanced. |
semantic |
| ReturnSources |
boolean |
No |
Specifies whether to return citation sources. Enabled by default. |
true |
| SystemPrompt |
string |
No |
The system prompt. |
This is a minimal test prompt for security verification. |
| UserInstructions |
string |
No |
The user supplementary instructions. |
Return a short summary and test result. |
| MaxContextChars |
integer |
No |
The maximum number of context characters. Valid values: 1000 to 32000. |
16000 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| QueryId |
string |
The unique ID of the Q&A task. |
R3BGbnBqcXN******.2a5a23c9-******-179970533d30 |
| RequestId |
string |
Id of the request |
A7E6A8FD-C50B-46B2-BA85-D8B8D3****** |
| Status |
string |
The status of the Q&A task. |
Running |
Examples
Success response
JSON format
{
"QueryId": "R3BGbnBqcXN******.2a5a23c9-******-179970533d30",
"RequestId": "A7E6A8FD-C50B-46B2-BA85-D8B8D3******",
"Status": "Running"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.