419 lines
11 KiB
Markdown
419 lines
11 KiB
Markdown
# Module Import Dependencies Diagram
|
|
|
|
Dieses Dokument zeigt die vollständigen Import-Abhängigkeiten zwischen allen Modulen im Gateway-System.
|
|
|
|
## Mermaid Diagram
|
|
|
|
```mermaid
|
|
graph TB
|
|
%% External Dependencies
|
|
subgraph "External Libraries"
|
|
EXT1[FastAPI]
|
|
EXT2[SQLAlchemy]
|
|
EXT3[Pydantic]
|
|
EXT4[OpenAI]
|
|
EXT5[LangChain]
|
|
EXT6[ReportLab]
|
|
EXT7[PyMuPDF]
|
|
EXT8[BeautifulSoup4]
|
|
EXT9[Requests]
|
|
EXT10[Pillow]
|
|
EXT11[NumPy]
|
|
EXT12[Pandas]
|
|
EXT13[Matplotlib]
|
|
EXT14[Office365-REST]
|
|
EXT15[Google Cloud APIs]
|
|
EXT16[Cryptography]
|
|
EXT17[JWT]
|
|
EXT18[MySQL Connector]
|
|
EXT19[PostgreSQL]
|
|
EXT20[Selenium]
|
|
EXT21[Tavily]
|
|
EXT22[MSAL]
|
|
EXT23[APScheduler]
|
|
EXT24[Pytest]
|
|
end
|
|
|
|
%% Main Module Categories
|
|
subgraph "ROUTES"
|
|
R1[routeChatbot]
|
|
R2[routeChatPlayground]
|
|
R3[routeDataNeutralization]
|
|
R4[routeDataUsers]
|
|
R5[routeDataPrompts]
|
|
R6[routeWorkflows]
|
|
R7[routeDataMandates]
|
|
R8[routeDataFiles]
|
|
end
|
|
|
|
subgraph "FEATURES"
|
|
F1[chatBot]
|
|
F2[chatPlayground]
|
|
F3[neutralizePlayground]
|
|
F4[syncDelta]
|
|
F5[featuresLifecycle]
|
|
end
|
|
|
|
subgraph "SERVICES"
|
|
S1[serviceAi]
|
|
S2[serviceExtraction]
|
|
S3[serviceGeneration]
|
|
S4[serviceNeutralization]
|
|
S5[serviceWorkflow]
|
|
S6[serviceUtils]
|
|
S7[serviceTicket]
|
|
S8[serviceSharepoint]
|
|
S9[serviceNormalization]
|
|
end
|
|
|
|
subgraph "WORKFLOWS"
|
|
W1[workflowManager]
|
|
W2[workflowProcessor]
|
|
W3[processing/core]
|
|
W4[processing/modes]
|
|
W5[processing/shared]
|
|
W6[processing/adaptive]
|
|
W7[methods]
|
|
end
|
|
|
|
subgraph "DATAMODELS"
|
|
D1[datamodelChat]
|
|
D2[datamodelAi]
|
|
D3[datamodelExtraction]
|
|
D4[datamodelWeb]
|
|
D5[datamodelUam]
|
|
D6[datamodelNeutralizer]
|
|
D7[datamodelSecurity]
|
|
D8[datamodelChatbot]
|
|
end
|
|
|
|
subgraph "INTERFACES"
|
|
I1[interfaceDbAppObjects]
|
|
I2[interfaceDbChatObjects]
|
|
I3[interfaceDbComponentObjects]
|
|
I4[interfaceDbChatAccess]
|
|
I5[interfaceAiObjects]
|
|
I6[interfaceTicketObjects]
|
|
end
|
|
|
|
subgraph "CONNECTORS"
|
|
C1[connectorDbPostgre]
|
|
C2[connectorDbMysql]
|
|
C3[connectorAiOpenai]
|
|
C4[connectorAiTavily]
|
|
C5[connectorSharepoint]
|
|
C6[connectorGoogle]
|
|
end
|
|
|
|
subgraph "SHARED"
|
|
SH1[configuration]
|
|
SH2[progressLogger]
|
|
SH3[eventManagement]
|
|
SH4[timezoneUtils]
|
|
SH5[jsonUtils]
|
|
SH6[attributeUtils]
|
|
SH7[debugLogger]
|
|
end
|
|
|
|
subgraph "SECURITY"
|
|
SEC1[tokenManager]
|
|
SEC2[encryption]
|
|
SEC3[authentication]
|
|
end
|
|
|
|
%% Routes to Features
|
|
R1 --> F1
|
|
R2 --> F2
|
|
R3 --> F3
|
|
R4 --> I1
|
|
R5 --> I3
|
|
R6 --> I2
|
|
R7 --> I1
|
|
R8 --> I3
|
|
|
|
%% Features to Services/Workflows
|
|
F1 --> D8
|
|
F1 --> D5
|
|
F1 --> SH1
|
|
F1 --> C4
|
|
F2 --> D5
|
|
F2 --> D1
|
|
F2 --> W1
|
|
F2 --> S1
|
|
F3 --> D5
|
|
F3 --> D6
|
|
F3 --> S1
|
|
F4 --> S1
|
|
F5 --> I1
|
|
|
|
%% Services Internal Dependencies
|
|
S1 --> S2
|
|
S1 --> D1
|
|
S1 --> D2
|
|
S1 --> D3
|
|
S1 --> D4
|
|
S1 --> I5
|
|
S1 --> S1_subCoreAi
|
|
S1 --> S1_subDocumentProcessing
|
|
S1 --> S1_subWebResearch
|
|
S1 --> S1_subDocumentGeneration
|
|
|
|
S2 --> D3
|
|
S2 --> D1
|
|
S2 --> D2
|
|
S2 --> I5
|
|
S2 --> S2_subRegistry
|
|
S2 --> S2_subPipeline
|
|
S2 --> S2_subMerger
|
|
S2 --> S2_subUtils
|
|
|
|
S3 --> D1
|
|
S3 --> D2
|
|
S3 --> I5
|
|
S3 --> S3_subDocumentUtility
|
|
S3 --> S3_subPromptBuilder
|
|
|
|
S4 --> D6
|
|
S4 --> S4_subProcessCommon
|
|
S4 --> S4_subProcessText
|
|
S4 --> S4_subProcessList
|
|
S4 --> S4_subProcessBinary
|
|
S4 --> S4_subPatterns
|
|
S4 --> S4_subParseString
|
|
|
|
S5 --> D5
|
|
S5 --> D1
|
|
S5 --> SEC1
|
|
S5 --> SH2
|
|
|
|
S6 --> SH1
|
|
S6 --> SH3
|
|
S6 --> SH4
|
|
S6 --> SH5
|
|
|
|
S7 --> I6
|
|
|
|
%% Workflows Internal Dependencies
|
|
W1 --> D1
|
|
W1 --> W2
|
|
|
|
W2 --> D1
|
|
W2 --> W4_modeBase
|
|
W2 --> W4_modeActionplan
|
|
W2 --> W4_modeReact
|
|
|
|
W3_taskPlanner --> D1
|
|
W3_taskPlanner --> D2
|
|
W3_taskPlanner --> W5_promptGenerationTaskplan
|
|
W3_taskPlanner --> W6_IntentAnalyzer
|
|
|
|
W3_actionExecutor --> D1
|
|
W3_actionExecutor --> W5_methodDiscovery
|
|
|
|
W3_messageCreator --> D1
|
|
|
|
W4_modeBase --> D1
|
|
W4_modeBase --> W3_taskPlanner
|
|
W4_modeBase --> W3_actionExecutor
|
|
W4_modeBase --> W3_messageCreator
|
|
W4_modeBase --> W3_validator
|
|
|
|
W4_modeActionplan --> D1
|
|
W4_modeActionplan --> D2
|
|
W4_modeActionplan --> W4_modeBase
|
|
W4_modeActionplan --> W5_executionState
|
|
W4_modeActionplan --> W5_promptGenerationActionsActionplan
|
|
|
|
W4_modeReact --> D1
|
|
W4_modeReact --> D2
|
|
W4_modeReact --> W4_modeBase
|
|
W4_modeReact --> W5_executionState
|
|
W4_modeReact --> W5_promptGenerationActionsReact
|
|
W4_modeReact --> W5_placeholderFactory
|
|
W4_modeReact --> W6_IntentAnalyzer
|
|
W4_modeReact --> W6_ContentValidator
|
|
W4_modeReact --> W6_LearningEngine
|
|
W4_modeReact --> W6_ProgressTracker
|
|
W4_modeReact --> W6_AdaptiveLearningEngine
|
|
|
|
W5_executionState --> D1
|
|
W5_methodDiscovery --> D1
|
|
W5_methodDiscovery --> W7_methodBase
|
|
W5_placeholderFactory --> D1
|
|
W5_placeholderFactory --> W5_methodDiscovery
|
|
W5_promptGenerationActionsActionplan --> D1
|
|
W5_promptGenerationActionsActionplan --> W5_placeholderFactory
|
|
W5_promptGenerationActionsReact --> D1
|
|
W5_promptGenerationActionsReact --> W5_placeholderFactory
|
|
W5_promptGenerationActionsReact --> W5_methodDiscovery
|
|
W5_promptGenerationTaskplan --> D1
|
|
W5_promptGenerationTaskplan --> W5_placeholderFactory
|
|
|
|
W7_methodAi --> W7_methodBase
|
|
W7_methodAi --> D1
|
|
W7_methodAi --> D2
|
|
W7_methodAi --> D4
|
|
|
|
W7_methodOutlook --> W7_methodBase
|
|
W7_methodOutlook --> D1
|
|
W7_methodOutlook --> D2
|
|
|
|
W7_methodSharepoint --> W7_methodBase
|
|
W7_methodSharepoint --> D1
|
|
|
|
%% Interfaces to Connectors
|
|
I1 --> C2
|
|
I2 --> C1
|
|
I3 --> C2
|
|
I4 --> C1
|
|
I5 --> C3
|
|
I6 --> C5
|
|
|
|
%% Shared Dependencies
|
|
SH1 --> EXT1
|
|
SH2 --> EXT2
|
|
SH3 --> EXT23
|
|
SH4 --> EXT11
|
|
SH5 --> EXT3
|
|
SH6 --> EXT3
|
|
SH7 --> EXT1
|
|
|
|
%% Security Dependencies
|
|
SEC1 --> EXT16
|
|
SEC1 --> EXT17
|
|
SEC2 --> EXT16
|
|
SEC3 --> EXT16
|
|
|
|
%% Service Extraction Sub-components
|
|
subgraph "SERVICE_EXTRACTION_SUB"
|
|
S2_subRegistry[subRegistry]
|
|
S2_subPipeline[subPipeline]
|
|
S2_subMerger[subMerger]
|
|
S2_subUtils[subUtils]
|
|
S2_extractors[extractors/*]
|
|
S2_chunkers[chunkers/*]
|
|
S2_mergers[mergers/*]
|
|
end
|
|
|
|
S2_extractors --> S2_subUtils
|
|
S2_extractors --> S2_subRegistry
|
|
S2_chunkers --> S2_subRegistry
|
|
S2_mergers --> S2_subUtils
|
|
|
|
%% Service Generation Sub-components
|
|
subgraph "SERVICE_GENERATION_SUB"
|
|
S3_subDocumentUtility[subDocumentUtility]
|
|
S3_subPromptBuilder[subPromptBuilder]
|
|
S3_renderers[renderers/*]
|
|
S3_rendererBase[rendererBaseTemplate]
|
|
end
|
|
|
|
S3_renderers --> S3_rendererBase
|
|
|
|
%% Service AI Sub-components
|
|
subgraph "SERVICE_AI_SUB"
|
|
S1_subCoreAi[subCoreAi]
|
|
S1_subDocumentProcessing[subDocumentProcessing]
|
|
S1_subWebResearch[subWebResearch]
|
|
S1_subDocumentGeneration[subDocumentGeneration]
|
|
end
|
|
|
|
S1_subDocumentProcessing --> S2
|
|
S1_subWebResearch --> C4
|
|
S1_subWebResearch --> SH1
|
|
|
|
%% Workflow Processing Sub-components
|
|
subgraph "WORKFLOW_PROCESSING_SUB"
|
|
W3_taskPlanner[taskPlanner]
|
|
W3_actionExecutor[actionExecutor]
|
|
W3_messageCreator[messageCreator]
|
|
W3_validator[validator]
|
|
W4_modeBase[modeBase]
|
|
W4_modeActionplan[modeActionplan]
|
|
W4_modeReact[modeReact]
|
|
W5_executionState[executionState]
|
|
W5_methodDiscovery[methodDiscovery]
|
|
W5_placeholderFactory[placeholderFactory]
|
|
W5_promptGenerationActionsActionplan[promptGenerationActionsActionplan]
|
|
W5_promptGenerationActionsReact[promptGenerationActionsReact]
|
|
W5_promptGenerationTaskplan[promptGenerationTaskplan]
|
|
W6_IntentAnalyzer[IntentAnalyzer]
|
|
W6_ContentValidator[ContentValidator]
|
|
W6_LearningEngine[LearningEngine]
|
|
W6_ProgressTracker[ProgressTracker]
|
|
W6_AdaptiveLearningEngine[AdaptiveLearningEngine]
|
|
W7_methodBase[methodBase]
|
|
W7_methodAi[methodAi]
|
|
W7_methodOutlook[methodOutlook]
|
|
W7_methodSharepoint[methodSharepoint]
|
|
end
|
|
|
|
%% ChatBot Sub-components
|
|
subgraph "CHATBOT_SUB"
|
|
F1_domain[domain/chatbot]
|
|
F1_utils[utils/*]
|
|
F1_tools[chatbotTools/*]
|
|
F1_database[subChatbotDatabase]
|
|
end
|
|
|
|
F1 --> F1_domain
|
|
F1 --> F1_utils
|
|
F1 --> F1_tools
|
|
F1 --> F1_database
|
|
|
|
%% Styling
|
|
classDef routes fill:#e1f5fe
|
|
classDef features fill:#f3e5f5
|
|
classDef services fill:#e8f5e8
|
|
classDef workflows fill:#fff3e0
|
|
classDef datamodels fill:#fce4ec
|
|
classDef interfaces fill:#f1f8e9
|
|
classDef connectors fill:#e0f2f1
|
|
classDef shared fill:#fff8e1
|
|
classDef security fill:#ffebee
|
|
classDef external fill:#f5f5f5
|
|
|
|
class R1,R2,R3,R4,R5,R6,R7,R8 routes
|
|
class F1,F2,F3,F4,F5 features
|
|
class S1,S2,S3,S4,S5,S6,S7,S8,S9 services
|
|
class W1,W2,W3,W4,W5,W6,W7 workflows
|
|
class D1,D2,D3,D4,D5,D6,D7,D8 datamodels
|
|
class I1,I2,I3,I4,I5,I6 interfaces
|
|
class C1,C2,C3,C4,C5,C6 connectors
|
|
class SH1,SH2,SH3,SH4,SH5,SH6,SH7 shared
|
|
class SEC1,SEC2,SEC3 security
|
|
class EXT1,EXT2,EXT3,EXT4,EXT5,EXT6,EXT7,EXT8,EXT9,EXT10,EXT11,EXT12,EXT13,EXT14,EXT15,EXT16,EXT17,EXT18,EXT19,EXT20,EXT21,EXT22,EXT23,EXT24 external
|
|
```
|
|
|
|
## Key Dependencies Summary
|
|
|
|
### Cross-Module Dependencies:
|
|
- **Routes → Features**: API endpoints use feature modules
|
|
- **Features → Services**: Features access services via interface
|
|
- **Features → Workflows**: Only chatPlayground uses workflows
|
|
- **Services → Datamodels**: All services use data models
|
|
- **Workflows → Datamodels**: Workflows heavily use chat/AI data models
|
|
- **Interfaces → Connectors**: Database interfaces use connectors
|
|
|
|
### Internal Module Dependencies:
|
|
- **Services**: Mostly independent, only serviceAi → serviceExtraction
|
|
- **Workflows**: Complex internal structure with processing pipeline
|
|
- **Features**: Independent modules with shared service access
|
|
|
|
### External Dependencies:
|
|
- **FastAPI**: Web framework
|
|
- **SQLAlchemy**: Database ORM
|
|
- **Pydantic**: Data validation
|
|
- **AI Libraries**: OpenAI, LangChain for AI functionality
|
|
- **Document Processing**: ReportLab, PyMuPDF for PDF handling
|
|
- **Web Scraping**: BeautifulSoup4, Selenium, Requests
|
|
- **Cloud APIs**: Google Cloud, Office365, Tavily
|
|
- **Security**: Cryptography, JWT for authentication
|
|
|
|
## Architecture Patterns
|
|
|
|
1. **Layered Architecture**: Routes → Features → Services → Interfaces → Connectors
|
|
2. **Service Layer**: Independent services with clear responsibilities
|
|
3. **Workflow Engine**: Complex processing pipeline with adaptive learning
|
|
4. **Data Models**: Centralized data structures used across all layers
|
|
5. **Interface Pattern**: Abstract interfaces for external system integration
|