Files
aiagent/backend/app/models/__init__.py
renjianbo a06082480a
Some checks failed
CI/CD Pipeline / Backend — Lint & Test (push) Has been cancelled
CI/CD Pipeline / Frontend — Lint & Build (push) Has been cancelled
CI/CD Pipeline / Docker — Build Check (push) Has been cancelled
feat: persistent chat message storage + Android pull-to-load history
Backend:
- Add ChatMessage model + Alembic migration 024
- Add on_message callback to AgentRuntime for persisting messages during SSE streaming
- Plumb session_id from ChatRequest to AgentContext in all 4 chat endpoints
- Add GET /agent-chat/{id}/sessions and /sessions/{sid}/messages with cursor pagination

Android:
- Add DTOs/ApiService/MessageDao for server-side chat history
- ChatRepository: fetchOlderMessages (API + Room cache), offline fallback
- ChatViewModel: loadMoreHistory with isLoadingMore/hasMoreMessages state
- ChatScreen: scroll-to-top detection + top loading indicator

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-30 00:07:26 +08:00

38 lines
2.7 KiB
Python

# Models package
from app.models.user import User
from app.models.workflow import Workflow
from app.models.workflow_version import WorkflowVersion
from app.models.agent import Agent, GlobalKnowledge, AgentRating, AgentFavorite
from app.models.execution import Execution
from app.models.execution_log import ExecutionLog
from app.models.model_config import ModelConfig
from app.models.data_source import DataSource
from app.models.workflow_template import WorkflowTemplate, TemplateRating, TemplateFavorite
from app.models.node_template import NodeTemplate
from app.models.permission import Role, Permission, WorkflowPermission, AgentPermission
from app.models.alert_rule import AlertRule, AlertLog
from app.models.persistent_user_memory import PersistentUserMemory
from app.models.agent_llm_log import AgentLLMLog
from app.models.agent_vector_memory import AgentVectorMemory
from app.models.agent_learning_pattern import AgentLearningPattern
from app.models.agent_schedule import AgentSchedule
from app.models.knowledge_base import KnowledgeBase, Document, DocumentChunk
from app.models.notification import Notification
from app.models.user_feishu_open_id import UserFeishuOpenId
from app.models.plugin import NodePlugin
from app.models.orchestration_template import OrchestrationTemplate
from app.models.goal import Goal
from app.models.task import Task
from app.models.agent_execution_log import AgentExecutionLog
from app.models.user_behavior import UserBehaviorLog
from app.models.knowledge_entry import KnowledgeEntry
from app.models.user_fingerprint import UserFingerprint
from app.models.shadow_comparison import ShadowComparison
from app.models.feedback_record import FeedbackRecord
from app.models.audit_log import AuditLog
from app.models.workspace import Workspace, WorkspaceMembership
from app.models.scene_contract import SceneContract
from app.models.team import Team, TeamMember
from app.models.chat_message import ChatMessage
__all__ = ["User", "Workflow", "WorkflowVersion", "Agent", "GlobalKnowledge", "AgentRating", "AgentFavorite", "Execution", "ExecutionLog", "ModelConfig", "DataSource", "WorkflowTemplate", "TemplateRating", "TemplateFavorite", "NodeTemplate", "Role", "Permission", "WorkflowPermission", "AgentPermission", "AlertRule", "AlertLog", "PersistentUserMemory", "AgentLLMLog", "AgentVectorMemory", "AgentLearningPattern", "AgentSchedule", "KnowledgeBase", "Document", "DocumentChunk", "Notification", "UserFeishuOpenId", "NodePlugin", "OrchestrationTemplate", "Goal", "Task", "AgentExecutionLog", "UserBehaviorLog", "KnowledgeEntry", "UserFingerprint", "ShadowComparison", "FeedbackRecord", "AuditLog", "Workspace", "WorkspaceMembership", "SceneContract", "Team", "TeamMember", "ChatMessage"]