Conversor de Ticket a JSON
Este flujo, denominado "Ticket to JSON", tiene como objetivo principal extraer información detallada de un ticket y estructurar esos datos en un formato JSON.
+2
graph TD
%%{init: {'theme': 'mc','layout': 'elk'}}%%
TextInput-7a156[<div><img src="/_astro/type.Dy26vmDy.svg" style="height: 20px !important;width: 20px !important"/></div>instrucciones]
style TextInput-7a156 stroke:#a170ff
ChatOutput-ol8bm[<div><img src="/_astro/messages-square.BaSDmT6g.svg" style="height: 20px !important;width: 20px !important"/></div>Chat Output]
style ChatOutput-ol8bm stroke:#a170ff
OpenAIModel-d3ck8[<div><img src="/_astro/openAI.BhmuxEs3.svg" style="height: 20px !important;width: 20px !important"/></div>OpenAI]
style OpenAIModel-d3ck8 stroke:#a170ff
TextInput-cv9yq[<div><img src="/_astro/type.Dy26vmDy.svg" style="height: 20px !important;width: 20px !important"/></div>ImagenURL]
style TextInput-cv9yq stroke:#a170ff
DescribeImage-mc9qi[<div><img src="/_astro/image.segxnpQg.svg" style="height: 20px !important;width: 20px !important"/></div>Describe Image]
style DescribeImage-mc9qi stroke:#a170ff
ParseData-y6byo[<div><img src="/_astro/braces.Djq0PW4_.svg" style="height: 20px !important;width: 20px !important"/></div>Parse Data]
style ParseData-y6byo stroke:#a170ff
ParseData-y6byo -.- ChatOutput-ol8bm
linkStyle 0 stroke:#a170ff
DescribeImage-mc9qi -.- ParseData-y6byo
linkStyle 1 stroke:#a170ff
TextInput-7a156 -.- DescribeImage-mc9qi
linkStyle 2 stroke:#a170ff
TextInput-cv9yq -.- DescribeImage-mc9qi
linkStyle 3 stroke:#a170ff
OpenAIModel-d3ck8 -.- DescribeImage-mc9qi
linkStyle 4 stroke:#a170ff
Conversor de Ticket a JSON
🧩 Overview
This workflow automates the extraction of structured data from a fast-food restaurant receipt image. It processes the visual information using an AI model with vision capabilities, guided by specific instructions, and outputs the extracted details in a clean, standardized JSON format. This streamlines data entry and analysis by converting unstructured image data into a machine-readable structure.
⚙️ Main Features
- Processes an image of a restaurant receipt to identify and extract key transactional data.
- Uses a pre-configured AI model with vision capabilities to analyze the image content.
- Applies a detailed set of instructions to guide the AI in extracting specific fields like restaurant name, date, items, and financial totals.
- Outputs the extracted data as a structured JSON object, ready for integration with other systems or databases.
🔄 Workflow Steps
| Component Name | Role in the Workflow | Key Inputs | Key Outputs |
|---|---|---|---|
| Text Input (Instructions) | Provides the detailed rules and schema for data extraction. | A text block defining the target document type, the list of fields to extract, and the required JSON output structure. | The extraction instructions passed to the AI model. |
| Text Input (Image URL) | Supplies the source image of the receipt to be processed. | A URL pointing to the digital image of the restaurant ticket. | The image location passed to the vision component. |
| OpenAI Model | Serves as the core AI engine with vision capabilities for analyzing the image. | Model configuration (e.g., model name, temperature). | A configured language model instance ready for vision tasks. |
| Describe Image | Analyzes the provided receipt image using the AI model and instructions. | The receipt image URL and the extraction instructions. | A detailed textual description of the image content, structured according to the instructions. |
| Parse Data | Converts the AI-generated description into a formatted message. | The structured data output from the Describe Image component. | A clean text message containing the extracted data. |
| Chat Output | Presents the final structured JSON result to the user. | The formatted text message from the Parse Data component. | The final, structured JSON data displayed in the chat interface. |
🧠 Notes
- The workflow is specifically designed for post-sale receipts from fast-food restaurants; its accuracy may vary with other document types.
- The AI model is instructed to output
nullfor any requested field that is not clearly present or identifiable in the receipt image. - The system requires a valid URL for the receipt image to process.
- The output is strictly formatted as a JSON object, ensuring compatibility with automated downstream processes.