Document-based questions and answers
The system extracts the content from a source file (such as a PDF or DOCX stored in Google Drive), receives as a parameter the desired number of questions, and uses an AI model (OpenAI) to generate a relevant questionnaire with its answers
📄 Document‑Based Questions & Answers Workflow
đź§© Overview
This workflow automatically generates a set of comprehension questions and detailed answers from a source document stored in Google Drive. The user supplies a Drive file URL and the desired number of questions. The system extracts the file’s text, feeds it to a prompt template that formats the request for the AI model, and returns a Markdown‑formatted Q&A list.
⚙️ Main Features
- Extracts text from PDFs or DOCX files hosted on Google Drive.
- Accepts a dynamic number of questions specified by the user.
- Uses a prompt template to structure the AI request in Spanish.
- Generates high‑quality questions and answers via the Deepseek LLM.
- Outputs the result directly in the Playground as formatted Markdown.
🔄 Workflow Steps
| Component Name | Role in the Workflow | Key Inputs | Key Outputs |
|---|---|---|---|
| File URL Input | Captures the Google Drive link for the source file. | User‑supplied file URL. | Text (file URL). |
| Drive File Manager | Retrieves the file content from Google Drive. | File URL (from File URL Input), Operation = “Get”. | Data (file metadata + raw content). |
| Text Extractor | Converts the raw file data into plain text. | Data from Drive File Manager. | Text (extracted document content). |
| Prompt Template | Builds a Spanish prompt that includes the extracted text and the requested number of questions. | Document text, Number of questions. | Prompt Message (ready for the LLM). |
| Deepseek Model | Generates the Q&A text using the Deepseek chat model. | Prompt Message. | Generated Text (Markdown Q&A). |
| Text Output | Displays the final Markdown text in the Playground. | Generated Text. | Text (visible output). |
Note: The “Number of questions” input is provided via a separate Text Input component and is consumed by the Prompt Template step.
đź§ Notes
- The workflow requires valid OAuth credentials for Google Drive access.
- The Deepseek model must be authenticated with a working API key stored in the environment.
- The prompt template is written in Spanish; the output will also be in Spanish.
- The final output is strictly Markdown, following the structure:
Pregunta 1: <question>
Respuesta a la pregunta 1: <answer>
---
- The number of questions must be an integer; non‑numeric input will result in an error.
- If the Drive file cannot be retrieved (e.g., invalid URL, missing permissions), the workflow will terminate with a clear error message.
- Empty or missing inputs are not processed; the workflow will skip the relevant steps and return no output.