Coverage for src/local_deep_research/database/models/__init__.py: 100%

25 statements  

« prev     ^ index     » next       coverage.py v7.15.1, created at 2026-07-19 23:35 +0000

1""" 

2Database models for Local Deep Research. 

3All models are organized by domain for better maintainability. 

4""" 

5 

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 .chat import ( 

18 ChatMessage, 

19 ChatMessageType, 

20 ChatProgressStep, 

21 ChatRole, 

22 ChatSession, 

23 ChatSessionStatus, 

24) 

25from .citation import Paper, PaperAppearance 

26from .journal import Journal 

27from .logs import ResearchLog 

28from .metrics import ModelUsage, ResearchRating, SearchCall, TokenUsage 

29from .providers import ProviderModel 

30from .queue import QueueStatus, TaskMetadata 

31from .queued_research import QueuedResearch 

32from .rate_limiting import RateLimitAttempt, RateLimitEstimate 

33from .reports import Report, ReportSection 

34from .research import ( 

35 Research, 

36 ResearchHistory, 

37 ResearchMode, 

38 ResearchResource, 

39 ResearchStatus, 

40 ResearchStrategy, 

41 ResearchTask, 

42 SearchQuery, 

43 SearchResult, 

44) 

45from .settings import APIKey, Setting, SettingType, UserSettings 

46from .user_news_search_history import UserNewsSearchHistory 

47from .news import ( 

48 NewsSubscription, 

49 SubscriptionFolder, 

50 NewsCard, 

51 UserRating, 

52 UserPreference, 

53 NewsInterest, 

54 CardType, 

55 RatingType, 

56 SubscriptionType, 

57 SubscriptionStatus, 

58) 

59 

60# Import Library models - Unified architecture 

61from .library import ( 

62 # New unified models 

63 SourceType, 

64 UploadBatch, 

65 Document, 

66 Collection, 

67 DocumentCollection, 

68 DownloadQueue, 

69 # Existing models 

70 DocumentChunk, 

71 LibraryStatistics, 

72 RAGIndex, 

73 CollectionFolder, 

74 CollectionFolderFile, 

75 RAGIndexStatus, 

76 # RAG document status 

77 RagDocumentStatus, 

78) 

79 

80# Note: Text content is now directly in Document.text_content field 

81from .download_tracker import ( 

82 DownloadTracker, 

83 DownloadDuplicates, 

84 DownloadAttempt, 

85) 

86 

87# Import File Integrity models 

88from .file_integrity import ( 

89 FileIntegrityRecord, 

90 FileVerificationFailure, 

91) 

92 

93# Import Zotero integration models 

94from .zotero import ( 

95 ZoteroSyncState, 

96 ZoteroItemMap, 

97) 

98 

99# Import Domain Classification model 

100from ...domain_classifier.models import DomainClassification 

101 

102# Note Models (notes are Documents with source_type='note') 

103from .note import ( 

104 NoteChangeType, 

105 NoteLink, 

106 NoteReference, 

107 NoteResearch, 

108 NoteSynthesis, 

109 NoteSynthesisSource, 

110 NoteSynthesisType, 

111 NoteVersion, 

112) 

113 

114__all__ = [ 

115 # Base 

116 "Base", 

117 # Active Research 

118 "UserActiveResearch", 

119 # Auth 

120 "User", 

121 # Queue 

122 "QueueStatus", 

123 "TaskMetadata", 

124 # Queued Research 

125 "QueuedResearch", 

126 # Benchmark 

127 "BenchmarkStatus", 

128 "DatasetType", 

129 "BenchmarkRun", 

130 "BenchmarkResult", 

131 "BenchmarkConfig", 

132 "BenchmarkProgress", 

133 # Papers (deduplicated academic papers) 

134 "Paper", 

135 "PaperAppearance", 

136 # Logs 

137 "ResearchLog", 

138 "Journal", 

139 # Metrics 

140 "TokenUsage", 

141 "ModelUsage", 

142 "ResearchRating", 

143 "SearchCall", 

144 # Providers 

145 "ProviderModel", 

146 # Rate Limiting 

147 "RateLimitAttempt", 

148 "RateLimitEstimate", 

149 # Reports 

150 "Report", 

151 "ReportSection", 

152 # Research 

153 "ResearchTask", 

154 "SearchQuery", 

155 "SearchResult", 

156 "ResearchHistory", 

157 "Research", 

158 "ResearchStrategy", 

159 "ResearchMode", 

160 "ResearchStatus", 

161 "ResearchResource", 

162 # Settings 

163 "UserSettings", 

164 "APIKey", 

165 "Setting", 

166 "SettingType", 

167 # User News Search History 

168 "UserNewsSearchHistory", 

169 # News Models 

170 "NewsSubscription", 

171 "SubscriptionFolder", 

172 "NewsCard", 

173 "UserRating", 

174 "UserPreference", 

175 "NewsInterest", 

176 "CardType", 

177 "RatingType", 

178 "SubscriptionType", 

179 "SubscriptionStatus", 

180 # Library Models - Unified Architecture 

181 "SourceType", 

182 "UploadBatch", 

183 "Document", 

184 "Collection", 

185 "DocumentCollection", 

186 "DownloadQueue", 

187 "DocumentChunk", 

188 "LibraryStatistics", 

189 "RAGIndex", 

190 "RAGIndexStatus", 

191 "CollectionFolder", 

192 "CollectionFolderFile", 

193 "RagDocumentStatus", 

194 # Download Tracker Models 

195 "DownloadTracker", 

196 "DownloadDuplicates", 

197 "DownloadAttempt", 

198 # File Integrity Models 

199 "FileIntegrityRecord", 

200 "FileVerificationFailure", 

201 # Chat Models 

202 "ChatSession", 

203 "ChatMessage", 

204 "ChatMessageType", 

205 "ChatProgressStep", 

206 "ChatRole", 

207 "ChatSessionStatus", 

208 # Zotero Integration Models 

209 "ZoteroSyncState", 

210 "ZoteroItemMap", 

211 # Domain Classification 

212 "DomainClassification", 

213 # Note Models 

214 "NoteChangeType", 

215 "NoteSynthesisType", 

216 "NoteVersion", 

217 "NoteLink", 

218 "NoteReference", 

219 "NoteResearch", 

220 "NoteSynthesis", 

221 "NoteSynthesisSource", 

222]