How zaibys/cloudprinter works
Project Type and Purpose
• This is a full-stack web application implementing an Order Management System (OMS) augmented by an AI-driven multi-agent orchestration layer (AG2, formerly AutoGen).
• Purpose: Provide a real-time chat interface where human operators and specialized AI agents collaborate to process orders, query product catalogs, and interact with external services (CloudPrinter, OpenAI, LangSmith).
File Structure
• Top-level files:
• .env.template / python-version / pyproject.toml – environment and dependency config
• README.md – project overview and architecture summary
• uv.lock – lockfile for the UV package manager
• src/ directory (core application):
• app.py – Flask server setup, HTTP routes, Socket.IO real-time endpoint
• functions.py – wrappers for CloudPrinter API calls (list products, order quote, etc.)
• prompts.py – definitions of agent prompts and conversational logic
• logger.py – centralized logging config
• templates/index.html – web UI (chat interface)
• static/ – image assets (user.png, agent.png) for UI avatars
README for Additional Insights
• Technology stack: Python 3.12+, Flask, Socket.IO, AG2 multi-agent framework, OpenAI API, CloudPrinter API, LangSmith tracing
• Agents: ConversableAgent instances with custom speaker selection logic (human, assistant_agent, executor_agent)
• Real-time update workaround: customized _print_received_message integrated via Socket.IO