Document Understanding
Wisdom Search
Generate Answer Endpoint POST /v1/api/wisdom_search/generate_answer
| Resource URL | /v1/api/wisdom_search/generate_answer |
|---|---|
| Response Format | JSON |
| Requires Authentication | Yes |
| Rate Limited | Yes |
| HTTPS | Yes |
Description
Generate an answer to a user question based solely on the provided context.
Parameters
| Parameter | Description | Required | Type | Default Value |
|---|---|---|---|---|
| system_prompt_template | Template for the AI system prompt | No | String | "You are an AI assistant that provides accurate and helpful answers to user questions based solely on the provided context. Your responses should only include information found in the context. If the answer is not available within the context, politely inform the user that the information is not provided.\n\nInstructions:\n\n- Carefully read and analyze the context before answering.\n- Provide clear and concise answers.\n- Reference specific parts of the context when relevant.\n- Do not include personal opinions or external knowledge.\n- Maintain a neutral and professional tone.\n" |
| user_prompt_template | Template for the user prompt including context and question | No | String | "\nContext:\n\n{facts}\n\nQuestion:\n\n{question}\n" |
Request Body
| Parameter | Description | Required | Type | Default Value |
|---|---|---|---|---|
| contexts | Array of context strings | Yes | Array[String] | N/A |
| question | The question to be answered | Yes | String | N/A |
Example Request
Example Request
HTTP Response
| HTTP Code | Message |
|---|---|
| 200 | Successful Response |
| 422 | Validation Error |