QA Management API
Question-Answer pair generation and management endpoints.
Endpoints
Process Chunks to QA
Generates QA pairs from document chunks.Request Body:
Response: APIOutputResponse
with QA generation results
Notes:
- Processes all chunks for the file if chunk_id
not provided
- Generates QA pairs using LLM processing
- Stores QA pairs in database
Delete QA Pairs
Deletes all QA pairs associated with a file.Request Body:
Response: APIOutputResponse
with deletion results
Get QA Pairs
Retrieves all QA pairs for a specific file.Path Parameters:
- file_id
: string (required)
Query Parameters:
- generate_jsonl
: boolean (default: false)
Response:
- If generate_jsonl=false
: APIOutputResponse
with QA pairs array
- If generate_jsonl=true
: JSONL file download (application/jsonl
)
Notes:
- JSONL download includes filename: qa_pairs_{file_id}.jsonl
- Each line in JSONL contains a single QA pair object
Error Handling
All endpoints return standardized error responses:
- 400
: Bad Request
- 500
: Internal Server Error
Dependencies
- LLM processing pipeline for QA generation
- Database for QA pair storage and retrieval
- Chunk data for QA generation