cs-models 0.0.627__py3-none-any.whl → 0.0.827__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (347) hide show
  1. cs_models/database/operations.py +17 -5
  2. cs_models/resources/ArtifactVectorIndex/__init__.py +0 -0
  3. cs_models/resources/ArtifactVectorIndex/models.py +32 -0
  4. cs_models/resources/ArtifactVectorIndex/schemas.py +16 -0
  5. cs_models/resources/ArtifactVectorIndexQueue/__init__.py +0 -0
  6. cs_models/resources/ArtifactVectorIndexQueue/models.py +34 -0
  7. cs_models/resources/ArtifactVectorIndexQueue/schemas.py +17 -0
  8. cs_models/resources/AssistantCommand/models.py +14 -1
  9. cs_models/resources/AssistantCommand/schemas.py +2 -0
  10. cs_models/resources/AssistantCommandArtifact/models.py +2 -1
  11. cs_models/resources/AssistantCommandArtifact/schemas.py +1 -0
  12. cs_models/resources/AssistantCommandChart/__init__.py +0 -0
  13. cs_models/resources/AssistantCommandChart/models.py +37 -0
  14. cs_models/resources/AssistantCommandChart/schemas.py +16 -0
  15. cs_models/resources/AssistantSession/models.py +8 -1
  16. cs_models/resources/AssistantSession/schemas.py +3 -0
  17. cs_models/resources/AssistantUserQuery/models.py +5 -1
  18. cs_models/resources/AssistantUserQuery/schemas.py +40 -1
  19. cs_models/resources/B3CRSS/__init__.py +0 -0
  20. cs_models/resources/B3CRSS/models.py +25 -0
  21. cs_models/resources/B3CRSS/schemas.py +14 -0
  22. cs_models/resources/CampaignTracker/__init__.py +0 -0
  23. cs_models/resources/CampaignTracker/models.py +29 -0
  24. cs_models/resources/CampaignTracker/schemas.py +17 -0
  25. cs_models/resources/CompanyDrugCount/__init__.py +0 -0
  26. cs_models/resources/CompanyDrugCount/models.py +28 -0
  27. cs_models/resources/CompanyDrugCount/schemas.py +11 -0
  28. cs_models/resources/CompanyMarketCap/__init__.py +0 -0
  29. cs_models/resources/CompanyMarketCap/models.py +29 -0
  30. cs_models/resources/CompanyMarketCap/schemas.py +11 -0
  31. cs_models/resources/CompanyOUS/models.py +2 -0
  32. cs_models/resources/CompanyOUS/schemas.py +2 -0
  33. cs_models/resources/CompanyOutbox/models.py +1 -0
  34. cs_models/resources/CompanyOutbox/schemas.py +1 -0
  35. cs_models/resources/CompanyReview/models.py +4 -1
  36. cs_models/resources/CompanyReview/schemas.py +3 -0
  37. cs_models/resources/CompanySEC/models.py +2 -0
  38. cs_models/resources/CompanySEC/schemas.py +2 -0
  39. cs_models/resources/Config/models.py +2 -0
  40. cs_models/resources/Config/schemas.py +3 -0
  41. cs_models/resources/CoverPage13F/__init__.py +0 -0
  42. cs_models/resources/CoverPage13F/models.py +29 -0
  43. cs_models/resources/CoverPage13F/schemas.py +27 -0
  44. cs_models/resources/Cusip13FSubsidiary/__init__.py +0 -0
  45. cs_models/resources/Cusip13FSubsidiary/models.py +28 -0
  46. cs_models/resources/Cusip13FSubsidiary/schemas.py +14 -0
  47. cs_models/resources/Deal/models.py +2 -0
  48. cs_models/resources/Deal/schemas.py +2 -0
  49. cs_models/resources/DealAdvisor/__init__.py +0 -0
  50. cs_models/resources/DealAdvisor/models.py +35 -0
  51. cs_models/resources/DealAdvisor/schemas.py +15 -0
  52. cs_models/resources/DealInvestor/models.py +1 -0
  53. cs_models/resources/DealInvestor/schemas.py +1 -0
  54. cs_models/resources/DealType/__init__.py +0 -0
  55. cs_models/resources/DealType/models.py +33 -0
  56. cs_models/resources/DealType/schemas.py +14 -0
  57. cs_models/resources/DealUnderwriter/__init__.py +0 -0
  58. cs_models/resources/DealUnderwriter/models.py +35 -0
  59. cs_models/resources/DealUnderwriter/schemas.py +15 -0
  60. cs_models/resources/Designation/models.py +7 -0
  61. cs_models/resources/Designation/schemas.py +2 -0
  62. cs_models/resources/DesignationOutbox/models.py +2 -0
  63. cs_models/resources/DesignationOutbox/schemas.py +1 -0
  64. cs_models/resources/Digest/models.py +1 -0
  65. cs_models/resources/Digest/schemas.py +1 -0
  66. cs_models/resources/DocChunk/__init__.py +0 -0
  67. cs_models/resources/DocChunk/models.py +33 -0
  68. cs_models/resources/DocChunk/schemas.py +20 -0
  69. cs_models/resources/DocMarkdownTable/__init__.py +0 -0
  70. cs_models/resources/DocMarkdownTable/models.py +29 -0
  71. cs_models/resources/DocMarkdownTable/schemas.py +16 -0
  72. cs_models/resources/EventLLM/__init__.py +0 -0
  73. cs_models/resources/EventLLM/models.py +41 -0
  74. cs_models/resources/EventLLM/schemas.py +39 -0
  75. cs_models/resources/EventsQueue/__init__.py +0 -0
  76. cs_models/resources/EventsQueue/models.py +33 -0
  77. cs_models/resources/EventsQueue/schemas.py +18 -0
  78. cs_models/resources/ExplorerColumn/__init__.py +0 -0
  79. cs_models/resources/ExplorerColumn/models.py +33 -0
  80. cs_models/resources/ExplorerColumn/schemas.py +16 -0
  81. cs_models/resources/ExternalDrive/__init__.py +0 -0
  82. cs_models/resources/ExternalDrive/models.py +29 -0
  83. cs_models/resources/ExternalDrive/schemas.py +14 -0
  84. cs_models/resources/FDADrugReview/__init__.py +0 -0
  85. cs_models/resources/FDADrugReview/models.py +29 -0
  86. cs_models/resources/FDADrugReview/schemas.py +19 -0
  87. cs_models/resources/FDADrugReviewFile/__init__.py +0 -0
  88. cs_models/resources/FDADrugReviewFile/models.py +43 -0
  89. cs_models/resources/FDADrugReviewFile/schemas.py +22 -0
  90. cs_models/resources/FDADrugReviewFileCondition/__init__.py +0 -0
  91. cs_models/resources/FDADrugReviewFileCondition/models.py +42 -0
  92. cs_models/resources/FDADrugReviewFileCondition/schemas.py +18 -0
  93. cs_models/resources/FDADrugReviewFileIntervention/__init__.py +0 -0
  94. cs_models/resources/FDADrugReviewFileIntervention/models.py +42 -0
  95. cs_models/resources/FDADrugReviewFileIntervention/schemas.py +18 -0
  96. cs_models/resources/FDADrugReviewFileTarget/__init__.py +0 -0
  97. cs_models/resources/FDADrugReviewFileTarget/models.py +42 -0
  98. cs_models/resources/FDADrugReviewFileTarget/schemas.py +18 -0
  99. cs_models/resources/FDALabel/models.py +3 -0
  100. cs_models/resources/FDALabel/schemas.py +2 -0
  101. cs_models/resources/FDAMeetingFiling/models.py +1 -0
  102. cs_models/resources/FDAMeetingFiling/schemas.py +1 -0
  103. cs_models/resources/FinancingDealType/__init__.py +0 -0
  104. cs_models/resources/FinancingDealType/models.py +28 -0
  105. cs_models/resources/FinancingDealType/schemas.py +13 -0
  106. cs_models/resources/InfoTable13F/__init__.py +0 -0
  107. cs_models/resources/InfoTable13F/models.py +26 -0
  108. cs_models/resources/InfoTable13F/schemas.py +20 -0
  109. cs_models/resources/Meeting/models.py +8 -0
  110. cs_models/resources/Meeting/schemas.py +84 -0
  111. cs_models/resources/MeetingDataOutbox/models.py +8 -1
  112. cs_models/resources/MeetingDataOutbox/schemas.py +4 -1
  113. cs_models/resources/MindgramOAuth/__init__.py +0 -0
  114. cs_models/resources/MindgramOAuth/models.py +35 -0
  115. cs_models/resources/MindgramOAuth/schemas.py +33 -0
  116. cs_models/resources/NCTFDADrugReviewFile/__init__.py +0 -0
  117. cs_models/resources/NCTFDADrugReviewFile/models.py +37 -0
  118. cs_models/resources/NCTFDADrugReviewFile/schemas.py +16 -0
  119. cs_models/resources/NCTFacilities/models.py +1 -0
  120. cs_models/resources/NCTFacilities/schemas.py +1 -0
  121. cs_models/resources/NCTParticipationCriteria/__init__.py +0 -0
  122. cs_models/resources/NCTParticipationCriteria/models.py +28 -0
  123. cs_models/resources/NCTParticipationCriteria/schemas.py +14 -0
  124. cs_models/resources/NCTStudy/models.py +2 -0
  125. cs_models/resources/NCTStudy/schemas.py +2 -0
  126. cs_models/resources/NotificationReadStatus/__init__.py +0 -0
  127. cs_models/resources/NotificationReadStatus/models.py +30 -0
  128. cs_models/resources/NotificationReadStatus/schemas.py +15 -0
  129. cs_models/resources/OtherManager13F/__init__.py +0 -0
  130. cs_models/resources/OtherManager13F/models.py +18 -0
  131. cs_models/resources/OtherManager13F/schemas.py +12 -0
  132. cs_models/resources/OtherManager213F/__init__.py +0 -0
  133. cs_models/resources/OtherManager213F/models.py +15 -0
  134. cs_models/resources/OtherManager213F/schemas.py +13 -0
  135. cs_models/resources/PromptIndices/__init__.py +0 -0
  136. cs_models/resources/PromptIndices/models.py +27 -0
  137. cs_models/resources/PromptIndices/schemas.py +17 -0
  138. cs_models/resources/PubmedUserDocument/__init__.py +0 -0
  139. cs_models/resources/PubmedUserDocument/models.py +35 -0
  140. cs_models/resources/PubmedUserDocument/schemas.py +15 -0
  141. cs_models/resources/PubmedVectorIndex/__init__.py +0 -0
  142. cs_models/resources/PubmedVectorIndex/models.py +33 -0
  143. cs_models/resources/PubmedVectorIndex/schemas.py +16 -0
  144. cs_models/resources/SalesEstimate/__init__.py +0 -0
  145. cs_models/resources/SalesEstimate/models.py +39 -0
  146. cs_models/resources/SalesEstimate/schemas.py +26 -0
  147. cs_models/resources/SalesEstimateCompany/__init__.py +0 -0
  148. cs_models/resources/SalesEstimateCompany/models.py +38 -0
  149. cs_models/resources/SalesEstimateCompany/schemas.py +35 -0
  150. cs_models/resources/SalesEstimateCondition/__init__.py +0 -0
  151. cs_models/resources/SalesEstimateCondition/models.py +41 -0
  152. cs_models/resources/SalesEstimateCondition/schemas.py +17 -0
  153. cs_models/resources/SalesEstimateIntervention/__init__.py +0 -0
  154. cs_models/resources/SalesEstimateIntervention/models.py +41 -0
  155. cs_models/resources/SalesEstimateIntervention/schemas.py +17 -0
  156. cs_models/resources/SalesEstimateTarget/__init__.py +0 -0
  157. cs_models/resources/SalesEstimateTarget/models.py +41 -0
  158. cs_models/resources/SalesEstimateTarget/schemas.py +17 -0
  159. cs_models/resources/SalesTable/__init__.py +0 -0
  160. cs_models/resources/SalesTable/models.py +34 -0
  161. cs_models/resources/SalesTable/schemas.py +20 -0
  162. cs_models/resources/SearchLink/__init__.py +0 -0
  163. cs_models/resources/SearchLink/models.py +29 -0
  164. cs_models/resources/SearchLink/schemas.py +16 -0
  165. cs_models/resources/Signature13F/__init__.py +0 -0
  166. cs_models/resources/Signature13F/models.py +15 -0
  167. cs_models/resources/Signature13F/schemas.py +13 -0
  168. cs_models/resources/SmartDefGrid/__init__.py +0 -0
  169. cs_models/resources/SmartDefGrid/models.py +30 -0
  170. cs_models/resources/SmartDefGrid/schemas.py +52 -0
  171. cs_models/resources/SmartDefGridCell/__init__.py +0 -0
  172. cs_models/resources/SmartDefGridCell/models.py +51 -0
  173. cs_models/resources/SmartDefGridCell/schemas.py +39 -0
  174. cs_models/resources/SmartDefGridCellAnswer/__init__.py +0 -0
  175. cs_models/resources/SmartDefGridCellAnswer/models.py +45 -0
  176. cs_models/resources/SmartDefGridCellAnswer/schemas.py +23 -0
  177. cs_models/resources/SmartDefGridCellAnswerCitation/__init__.py +0 -0
  178. cs_models/resources/SmartDefGridCellAnswerCitation/models.py +21 -0
  179. cs_models/resources/SmartDefGridCellAnswerCitation/schemas.py +14 -0
  180. cs_models/resources/SmartDefGridCellQuestion/__init__.py +0 -0
  181. cs_models/resources/SmartDefGridCellQuestion/models.py +76 -0
  182. cs_models/resources/SmartDefGridCellQuestion/schemas.py +41 -0
  183. cs_models/resources/SmartDefGridCellValue/__init__.py +0 -0
  184. cs_models/resources/SmartDefGridCellValue/models.py +54 -0
  185. cs_models/resources/SmartDefGridCellValue/schemas.py +19 -0
  186. cs_models/resources/SmartDefGridRun/__init__.py +0 -0
  187. cs_models/resources/SmartDefGridRun/models.py +60 -0
  188. cs_models/resources/SmartDefGridRun/schemas.py +31 -0
  189. cs_models/resources/SmartGrid/__init__.py +0 -0
  190. cs_models/resources/SmartGrid/models.py +34 -0
  191. cs_models/resources/SmartGrid/schemas.py +18 -0
  192. cs_models/resources/SmartGridCell/__init__.py +0 -0
  193. cs_models/resources/SmartGridCell/models.py +44 -0
  194. cs_models/resources/SmartGridCell/schemas.py +22 -0
  195. cs_models/resources/Submission13F/__init__.py +0 -0
  196. cs_models/resources/Submission13F/models.py +12 -0
  197. cs_models/resources/Submission13F/schemas.py +10 -0
  198. cs_models/resources/SummaryPage13F/__init__.py +0 -0
  199. cs_models/resources/SummaryPage13F/models.py +12 -0
  200. cs_models/resources/SummaryPage13F/schemas.py +9 -0
  201. cs_models/resources/TableFigure/__init__.py +0 -0
  202. cs_models/resources/TableFigure/models.py +40 -0
  203. cs_models/resources/TableFigure/schemas.py +61 -0
  204. cs_models/resources/TargetSyn/models.py +4 -0
  205. cs_models/resources/TargetSyn/schemas.py +3 -0
  206. cs_models/resources/Transcript/__init__.py +0 -0
  207. cs_models/resources/Transcript/models.py +31 -0
  208. cs_models/resources/Transcript/schemas.py +20 -0
  209. cs_models/resources/TranscriptCondition/__init__.py +0 -0
  210. cs_models/resources/TranscriptCondition/models.py +41 -0
  211. cs_models/resources/TranscriptCondition/schemas.py +17 -0
  212. cs_models/resources/TranscriptEquity/__init__.py +0 -0
  213. cs_models/resources/TranscriptEquity/models.py +28 -0
  214. cs_models/resources/TranscriptEquity/schemas.py +15 -0
  215. cs_models/resources/TranscriptEquityCompany/__init__.py +0 -0
  216. cs_models/resources/TranscriptEquityCompany/models.py +34 -0
  217. cs_models/resources/TranscriptEquityCompany/schemas.py +16 -0
  218. cs_models/resources/TranscriptGrouping/__init__.py +0 -0
  219. cs_models/resources/TranscriptGrouping/models.py +23 -0
  220. cs_models/resources/TranscriptGrouping/schemas.py +14 -0
  221. cs_models/resources/TranscriptGroupingMap/__init__.py +0 -0
  222. cs_models/resources/TranscriptGroupingMap/models.py +31 -0
  223. cs_models/resources/TranscriptGroupingMap/schemas.py +14 -0
  224. cs_models/resources/TranscriptIntervention/__init__.py +0 -0
  225. cs_models/resources/TranscriptIntervention/models.py +41 -0
  226. cs_models/resources/TranscriptIntervention/schemas.py +17 -0
  227. cs_models/resources/TranscriptItem/__init__.py +0 -0
  228. cs_models/resources/TranscriptItem/models.py +35 -0
  229. cs_models/resources/TranscriptItem/schemas.py +20 -0
  230. cs_models/resources/TranscriptTarget/__init__.py +0 -0
  231. cs_models/resources/TranscriptTarget/models.py +41 -0
  232. cs_models/resources/TranscriptTarget/schemas.py +17 -0
  233. cs_models/resources/UserAutomatedDigest/__init__.py +0 -0
  234. cs_models/resources/UserAutomatedDigest/models.py +35 -0
  235. cs_models/resources/UserAutomatedDigest/schemas.py +19 -0
  236. cs_models/resources/UserDocument/models.py +2 -0
  237. cs_models/resources/UserDocument/schemas.py +1 -0
  238. cs_models/resources/UserDocumentAccess/__init__.py +0 -0
  239. cs_models/resources/UserDocumentAccess/models.py +29 -0
  240. cs_models/resources/UserDocumentAccess/schemas.py +18 -0
  241. cs_models/resources/UserDocumentChunk/__init__.py +0 -0
  242. cs_models/resources/UserDocumentChunk/models.py +35 -0
  243. cs_models/resources/UserDocumentChunk/schemas.py +18 -0
  244. cs_models/resources/UserDocumentHierarchy/__init__.py +0 -0
  245. cs_models/resources/UserDocumentHierarchy/models.py +51 -0
  246. cs_models/resources/UserDocumentHierarchy/schemas.py +24 -0
  247. cs_models/resources/UserDocumentMeeting/__init__.py +0 -0
  248. cs_models/resources/UserDocumentMeeting/models.py +33 -0
  249. cs_models/resources/UserDocumentMeeting/schemas.py +14 -0
  250. cs_models/resources/UserDocumentTag/__init__.py +0 -0
  251. cs_models/resources/UserDocumentTag/models.py +31 -0
  252. cs_models/resources/UserDocumentTag/schemas.py +15 -0
  253. cs_models/resources/UserExplorerColumn/__init__.py +0 -0
  254. cs_models/resources/UserExplorerColumn/models.py +30 -0
  255. cs_models/resources/UserExplorerColumn/schemas.py +14 -0
  256. cs_models/resources/UserInternalDocWorkflow/__init__.py +0 -0
  257. cs_models/resources/UserInternalDocWorkflow/models.py +28 -0
  258. cs_models/resources/UserInternalDocWorkflow/schemas.py +11 -0
  259. cs_models/resources/UserMeeting/__init__.py +0 -0
  260. cs_models/resources/UserMeeting/models.py +31 -0
  261. cs_models/resources/UserMeeting/schemas.py +12 -0
  262. cs_models/resources/UserMeetingFavorite/__init__.py +0 -0
  263. cs_models/resources/UserMeetingFavorite/models.py +36 -0
  264. cs_models/resources/UserMeetingFavorite/schemas.py +13 -0
  265. cs_models/resources/UserSavedSearch/models.py +1 -0
  266. cs_models/resources/UserSavedSearch/schemas.py +1 -0
  267. cs_models/resources/UserSavedSearchAccess/__init__.py +0 -0
  268. cs_models/resources/UserSavedSearchAccess/models.py +34 -0
  269. cs_models/resources/UserSavedSearchAccess/schemas.py +18 -0
  270. cs_models/resources/UserSavedSearchCollectionMap/__init__.py +0 -0
  271. cs_models/resources/UserSavedSearchCollectionMap/models.py +33 -0
  272. cs_models/resources/UserSavedSearchCollectionMap/schemas.py +14 -0
  273. cs_models/resources/UserSavedSearchDigest/__init__.py +0 -0
  274. cs_models/resources/UserSavedSearchDigest/models.py +36 -0
  275. cs_models/resources/UserSavedSearchDigest/schemas.py +16 -0
  276. cs_models/resources/UserVAParameterView/__init__.py +0 -0
  277. cs_models/resources/UserVAParameterView/models.py +27 -0
  278. cs_models/resources/UserVAParameterView/schemas.py +13 -0
  279. cs_models/resources/UserWatchlistAccess/__init__.py +0 -0
  280. cs_models/resources/UserWatchlistAccess/models.py +31 -0
  281. cs_models/resources/UserWatchlistAccess/schemas.py +15 -0
  282. cs_models/resources/UserWorkbook/__init__.py +0 -0
  283. cs_models/resources/UserWorkbook/models.py +31 -0
  284. cs_models/resources/UserWorkbook/schemas.py +15 -0
  285. cs_models/resources/UserWorkbookWorkflows/__init__.py +0 -0
  286. cs_models/resources/UserWorkbookWorkflows/models.py +27 -0
  287. cs_models/resources/UserWorkbookWorkflows/schemas.py +15 -0
  288. cs_models/resources/UserWorkbookWorkflowsShared/__init__.py +0 -0
  289. cs_models/resources/UserWorkbookWorkflowsShared/models.py +31 -0
  290. cs_models/resources/UserWorkbookWorkflowsShared/schemas.py +15 -0
  291. cs_models/resources/VACompanyMap/__init__.py +0 -0
  292. cs_models/resources/VACompanyMap/models.py +37 -0
  293. cs_models/resources/VACompanyMap/schemas.py +38 -0
  294. cs_models/resources/VAParameter/__init__.py +0 -0
  295. cs_models/resources/VAParameter/models.py +36 -0
  296. cs_models/resources/VAParameter/schemas.py +25 -0
  297. cs_models/resources/VAParameterCondition/__init__.py +0 -0
  298. cs_models/resources/VAParameterCondition/models.py +41 -0
  299. cs_models/resources/VAParameterCondition/schemas.py +17 -0
  300. cs_models/resources/VAParameterGeography/__init__.py +0 -0
  301. cs_models/resources/VAParameterGeography/models.py +0 -0
  302. cs_models/resources/VAParameterGeography/schemas.py +0 -0
  303. cs_models/resources/VAParameterIntervention/__init__.py +0 -0
  304. cs_models/resources/VAParameterIntervention/models.py +41 -0
  305. cs_models/resources/VAParameterIntervention/schemas.py +17 -0
  306. cs_models/resources/VAParameterValue/__init__.py +0 -0
  307. cs_models/resources/VAParameterValue/models.py +42 -0
  308. cs_models/resources/VAParameterValue/schemas.py +27 -0
  309. cs_models/resources/VAParameterView/__init__.py +0 -0
  310. cs_models/resources/VAParameterView/models.py +35 -0
  311. cs_models/resources/VAParameterView/schemas.py +15 -0
  312. cs_models/resources/ViewPublicAssistantUserQuery/__init__.py +0 -0
  313. cs_models/resources/ViewPublicAssistantUserQuery/models.py +30 -0
  314. cs_models/resources/ViewPublicAssistantUserQuery/schemas.py +14 -0
  315. cs_models/resources/ViewPublicWorkbook/__init__.py +0 -0
  316. cs_models/resources/ViewPublicWorkbook/models.py +30 -0
  317. cs_models/resources/ViewPublicWorkbook/schemas.py +14 -0
  318. cs_models/resources/ViewPublicationCondition/__init__.py +0 -0
  319. cs_models/resources/ViewPublicationCondition/models.py +32 -0
  320. cs_models/resources/ViewPublicationCondition/schemas.py +16 -0
  321. cs_models/resources/WatchlistDigest/__init__.py +0 -0
  322. cs_models/resources/WatchlistDigest/models.py +36 -0
  323. cs_models/resources/WatchlistDigest/schemas.py +16 -0
  324. cs_models/resources/Workbook/__init__.py +0 -0
  325. cs_models/resources/Workbook/models.py +37 -0
  326. cs_models/resources/Workbook/schemas.py +26 -0
  327. cs_models/resources/WorkbookBlock/__init__.py +0 -0
  328. cs_models/resources/WorkbookBlock/models.py +50 -0
  329. cs_models/resources/WorkbookBlock/schemas.py +63 -0
  330. cs_models/resources/WorkbookBlockComment/__init__.py +0 -0
  331. cs_models/resources/WorkbookBlockComment/models.py +36 -0
  332. cs_models/resources/WorkbookBlockComment/schemas.py +15 -0
  333. cs_models/resources/WorkbookMeta/__init__.py +0 -0
  334. cs_models/resources/WorkbookMeta/models.py +14 -0
  335. cs_models/resources/WorkbookMeta/schemas.py +9 -0
  336. cs_models/resources/WorkbookWorkflow/__init__.py +0 -0
  337. cs_models/resources/WorkbookWorkflow/models.py +39 -0
  338. cs_models/resources/WorkbookWorkflow/schemas.py +24 -0
  339. cs_models/resources/WorkbookWorkflowBlock/__init__.py +0 -0
  340. cs_models/resources/WorkbookWorkflowBlock/models.py +37 -0
  341. cs_models/resources/WorkbookWorkflowBlock/schemas.py +60 -0
  342. cs_models/utils/utils.py +27 -1
  343. cs_models-0.0.827.dist-info/METADATA +29 -0
  344. {cs_models-0.0.627.dist-info → cs_models-0.0.827.dist-info}/RECORD +346 -52
  345. {cs_models-0.0.627.dist-info → cs_models-0.0.827.dist-info}/WHEEL +1 -1
  346. cs_models-0.0.627.dist-info/METADATA +0 -29
  347. {cs_models-0.0.627.dist-info → cs_models-0.0.827.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,45 @@
1
+ from datetime import datetime
2
+ from sqlalchemy import Column, DateTime, ForeignKey, Float, String, JSON, Integer, Index, Text, BigInteger, ForeignKeyConstraint
3
+ from sqlalchemy.orm import relationship
4
+ from ...database import Base
5
+
6
+
7
+ class SmartDefGridCellAnswerModel(Base):
8
+ """
9
+ Answers emitted by workers. Keep multiple rows per question (retries, models).
10
+ """
11
+ __tablename__ = "smart_def_grid_cell_answers"
12
+
13
+ id = Column(BigInteger, primary_key=True, autoincrement=True)
14
+ question_id = Column(Integer, ForeignKey("smart_def_grid_cell_questions.id", ondelete="CASCADE"), nullable=False)
15
+
16
+ smart_def_grid_id = Column(Integer, ForeignKey("smart_def_grids.id", ondelete="CASCADE"), nullable=False)
17
+ run_id = Column(Integer, ForeignKey("smart_def_grid_runs.id", ondelete="SET NULL"), nullable=True)
18
+ cell_id = Column(String(36), nullable=False)
19
+
20
+ # canonical payload
21
+ raw_value = Column(Float, nullable=True) # numeric scalar (if any)
22
+ text_value = Column(Text, nullable=True) # string/summary
23
+ display_text = Column(Text, nullable=True) # preformatted; writeback may still reformat
24
+ citations = Column(JSON, nullable=True) # list of {url|doi|title|snippet|...}
25
+ extra_payload = Column(JSON, nullable=True) # any provider-specific structure
26
+
27
+ # provenance
28
+ provider = Column(String(64), nullable=True) # e.g., "gpt-4.1"
29
+ provider_meta = Column(JSON, nullable=True) # tokens, latency, etc.
30
+
31
+ created_at = Column(DateTime, default=datetime.utcnow, nullable=False)
32
+
33
+ # convenience index to quickly get latest by created_at
34
+ __table_args__ = (
35
+ ForeignKeyConstraint(
36
+ ["smart_def_grid_id", "cell_id"],
37
+ ["smart_def_grid_cells.smart_def_grid_id", "smart_def_grid_cells.cell_id"],
38
+ ondelete="CASCADE",
39
+ ),
40
+ Index("ix_smart_def_grid_cell_answers_cell", "smart_def_grid_id", "cell_id", "created_at"),
41
+ Index("ix_sdgca_run_cell", "run_id", "smart_def_grid_id", "cell_id", "created_at"),
42
+ )
43
+
44
+ question = relationship("SmartDefGridCellQuestionModel", back_populates="answers")
45
+ run = relationship("SmartDefGridRunModel")
@@ -0,0 +1,23 @@
1
+ from marshmallow import Schema, fields
2
+
3
+
4
+ class SmartDefGridCellAnswerResourceSchema(Schema):
5
+ id = fields.String(dump_only=True)
6
+ question_id = fields.Integer(required=True)
7
+ smart_def_grid_id = fields.Integer(required=True)
8
+ cell_id = fields.String(required=True)
9
+
10
+ raw_value = fields.Float(allow_none=True)
11
+ text_value = fields.String(allow_none=True)
12
+ display_text = fields.String(allow_none=True)
13
+
14
+ citations = fields.Raw(allow_none=True) # list/dict (or keep normalized rows separately)
15
+ extra_payload = fields.Raw(allow_none=True) # provider-specific data
16
+
17
+ provider = fields.String(allow_none=True)
18
+ provider_meta = fields.Raw(allow_none=True)
19
+
20
+ created_at = fields.DateTime(dump_only=True)
21
+
22
+ # if you materialize normalized citations, expose them here:
23
+ # citations_rel = fields.Nested(AnswerCitationResourceSchema, many=True, dump_only=True)
@@ -0,0 +1,21 @@
1
+ from sqlalchemy import Column, DateTime, ForeignKey, String, JSON, Integer, Index, Text, BigInteger
2
+ from ...database import Base
3
+
4
+
5
+ class SmartDefGridCellAnswerCitationModel(Base):
6
+ __tablename__ = "smart_def_grid_cell_answer_citations"
7
+
8
+ id = Column(BigInteger, primary_key=True, autoincrement=True)
9
+ answer_id = Column(Integer, ForeignKey("smart_def_grid_cell_answers.id", ondelete="CASCADE"), nullable=False)
10
+
11
+ source_type = Column(String(16), nullable=True) # 'url','doi','patent','pubmed'
12
+ source_id = Column(String(256), nullable=True) # doi, pubmed id, etc.
13
+ url = Column(Text, nullable=True)
14
+ title = Column(Text, nullable=True)
15
+ snippet = Column(Text, nullable=True)
16
+ published_at = Column(DateTime, nullable=True)
17
+ extra = Column(JSON, nullable=True)
18
+
19
+ __table_args__ = (
20
+ Index("ix_smart_def_grid_cell_answer_citations_source", "source_type", "source_id"),
21
+ )
@@ -0,0 +1,14 @@
1
+ from marshmallow import Schema, fields, validate
2
+
3
+
4
+ class SmartDefGridCellAnswerCitationResourceSchema(Schema):
5
+ id = fields.Integer(dump_only=True)
6
+ answer_id = fields.Integer(required=True)
7
+
8
+ source_type = fields.String(allow_none=True)
9
+ source_id = fields.String(allow_none=True)
10
+ url = fields.String(allow_none=True)
11
+ title = fields.String(allow_none=True)
12
+ snippet = fields.String(allow_none=True)
13
+ published_at = fields.DateTime(allow_none=True)
14
+ extra = fields.Raw(allow_none=True) # any additional normalized payload
@@ -0,0 +1,76 @@
1
+ import enum
2
+ from datetime import datetime
3
+ from sqlalchemy import Column, DateTime, ForeignKey, Integer, String, JSON, Boolean, Index, Text, Enum, ForeignKeyConstraint
4
+ from sqlalchemy.orm import relationship
5
+ from ...database import Base
6
+
7
+
8
+ class QuestionStatus(str, enum.Enum):
9
+ pending = "pending" # created, not enqueued yet
10
+ queued = "queued" # sent to your queue
11
+ running = "running" # worker picked it up
12
+ succeeded = "succeeded" # at least one answer persisted
13
+ failed = "failed" # irrecoverable error (manual retry/override)
14
+ cancelled = "cancelled" # cancelled
15
+
16
+
17
+ class ExpectedType(str, enum.Enum):
18
+ number = "number"
19
+ text = "text"
20
+
21
+
22
+ class SmartDefGridCellQuestionModel(Base):
23
+ """
24
+ One question per cell (you may create new ones on re-ask/revision).
25
+ """
26
+ __tablename__ = "smart_def_grid_cell_questions"
27
+
28
+ id = Column(Integer, primary_key=True, autoincrement=True) # question_id (uuid)
29
+ smart_def_grid_id = Column(Integer, ForeignKey("smart_def_grids.id", ondelete="CASCADE"), nullable=False)
30
+ run_id = Column(Integer, ForeignKey("smart_def_grid_runs.id", ondelete="SET NULL"), nullable=True)
31
+ cell_id = Column(String(36), nullable=False)
32
+
33
+ question_text = Column(Text, nullable=False)
34
+ expected_type = Column(Enum(ExpectedType), nullable=False)
35
+ must_cite = Column(Boolean, nullable=False, default=True)
36
+
37
+ topic_key = Column(JSON, nullable=True)
38
+ retrieval_hints = Column(JSON, nullable=True)
39
+
40
+ # Answer
41
+ answer_text = Column(Text, nullable=True)
42
+ answer_info = Column(JSON, nullable=True)
43
+
44
+ # Queue & lifecycle
45
+ status = Column(Enum(QuestionStatus), nullable=False, default=QuestionStatus.pending)
46
+ priority = Column(Integer, nullable=False, default=5) # lower = higher priority
47
+ attempts = Column(Integer, nullable=False, default=0)
48
+ last_error = Column(Text, nullable=True)
49
+
50
+ idempotency_key = Column(String(64), nullable=True) # to avoid dup work
51
+ dedupe_hash = Column(String(64), nullable=True) # e.g., hash(table_id, cell_id, question_text)
52
+
53
+ created_at = Column(DateTime, default=datetime.utcnow, nullable=False)
54
+ updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow, nullable=False)
55
+ started_at = Column(DateTime, nullable=True)
56
+ finished_at = Column(DateTime, nullable=True)
57
+
58
+ # relationships
59
+ answers = relationship("SmartDefGridCellAnswerModel", back_populates="question", cascade="all, delete-orphan")
60
+ run = relationship("SmartDefGridRunModel")
61
+
62
+ __table_args__ = (
63
+ # Useful to grab next jobs: status+priority+created
64
+ Index("ix_smart_def_grid_cell_questions_queue", "status", "priority", "created_at"),
65
+ # Quick lookup for this cell's active question(s)
66
+ Index("ix_smart_def_grid_cell_questions_cell", "smart_def_grid_id", "cell_id"),
67
+ Index("ix_sdgcq_run_status", "run_id", "status", "priority", "created_at"),
68
+ Index("ix_sdgcq_run_cell", "run_id", "smart_def_grid_id", "cell_id"),
69
+ ForeignKeyConstraint(
70
+ ["smart_def_grid_id", "cell_id"],
71
+ ["smart_def_grid_cells.smart_def_grid_id", "smart_def_grid_cells.cell_id"],
72
+ ondelete="CASCADE",
73
+ ),
74
+ # strong uniqueness if you want only one ACTIVE per cell; or enforce app-side
75
+ # UniqueConstraint("table_id", "cell_id", "status", name="uq_cell_question_cell_status"),
76
+ )
@@ -0,0 +1,41 @@
1
+ from marshmallow import Schema, fields, validate
2
+ from ..SmartDefGridCellAnswer.schemas import SmartDefGridCellAnswerResourceSchema
3
+
4
+
5
+ QUESTION_STATUS = ["pending", "queued", "running", "succeeded", "failed", "cancelled"]
6
+ EXPECTED_TYPE = ["number", "text", "citationList", "json"]
7
+
8
+
9
+ class SmartDefGridCellQuestionResourceSchema(Schema):
10
+ not_blank = validate.Length(min=1, error="Field cannot be blank")
11
+
12
+ id = fields.String(dump_only=True)
13
+ smart_def_grid_id = fields.Integer(required=True)
14
+ run_id = fields.Integer(allow_none=True)
15
+ cell_id = fields.String(required=True)
16
+
17
+ question_text = fields.String(required=True, validate=not_blank)
18
+ expected_type = fields.String(required=True, validate=validate.OneOf(EXPECTED_TYPE))
19
+ must_cite = fields.Boolean(required=True)
20
+
21
+ topic_key = fields.Raw(allow_none=True) # e.g., {"row":[...], "col":[...]}
22
+ retrieval_hints = fields.Raw(allow_none=True)
23
+
24
+ answer_text = fields.String(allow_none=True)
25
+ answer_info = fields.Raw(allow_none=True)
26
+
27
+ status = fields.String(required=True, validate=validate.OneOf(QUESTION_STATUS))
28
+ priority = fields.Integer(required=True)
29
+ attempts = fields.Integer(required=True)
30
+ last_error = fields.String(allow_none=True)
31
+
32
+ idempotency_key = fields.String(allow_none=True)
33
+ dedupe_hash = fields.String(allow_none=True)
34
+
35
+ created_at = fields.DateTime(dump_only=True)
36
+ updated_at = fields.DateTime(dump_only=True)
37
+ started_at = fields.DateTime(dump_only=True)
38
+ finished_at = fields.DateTime(dump_only=True)
39
+
40
+ # light nesting of answers on read
41
+ answers = fields.Nested(SmartDefGridCellAnswerResourceSchema(), many=True, dump_only=True)
File without changes
@@ -0,0 +1,54 @@
1
+ from datetime import datetime
2
+ from sqlalchemy import Column, DateTime, ForeignKey, Float, String, JSON, Boolean, Integer, Text, ForeignKeyConstraint, and_
3
+ from sqlalchemy.orm import relationship
4
+ from ...database import Base
5
+ from ..SmartDefGridCell.models import SmartDefGridCellModel
6
+
7
+
8
+ class SmartDefGridCellValueModel(Base):
9
+ """
10
+ The canonical, last-applied value for a cell in the user table (what's rendered back).
11
+ This is what your UI reads to show the latest state (without opening BlockNote).
12
+ """
13
+ __tablename__ = "smart_def_grid_cell_values"
14
+
15
+ smart_def_grid_id = Column(Integer, ForeignKey("smart_def_grids.id", ondelete="CASCADE"), primary_key=True)
16
+ applied_run_id = Column(Integer, ForeignKey("smart_def_grid_runs.id", ondelete="SET NULL"), nullable=True)
17
+ cell_id = Column(String(36), primary_key=True)
18
+
19
+ # applied value derived from a specific answer_id (or manual override)
20
+ answer_id = Column(Integer, ForeignKey("smart_def_grid_cell_answers.id", ondelete="SET NULL"), nullable=True)
21
+ raw_value = Column(Float, nullable=True)
22
+ display_text = Column(Text, nullable=True)
23
+ citations = Column(JSON, nullable=True)
24
+ formatting_used = Column(JSON, nullable=True) # snapshot of FormattingSpec used to render
25
+
26
+ # flags
27
+ manual_override = Column(Boolean, nullable=False, default=False)
28
+ note = Column(Text, nullable=True)
29
+
30
+ applied_at = Column(DateTime, default=datetime.utcnow, nullable=False)
31
+ updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow, nullable=False)
32
+
33
+ __table_args__ = (
34
+ ForeignKeyConstraint(
35
+ ["smart_def_grid_id", "cell_id"],
36
+ ["smart_def_grid_cells.smart_def_grid_id", "smart_def_grid_cells.cell_id"],
37
+ ondelete="CASCADE",
38
+ ),
39
+ )
40
+
41
+ # relationships
42
+ cell = relationship(
43
+ "SmartDefGridCellModel",
44
+ back_populates="applied_value",
45
+ uselist=False,
46
+ primaryjoin=lambda: and_(
47
+ SmartDefGridCellValueModel.smart_def_grid_id == SmartDefGridCellModel.smart_def_grid_id,
48
+ SmartDefGridCellValueModel.cell_id == SmartDefGridCellModel.cell_id,
49
+ ),
50
+ foreign_keys=lambda: [SmartDefGridCellValueModel.smart_def_grid_id, SmartDefGridCellValueModel.cell_id],
51
+ )
52
+
53
+ answer = relationship("SmartDefGridCellAnswerModel", foreign_keys=[answer_id])
54
+ applied_run = relationship("SmartDefGridRunModel")
@@ -0,0 +1,19 @@
1
+ from marshmallow import Schema, fields
2
+
3
+
4
+ class SmartDefGridCellValueResourceSchema(Schema):
5
+ smart_def_grid_id = fields.Integer(required=True)
6
+ applied_run_id = fields.Integer(allow_none=True)
7
+ cell_id = fields.String(required=True)
8
+
9
+ answer_id = fields.Integer(allow_none=True)
10
+ raw_value = fields.Float(allow_none=True)
11
+ display_text = fields.String(allow_none=True)
12
+ citations = fields.Raw(allow_none=True)
13
+ formatting_used = fields.Raw(allow_none=True)
14
+
15
+ manual_override = fields.Boolean(required=True, default=False)
16
+ note = fields.String(allow_none=True)
17
+
18
+ applied_at = fields.DateTime(dump_only=True)
19
+ updated_at = fields.DateTime(dump_only=True)
File without changes
@@ -0,0 +1,60 @@
1
+ from enum import Enum
2
+ from datetime import datetime
3
+ from sqlalchemy import Enum as SAEnum
4
+ from sqlalchemy import Column, DateTime, ForeignKey, Integer, String, JSON, Text, Index
5
+ from sqlalchemy.orm import relationship
6
+ from ...database import Base
7
+
8
+
9
+ class SmartDefGridRunStatus(str, Enum):
10
+ created = "created"
11
+ dispatched = "dispatched"
12
+ running = "running"
13
+ succeeded = "succeeded"
14
+ failed = "failed"
15
+ cancelled = "cancelled"
16
+ partial = "partial" # finished with some failed cells
17
+
18
+
19
+ class SmartDefGridRunScope(str, Enum):
20
+ all = "all"
21
+ empty_only = "empty_only"
22
+
23
+
24
+ class SmartDefGridRunModel(Base):
25
+ __tablename__ = "smart_def_grid_runs"
26
+
27
+ id = Column(Integer, primary_key=True, autoincrement=True) # run_id
28
+ smart_def_grid_id = Column(Integer, ForeignKey("smart_def_grids.id", ondelete="CASCADE"), nullable=False)
29
+
30
+ scope_mode = Column(SAEnum(SmartDefGridRunScope), nullable=False, default=SmartDefGridRunScope.all)
31
+
32
+ # optional snapshotting to make runs reproducible/debuggable
33
+ outline_json = Column(JSON, nullable=False) # new outline created for this run
34
+ original_table_json = Column(JSON, nullable=False) # stamped block at run start
35
+ targets_json = Column(JSON, nullable=True)
36
+
37
+ # execution metadata
38
+ status = Column(
39
+ SAEnum(
40
+ SmartDefGridRunStatus,
41
+ validate_strings=True, # allow assigning "created" etc. as strings too
42
+ ),
43
+ nullable=False,
44
+ default=SmartDefGridRunStatus.created,
45
+ )
46
+
47
+ started_by_user_id = Column(String(64), nullable=False)
48
+ notes = Column(Text, nullable=True)
49
+ # optional idempotency token if you want “re-run latest”
50
+ client_token = Column(String(128), nullable=True, index=True)
51
+
52
+ created_at = Column(DateTime, default=datetime.utcnow, nullable=False)
53
+ started_at = Column(DateTime, nullable=True)
54
+ finished_at = Column(DateTime, nullable=True)
55
+ updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow, nullable=False)
56
+
57
+ grid = relationship("SmartDefGridModel", backref="runs")
58
+ __table_args__ = (
59
+ Index("ix_sdgr_runs_grid_created", "smart_def_grid_id", "created_at"),
60
+ )
@@ -0,0 +1,31 @@
1
+ from marshmallow import Schema, fields, validate
2
+
3
+
4
+ class SmartDefGridRunResourceSchema(Schema):
5
+ """
6
+ The user-defined table artifact (aka 'SmartDefGrid' resource).
7
+ - id is your table_id (UUID string or int—your choice).
8
+ - outline_json/original_table_json can be dicts (preferred) or JSON strings if you’d rather store serialized blobs.
9
+ """
10
+ not_blank = validate.Length(min=1, error="Field cannot be blank")
11
+
12
+ id = fields.String(dump_only=True) # table_id
13
+ smart_def_grid_id = fields.Integer(allow_none=True) # if you link to a workbook
14
+
15
+ scope_mode = fields.String(required=True)
16
+
17
+ # prefer dicts; switch to fields.String if you store JSON-serialized strings
18
+ outline_json = fields.Raw(required=True)
19
+ original_table_json = fields.Raw(required=True)
20
+ targets_json = fields.Raw(allow_none=True)
21
+
22
+ status = fields.String(required=True)
23
+ started_by_user_id = fields.String(required=True)
24
+
25
+ notes = fields.String(allow_none=True)
26
+ client_token = fields.String(allow_none=True)
27
+
28
+ created_at = fields.DateTime(dump_only=True)
29
+ started_at = fields.DateTime(allow_none=True)
30
+ finished_at = fields.DateTime(allow_none=True)
31
+ updated_at = fields.DateTime(dump_only=True)
File without changes
@@ -0,0 +1,34 @@
1
+ from datetime import datetime
2
+
3
+ from sqlalchemy import Column, DateTime, Boolean, ForeignKey, Integer, Text, String
4
+ from sqlalchemy.orm import relationship
5
+
6
+ from ...database import Base
7
+ from ..SmartGridCell.models import SmartGridCellModel
8
+
9
+
10
+ class SmartGridModel(Base):
11
+ __tablename__ = "smart_grids"
12
+
13
+ id = Column(Integer, primary_key=True)
14
+ user_id = Column(String(128), nullable=False)
15
+ workbook_id = Column(
16
+ Integer,
17
+ ForeignKey('workbooks.id'),
18
+ nullable=True,
19
+ )
20
+ table_info = Column(Text, nullable=True)
21
+ is_deleted = Column(Boolean, nullable=True)
22
+ updated_at = Column(
23
+ DateTime,
24
+ nullable=False,
25
+ # https://stackoverflow.com/questions/58776476/why-doesnt-freezegun-work-with-sqlalchemy-default-values
26
+ default=lambda: datetime.utcnow(),
27
+ onupdate=lambda: datetime.utcnow(),
28
+ )
29
+
30
+ cells = relationship(
31
+ "SmartGridCellModel",
32
+ order_by=SmartGridCellModel.row,
33
+ back_populates="smart_grid",
34
+ )
@@ -0,0 +1,18 @@
1
+ from marshmallow import Schema, fields, validate
2
+ from ..SmartGridCell.schemas import SmartGridCellResourceSchema
3
+
4
+
5
+ class SmartGridResourceSchema(Schema):
6
+ not_blank = validate.Length(min=1, error="Field cannot be blank")
7
+
8
+ id = fields.Integer(dump_only=True)
9
+ user_id = fields.String(required=True, validate=not_blank)
10
+ workbook_id = fields.Integer(allow_none=True)
11
+ table_info = fields.String(allow_none=True)
12
+ is_deleted = fields.Boolean(allow_none=True)
13
+ cells = fields.Nested(
14
+ SmartGridCellResourceSchema(exclude=("smart_grid_id",)),
15
+ many=True,
16
+ dump_only=True,
17
+ )
18
+ updated_at = fields.DateTime(dump_only=True)
File without changes
@@ -0,0 +1,44 @@
1
+ from datetime import datetime
2
+
3
+ from sqlalchemy import Column, DateTime, Boolean, ForeignKey, Integer, Text, String
4
+ from sqlalchemy.orm import relationship
5
+
6
+ from ...database import Base
7
+
8
+
9
+ class SmartGridCellModel(Base):
10
+ __tablename__ = "smart_grid_cells"
11
+
12
+ id = Column(Integer, primary_key=True)
13
+ smart_grid_id = Column(
14
+ Integer,
15
+ ForeignKey("smart_grids.id"),
16
+ nullable=False,
17
+ )
18
+ row = Column(Integer, nullable=False)
19
+ col = Column(Integer, nullable=False)
20
+ type = Column(String(20), nullable=False)
21
+ data = Column(Text, nullable=True)
22
+ user_query_id = Column(
23
+ Integer,
24
+ ForeignKey("assistant_user_queries.id"),
25
+ nullable=True,
26
+ )
27
+ reformulated_question = Column(String(Text), nullable=False)
28
+ is_deleted = Column(Boolean, nullable=True)
29
+ updated_at = Column(
30
+ DateTime,
31
+ nullable=False,
32
+ # https://stackoverflow.com/questions/58776476/why-doesnt-freezegun-work-with-sqlalchemy-default-values
33
+ default=lambda: datetime.utcnow(),
34
+ onupdate=lambda: datetime.utcnow(),
35
+ )
36
+
37
+ user_query = relationship(
38
+ "AssistantUserQueryModel",
39
+ )
40
+
41
+ smart_grid = relationship(
42
+ "SmartGridModel",
43
+ back_populates="cells",
44
+ )
@@ -0,0 +1,22 @@
1
+ """Marshmallow Schema for AssistantCommand."""
2
+ from marshmallow import Schema, fields
3
+ from ..AssistantUserQuery.schemas import AssistantUserQueryResourceSchema
4
+
5
+
6
+ class SmartGridCellResourceSchema(Schema):
7
+ """Class for AssistantCommandResource schema"""
8
+
9
+ id = fields.Integer(dump_only=True)
10
+ smart_grid_id = fields.Integer(required=True)
11
+ row = fields.Integer(required=True)
12
+ col = fields.Integer(required=True)
13
+ type = fields.String(required=True)
14
+ data = fields.String(allow_none=True)
15
+ user_query_id = fields.Integer(allow_none=True)
16
+ user_query = fields.Nested(
17
+ AssistantUserQueryResourceSchema(),
18
+ dump_only=True,
19
+ )
20
+ reformulated_question = fields.String(allow_none=True)
21
+ is_deleted = fields.Boolean(allow_none=True)
22
+ updated_at = fields.DateTime(dump_only=True)
File without changes
@@ -0,0 +1,12 @@
1
+ from sqlalchemy import Column, Integer, String, Date
2
+ from ...database import Base
3
+
4
+
5
+ class Submission13FModel(Base):
6
+ __tablename__ = '13fsubmission'
7
+
8
+ ACCESSION_NUMBER = Column(String(25), primary_key=True)
9
+ FILING_DATE = Column(Date, nullable=False)
10
+ SUBMISSIONTYPE = Column(String(10), nullable=False)
11
+ CIK = Column(String(10), nullable=False)
12
+ PERIODOFREPORT = Column(Date, nullable=False)
@@ -0,0 +1,10 @@
1
+ from marshmallow import Schema, fields
2
+ from ...utils.utils import Safe13FDate
3
+
4
+
5
+ class Submission13FSchema(Schema):
6
+ ACCESSION_NUMBER = fields.String(required=True)
7
+ FILING_DATE = Safe13FDate(required=True)
8
+ SUBMISSIONTYPE = fields.String(required=True)
9
+ CIK = fields.String(required=True)
10
+ PERIODOFREPORT = Safe13FDate(required=True)
File without changes
@@ -0,0 +1,12 @@
1
+ from sqlalchemy import Column, Integer, String, Date
2
+ from ...database import Base
3
+
4
+
5
+ class Summarypage13FModel(Base):
6
+ __tablename__ = '13fsummarypage'
7
+
8
+ ACCESSION_NUMBER = Column(String(25), primary_key=True)
9
+ OTHERINCLUDEDMANAGERSCOUNT = Column(Integer)
10
+ TABLEENTRYTOTAL = Column(Integer)
11
+ TABLEVALUETOTAL = Column(Integer)
12
+ ISCONFIDENTIALOMITTED = Column(String(1))
@@ -0,0 +1,9 @@
1
+ from marshmallow import Schema, fields
2
+
3
+
4
+ class Summarypage13FSchema(Schema):
5
+ ACCESSION_NUMBER = fields.String(required=True)
6
+ OTHERINCLUDEDMANAGERSCOUNT = fields.Integer()
7
+ TABLEENTRYTOTAL = fields.Integer()
8
+ TABLEVALUETOTAL = fields.Integer()
9
+ ISCONFIDENTIALOMITTED = fields.String()
File without changes
@@ -0,0 +1,40 @@
1
+ from datetime import datetime
2
+
3
+ from sqlalchemy import (
4
+ Column,
5
+ Integer,
6
+ DateTime,
7
+ String,
8
+ Text,
9
+ Boolean,
10
+ ForeignKey,
11
+ )
12
+
13
+ from ...database import Base
14
+
15
+
16
+ class TableFigureModel(Base):
17
+ __tablename__ = "table_figures"
18
+
19
+ id = Column(Integer, primary_key=True)
20
+ file_id = Column(
21
+ Integer,
22
+ ForeignKey('files.id'),
23
+ nullable=True,
24
+ )
25
+ source_type = Column(String(50), nullable=False)
26
+ source_id = Column(Integer, nullable=False)
27
+ type = Column(String(50), nullable=False)
28
+ label = Column(String(50), nullable=True)
29
+ caption = Column(Text, nullable=True)
30
+ description = Column(Text, nullable=True)
31
+ content = Column(Text, nullable=True)
32
+ link = Column(String(255), nullable=True)
33
+ llm_processed = Column(Boolean, nullable=True)
34
+ updated_at = Column(
35
+ DateTime,
36
+ nullable=False,
37
+ # https://stackoverflow.com/questions/58776476/why-doesnt-freezegun-work-with-sqlalchemy-default-values
38
+ default=lambda: datetime.utcnow(),
39
+ onupdate=lambda: datetime.utcnow(),
40
+ )