Coverage for src / local_deep_research / database / models / __init__.py: 100%
21 statements
« prev ^ index » next coverage.py v7.12.0, created at 2026-01-11 00:51 +0000
« prev ^ index » next coverage.py v7.12.0, created at 2026-01-11 00:51 +0000
1"""
2Database models for Local Deep Research.
3All models are organized by domain for better maintainability.
4"""
6from .active_research import UserActiveResearch
7from .auth import User
8from .base import Base
9from .benchmark import (
10 BenchmarkConfig,
11 BenchmarkProgress,
12 BenchmarkResult,
13 BenchmarkRun,
14 BenchmarkStatus,
15 DatasetType,
16)
17from .cache import Cache, SearchCache
18from .logs import Journal, ResearchLog
19from .metrics import ModelUsage, ResearchRating, SearchCall, TokenUsage
20from .providers import ProviderModel
21from .queue import QueueStatus, TaskMetadata
22from .queued_research import QueuedResearch
23from .rate_limiting import RateLimitAttempt, RateLimitEstimate
24from .reports import Report, ReportSection
25from .research import (
26 Research,
27 ResearchHistory,
28 ResearchMode,
29 ResearchResource,
30 ResearchStatus,
31 ResearchStrategy,
32 ResearchTask,
33 SearchQuery,
34 SearchResult,
35)
36from .settings import APIKey, Setting, SettingType, UserSettings
37from .user_news_search_history import UserNewsSearchHistory
38from .news import (
39 NewsSubscription,
40 SubscriptionFolder,
41 NewsCard,
42 UserRating,
43 UserPreference,
44 NewsInterest,
45 CardType,
46 RatingType,
47 SubscriptionType,
48 SubscriptionStatus,
49)
51# Import Library models - Unified architecture
52from .library import (
53 # New unified models
54 SourceType,
55 UploadBatch,
56 Document,
57 Collection,
58 DocumentCollection,
59 DownloadQueue,
60 # Existing models
61 DocumentChunk,
62 LibraryStatistics,
63 RAGIndex,
64 CollectionFolder,
65 CollectionFolderFile,
66 RAGIndexStatus,
67)
69# Note: Text content is now directly in Document.text_content field
70from .download_tracker import (
71 DownloadTracker,
72 DownloadDuplicates,
73 DownloadAttempt,
74)
76# Import File Integrity models
77from .file_integrity import (
78 FileIntegrityRecord,
79 FileVerificationFailure,
80)
82# Import Domain Classification model
83from ...domain_classifier.models import DomainClassification
85__all__ = [
86 # Base
87 "Base",
88 # Active Research
89 "UserActiveResearch",
90 # Auth
91 "User",
92 # Queue
93 "QueueStatus",
94 "TaskMetadata",
95 # Queued Research
96 "QueuedResearch",
97 # Benchmark
98 "BenchmarkStatus",
99 "DatasetType",
100 "BenchmarkRun",
101 "BenchmarkResult",
102 "BenchmarkConfig",
103 "BenchmarkProgress",
104 # Cache
105 "Cache",
106 "SearchCache",
107 # Logs
108 "ResearchLog",
109 "Journal",
110 # Metrics
111 "TokenUsage",
112 "ModelUsage",
113 "ResearchRating",
114 "SearchCall",
115 # Providers
116 "ProviderModel",
117 # Rate Limiting
118 "RateLimitAttempt",
119 "RateLimitEstimate",
120 # Reports
121 "Report",
122 "ReportSection",
123 # Research
124 "ResearchTask",
125 "SearchQuery",
126 "SearchResult",
127 "ResearchHistory",
128 "Research",
129 "ResearchStrategy",
130 "ResearchMode",
131 "ResearchStatus",
132 "ResearchResource",
133 # Settings
134 "UserSettings",
135 "APIKey",
136 "Setting",
137 "SettingType",
138 # User News Search History
139 "UserNewsSearchHistory",
140 # News Models
141 "NewsSubscription",
142 "SubscriptionFolder",
143 "NewsCard",
144 "UserRating",
145 "UserPreference",
146 "NewsInterest",
147 "CardType",
148 "RatingType",
149 "SubscriptionType",
150 "SubscriptionStatus",
151 # Library Models - Unified Architecture
152 "SourceType",
153 "UploadBatch",
154 "Document",
155 "Collection",
156 "DocumentCollection",
157 "DownloadQueue",
158 "DocumentChunk",
159 "LibraryStatistics",
160 "RAGIndex",
161 "RAGIndexStatus",
162 "CollectionFolder",
163 "CollectionFolderFile",
164 # Download Tracker Models
165 "DownloadTracker",
166 "DownloadDuplicates",
167 "DownloadAttempt",
168 # File Integrity Models
169 "FileIntegrityRecord",
170 "FileVerificationFailure",
171 # Domain Classification
172 "DomainClassification",
173]