Encadenamiento de prompts
Utiliza una técnica de "encadenamiento de prompts". Primero, una IA genera un resumen conciso del texto original. Luego, utilizando ese resumen, una segunda IA crea un conjunto de preguntas de opción múltiple.
graph TD
%%{init: {'theme': 'mc','layout': 'elk'}}%%
OpenAIModel-2zqbh[<div><img src="/_astro/openAI.BhmuxEs3.svg" style="height: 20px !important;width: 20px !important"/></div>OpenAI]
style OpenAIModel-2zqbh stroke:#a170ff
OpenAIModel-ponsr[<div><img src="/_astro/openAI.BhmuxEs3.svg" style="height: 20px !important;width: 20px !important"/></div>OpenAI]
style OpenAIModel-ponsr stroke:#a170ff
ChatOutput-p1d55[<div><img src="/_astro/messages-square.BaSDmT6g.svg" style="height: 20px !important;width: 20px !important"/></div>Chat Output]
style ChatOutput-p1d55 stroke:#a170ff
Prompt-vfbvv[<div><img src="/_astro/square-terminal.BMOXc-nZ.svg" style="height: 20px !important;width: 20px !important"/></div>Generar Resumen]
style Prompt-vfbvv stroke:#a170ff
ChatInput-3g4zy[<div><img src="/_astro/messages-square.BaSDmT6g.svg" style="height: 20px !important;width: 20px !important"/></div>Chat Input]
style ChatInput-3g4zy stroke:#a170ff
Prompt-g1mz2[<div><img src="/_astro/square-terminal.BMOXc-nZ.svg" style="height: 20px !important;width: 20px !important"/></div>Prompt]
style Prompt-g1mz2 stroke:#a170ff
OpenAIModel-ponsr -.- ChatOutput-p1d55
linkStyle 0 stroke:#a170ff
Prompt-vfbvv -.- OpenAIModel-2zqbh
linkStyle 1 stroke:#a170ff
ChatInput-3g4zy -.- Prompt-vfbvv
linkStyle 2 stroke:#a170ff
Prompt-g1mz2 -.- OpenAIModel-ponsr
linkStyle 3 stroke:#a170ff
OpenAIModel-2zqbh -.- Prompt-g1mz2
linkStyle 4 stroke:#a170ff
Encadenamiento de prompts
🧩 Overview
This workflow automates the creation of educational or assessment materials from a source document using a prompt chaining technique. It first processes a user-provided text to generate a concise summary, then uses that summary as context to create a set of multiple-choice questions. This two-step process efficiently transforms raw information into structured, interactive content.
⚙️ Main Features
- Automatically generates a clear and concise summary from a user-provided document or text input.
- Creates relevant multiple-choice questions based on the key points and details captured in the generated summary.
- Implements a sequential, two-stage AI process where the output of the first model serves as the input for the second.
- Delivers the final multiple-choice questions in a formatted chat output for easy review.
🔄 Workflow Steps
| Component Name | Role in the Workflow | Key Inputs | Key Outputs |
|---|---|---|---|
| Chat Input | Captures the initial user input, which is the source document or text to be processed. | User-provided text or document. | User message containing the source text. |
| Prompt (Generar Resumen) | Formats the user's input into a structured instruction for the first AI model, tasking it with creating a summary. | Source text from the Chat Input. | A formatted prompt requesting a concise summary. |
| OpenAI Model | The first AI model that processes the prompt and generates a clear, accurate summary of the original document. | Prompt requesting a summary. | A concise text summary. |
| Prompt | Takes the generated summary and formats it into a new instruction for the second AI model, asking it to create multiple-choice questions. | Summary from the first OpenAI Model. | A formatted prompt requesting multiple-choice questions based on the summary. |
| OpenAI Model | The second AI model that uses the summary as context to generate relevant and clear multiple-choice questions. | Prompt requesting multiple-choice questions. | Generated multiple-choice questions. |
| Chat Output | Displays the final result—the set of multiple-choice questions—to the user in the chat interface. | Multiple-choice questions from the second OpenAI Model. | Formatted chat message with the questions. |
🧠 Notes
- The workflow is designed for sequential execution; the second stage depends entirely on the output of the first.
- The quality and relevance of the final multiple-choice questions are contingent on the accuracy and completeness of the initial summary.
- The second prompt includes a conditional instruction to request a proper document if the input it receives is not a valid summary, providing basic error handling.
- The workflow requires a valid OpenAI API key and network connectivity to function.