cs-models 0.0.627__py3-none-any.whl → 0.0.847__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.
- cs_models/database/operations.py +17 -5
- cs_models/resources/ArtifactVectorIndex/__init__.py +0 -0
- cs_models/resources/ArtifactVectorIndex/models.py +32 -0
- cs_models/resources/ArtifactVectorIndex/schemas.py +16 -0
- cs_models/resources/ArtifactVectorIndexQueue/__init__.py +0 -0
- cs_models/resources/ArtifactVectorIndexQueue/models.py +34 -0
- cs_models/resources/ArtifactVectorIndexQueue/schemas.py +17 -0
- cs_models/resources/AssistantCommand/models.py +14 -1
- cs_models/resources/AssistantCommand/schemas.py +2 -0
- cs_models/resources/AssistantCommandArtifact/models.py +2 -1
- cs_models/resources/AssistantCommandArtifact/schemas.py +1 -0
- cs_models/resources/AssistantCommandChart/__init__.py +0 -0
- cs_models/resources/AssistantCommandChart/models.py +37 -0
- cs_models/resources/AssistantCommandChart/schemas.py +16 -0
- cs_models/resources/AssistantSession/models.py +8 -1
- cs_models/resources/AssistantSession/schemas.py +3 -0
- cs_models/resources/AssistantUserQuery/models.py +5 -1
- cs_models/resources/AssistantUserQuery/schemas.py +40 -1
- cs_models/resources/B3CRSS/__init__.py +0 -0
- cs_models/resources/B3CRSS/models.py +25 -0
- cs_models/resources/B3CRSS/schemas.py +14 -0
- cs_models/resources/CampaignTracker/__init__.py +0 -0
- cs_models/resources/CampaignTracker/models.py +29 -0
- cs_models/resources/CampaignTracker/schemas.py +17 -0
- cs_models/resources/CompanyDrugCount/__init__.py +0 -0
- cs_models/resources/CompanyDrugCount/models.py +28 -0
- cs_models/resources/CompanyDrugCount/schemas.py +11 -0
- cs_models/resources/CompanyMarketCap/__init__.py +0 -0
- cs_models/resources/CompanyMarketCap/models.py +29 -0
- cs_models/resources/CompanyMarketCap/schemas.py +11 -0
- cs_models/resources/CompanyOUS/models.py +4 -0
- cs_models/resources/CompanyOUS/schemas.py +6 -0
- cs_models/resources/CompanyOutbox/models.py +1 -0
- cs_models/resources/CompanyOutbox/schemas.py +1 -0
- cs_models/resources/CompanyReview/models.py +4 -1
- cs_models/resources/CompanyReview/schemas.py +3 -0
- cs_models/resources/CompanySEC/models.py +4 -0
- cs_models/resources/CompanySEC/schemas.py +6 -0
- cs_models/resources/Config/models.py +2 -0
- cs_models/resources/Config/schemas.py +3 -0
- cs_models/resources/CoverPage13F/__init__.py +0 -0
- cs_models/resources/CoverPage13F/models.py +29 -0
- cs_models/resources/CoverPage13F/schemas.py +27 -0
- cs_models/resources/Cusip13FSubsidiary/__init__.py +0 -0
- cs_models/resources/Cusip13FSubsidiary/models.py +28 -0
- cs_models/resources/Cusip13FSubsidiary/schemas.py +14 -0
- cs_models/resources/Deal/models.py +2 -0
- cs_models/resources/Deal/schemas.py +2 -0
- cs_models/resources/DealAdvisor/__init__.py +0 -0
- cs_models/resources/DealAdvisor/models.py +35 -0
- cs_models/resources/DealAdvisor/schemas.py +15 -0
- cs_models/resources/DealInvestor/models.py +1 -0
- cs_models/resources/DealInvestor/schemas.py +1 -0
- cs_models/resources/DealType/__init__.py +0 -0
- cs_models/resources/DealType/models.py +33 -0
- cs_models/resources/DealType/schemas.py +14 -0
- cs_models/resources/DealUnderwriter/__init__.py +0 -0
- cs_models/resources/DealUnderwriter/models.py +35 -0
- cs_models/resources/DealUnderwriter/schemas.py +15 -0
- cs_models/resources/DeepResearchAgenticUnit/__init__.py +14 -0
- cs_models/resources/DeepResearchAgenticUnit/models.py +123 -0
- cs_models/resources/DeepResearchAgenticUnit/schemas.py +50 -0
- cs_models/resources/DeepResearchSession/__init__.py +20 -0
- cs_models/resources/DeepResearchSession/models.py +170 -0
- cs_models/resources/DeepResearchSession/schemas.py +94 -0
- cs_models/resources/DeepResearchSubTask/__init__.py +20 -0
- cs_models/resources/DeepResearchSubTask/models.py +177 -0
- cs_models/resources/DeepResearchSubTask/schemas.py +105 -0
- cs_models/resources/Designation/models.py +7 -0
- cs_models/resources/Designation/schemas.py +2 -0
- cs_models/resources/DesignationOutbox/models.py +2 -0
- cs_models/resources/DesignationOutbox/schemas.py +1 -0
- cs_models/resources/Digest/models.py +1 -0
- cs_models/resources/Digest/schemas.py +1 -0
- cs_models/resources/DocChunk/__init__.py +0 -0
- cs_models/resources/DocChunk/models.py +33 -0
- cs_models/resources/DocChunk/schemas.py +20 -0
- cs_models/resources/DocMarkdownTable/__init__.py +0 -0
- cs_models/resources/DocMarkdownTable/models.py +29 -0
- cs_models/resources/DocMarkdownTable/schemas.py +16 -0
- cs_models/resources/EventLLM/__init__.py +0 -0
- cs_models/resources/EventLLM/models.py +41 -0
- cs_models/resources/EventLLM/schemas.py +39 -0
- cs_models/resources/EventsQueue/__init__.py +0 -0
- cs_models/resources/EventsQueue/models.py +33 -0
- cs_models/resources/EventsQueue/schemas.py +18 -0
- cs_models/resources/ExplorerColumn/__init__.py +0 -0
- cs_models/resources/ExplorerColumn/models.py +33 -0
- cs_models/resources/ExplorerColumn/schemas.py +16 -0
- cs_models/resources/ExternalDrive/__init__.py +0 -0
- cs_models/resources/ExternalDrive/models.py +29 -0
- cs_models/resources/ExternalDrive/schemas.py +14 -0
- cs_models/resources/FDADrugReview/__init__.py +0 -0
- cs_models/resources/FDADrugReview/models.py +29 -0
- cs_models/resources/FDADrugReview/schemas.py +19 -0
- cs_models/resources/FDADrugReviewFile/__init__.py +0 -0
- cs_models/resources/FDADrugReviewFile/models.py +43 -0
- cs_models/resources/FDADrugReviewFile/schemas.py +22 -0
- cs_models/resources/FDADrugReviewFileCondition/__init__.py +0 -0
- cs_models/resources/FDADrugReviewFileCondition/models.py +42 -0
- cs_models/resources/FDADrugReviewFileCondition/schemas.py +18 -0
- cs_models/resources/FDADrugReviewFileIntervention/__init__.py +0 -0
- cs_models/resources/FDADrugReviewFileIntervention/models.py +42 -0
- cs_models/resources/FDADrugReviewFileIntervention/schemas.py +18 -0
- cs_models/resources/FDADrugReviewFileTarget/__init__.py +0 -0
- cs_models/resources/FDADrugReviewFileTarget/models.py +42 -0
- cs_models/resources/FDADrugReviewFileTarget/schemas.py +18 -0
- cs_models/resources/FDALabel/models.py +3 -0
- cs_models/resources/FDALabel/schemas.py +2 -0
- cs_models/resources/FDAMeetingFiling/models.py +1 -0
- cs_models/resources/FDAMeetingFiling/schemas.py +1 -0
- cs_models/resources/FinancingDealType/__init__.py +0 -0
- cs_models/resources/FinancingDealType/models.py +28 -0
- cs_models/resources/FinancingDealType/schemas.py +13 -0
- cs_models/resources/InfoTable13F/__init__.py +0 -0
- cs_models/resources/InfoTable13F/models.py +26 -0
- cs_models/resources/InfoTable13F/schemas.py +20 -0
- cs_models/resources/Meeting/models.py +8 -0
- cs_models/resources/Meeting/schemas.py +84 -0
- cs_models/resources/MeetingDataOutbox/models.py +8 -1
- cs_models/resources/MeetingDataOutbox/schemas.py +4 -1
- cs_models/resources/MeetingUserDocument/__init__.py +0 -0
- cs_models/resources/MeetingUserDocument/models.py +39 -0
- cs_models/resources/MeetingUserDocument/schemas.py +17 -0
- cs_models/resources/MindgramOAuth/__init__.py +0 -0
- cs_models/resources/MindgramOAuth/models.py +35 -0
- cs_models/resources/MindgramOAuth/schemas.py +33 -0
- cs_models/resources/NCTFDADrugReviewFile/__init__.py +0 -0
- cs_models/resources/NCTFDADrugReviewFile/models.py +37 -0
- cs_models/resources/NCTFDADrugReviewFile/schemas.py +16 -0
- cs_models/resources/NCTFacilities/models.py +1 -0
- cs_models/resources/NCTFacilities/schemas.py +1 -0
- cs_models/resources/NCTParticipationCriteria/__init__.py +0 -0
- cs_models/resources/NCTParticipationCriteria/models.py +28 -0
- cs_models/resources/NCTParticipationCriteria/schemas.py +14 -0
- cs_models/resources/NCTStudy/models.py +2 -0
- cs_models/resources/NCTStudy/schemas.py +2 -0
- cs_models/resources/NotificationReadStatus/__init__.py +0 -0
- cs_models/resources/NotificationReadStatus/models.py +30 -0
- cs_models/resources/NotificationReadStatus/schemas.py +15 -0
- cs_models/resources/OtherManager13F/__init__.py +0 -0
- cs_models/resources/OtherManager13F/models.py +18 -0
- cs_models/resources/OtherManager13F/schemas.py +12 -0
- cs_models/resources/OtherManager213F/__init__.py +0 -0
- cs_models/resources/OtherManager213F/models.py +15 -0
- cs_models/resources/OtherManager213F/schemas.py +13 -0
- cs_models/resources/PipelineCrawlSession/__init__.py +0 -0
- cs_models/resources/PipelineCrawlSession/models.py +67 -0
- cs_models/resources/PipelineCrawlSession/schemas.py +22 -0
- cs_models/resources/PipelineCrawledPage/__init__.py +0 -0
- cs_models/resources/PipelineCrawledPage/models.py +80 -0
- cs_models/resources/PipelineCrawledPage/schemas.py +34 -0
- cs_models/resources/PipelineDrugPortfolio/__init__.py +0 -0
- cs_models/resources/PipelineDrugPortfolio/models.py +92 -0
- cs_models/resources/PipelineDrugPortfolio/schemas.py +31 -0
- cs_models/resources/PipelineExtractionLog/__init__.py +0 -0
- cs_models/resources/PipelineExtractionLog/models.py +55 -0
- cs_models/resources/PipelineExtractionLog/schemas.py +23 -0
- cs_models/resources/PromptIndices/__init__.py +0 -0
- cs_models/resources/PromptIndices/models.py +27 -0
- cs_models/resources/PromptIndices/schemas.py +17 -0
- cs_models/resources/PubmedMeetingSellSideSignal/__init__.py +0 -0
- cs_models/resources/PubmedMeetingSellSideSignal/models.py +64 -0
- cs_models/resources/PubmedMeetingSellSideSignal/schemas.py +21 -0
- cs_models/resources/PubmedMeetingUserDocument/__init__.py +0 -0
- cs_models/resources/PubmedMeetingUserDocument/models.py +40 -0
- cs_models/resources/PubmedMeetingUserDocument/schemas.py +16 -0
- cs_models/resources/PubmedUserDocument/__init__.py +0 -0
- cs_models/resources/PubmedUserDocument/models.py +35 -0
- cs_models/resources/PubmedUserDocument/schemas.py +15 -0
- cs_models/resources/PubmedVectorIndex/__init__.py +0 -0
- cs_models/resources/PubmedVectorIndex/models.py +33 -0
- cs_models/resources/PubmedVectorIndex/schemas.py +16 -0
- cs_models/resources/SalesEstimate/__init__.py +0 -0
- cs_models/resources/SalesEstimate/models.py +39 -0
- cs_models/resources/SalesEstimate/schemas.py +26 -0
- cs_models/resources/SalesEstimateCompany/__init__.py +0 -0
- cs_models/resources/SalesEstimateCompany/models.py +38 -0
- cs_models/resources/SalesEstimateCompany/schemas.py +35 -0
- cs_models/resources/SalesEstimateCondition/__init__.py +0 -0
- cs_models/resources/SalesEstimateCondition/models.py +41 -0
- cs_models/resources/SalesEstimateCondition/schemas.py +17 -0
- cs_models/resources/SalesEstimateIntervention/__init__.py +0 -0
- cs_models/resources/SalesEstimateIntervention/models.py +41 -0
- cs_models/resources/SalesEstimateIntervention/schemas.py +17 -0
- cs_models/resources/SalesEstimateTarget/__init__.py +0 -0
- cs_models/resources/SalesEstimateTarget/models.py +41 -0
- cs_models/resources/SalesEstimateTarget/schemas.py +17 -0
- cs_models/resources/SalesTable/__init__.py +0 -0
- cs_models/resources/SalesTable/models.py +34 -0
- cs_models/resources/SalesTable/schemas.py +20 -0
- cs_models/resources/SearchLink/__init__.py +0 -0
- cs_models/resources/SearchLink/models.py +29 -0
- cs_models/resources/SearchLink/schemas.py +16 -0
- cs_models/resources/SellSideAbstractMention/__init__.py +0 -0
- cs_models/resources/SellSideAbstractMention/models.py +57 -0
- cs_models/resources/SellSideAbstractMention/schemas.py +28 -0
- cs_models/resources/SellSideAbstractMentionLink/__init__.py +0 -0
- cs_models/resources/SellSideAbstractMentionLink/models.py +60 -0
- cs_models/resources/SellSideAbstractMentionLink/schemas.py +24 -0
- cs_models/resources/SellSideSource/__init__.py +0 -0
- cs_models/resources/SellSideSource/models.py +25 -0
- cs_models/resources/SellSideSource/schemas.py +13 -0
- cs_models/resources/Signature13F/__init__.py +0 -0
- cs_models/resources/Signature13F/models.py +15 -0
- cs_models/resources/Signature13F/schemas.py +13 -0
- cs_models/resources/SmartDefGrid/__init__.py +0 -0
- cs_models/resources/SmartDefGrid/models.py +30 -0
- cs_models/resources/SmartDefGrid/schemas.py +52 -0
- cs_models/resources/SmartDefGridCell/__init__.py +0 -0
- cs_models/resources/SmartDefGridCell/models.py +51 -0
- cs_models/resources/SmartDefGridCell/schemas.py +39 -0
- cs_models/resources/SmartDefGridCellAnswer/__init__.py +0 -0
- cs_models/resources/SmartDefGridCellAnswer/models.py +45 -0
- cs_models/resources/SmartDefGridCellAnswer/schemas.py +23 -0
- cs_models/resources/SmartDefGridCellAnswerCitation/__init__.py +0 -0
- cs_models/resources/SmartDefGridCellAnswerCitation/models.py +21 -0
- cs_models/resources/SmartDefGridCellAnswerCitation/schemas.py +14 -0
- cs_models/resources/SmartDefGridCellQuestion/__init__.py +0 -0
- cs_models/resources/SmartDefGridCellQuestion/models.py +76 -0
- cs_models/resources/SmartDefGridCellQuestion/schemas.py +41 -0
- cs_models/resources/SmartDefGridCellValue/__init__.py +0 -0
- cs_models/resources/SmartDefGridCellValue/models.py +54 -0
- cs_models/resources/SmartDefGridCellValue/schemas.py +19 -0
- cs_models/resources/SmartDefGridRun/__init__.py +0 -0
- cs_models/resources/SmartDefGridRun/models.py +60 -0
- cs_models/resources/SmartDefGridRun/schemas.py +31 -0
- cs_models/resources/SmartGrid/__init__.py +0 -0
- cs_models/resources/SmartGrid/models.py +34 -0
- cs_models/resources/SmartGrid/schemas.py +18 -0
- cs_models/resources/SmartGridCell/__init__.py +0 -0
- cs_models/resources/SmartGridCell/models.py +44 -0
- cs_models/resources/SmartGridCell/schemas.py +22 -0
- cs_models/resources/Submission13F/__init__.py +0 -0
- cs_models/resources/Submission13F/models.py +12 -0
- cs_models/resources/Submission13F/schemas.py +10 -0
- cs_models/resources/SummaryPage13F/__init__.py +0 -0
- cs_models/resources/SummaryPage13F/models.py +12 -0
- cs_models/resources/SummaryPage13F/schemas.py +9 -0
- cs_models/resources/TableFigure/__init__.py +0 -0
- cs_models/resources/TableFigure/models.py +40 -0
- cs_models/resources/TableFigure/schemas.py +61 -0
- cs_models/resources/TargetSyn/models.py +4 -0
- cs_models/resources/TargetSyn/schemas.py +3 -0
- cs_models/resources/Transcript/__init__.py +0 -0
- cs_models/resources/Transcript/models.py +31 -0
- cs_models/resources/Transcript/schemas.py +20 -0
- cs_models/resources/TranscriptCondition/__init__.py +0 -0
- cs_models/resources/TranscriptCondition/models.py +41 -0
- cs_models/resources/TranscriptCondition/schemas.py +17 -0
- cs_models/resources/TranscriptEquity/__init__.py +0 -0
- cs_models/resources/TranscriptEquity/models.py +28 -0
- cs_models/resources/TranscriptEquity/schemas.py +15 -0
- cs_models/resources/TranscriptEquityCompany/__init__.py +0 -0
- cs_models/resources/TranscriptEquityCompany/models.py +34 -0
- cs_models/resources/TranscriptEquityCompany/schemas.py +16 -0
- cs_models/resources/TranscriptGrouping/__init__.py +0 -0
- cs_models/resources/TranscriptGrouping/models.py +23 -0
- cs_models/resources/TranscriptGrouping/schemas.py +14 -0
- cs_models/resources/TranscriptGroupingMap/__init__.py +0 -0
- cs_models/resources/TranscriptGroupingMap/models.py +31 -0
- cs_models/resources/TranscriptGroupingMap/schemas.py +14 -0
- cs_models/resources/TranscriptIntervention/__init__.py +0 -0
- cs_models/resources/TranscriptIntervention/models.py +41 -0
- cs_models/resources/TranscriptIntervention/schemas.py +17 -0
- cs_models/resources/TranscriptItem/__init__.py +0 -0
- cs_models/resources/TranscriptItem/models.py +35 -0
- cs_models/resources/TranscriptItem/schemas.py +20 -0
- cs_models/resources/TranscriptTarget/__init__.py +0 -0
- cs_models/resources/TranscriptTarget/models.py +41 -0
- cs_models/resources/TranscriptTarget/schemas.py +17 -0
- cs_models/resources/UserAutomatedDigest/__init__.py +0 -0
- cs_models/resources/UserAutomatedDigest/models.py +35 -0
- cs_models/resources/UserAutomatedDigest/schemas.py +19 -0
- cs_models/resources/UserDocument/models.py +9 -0
- cs_models/resources/UserDocument/schemas.py +3 -0
- cs_models/resources/UserDocumentAccess/__init__.py +0 -0
- cs_models/resources/UserDocumentAccess/models.py +35 -0
- cs_models/resources/UserDocumentAccess/schemas.py +19 -0
- cs_models/resources/UserDocumentChunk/__init__.py +0 -0
- cs_models/resources/UserDocumentChunk/models.py +35 -0
- cs_models/resources/UserDocumentChunk/schemas.py +18 -0
- cs_models/resources/UserDocumentHierarchy/__init__.py +0 -0
- cs_models/resources/UserDocumentHierarchy/models.py +51 -0
- cs_models/resources/UserDocumentHierarchy/schemas.py +24 -0
- cs_models/resources/UserDocumentMeeting/__init__.py +0 -0
- cs_models/resources/UserDocumentMeeting/models.py +33 -0
- cs_models/resources/UserDocumentMeeting/schemas.py +14 -0
- cs_models/resources/UserDocumentTag/__init__.py +0 -0
- cs_models/resources/UserDocumentTag/models.py +31 -0
- cs_models/resources/UserDocumentTag/schemas.py +15 -0
- cs_models/resources/UserExplorerColumn/__init__.py +0 -0
- cs_models/resources/UserExplorerColumn/models.py +30 -0
- cs_models/resources/UserExplorerColumn/schemas.py +14 -0
- cs_models/resources/UserInternalDocWorkflow/__init__.py +0 -0
- cs_models/resources/UserInternalDocWorkflow/models.py +28 -0
- cs_models/resources/UserInternalDocWorkflow/schemas.py +11 -0
- cs_models/resources/UserMeeting/__init__.py +0 -0
- cs_models/resources/UserMeeting/models.py +31 -0
- cs_models/resources/UserMeeting/schemas.py +12 -0
- cs_models/resources/UserMeetingFavorite/__init__.py +0 -0
- cs_models/resources/UserMeetingFavorite/models.py +36 -0
- cs_models/resources/UserMeetingFavorite/schemas.py +13 -0
- cs_models/resources/UserSavedSearch/models.py +1 -0
- cs_models/resources/UserSavedSearch/schemas.py +1 -0
- cs_models/resources/UserSavedSearchAccess/__init__.py +0 -0
- cs_models/resources/UserSavedSearchAccess/models.py +34 -0
- cs_models/resources/UserSavedSearchAccess/schemas.py +18 -0
- cs_models/resources/UserSavedSearchCollectionMap/__init__.py +0 -0
- cs_models/resources/UserSavedSearchCollectionMap/models.py +33 -0
- cs_models/resources/UserSavedSearchCollectionMap/schemas.py +14 -0
- cs_models/resources/UserSavedSearchDigest/__init__.py +0 -0
- cs_models/resources/UserSavedSearchDigest/models.py +36 -0
- cs_models/resources/UserSavedSearchDigest/schemas.py +16 -0
- cs_models/resources/UserVAParameterView/__init__.py +0 -0
- cs_models/resources/UserVAParameterView/models.py +27 -0
- cs_models/resources/UserVAParameterView/schemas.py +13 -0
- cs_models/resources/UserWatchlistAccess/__init__.py +0 -0
- cs_models/resources/UserWatchlistAccess/models.py +31 -0
- cs_models/resources/UserWatchlistAccess/schemas.py +15 -0
- cs_models/resources/UserWorkbook/__init__.py +0 -0
- cs_models/resources/UserWorkbook/models.py +31 -0
- cs_models/resources/UserWorkbook/schemas.py +15 -0
- cs_models/resources/UserWorkbookWorkflows/__init__.py +0 -0
- cs_models/resources/UserWorkbookWorkflows/models.py +27 -0
- cs_models/resources/UserWorkbookWorkflows/schemas.py +15 -0
- cs_models/resources/UserWorkbookWorkflowsShared/__init__.py +0 -0
- cs_models/resources/UserWorkbookWorkflowsShared/models.py +31 -0
- cs_models/resources/UserWorkbookWorkflowsShared/schemas.py +15 -0
- cs_models/resources/VACompanyMap/__init__.py +0 -0
- cs_models/resources/VACompanyMap/models.py +37 -0
- cs_models/resources/VACompanyMap/schemas.py +38 -0
- cs_models/resources/VAParameter/__init__.py +0 -0
- cs_models/resources/VAParameter/models.py +36 -0
- cs_models/resources/VAParameter/schemas.py +25 -0
- cs_models/resources/VAParameterCondition/__init__.py +0 -0
- cs_models/resources/VAParameterCondition/models.py +41 -0
- cs_models/resources/VAParameterCondition/schemas.py +17 -0
- cs_models/resources/VAParameterGeography/__init__.py +0 -0
- cs_models/resources/VAParameterGeography/models.py +0 -0
- cs_models/resources/VAParameterGeography/schemas.py +0 -0
- cs_models/resources/VAParameterIntervention/__init__.py +0 -0
- cs_models/resources/VAParameterIntervention/models.py +41 -0
- cs_models/resources/VAParameterIntervention/schemas.py +17 -0
- cs_models/resources/VAParameterValue/__init__.py +0 -0
- cs_models/resources/VAParameterValue/models.py +42 -0
- cs_models/resources/VAParameterValue/schemas.py +27 -0
- cs_models/resources/VAParameterView/__init__.py +0 -0
- cs_models/resources/VAParameterView/models.py +35 -0
- cs_models/resources/VAParameterView/schemas.py +15 -0
- cs_models/resources/ViewPublicAssistantUserQuery/__init__.py +0 -0
- cs_models/resources/ViewPublicAssistantUserQuery/models.py +30 -0
- cs_models/resources/ViewPublicAssistantUserQuery/schemas.py +14 -0
- cs_models/resources/ViewPublicWorkbook/__init__.py +0 -0
- cs_models/resources/ViewPublicWorkbook/models.py +30 -0
- cs_models/resources/ViewPublicWorkbook/schemas.py +14 -0
- cs_models/resources/ViewPublicationCondition/__init__.py +0 -0
- cs_models/resources/ViewPublicationCondition/models.py +32 -0
- cs_models/resources/ViewPublicationCondition/schemas.py +16 -0
- cs_models/resources/WatchlistDigest/__init__.py +0 -0
- cs_models/resources/WatchlistDigest/models.py +36 -0
- cs_models/resources/WatchlistDigest/schemas.py +16 -0
- cs_models/resources/Workbook/__init__.py +0 -0
- cs_models/resources/Workbook/models.py +46 -0
- cs_models/resources/Workbook/schemas.py +32 -0
- cs_models/resources/WorkbookBlock/__init__.py +0 -0
- cs_models/resources/WorkbookBlock/models.py +50 -0
- cs_models/resources/WorkbookBlock/schemas.py +63 -0
- cs_models/resources/WorkbookBlockComment/__init__.py +0 -0
- cs_models/resources/WorkbookBlockComment/models.py +36 -0
- cs_models/resources/WorkbookBlockComment/schemas.py +15 -0
- cs_models/resources/WorkbookCommentThread/__init__.py +0 -0
- cs_models/resources/WorkbookCommentThread/models.py +59 -0
- cs_models/resources/WorkbookCommentThread/schemas.py +35 -0
- cs_models/resources/WorkbookMeta/__init__.py +0 -0
- cs_models/resources/WorkbookMeta/models.py +14 -0
- cs_models/resources/WorkbookMeta/schemas.py +9 -0
- cs_models/resources/WorkbookThreadComment/__init__.py +0 -0
- cs_models/resources/WorkbookThreadComment/models.py +38 -0
- cs_models/resources/WorkbookThreadComment/schemas.py +14 -0
- cs_models/resources/WorkbookWorkflow/__init__.py +0 -0
- cs_models/resources/WorkbookWorkflow/models.py +39 -0
- cs_models/resources/WorkbookWorkflow/schemas.py +24 -0
- cs_models/resources/WorkbookWorkflowBlock/__init__.py +0 -0
- cs_models/resources/WorkbookWorkflowBlock/models.py +37 -0
- cs_models/resources/WorkbookWorkflowBlock/schemas.py +60 -0
- cs_models/utils/utils.py +27 -1
- cs_models-0.0.847.dist-info/METADATA +29 -0
- {cs_models-0.0.627.dist-info → cs_models-0.0.847.dist-info}/RECORD +391 -52
- {cs_models-0.0.627.dist-info → cs_models-0.0.847.dist-info}/WHEEL +1 -1
- cs_models-0.0.627.dist-info/METADATA +0 -29
- {cs_models-0.0.627.dist-info → cs_models-0.0.847.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"""Models for Deep Research Sessions - Agentic research orchestration."""
|
|
2
|
+
import enum
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
|
|
5
|
+
from sqlalchemy import (
|
|
6
|
+
Column,
|
|
7
|
+
DateTime,
|
|
8
|
+
Integer,
|
|
9
|
+
String,
|
|
10
|
+
Text,
|
|
11
|
+
Boolean,
|
|
12
|
+
ForeignKey,
|
|
13
|
+
Enum,
|
|
14
|
+
Float,
|
|
15
|
+
)
|
|
16
|
+
from sqlalchemy.orm import relationship
|
|
17
|
+
|
|
18
|
+
from ...database import Base
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class DeepResearchStatusEnum(enum.Enum):
|
|
22
|
+
"""Status enum for deep research sessions."""
|
|
23
|
+
NOT_STARTED = "NOT_STARTED"
|
|
24
|
+
DECOMPOSING = "DECOMPOSING"
|
|
25
|
+
WAITING_USER_CLARIFICATION = "WAITING_USER_CLARIFICATION"
|
|
26
|
+
WAITING_SCOPE_APPROVAL = "WAITING_SCOPE_APPROVAL"
|
|
27
|
+
RESEARCHING = "RESEARCHING"
|
|
28
|
+
SYNTHESIZING = "SYNTHESIZING"
|
|
29
|
+
WAITING_USER_REVIEW = "WAITING_USER_REVIEW"
|
|
30
|
+
DRILL_DOWN = "DRILL_DOWN"
|
|
31
|
+
COMPLETED = "COMPLETED"
|
|
32
|
+
FAILED = "FAILED"
|
|
33
|
+
CANCELLED = "CANCELLED"
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class HITLStatusEnum(enum.Enum):
|
|
37
|
+
"""Human-in-the-loop status enum."""
|
|
38
|
+
NONE = "NONE"
|
|
39
|
+
PENDING = "PENDING"
|
|
40
|
+
RESPONDED = "RESPONDED"
|
|
41
|
+
TIMEOUT = "TIMEOUT"
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class DeepResearchSessionModel(Base):
|
|
45
|
+
"""
|
|
46
|
+
Model for Deep Research Sessions.
|
|
47
|
+
|
|
48
|
+
Each session represents a complex research task that is decomposed into
|
|
49
|
+
parallel sub-tasks executed by independent agents. Supports human-in-the-loop
|
|
50
|
+
checkpoints for clarification, scope approval, and result review.
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
__tablename__ = "deep_research_sessions"
|
|
54
|
+
|
|
55
|
+
id = Column(Integer, primary_key=True)
|
|
56
|
+
|
|
57
|
+
# User and organization
|
|
58
|
+
user_id = Column(String(128), nullable=False)
|
|
59
|
+
org_id = Column(String(128), nullable=True)
|
|
60
|
+
|
|
61
|
+
# Link to workbook (optional)
|
|
62
|
+
workbook_id = Column(
|
|
63
|
+
Integer,
|
|
64
|
+
ForeignKey("workbooks.id"),
|
|
65
|
+
nullable=True,
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
# Original query and configuration
|
|
69
|
+
original_query = Column(Text, nullable=False)
|
|
70
|
+
research_config = Column(Text, nullable=True) # JSON string of config
|
|
71
|
+
|
|
72
|
+
# Execution status
|
|
73
|
+
status = Column(
|
|
74
|
+
"status",
|
|
75
|
+
Enum(DeepResearchStatusEnum),
|
|
76
|
+
default=DeepResearchStatusEnum.NOT_STARTED,
|
|
77
|
+
nullable=False,
|
|
78
|
+
)
|
|
79
|
+
current_phase = Column(String(50), nullable=True)
|
|
80
|
+
|
|
81
|
+
# AWS Step Functions tracking
|
|
82
|
+
step_function_arn = Column(String(512), nullable=True)
|
|
83
|
+
step_function_execution_arn = Column(String(512), nullable=True)
|
|
84
|
+
|
|
85
|
+
# Progress tracking
|
|
86
|
+
total_subtasks = Column(Integer, nullable=True, default=0)
|
|
87
|
+
completed_subtasks = Column(Integer, nullable=True, default=0)
|
|
88
|
+
failed_subtasks = Column(Integer, nullable=True, default=0)
|
|
89
|
+
|
|
90
|
+
# Human-in-the-loop state
|
|
91
|
+
hitl_status = Column(
|
|
92
|
+
"hitl_status",
|
|
93
|
+
Enum(HITLStatusEnum),
|
|
94
|
+
default=HITLStatusEnum.NONE,
|
|
95
|
+
nullable=False,
|
|
96
|
+
)
|
|
97
|
+
hitl_type = Column(String(50), nullable=True) # clarification, scope_approval, review
|
|
98
|
+
hitl_questions = Column(Text, nullable=True) # JSON array of questions
|
|
99
|
+
hitl_responses = Column(Text, nullable=True) # JSON object of responses
|
|
100
|
+
hitl_task_token = Column(String(1024), nullable=True) # Step Functions callback token
|
|
101
|
+
hitl_requested_at = Column(DateTime, nullable=True)
|
|
102
|
+
hitl_responded_at = Column(DateTime, nullable=True)
|
|
103
|
+
|
|
104
|
+
# Results storage
|
|
105
|
+
final_report_s3_key = Column(String(512), nullable=True)
|
|
106
|
+
executive_summary = Column(Text, nullable=True)
|
|
107
|
+
smart_grid_id = Column(
|
|
108
|
+
Integer,
|
|
109
|
+
ForeignKey("smart_grids.id"),
|
|
110
|
+
nullable=True,
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
# Metadata
|
|
114
|
+
total_citations = Column(Integer, nullable=True, default=0)
|
|
115
|
+
average_confidence = Column(Float, nullable=True)
|
|
116
|
+
total_documents_analyzed = Column(Integer, nullable=True, default=0)
|
|
117
|
+
|
|
118
|
+
# V2 Architecture Fields (Agentic Units)
|
|
119
|
+
architecture_version = Column(String(10), default="v1") # "v1" = old DAG, "v2" = agentic units
|
|
120
|
+
|
|
121
|
+
# Orchestration state (V2)
|
|
122
|
+
current_iteration = Column(Integer, default=0) # Plan-Execute-Evaluate cycle count
|
|
123
|
+
max_iterations = Column(Integer, default=10)
|
|
124
|
+
token_budget = Column(Integer, default=100000)
|
|
125
|
+
tokens_used = Column(Integer, default=0)
|
|
126
|
+
|
|
127
|
+
# Unit tracking (V2)
|
|
128
|
+
total_units = Column(Integer, default=0)
|
|
129
|
+
completed_units = Column(Integer, default=0)
|
|
130
|
+
|
|
131
|
+
# Evaluation state (V2)
|
|
132
|
+
last_evaluation = Column(Text, nullable=True) # JSON: Last evaluator output
|
|
133
|
+
objective_confidence = Column(Float, nullable=True) # Overall confidence
|
|
134
|
+
|
|
135
|
+
# Error handling
|
|
136
|
+
error_message = Column(Text, nullable=True)
|
|
137
|
+
retry_count = Column(Integer, nullable=True, default=0)
|
|
138
|
+
|
|
139
|
+
# Soft delete and timestamps
|
|
140
|
+
is_deleted = Column(Boolean, nullable=True)
|
|
141
|
+
created_at = Column(
|
|
142
|
+
DateTime,
|
|
143
|
+
nullable=False,
|
|
144
|
+
default=lambda: datetime.utcnow(),
|
|
145
|
+
)
|
|
146
|
+
updated_at = Column(
|
|
147
|
+
DateTime,
|
|
148
|
+
nullable=False,
|
|
149
|
+
default=lambda: datetime.utcnow(),
|
|
150
|
+
onupdate=lambda: datetime.utcnow(),
|
|
151
|
+
)
|
|
152
|
+
completed_at = Column(DateTime, nullable=True)
|
|
153
|
+
|
|
154
|
+
# ORM Relationships
|
|
155
|
+
subtasks = relationship(
|
|
156
|
+
"DeepResearchSubTaskModel",
|
|
157
|
+
primaryjoin="and_(DeepResearchSessionModel.id==DeepResearchSubTaskModel.session_id, "
|
|
158
|
+
"or_(DeepResearchSubTaskModel.is_deleted==False, DeepResearchSubTaskModel.is_deleted==None))",
|
|
159
|
+
order_by="DeepResearchSubTaskModel.sequence_number",
|
|
160
|
+
back_populates="session",
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
# V2: Agentic Units relationship
|
|
164
|
+
agentic_units = relationship(
|
|
165
|
+
"DeepResearchAgenticUnitModel",
|
|
166
|
+
primaryjoin="and_(DeepResearchSessionModel.id==DeepResearchAgenticUnitModel.session_id, "
|
|
167
|
+
"or_(DeepResearchAgenticUnitModel.is_deleted==False, DeepResearchAgenticUnitModel.is_deleted==None))",
|
|
168
|
+
order_by="DeepResearchAgenticUnitModel.wave_number",
|
|
169
|
+
back_populates="session",
|
|
170
|
+
)
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"""Schemas for Deep Research Sessions."""
|
|
2
|
+
from marshmallow import Schema, fields, validate
|
|
3
|
+
|
|
4
|
+
from .models import DeepResearchStatusEnum, HITLStatusEnum
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class DeepResearchSessionResourceSchema(Schema):
|
|
8
|
+
"""Schema for DeepResearchSessionModel."""
|
|
9
|
+
|
|
10
|
+
not_blank = validate.Length(min=1, error="Field cannot be blank")
|
|
11
|
+
|
|
12
|
+
id = fields.Integer(dump_only=True)
|
|
13
|
+
user_id = fields.String(required=True, validate=not_blank)
|
|
14
|
+
org_id = fields.String(allow_none=True)
|
|
15
|
+
workbook_id = fields.Integer(allow_none=True)
|
|
16
|
+
|
|
17
|
+
# Query and config
|
|
18
|
+
original_query = fields.String(required=True)
|
|
19
|
+
research_config = fields.String(allow_none=True)
|
|
20
|
+
|
|
21
|
+
# Status
|
|
22
|
+
status = fields.Enum(DeepResearchStatusEnum, by_value=True)
|
|
23
|
+
current_phase = fields.String(allow_none=True)
|
|
24
|
+
|
|
25
|
+
# Step Functions
|
|
26
|
+
step_function_arn = fields.String(allow_none=True)
|
|
27
|
+
step_function_execution_arn = fields.String(allow_none=True)
|
|
28
|
+
|
|
29
|
+
# Progress
|
|
30
|
+
total_subtasks = fields.Integer(allow_none=True)
|
|
31
|
+
completed_subtasks = fields.Integer(allow_none=True)
|
|
32
|
+
failed_subtasks = fields.Integer(allow_none=True)
|
|
33
|
+
|
|
34
|
+
# HITL
|
|
35
|
+
hitl_status = fields.Enum(HITLStatusEnum, by_value=True)
|
|
36
|
+
hitl_type = fields.String(allow_none=True)
|
|
37
|
+
hitl_questions = fields.String(allow_none=True)
|
|
38
|
+
hitl_responses = fields.String(allow_none=True)
|
|
39
|
+
hitl_task_token = fields.String(allow_none=True)
|
|
40
|
+
hitl_requested_at = fields.DateTime(allow_none=True)
|
|
41
|
+
hitl_responded_at = fields.DateTime(allow_none=True)
|
|
42
|
+
|
|
43
|
+
# Results
|
|
44
|
+
final_report_s3_key = fields.String(allow_none=True)
|
|
45
|
+
executive_summary = fields.String(allow_none=True)
|
|
46
|
+
smart_grid_id = fields.Integer(allow_none=True)
|
|
47
|
+
|
|
48
|
+
# Metadata
|
|
49
|
+
total_citations = fields.Integer(allow_none=True)
|
|
50
|
+
average_confidence = fields.Float(allow_none=True)
|
|
51
|
+
total_documents_analyzed = fields.Integer(allow_none=True)
|
|
52
|
+
|
|
53
|
+
# Error handling
|
|
54
|
+
error_message = fields.String(allow_none=True)
|
|
55
|
+
retry_count = fields.Integer(allow_none=True)
|
|
56
|
+
|
|
57
|
+
# Timestamps
|
|
58
|
+
is_deleted = fields.Boolean(allow_none=True)
|
|
59
|
+
created_at = fields.DateTime(dump_only=True)
|
|
60
|
+
updated_at = fields.DateTime(dump_only=True)
|
|
61
|
+
completed_at = fields.DateTime(allow_none=True)
|
|
62
|
+
|
|
63
|
+
# Nested relationships (dump only)
|
|
64
|
+
subtasks = fields.Nested(
|
|
65
|
+
"DeepResearchSubTaskResourceSchema",
|
|
66
|
+
many=True,
|
|
67
|
+
dump_only=True,
|
|
68
|
+
exclude=("session_id",),
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
class DeepResearchSessionCreateSchema(Schema):
|
|
73
|
+
"""Schema for creating a new Deep Research Session."""
|
|
74
|
+
|
|
75
|
+
not_blank = validate.Length(min=1, error="Field cannot be blank")
|
|
76
|
+
|
|
77
|
+
original_query = fields.String(required=True, validate=not_blank)
|
|
78
|
+
workbook_id = fields.Integer(allow_none=True)
|
|
79
|
+
research_config = fields.Dict(allow_none=True) # Will be serialized to JSON
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
class DeepResearchSessionProgressSchema(Schema):
|
|
83
|
+
"""Schema for returning session progress."""
|
|
84
|
+
|
|
85
|
+
id = fields.Integer()
|
|
86
|
+
status = fields.Enum(DeepResearchStatusEnum, by_value=True)
|
|
87
|
+
current_phase = fields.String(allow_none=True)
|
|
88
|
+
total_subtasks = fields.Integer()
|
|
89
|
+
completed_subtasks = fields.Integer()
|
|
90
|
+
failed_subtasks = fields.Integer()
|
|
91
|
+
hitl_status = fields.Enum(HITLStatusEnum, by_value=True)
|
|
92
|
+
hitl_type = fields.String(allow_none=True)
|
|
93
|
+
hitl_questions = fields.String(allow_none=True)
|
|
94
|
+
error_message = fields.String(allow_none=True)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""Deep Research SubTask model and schema exports."""
|
|
2
|
+
from .models import (
|
|
3
|
+
DeepResearchSubTaskModel,
|
|
4
|
+
SubTaskStatusEnum,
|
|
5
|
+
SubTaskTypeEnum,
|
|
6
|
+
)
|
|
7
|
+
from .schemas import (
|
|
8
|
+
DeepResearchSubTaskResourceSchema,
|
|
9
|
+
DeepResearchSubTaskSpecSchema,
|
|
10
|
+
DeepResearchSubTaskCreateSchema,
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
__all__ = [
|
|
14
|
+
"DeepResearchSubTaskModel",
|
|
15
|
+
"SubTaskStatusEnum",
|
|
16
|
+
"SubTaskTypeEnum",
|
|
17
|
+
"DeepResearchSubTaskResourceSchema",
|
|
18
|
+
"DeepResearchSubTaskSpecSchema",
|
|
19
|
+
"DeepResearchSubTaskCreateSchema",
|
|
20
|
+
]
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"""Models for Deep Research SubTasks - Individual research agents."""
|
|
2
|
+
import enum
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
|
|
5
|
+
from sqlalchemy import (
|
|
6
|
+
Column,
|
|
7
|
+
DateTime,
|
|
8
|
+
Integer,
|
|
9
|
+
String,
|
|
10
|
+
Text,
|
|
11
|
+
Boolean,
|
|
12
|
+
ForeignKey,
|
|
13
|
+
Enum,
|
|
14
|
+
Float,
|
|
15
|
+
)
|
|
16
|
+
from sqlalchemy.orm import relationship
|
|
17
|
+
|
|
18
|
+
from ...database import Base
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class SubTaskStatusEnum(enum.Enum):
|
|
22
|
+
"""Status enum for deep research subtasks."""
|
|
23
|
+
PENDING = "PENDING"
|
|
24
|
+
QUEUED = "QUEUED"
|
|
25
|
+
RUNNING = "RUNNING"
|
|
26
|
+
COMPLETED = "COMPLETED"
|
|
27
|
+
FAILED = "FAILED"
|
|
28
|
+
SKIPPED = "SKIPPED"
|
|
29
|
+
EXPANDED = "EXPANDED" # Template task that has been expanded into child tasks
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class SubTaskTypeEnum(enum.Enum):
|
|
33
|
+
"""Type enum for research dimensions and special task types."""
|
|
34
|
+
# Research dimensions
|
|
35
|
+
CUSTOM = "CUSTOM"
|
|
36
|
+
INVESTIGATION = "INVESTIGATION"
|
|
37
|
+
DISCOVERY = "DISCOVERY" # Entity discovery tasks
|
|
38
|
+
SMART_GRID = "SMART_GRID" # SmartGrid matrix research (items × dimensions)
|
|
39
|
+
AGGREGATION = "AGGREGATION" # Aggregation of other task results
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class DeepResearchSubTaskModel(Base):
|
|
43
|
+
"""
|
|
44
|
+
Model for Deep Research SubTasks.
|
|
45
|
+
|
|
46
|
+
Each subtask represents an independent research agent that executes
|
|
47
|
+
with a fresh context window. Subtasks do not communicate with each
|
|
48
|
+
other - all coordination flows through the main orchestrator.
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
__tablename__ = "deep_research_subtasks"
|
|
52
|
+
|
|
53
|
+
id = Column(Integer, primary_key=True)
|
|
54
|
+
|
|
55
|
+
# Parent session
|
|
56
|
+
session_id = Column(
|
|
57
|
+
Integer,
|
|
58
|
+
ForeignKey("deep_research_sessions.id"),
|
|
59
|
+
nullable=False,
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
# V2: Parent agentic unit (nullable for backward compatibility with v1)
|
|
63
|
+
agentic_unit_id = Column(
|
|
64
|
+
Integer,
|
|
65
|
+
ForeignKey("deep_research_agentic_units.id"),
|
|
66
|
+
nullable=True,
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
# Task identification
|
|
70
|
+
task_id = Column(String(100), nullable=True) # Logical task ID (e.g., "t1", "t2_ide-cel")
|
|
71
|
+
sequence_number = Column(Integer, nullable=False, default=0)
|
|
72
|
+
task_type = Column(
|
|
73
|
+
"task_type",
|
|
74
|
+
Enum(SubTaskTypeEnum),
|
|
75
|
+
default=SubTaskTypeEnum.CUSTOM,
|
|
76
|
+
nullable=False,
|
|
77
|
+
)
|
|
78
|
+
task_label = Column(String(256), nullable=True)
|
|
79
|
+
|
|
80
|
+
# Template/Expansion tracking
|
|
81
|
+
is_template = Column(Boolean, nullable=True, default=False) # True if this is a template task
|
|
82
|
+
parent_task_id = Column(
|
|
83
|
+
Integer,
|
|
84
|
+
ForeignKey("deep_research_subtasks.id"),
|
|
85
|
+
nullable=True,
|
|
86
|
+
) # Links expanded tasks to their parent template
|
|
87
|
+
|
|
88
|
+
# Task specification (JSON)
|
|
89
|
+
specification = Column(Text, nullable=False) # JSON with focus_question, entities, etc.
|
|
90
|
+
focus_question = Column(Text, nullable=True) # Denormalized for quick access
|
|
91
|
+
entities = Column(Text, nullable=True) # JSON array of entity objects
|
|
92
|
+
search_scope = Column(Text, nullable=True) # JSON array: ["PUBLICATION", "CLINICAL_TRIAL"]
|
|
93
|
+
expected_output_format = Column(String(50), nullable=True) # structured, narrative, table_row
|
|
94
|
+
time_range_start = Column(DateTime, nullable=True)
|
|
95
|
+
time_range_end = Column(DateTime, nullable=True)
|
|
96
|
+
|
|
97
|
+
# Entity discovery (for DISCOVERY tasks and for_each_entity_from pattern)
|
|
98
|
+
output_entities = Column(Boolean, nullable=True, default=False) # True if this task outputs entities
|
|
99
|
+
entity_type = Column(String(50), nullable=True) # Type of entities discovered (e.g., "drug", "event")
|
|
100
|
+
for_each_entity_from = Column(String(100), nullable=True) # task_id of parent task to get entities from
|
|
101
|
+
entity_name = Column(String(256), nullable=True) # Entity name this expanded task was created for
|
|
102
|
+
entity_data = Column(Text, nullable=True) # JSON: Full entity info including synonyms
|
|
103
|
+
discovered_entities = Column(Text, nullable=True) # JSON: Entities discovered by this task
|
|
104
|
+
|
|
105
|
+
# Execution status
|
|
106
|
+
status = Column(
|
|
107
|
+
"status",
|
|
108
|
+
Enum(SubTaskStatusEnum),
|
|
109
|
+
default=SubTaskStatusEnum.PENDING,
|
|
110
|
+
nullable=False,
|
|
111
|
+
)
|
|
112
|
+
lambda_request_id = Column(String(256), nullable=True)
|
|
113
|
+
started_at = Column(DateTime, nullable=True)
|
|
114
|
+
completed_at = Column(DateTime, nullable=True)
|
|
115
|
+
|
|
116
|
+
# Dependencies (for sequential tasks)
|
|
117
|
+
depends_on = Column(Text, nullable=True) # JSON array of subtask IDs
|
|
118
|
+
priority = Column(Integer, nullable=True, default=1)
|
|
119
|
+
|
|
120
|
+
# Results
|
|
121
|
+
result_s3_key = Column(String(512), nullable=True)
|
|
122
|
+
result_summary = Column(Text, nullable=True) # Brief summary of findings
|
|
123
|
+
citations_count = Column(Integer, nullable=True, default=0)
|
|
124
|
+
documents_analyzed = Column(Integer, nullable=True, default=0)
|
|
125
|
+
|
|
126
|
+
# SmartGrid integration (for SMART_GRID task type)
|
|
127
|
+
smart_grid_id = Column(Integer, nullable=True) # FK to SmartGridModel (not enforced)
|
|
128
|
+
smart_grid_analysis_type = Column(String(50), nullable=True) # "row", "column", or "both"
|
|
129
|
+
|
|
130
|
+
# Quality metrics
|
|
131
|
+
confidence_score = Column(Float, nullable=True) # 0.0 - 1.0
|
|
132
|
+
relevance_score = Column(Float, nullable=True) # 0.0 - 1.0
|
|
133
|
+
coverage_score = Column(Float, nullable=True) # How well the question was answered
|
|
134
|
+
|
|
135
|
+
# Execution metrics
|
|
136
|
+
execution_time_ms = Column(Integer, nullable=True)
|
|
137
|
+
tokens_used = Column(Integer, nullable=True)
|
|
138
|
+
search_queries_count = Column(Integer, nullable=True)
|
|
139
|
+
|
|
140
|
+
# Error handling
|
|
141
|
+
error_message = Column(Text, nullable=True)
|
|
142
|
+
error_type = Column(String(100), nullable=True)
|
|
143
|
+
retry_count = Column(Integer, nullable=True, default=0)
|
|
144
|
+
|
|
145
|
+
# Soft delete and timestamps
|
|
146
|
+
is_deleted = Column(Boolean, nullable=True)
|
|
147
|
+
created_at = Column(
|
|
148
|
+
DateTime,
|
|
149
|
+
nullable=False,
|
|
150
|
+
default=lambda: datetime.utcnow(),
|
|
151
|
+
)
|
|
152
|
+
updated_at = Column(
|
|
153
|
+
DateTime,
|
|
154
|
+
nullable=False,
|
|
155
|
+
default=lambda: datetime.utcnow(),
|
|
156
|
+
onupdate=lambda: datetime.utcnow(),
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
# ORM Relationships
|
|
160
|
+
session = relationship(
|
|
161
|
+
"DeepResearchSessionModel",
|
|
162
|
+
back_populates="subtasks",
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
# Self-referential relationship for template → expanded tasks
|
|
166
|
+
parent_task = relationship(
|
|
167
|
+
"DeepResearchSubTaskModel",
|
|
168
|
+
remote_side=[id],
|
|
169
|
+
backref="expanded_tasks",
|
|
170
|
+
foreign_keys=[parent_task_id],
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
# V2: Relationship to parent agentic unit
|
|
174
|
+
agentic_unit = relationship(
|
|
175
|
+
"DeepResearchAgenticUnitModel",
|
|
176
|
+
back_populates="internal_tasks",
|
|
177
|
+
)
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"""Schemas for Deep Research SubTasks."""
|
|
2
|
+
from marshmallow import Schema, fields, validate
|
|
3
|
+
|
|
4
|
+
from .models import SubTaskStatusEnum, SubTaskTypeEnum
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class DeepResearchSubTaskResourceSchema(Schema):
|
|
8
|
+
"""Schema for DeepResearchSubTaskModel."""
|
|
9
|
+
|
|
10
|
+
not_blank = validate.Length(min=1, error="Field cannot be blank")
|
|
11
|
+
|
|
12
|
+
id = fields.Integer(dump_only=True)
|
|
13
|
+
session_id = fields.Integer(required=True)
|
|
14
|
+
|
|
15
|
+
# Task identification
|
|
16
|
+
task_id = fields.String(allow_none=True) # Logical task ID (e.g., "t1", "t2_ide-cel")
|
|
17
|
+
sequence_number = fields.Integer(required=True)
|
|
18
|
+
task_type = fields.Enum(SubTaskTypeEnum, by_value=True)
|
|
19
|
+
task_label = fields.String(allow_none=True)
|
|
20
|
+
|
|
21
|
+
# Template/Expansion tracking
|
|
22
|
+
is_template = fields.Boolean(allow_none=True)
|
|
23
|
+
parent_task_id = fields.Integer(allow_none=True)
|
|
24
|
+
|
|
25
|
+
# Task specification
|
|
26
|
+
specification = fields.String(required=True)
|
|
27
|
+
focus_question = fields.String(allow_none=True)
|
|
28
|
+
entities = fields.String(allow_none=True)
|
|
29
|
+
search_scope = fields.String(allow_none=True)
|
|
30
|
+
expected_output_format = fields.String(allow_none=True)
|
|
31
|
+
time_range_start = fields.DateTime(allow_none=True)
|
|
32
|
+
time_range_end = fields.DateTime(allow_none=True)
|
|
33
|
+
|
|
34
|
+
# Entity discovery fields
|
|
35
|
+
output_entities = fields.Boolean(allow_none=True)
|
|
36
|
+
entity_type = fields.String(allow_none=True)
|
|
37
|
+
for_each_entity_from = fields.String(allow_none=True)
|
|
38
|
+
entity_name = fields.String(allow_none=True)
|
|
39
|
+
entity_data = fields.String(allow_none=True)
|
|
40
|
+
discovered_entities = fields.String(allow_none=True)
|
|
41
|
+
|
|
42
|
+
# Execution status
|
|
43
|
+
status = fields.Enum(SubTaskStatusEnum, by_value=True)
|
|
44
|
+
lambda_request_id = fields.String(allow_none=True)
|
|
45
|
+
started_at = fields.DateTime(allow_none=True)
|
|
46
|
+
completed_at = fields.DateTime(allow_none=True)
|
|
47
|
+
|
|
48
|
+
# Dependencies
|
|
49
|
+
depends_on = fields.String(allow_none=True)
|
|
50
|
+
priority = fields.Integer(allow_none=True)
|
|
51
|
+
|
|
52
|
+
# Results
|
|
53
|
+
result_s3_key = fields.String(allow_none=True)
|
|
54
|
+
result_summary = fields.String(allow_none=True)
|
|
55
|
+
citations_count = fields.Integer(allow_none=True)
|
|
56
|
+
documents_analyzed = fields.Integer(allow_none=True)
|
|
57
|
+
|
|
58
|
+
# Smart Grid
|
|
59
|
+
smart_grid_id = fields.Integer(allow_none=True)
|
|
60
|
+
smart_grid_analysis_type = fields.String(allow_none=True)
|
|
61
|
+
|
|
62
|
+
# Quality metrics
|
|
63
|
+
confidence_score = fields.Float(allow_none=True)
|
|
64
|
+
relevance_score = fields.Float(allow_none=True)
|
|
65
|
+
coverage_score = fields.Float(allow_none=True)
|
|
66
|
+
|
|
67
|
+
# Execution metrics
|
|
68
|
+
execution_time_ms = fields.Integer(allow_none=True)
|
|
69
|
+
tokens_used = fields.Integer(allow_none=True)
|
|
70
|
+
search_queries_count = fields.Integer(allow_none=True)
|
|
71
|
+
|
|
72
|
+
# Error handling
|
|
73
|
+
error_message = fields.String(allow_none=True)
|
|
74
|
+
error_type = fields.String(allow_none=True)
|
|
75
|
+
retry_count = fields.Integer(allow_none=True)
|
|
76
|
+
|
|
77
|
+
# Timestamps
|
|
78
|
+
is_deleted = fields.Boolean(allow_none=True)
|
|
79
|
+
created_at = fields.DateTime(dump_only=True)
|
|
80
|
+
updated_at = fields.DateTime(dump_only=True)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
class DeepResearchSubTaskSpecSchema(Schema):
|
|
84
|
+
"""Schema for subtask specification object."""
|
|
85
|
+
|
|
86
|
+
focus_question = fields.String(required=True)
|
|
87
|
+
entities = fields.List(fields.Dict(), allow_none=True)
|
|
88
|
+
search_scope = fields.List(fields.String(), allow_none=True)
|
|
89
|
+
output_format = fields.String(allow_none=True)
|
|
90
|
+
expected_fields = fields.List(fields.String(), allow_none=True)
|
|
91
|
+
max_documents = fields.Integer(allow_none=True)
|
|
92
|
+
time_range = fields.List(fields.String(), allow_none=True)
|
|
93
|
+
retrieval_hints = fields.Dict(allow_none=True)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
class DeepResearchSubTaskCreateSchema(Schema):
|
|
97
|
+
"""Schema for creating a subtask."""
|
|
98
|
+
|
|
99
|
+
session_id = fields.Integer(required=True)
|
|
100
|
+
sequence_number = fields.Integer(required=True)
|
|
101
|
+
task_type = fields.Enum(SubTaskTypeEnum, by_value=True, required=True)
|
|
102
|
+
task_label = fields.String(allow_none=True)
|
|
103
|
+
specification = fields.Nested(DeepResearchSubTaskSpecSchema, required=True)
|
|
104
|
+
depends_on = fields.List(fields.Integer(), allow_none=True)
|
|
105
|
+
priority = fields.Integer(allow_none=True)
|
|
@@ -6,6 +6,7 @@ from sqlalchemy import (
|
|
|
6
6
|
DateTime,
|
|
7
7
|
ForeignKey,
|
|
8
8
|
Boolean,
|
|
9
|
+
Text,
|
|
9
10
|
String,
|
|
10
11
|
)
|
|
11
12
|
|
|
@@ -22,6 +23,12 @@ class DesignationModel(Base):
|
|
|
22
23
|
nullable=False,
|
|
23
24
|
)
|
|
24
25
|
designation = Column(String(128), nullable=False, index=True)
|
|
26
|
+
news_id = Column(
|
|
27
|
+
Integer,
|
|
28
|
+
ForeignKey('newswires.id'),
|
|
29
|
+
nullable=True,
|
|
30
|
+
)
|
|
31
|
+
designation_text = Column(Text, nullable=True)
|
|
25
32
|
is_deleted = Column(Boolean, nullable=True)
|
|
26
33
|
updated_at = Column(
|
|
27
34
|
DateTime,
|
|
@@ -11,5 +11,7 @@ class DesignationResourceSchema(Schema):
|
|
|
11
11
|
id = fields.Integer(dump_only=True)
|
|
12
12
|
intervention_condition_id = fields.Integer(required=True)
|
|
13
13
|
designation = fields.String(validate=not_blank, required=True)
|
|
14
|
+
designation_text = fields.String(allow_none=True)
|
|
15
|
+
news_id = fields.Integer(allow_none=True)
|
|
14
16
|
is_deleted = fields.Boolean(allow_none=True)
|
|
15
17
|
updated_at = fields.DateTime()
|
|
@@ -7,6 +7,7 @@ from sqlalchemy import (
|
|
|
7
7
|
ForeignKey,
|
|
8
8
|
Text,
|
|
9
9
|
String,
|
|
10
|
+
Boolean,
|
|
10
11
|
)
|
|
11
12
|
|
|
12
13
|
from ...database import Base
|
|
@@ -28,6 +29,7 @@ class DesignationOutboxModel(Base):
|
|
|
28
29
|
ForeignKey('newswires.id'),
|
|
29
30
|
nullable=False,
|
|
30
31
|
)
|
|
32
|
+
processed = Column(Boolean, nullable=True)
|
|
31
33
|
updated_at = Column(
|
|
32
34
|
DateTime,
|
|
33
35
|
nullable=False,
|
|
@@ -13,4 +13,5 @@ class DesignationOutboxResourceSchema(Schema):
|
|
|
13
13
|
designation = fields.String(validate=not_blank, required=True)
|
|
14
14
|
designation_text = fields.String(validate=not_blank)
|
|
15
15
|
news_id = fields.Integer(required=True)
|
|
16
|
+
processed = fields.Boolean(allow_none=True)
|
|
16
17
|
updated_at = fields.DateTime()
|
|
@@ -20,6 +20,7 @@ class DigestModel(Base):
|
|
|
20
20
|
ForeignKey('user_saved_searches.id'),
|
|
21
21
|
nullable=False,
|
|
22
22
|
)
|
|
23
|
+
user_id = Column(String(128), nullable=True, index=True)
|
|
23
24
|
type = Column(String(128), nullable=False)
|
|
24
25
|
description = Column(String(256), nullable=False)
|
|
25
26
|
created_at = Column(DateTime, nullable=True)
|
|
@@ -10,6 +10,7 @@ class DigestResourceSchema(Schema):
|
|
|
10
10
|
|
|
11
11
|
id = fields.Integer(dump_only=True)
|
|
12
12
|
saved_search_id = fields.Integer(required=True)
|
|
13
|
+
user_id = fields.String(allow_none=True)
|
|
13
14
|
type = fields.String(required=True)
|
|
14
15
|
description = fields.String(required=True)
|
|
15
16
|
created_at = fields.DateTime()
|
|
File without changes
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
|
|
3
|
+
from sqlalchemy import (
|
|
4
|
+
Column,
|
|
5
|
+
Integer,
|
|
6
|
+
String,
|
|
7
|
+
DateTime,
|
|
8
|
+
Text,
|
|
9
|
+
Boolean,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
from ...database import Base
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class DocChunkModel(Base):
|
|
16
|
+
__tablename__ = "doc_chunks"
|
|
17
|
+
|
|
18
|
+
id = Column(Integer, primary_key=True)
|
|
19
|
+
artifact_id = Column(String(50), nullable=False)
|
|
20
|
+
chunk_cui = Column(String(50), nullable=False)
|
|
21
|
+
chunk_text = Column(Text, nullable=False)
|
|
22
|
+
chunk_embedding = Column(Text, nullable=False)
|
|
23
|
+
embedding_source = Column(String(50), nullable=False)
|
|
24
|
+
is_deleted = Column(Boolean, nullable=True)
|
|
25
|
+
is_indexed = Column(Boolean, nullable=True)
|
|
26
|
+
indexed_date = Column(DateTime, nullable=True)
|
|
27
|
+
updated_at = Column(
|
|
28
|
+
DateTime,
|
|
29
|
+
nullable=False,
|
|
30
|
+
# https://stackoverflow.com/questions/58776476/why-doesnt-freezegun-work-with-sqlalchemy-default-values
|
|
31
|
+
default=lambda: datetime.utcnow(),
|
|
32
|
+
onupdate=lambda: datetime.utcnow(),
|
|
33
|
+
)
|