Request extractor for clothing stores · Agents for ChatGPT | Prompt Studio
    1. ChatGPT
    2. Agents
    3. Request extractor for clothing stores
    ChatGPT · AgentsDatos

    Request extractor for clothing stores

    Turns clothing stores customer messages into structured data.

    by Prompt Studio

    agents-sdkpythonoutput_type

    License: MITView original

    Contents

    Where it goes: extract_fashion_retail.py

    # Extrae datos estructurados de mensajes de clientas y clientes de una tienda de ropa.
    # pip install openai-agents pydantic
    from typing import Literal
    from pydantic import BaseModel
    from agents import Agent, Runner
    
    
    class Solicitud(BaseModel):
        tipo: Literal["nueva", "cambio", "cancelación", "queja", "duda"]
        nombre_cliente: str | None
        fecha: str | None  # YYYY-MM-DD si la menciona
        detalle: str
        urgente: bool
    
    
    extractor = Agent(
        name="Extractor de solicitudes",
        instructions=(
            "Lee el mensaje de un cliente sobre prendas y llena los campos. "
            "Si un dato no aparece, déjalo en null; no lo adivines. "
            "Marca urgente si menciona tallas agotadas o un plazo de menos de 24 horas."
        ),
        output_type=Solicitud,
    )
    
    mensaje = "Buenas, soy Ana. Necesito mover mi prenda del viernes al lunes 12, es urgente."
    solicitud: Solicitud = Runner.run_sync(extractor, mensaje).final_output
    print(solicitud.model_dump_json(indent=2))
    

    More in Agents

    • Support with handoffs

      A triage agent that hands off to billing or tech support.

    • Web researcher

      Searches the web, cites sources and writes a short report.

    • Analyst with guardrails

      TypeScript agent with a custom tool and an input guardrail.

    • Lead qualifier

      Researches the lead company and returns a structured score.

    • Operations assistant for restaurants

      Agent with function tools for day-to-day restaurants work.

    • Triage with handoffs for restaurants

      Front-desk agent that hands off customers of restaurants.

    See all in Agents (504) →

    Your ultimate collection of AI prompts. Gather inspiration, explore examples, and create with AI.

    Main hubs

    • Prompts
    • Images
    • Videos
    • Generate Videos
    • Templates
    • Animations
    • Prices
    • About
    • Affiliate

    Browse by type

    • Component kits
    • Image Tags
    • Video Tags
    • Webs

    Popular topics

    • Music
    • Portfolio
    • Gaming
    • Travel
    • Nano Banana Pro

    Legal

    • Terms of Use
    • Privacy Policy
    • Cookie Policy
    • Licenses Policy
    • Refund Policy
    • Affiliate Program Terms
    • Crowdfunding Terms

    Magzin LLC, 800 Third Avenue Associates, New York, NY, 10022, United States

    © 2026 Prompt Studio by Magzin. All rights reserved.