Files
Hartmut 59ce61098c feat: tenant AI chat agent with function calling
Actionable AI assistant that uses per-tenant Azure OpenAI credentials
to execute natural language commands against the render pipeline.

Backend:
- ChatMessage model + migration (session-based conversations)
- Chat service with 10 OpenAI function-calling tools:
  list_orders, search_products, create_order, dispatch_renders,
  get_order_status, set_material_override, set_render_overrides,
  get_render_stats, check_materials, query_database
- All tools tenant-scoped (queries filtered by tenant_id)
- Write operations use httpx to call backend API internally
- Chat API: POST /chat/messages, GET /chat/sessions, DELETE session
- Conversation history preserved in DB (last 50 messages per session)

Frontend:
- Slide-out ChatPanel (right side, w-96, animated)
- User/assistant message styling with avatars and timestamps
- Session management (new chat, session history, delete)
- Typing indicator while waiting for AI response
- Floating chat button in bottom-right corner
- Error state for unconfigured AI tenants

Example: "Render all Kugellager products as WebP at 1024x1024"
→ Agent calls search_products + create_order + dispatch_renders

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 12:46:21 +01:00

30 lines
1.5 KiB
Python

"""Re-export all models from domain locations.
This file ensures that `from app.models import X` continues to work.
The canonical definitions live in app/domains/*/models.py.
"""
from app.domains.tenants.models import Tenant
from app.domains.auth.models import User
from app.domains.imports.models import Template
from app.domains.products.models import CadFile, Product
from app.domains.orders.models import Order, OrderItem, OrderLine
from app.domains.notifications.models import AuditLog
from app.domains.billing.models import PricingTier
from app.domains.rendering.models import OutputType, RenderTemplate, ProductRenderPosition, GlobalRenderPosition, WorkflowDefinition, WorkflowRun, WorkflowNodeResult
from app.domains.materials.models import Material, MaterialAlias, AssetLibrary
from app.domains.media.models import MediaAsset, MediaAssetType
from app.domains.admin.models import DashboardConfig
# Also re-export SystemSetting (no domain assigned — stays as-is)
from app.models.system_setting import SystemSetting
from app.models.worker_config import WorkerConfig
from app.models.chat import ChatMessage
__all__ = [
"Tenant", "User", "Template", "CadFile", "Product", "Order", "OrderItem", "OrderLine",
"AuditLog", "PricingTier", "OutputType", "RenderTemplate", "ProductRenderPosition", "GlobalRenderPosition",
"WorkflowDefinition", "WorkflowRun", "WorkflowNodeResult",
"Material", "MaterialAlias", "AssetLibrary", "MediaAsset", "MediaAssetType", "SystemSetting",
"DashboardConfig", "WorkerConfig", "ChatMessage",
]