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

21 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-04-14 23:55 +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 .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) 

50 

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 # RAG document status 

68 RagDocumentStatus, 

69) 

70 

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

72from .download_tracker import ( 

73 DownloadTracker, 

74 DownloadDuplicates, 

75 DownloadAttempt, 

76) 

77 

78# Import File Integrity models 

79from .file_integrity import ( 

80 FileIntegrityRecord, 

81 FileVerificationFailure, 

82) 

83 

84# Import Domain Classification model 

85from ...domain_classifier.models import DomainClassification 

86 

87__all__ = [ 

88 # Base 

89 "Base", 

90 # Active Research 

91 "UserActiveResearch", 

92 # Auth 

93 "User", 

94 # Queue 

95 "QueueStatus", 

96 "TaskMetadata", 

97 # Queued Research 

98 "QueuedResearch", 

99 # Benchmark 

100 "BenchmarkStatus", 

101 "DatasetType", 

102 "BenchmarkRun", 

103 "BenchmarkResult", 

104 "BenchmarkConfig", 

105 "BenchmarkProgress", 

106 # Cache 

107 "Cache", 

108 "SearchCache", 

109 # Logs 

110 "ResearchLog", 

111 "Journal", 

112 # Metrics 

113 "TokenUsage", 

114 "ModelUsage", 

115 "ResearchRating", 

116 "SearchCall", 

117 # Providers 

118 "ProviderModel", 

119 # Rate Limiting 

120 "RateLimitAttempt", 

121 "RateLimitEstimate", 

122 # Reports 

123 "Report", 

124 "ReportSection", 

125 # Research 

126 "ResearchTask", 

127 "SearchQuery", 

128 "SearchResult", 

129 "ResearchHistory", 

130 "Research", 

131 "ResearchStrategy", 

132 "ResearchMode", 

133 "ResearchStatus", 

134 "ResearchResource", 

135 # Settings 

136 "UserSettings", 

137 "APIKey", 

138 "Setting", 

139 "SettingType", 

140 # User News Search History 

141 "UserNewsSearchHistory", 

142 # News Models 

143 "NewsSubscription", 

144 "SubscriptionFolder", 

145 "NewsCard", 

146 "UserRating", 

147 "UserPreference", 

148 "NewsInterest", 

149 "CardType", 

150 "RatingType", 

151 "SubscriptionType", 

152 "SubscriptionStatus", 

153 # Library Models - Unified Architecture 

154 "SourceType", 

155 "UploadBatch", 

156 "Document", 

157 "Collection", 

158 "DocumentCollection", 

159 "DownloadQueue", 

160 "DocumentChunk", 

161 "LibraryStatistics", 

162 "RAGIndex", 

163 "RAGIndexStatus", 

164 "CollectionFolder", 

165 "CollectionFolderFile", 

166 "RagDocumentStatus", 

167 # Download Tracker Models 

168 "DownloadTracker", 

169 "DownloadDuplicates", 

170 "DownloadAttempt", 

171 # File Integrity Models 

172 "FileIntegrityRecord", 

173 "FileVerificationFailure", 

174 # Domain Classification 

175 "DomainClassification", 

176]