Files
leocrm/app/models/__init__.py
Agent Zero 7f61dfb25b
Check Cross-Plugin Imports / check (push) Has been cancelled
feat(UI-Overhaul-Phase2): AI Assistent in Kommunikation integriert
Migration 0137: Drop AI chat tables (ai_chat_sessions, ai_chat_messages, ai_chat_attachments, ai_conversations, ai_messages)

Backend:
- Remove AIChatSession, AIChatMessage, AIChatAttachment models from ai_assistant/models.py
- Remove AIConversation, AIMessage from app/models/__init__.py
- Remove session/message/stream/attachment routes from ai_assistant/routes.py
- Add new streaming route POST /ai/conversations/{conversation_id}/stream using comm tables
- Add new messages route GET /ai/conversations/{conversation_id}/messages using comm tables
- Add stream_chat_comm, get_comm_messages, save_comm_message to services.py
- Update external_api.py to use CommConversation/CommMessage instead of AIChatSession/AIChatMessage
- Update unified_search ai_chat_provider to search comm_messages with conversation_type=ai
- Remove ai_copilot router from main.py and routes/__init__.py
- Remove ai_conversation from entity_permissions.py and owner_transfer_service.py
- Update ai_assistant/plugin.py get_entity_models to remove AIChatSession
- Guard ai_copilot_service.py imports with try/except

Frontend:
- Remove AIAssistant.tsx, AIAssistantStandalone.tsx, SessionList.tsx, ChatWindow.tsx
- Remove AI Assistant routes from routes/index.tsx
- Update api/ai.ts: streamChat uses /ai/conversations/{id}/stream, fetchMessages uses /ai/conversations/{id}/messages
- Update Communication.tsx: use convId for AI streaming, remove aiSessionId, use fetchAiMessages for AI conversations
- Update AiChatPanel.tsx: create comm conversation instead of AI session, use new fetchMessages
- Update AISidebar.tsx: remove ChatWindow import, show placeholder

tsc clean, build successful, backend import OK
2026-08-21 13:34:54 +02:00

86 lines
2.6 KiB
Python

"""SQLAlchemy models for LeoCRM."""
from app.models.address import Address
from app.models.attachment import Attachment
from app.models.audit import AuditLog
from app.models.auth import ApiToken, PasswordResetToken
from app.models.backup import Backup
from app.models.bank_account import BankAccount
from app.models.consumer_inbox import ConsumerInbox
from app.models.compliance import ComplianceIncident
from app.models.contact import Contact, ContactPerson
from app.models.contact_folder import ContactFolder
from app.models.contact_merge import ContactMergeHistory
from app.models.currency import Currency
from app.models.custom_field_definition import CustomFieldDefinition
from app.models.entity_history import EntityHistory
from app.models.entity_permission import EntityPermission
from app.models.entity_policy import EntityPolicy
from app.models.group import Group, UserGroup
from app.models.notification import Notification, NotificationPreference, NotificationType
from app.models.owned_mixin import OwnedMixin
from app.models.permission_delegation import PermissionDelegation
from app.models.permission_template import PermissionTemplate
from app.models.plugin import Plugin, PluginMigration
from app.models.role import Role
from app.models.saved_view import SavedView
from app.models.sequence import Sequence
from app.models.session import Session
from app.models.system_settings import SystemSettings
from app.models.tax import TaxRate
from app.models.tenant import Tenant
from app.models.user import User, UserTenant
from app.models.webhook import Webhook
from app.models.workflow import Workflow, WorkflowInstance, WorkflowStepHistory
__all__ = [
"Tenant",
"User",
"UserTenant",
"Role",
"Group",
"UserGroup",
"Session",
"AuditLog",
"Notification",
"NotificationType",
"NotificationPreference",
"PasswordResetToken",
"ApiToken",
"ComplianceIncident",
"Contact",
"ContactPerson",
"ContactFolder",
"ContactMergeHistory",
"EntityPermission",
"ConsumerInbox",
"PermissionDelegation",
"PermissionTemplate",
"EntityPolicy",
"OwnedMixin",
"EntityHistory",
"Currency",
"TaxRate",
"Sequence",
"SystemSettings",
"Attachment",
"Address",
"BankAccount",
"Plugin",
"PluginMigration",
"Backup",
"CustomFieldDefinition",
"Webhook",
"Workflow",
"WorkflowInstance",
"WorkflowStepHistory",
"SavedView",
]
from app.models.entity_attachment import EntityAttachment # noqa: F401
from app.models.workspace import ( # noqa: F401
Workspace,
WorkspaceModule,
WorkspaceUser,
WorkspaceWidget,
)