before feature container refactory
This commit is contained in:
parent
5fcbc6acd3
commit
04ba89a0e8
49 changed files with 3172 additions and 462 deletions
20
app.py
20
app.py
|
|
@ -20,7 +20,7 @@ from datetime import datetime
|
|||
from modules.shared.configuration import APP_CONFIG
|
||||
from modules.shared.eventManagement import eventManager
|
||||
from modules.features import featuresLifecycle as featuresLifecycle
|
||||
from modules.interfaces.interfaceDbAppObjects import getRootInterface
|
||||
from modules.interfaces.interfaceDbApp import getRootInterface
|
||||
|
||||
class DailyRotatingFileHandler(RotatingFileHandler):
|
||||
"""
|
||||
|
|
@ -421,8 +421,8 @@ app.include_router(promptRouter)
|
|||
from modules.routes.routeDataConnections import router as connectionsRouter
|
||||
app.include_router(connectionsRouter)
|
||||
|
||||
from modules.routes.routeWorkflows import router as workflowRouter
|
||||
app.include_router(workflowRouter)
|
||||
from modules.routes.routeDataWorkflows import router as dataWorkflowsRouter
|
||||
app.include_router(dataWorkflowsRouter)
|
||||
|
||||
from modules.routes.routeFeatureChatDynamic import router as chatPlaygroundRouter
|
||||
app.include_router(chatPlaygroundRouter)
|
||||
|
|
@ -451,11 +451,11 @@ app.include_router(sharepointRouter)
|
|||
from modules.routes.routeDataAutomation import router as automationRouter
|
||||
app.include_router(automationRouter)
|
||||
|
||||
from modules.routes.routeFeatureWorkflow import router as adminAutomationEventsRouter
|
||||
from modules.routes.routeAdminAutomationEvents import router as adminAutomationEventsRouter
|
||||
app.include_router(adminAutomationEventsRouter)
|
||||
|
||||
from modules.routes.routeRbac import router as rbacRouter
|
||||
app.include_router(rbacRouter)
|
||||
from modules.routes.routeAdminRbacRules import router as rbacAdminRulesRouter
|
||||
app.include_router(rbacAdminRulesRouter)
|
||||
|
||||
from modules.routes.routeOptions import router as optionsRouter
|
||||
app.include_router(optionsRouter)
|
||||
|
|
@ -470,14 +470,14 @@ from modules.routes.routeFeatureTrustee import router as trusteeRouter
|
|||
app.include_router(trusteeRouter)
|
||||
|
||||
# Phase 8: New Feature Routes
|
||||
from modules.routes.routeFeatures import router as featuresRouter
|
||||
app.include_router(featuresRouter)
|
||||
from modules.routes.routeAdminFeatures import router as featuresAdminRouter
|
||||
app.include_router(featuresAdminRouter)
|
||||
|
||||
from modules.routes.routeInvitations import router as invitationsRouter
|
||||
app.include_router(invitationsRouter)
|
||||
|
||||
from modules.routes.routeRbacExport import router as rbacExportRouter
|
||||
app.include_router(rbacExportRouter)
|
||||
from modules.routes.routeAdminRbacExport import router as rbacAdminExportRouter
|
||||
app.include_router(rbacAdminExportRouter)
|
||||
|
||||
from modules.routes.routeGdpr import router as gdprRouter
|
||||
app.include_router(gdprRouter)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ from slowapi.util import get_remote_address
|
|||
|
||||
from modules.shared.configuration import APP_CONFIG
|
||||
from modules.security.rootAccess import getRootDbAppConnector, getRootUser
|
||||
from modules.interfaces.interfaceDbAppObjects import getInterface, getRootInterface
|
||||
from modules.interfaces.interfaceDbApp import getInterface, getRootInterface
|
||||
from modules.datamodels.datamodelUam import User, AuthAuthority, AccessLevel
|
||||
from modules.datamodels.datamodelSecurity import Token
|
||||
from modules.datamodels.datamodelRbac import AccessRule
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ class TokenManager:
|
|||
try:
|
||||
if interface is None:
|
||||
from modules.security.rootAccess import getRootUser
|
||||
from modules.interfaces.interfaceDbAppObjects import getInterface
|
||||
from modules.interfaces.interfaceDbApp import getInterface
|
||||
rootUser = getRootUser()
|
||||
interface = getInterface(rootUser)
|
||||
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ class TokenRefreshService:
|
|||
|
||||
# Get user interface
|
||||
from modules.security.rootAccess import getRootUser
|
||||
from modules.interfaces.interfaceDbAppObjects import getInterface
|
||||
from modules.interfaces.interfaceDbApp import getInterface
|
||||
rootUser = getRootUser()
|
||||
root_interface = getInterface(rootUser)
|
||||
|
||||
|
|
@ -228,7 +228,7 @@ class TokenRefreshService:
|
|||
|
||||
# Get user interface
|
||||
from modules.security.rootAccess import getRootUser
|
||||
from modules.interfaces.interfaceDbAppObjects import getInterface
|
||||
from modules.interfaces.interfaceDbApp import getInterface
|
||||
rootUser = getRootUser()
|
||||
root_interface = getInterface(rootUser)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,314 +0,0 @@
|
|||
| Field Name | Type Pattern | Models Using It |
|
||||
|------------|--------------|-----------------|
|
||||
| `accumulatedJsonString` | str | JsonAccumulationState |
|
||||
| `action` | str | ActionDefinition |
|
||||
| `actionId` | str | ChatDocument, ChatMessage |
|
||||
| `actionList` | List | TaskItem |
|
||||
| `actionMethod` | str | ChatMessage |
|
||||
| `actionName` | str | ChatMessage |
|
||||
| `actionNumber` | int | ChatLog, ChatDocument, ChatMessage |
|
||||
| `actionObjective` | str | ActionDefinition, TaskContext |
|
||||
| `actionProgress` | str | ChatMessage |
|
||||
| `actionResult` | Any | TaskResult |
|
||||
| `active` | bool | AutomationDefinition |
|
||||
| `additionalData` | Dict | AiResponseMetadata |
|
||||
| `aiPrompt` | str | AiProcessParameters |
|
||||
| `allSections` | List | JsonAccumulationState |
|
||||
| `apiUrl` | str | AiModel |
|
||||
| `authenticationAuthority` | AuthAuthority | User |
|
||||
| `authority` | AuthAuthority | UserConnection, Token |
|
||||
| `availableConnections` | list | TaskContext |
|
||||
| `availableDocuments` | str | TaskContext |
|
||||
| `base64Encoded` | bool | ContentMetadata, FileData |
|
||||
| `bytesSent` | int | ChatStat, AiCallResponse |
|
||||
| `bytesReceived` | int | ChatStat, AiCallResponse |
|
||||
| `classes` | List | CodeContentPromptArgs |
|
||||
| `colorMode` | str | ContentMetadata |
|
||||
| `compressContext` | bool | AiCallOptions |
|
||||
| `compressPrompt` | bool | AiCallOptions |
|
||||
| `condition` | str | SelectionRule |
|
||||
| `confidence` | float | ReviewResult |
|
||||
| `connectedAt` | float | UserConnection |
|
||||
| `connectionId` | str | Token |
|
||||
| `connectionReference` | str | ActionDefinition |
|
||||
| `connectorType` | str | AiModel |
|
||||
| `content` | str | Prompt, ContentItem, AiResponse, AiCallResponse, FilePreview |
|
||||
| `contentAnalysis` | Dict | Observation |
|
||||
| `contentParts` | List | AiCallRequest, AiProcessParameters, SectionPromptArgs, ChapterStructurePromptArgs, CodeContentPromptArgs, CodeStructurePromptArgs |
|
||||
| `contentSize` | str | ObservationPreview |
|
||||
| `contentValidation` | Dict | Observation |
|
||||
| `contents` | List | ChatContentExtracted |
|
||||
| `context` | Dict, AccessRuleContext | TaskHandover, UnderstandingResult, AccessRule |
|
||||
| `contextInfo` | str | CodeContentPromptArgs |
|
||||
| `costPer1kTokensInput` | float | AiModel |
|
||||
| `costPer1kTokensOutput` | float | AiModel |
|
||||
| `country` | str | AiCallPromptWebSearch |
|
||||
| `create` | AccessLevel | AccessRule, UserPermissions |
|
||||
| `created` | str | ObservationPreview |
|
||||
| `createdAt` | float | Token |
|
||||
| `creationDate` | float | FileItem |
|
||||
| `criteriaProgress` | dict | TaskContext |
|
||||
| `currentAction` | int | ChatWorkflow |
|
||||
| `currentRound` | int | ChatWorkflow |
|
||||
| `currentTask` | int | ChatWorkflow |
|
||||
| `data` | str | ContentItem, FileData |
|
||||
| `dataType` | str | TaskStep |
|
||||
| `delete` | AccessLevel | AccessRule, UserPermissions |
|
||||
| `deliverable` | Dict | TaskDefinition |
|
||||
| `delivered_summary` | str | ContinuationContext |
|
||||
| `dependencies` | List | TaskItem, TaskStep, CodeContentPromptArgs |
|
||||
| `description` | TextMultilingual | Role |
|
||||
| `details` | str | AuthEvent |
|
||||
| `detectedComplexity` | str | RequestContext |
|
||||
| `displayName` | str | AiModel |
|
||||
| `documentData` | Any | ActionDocument, DocumentData |
|
||||
| `documentId` | str | ObservationPreview |
|
||||
| `documentList` | DocumentReferenceList | ActionDefinition, ExtractContentParameters |
|
||||
| `documentName` | str | ActionDocument, DocumentData |
|
||||
| `documentReferences` | List | UnderstandingResult |
|
||||
| `documents` | List | ChatMessage, ActionResult, AiResponse |
|
||||
| `documentsCount` | int | Observation |
|
||||
| `documentsLabel` | str | ChatMessage, DocumentExchange |
|
||||
| `durationSec` | float | ContentMetadata |
|
||||
| `email` | EmailStr | User |
|
||||
| `enabled` | bool | Mandate, User |
|
||||
| `encoding` | str | FilePreview |
|
||||
| `engine` | str | ChatStat |
|
||||
| `error` | str | ContentMetadata, ActionResult, ActionItem, TaskItem, TaskResult |
|
||||
| `errorCount` | int | ChatStat, AiCallResponse |
|
||||
| `estimatedComplexity` | str | TaskStep |
|
||||
| `eventId` | str | AutomationDefinition |
|
||||
| `eventType` | str | AuthEvent |
|
||||
| `execAction` | str | ActionItem |
|
||||
| `execMethod` | str | ActionItem |
|
||||
| `execParameters` | Dict | ActionItem |
|
||||
| `execResultLabel` | str | ActionItem |
|
||||
| `executedActions` | list | TaskContext |
|
||||
| `executionLogs` | List | AutomationDefinition |
|
||||
| `expectedDocumentFormats` | List | ActionItem |
|
||||
| `expectedFormats` | List | ChatWorkflow, TaskStep |
|
||||
| `expectedOutputFormat` | str | RequestContext |
|
||||
| `expectedOutputType` | str | RequestContext |
|
||||
| `expiresAt` | float | UserConnection, Token |
|
||||
| `externalEmail` | EmailStr | UserConnection |
|
||||
| `externalId` | str | UserConnection |
|
||||
| `externalUsername` | str | UserConnection |
|
||||
| `extractionMethod` | str | AiResponseMetadata |
|
||||
| `extractionOptions` | Any | TaskDefinition, ExtractContentParameters |
|
||||
| `failedActions` | list | TaskContext |
|
||||
| `failurePatterns` | list | TaskContext |
|
||||
| `feedback` | str | TaskResult, TaskItem |
|
||||
| `fileHash` | str | FileItem |
|
||||
| `fileId` | str | ChatDocument |
|
||||
| `fileName` | str | FileItem, FilePreview, ChatDocument |
|
||||
| `fileSize` | int | FileItem, ChatDocument |
|
||||
| `fileType` | str | CodeContentPromptArgs |
|
||||
| `filename` | str | AiResponseMetadata, CodeContentPromptArgs |
|
||||
| `finishedAt` | float | TaskItem |
|
||||
| `fps` | float | ContentMetadata |
|
||||
| `fullName` | str | User |
|
||||
| `functionCall` | Callable | AiModel |
|
||||
| `functions` | List | CodeContentPromptArgs |
|
||||
| `generationHint` | str | SectionPromptArgs |
|
||||
| `handoverType` | str | TaskHandover |
|
||||
| `hashedPassword` | str | UserInDB |
|
||||
| `height` | int | ContentMetadata |
|
||||
| `hierarchyContext` | str | JsonContinuationContexts |
|
||||
| `hierarchyContextForPrompt` | str | JsonContinuationContexts |
|
||||
| `id` | str | *Most models* |
|
||||
| `improvements` | List | TaskHandover, TaskContext, ReviewResult |
|
||||
| `incomplete_part` | str | ContinuationContext |
|
||||
| `inputDocuments` | List | TaskHandover |
|
||||
| `instruction` | str | AiCallPromptWebSearch, AiCallPromptWebCrawl |
|
||||
| `intention` | Dict | UnderstandingResult |
|
||||
| `ipAddress` | str | AuthEvent |
|
||||
| `isAccumulationMode` | bool | JsonAccumulationState |
|
||||
| `isAggregation` | bool | SectionPromptArgs |
|
||||
| `isAvailable` | bool | AiModel |
|
||||
| `isRegeneration` | bool | TaskContext |
|
||||
| `isSystemRole` | bool | Role |
|
||||
| `isText` | bool | FilePreview |
|
||||
| `item` | str | AccessRule |
|
||||
| `jsonParsingSuccess` | bool | JsonContinuationContexts |
|
||||
| `kpis` | List | JsonAccumulationState |
|
||||
| `label` | str | ContentItem, AutomationDefinition |
|
||||
| `language` | str | Mandate, User, SectionPromptArgs, AiCallPromptWebSearch |
|
||||
| `last_complete_part` | str | ContinuationContext |
|
||||
| `last_raw_json` | str | ContinuationContext |
|
||||
| `lastActivity` | float | ChatWorkflow |
|
||||
| `lastChecked` | float | UserConnection |
|
||||
| `lastParsedResult` | Dict | JsonAccumulationState |
|
||||
| `lastUpdated` | str | AiModel |
|
||||
| `learnings` | List | ActionDefinition, TaskContext |
|
||||
| `listFileId` | List | UserInputRequest |
|
||||
| `logs` | List | ChatWorkflow |
|
||||
| `mandateId` | str | ChatWorkflow, FileItem, Prompt, User, AutomationDefinition, Token |
|
||||
| `maxCost` | float | SelectionRule, AiCallOptions |
|
||||
| `maxDepth` | int | AiCallPromptWebCrawl |
|
||||
| `maxNumberPages` | int | AiCallPromptWebSearch |
|
||||
| `maxParts` | int | AiCallOptions |
|
||||
| `maxProcessingTime` | int | AiCallOptions |
|
||||
| `maxSteps` | int | ChatWorkflow |
|
||||
| `maxTokens` | int | AiModel |
|
||||
| `maxWidth` | int | AiCallPromptWebCrawl |
|
||||
| `message` | str | ChatLog, ChatMessage |
|
||||
| `messageHistory` | List | TaskHandover |
|
||||
| `messageId` | str | ChatDocument |
|
||||
| `messages` | List | ChatWorkflow, AiModelCall |
|
||||
| `metadata` | ContentMetadata, AiResponseMetadata, Dict | ContentItem, AiResponse, AiModelResponse, CodeContentPromptArgs |
|
||||
| `metCriteria` | List | ReviewResult |
|
||||
| `method` | str | ActionSelection |
|
||||
| `mime` | str | ObservationPreview |
|
||||
| `mimeType` | str | ContentMetadata, FileItem, FilePreview, ChatDocument, ActionDocument, DocumentData |
|
||||
| `minContextLength` | int | AiModel, SelectionRule |
|
||||
| `minQualityRating` | int | SelectionRule |
|
||||
| `missingOutputs` | List | ReviewResult |
|
||||
| `model` | AiModel | AiModelCall |
|
||||
| `modelId` | str | AiModelResponse |
|
||||
| `modelName` | str | AiCallResponse |
|
||||
| `modified` | str | ObservationPreview |
|
||||
| `name` | str | Mandate, Prompt, ActionSelection, AiModel, SelectionRule, ObservationPreview |
|
||||
| `nextAction` | str | ReviewResult |
|
||||
| `nextActionGuidance` | Dict | TaskContext |
|
||||
| `nextActionObjective` | str | ReviewResult |
|
||||
| `nextActionParameters` | Dict | ReviewResult |
|
||||
| `notes` | List | Observation |
|
||||
| `objective` | str | TaskStep, TaskDefinition |
|
||||
| `operationId` | str | ChatLog |
|
||||
| `operationType` | OperationTypeEnum, str | OperationTypeRating, AiCallOptions, AiResponseMetadata |
|
||||
| `operationTypes` | List | AiModel, SelectionRule |
|
||||
| `options` | AiCallOptions | AiCallRequest, AiModelCall |
|
||||
| `originalPrompt` | str | RequestContext |
|
||||
| `outputDocuments` | List | TaskHandover |
|
||||
| `outputFormat` | str | ChapterStructurePromptArgs |
|
||||
| `overlapContext` | str | JsonContinuationContexts |
|
||||
| `overlap_context` | str | ContinuationContext |
|
||||
| `overview` | str | TaskPlan |
|
||||
| `pages` | int | ContentMetadata |
|
||||
| `parameters` | Dict | ActionParameters, UnderstandingResult, ActionDefinition |
|
||||
| `parametersContext` | str | ActionDefinition, TaskContext |
|
||||
| `parentId` | str | ChatLog |
|
||||
| `parentMessageId` | str | ChatMessage |
|
||||
| `performance` | Dict | ChatLog |
|
||||
| `placeholders` | List, Dict | PromptBundle, AutomationDefinition |
|
||||
| `priceUsd` | float | ChatStat, AiCallResponse |
|
||||
| `previews` | List | Observation |
|
||||
| `previousActionResults` | list | TaskContext |
|
||||
| `previousHandover` | TaskHandover | TaskContext |
|
||||
| `previousResults` | List | TaskHandover, TaskContext, ReviewContext |
|
||||
| `previousReviewResult` | dict | TaskContext |
|
||||
| `priority` | PriorityEnum | AiModel, SelectionRule, AiCallOptions |
|
||||
| `process` | str | ChatStat |
|
||||
| `processDocumentsIndividually` | bool | AiCallOptions |
|
||||
| `processingMode` | ProcessingModeEnum | AiModel, AiCallOptions |
|
||||
| `processingTime` | float | ChatStat, ActionItem, TaskItem, AiCallResponse, AiModelResponse |
|
||||
| `progress` | float | ChatLog |
|
||||
| `prompt` | str | UserInputRequest, PromptBundle, AiCallPromptImage |
|
||||
| `publishedAt` | float | ChatMessage |
|
||||
| `qualityRating` | int | AiModel |
|
||||
| `qualityRequirements` | Dict | TaskStep |
|
||||
| `qualityScore` | float | ReviewResult |
|
||||
| `quality` | str | AiCallPromptImage |
|
||||
| `rating` | int | OperationTypeRating |
|
||||
| `read` | AccessLevel | AccessRule, UserPermissions |
|
||||
| `reason` | str | Token, ReviewResult |
|
||||
| `reference` | str | ObservationPreview |
|
||||
| `requiredDocuments` | List | TaskDefinition |
|
||||
| `requiresAnalysis` | bool | RequestContext |
|
||||
| `requiresContentGeneration` | bool | TaskDefinition |
|
||||
| `requiresDocumentAnalysis` | bool | TaskDefinition |
|
||||
| `requiresDocuments` | bool | RequestContext |
|
||||
| `requiresWebResearch` | bool | RequestContext, TaskDefinition |
|
||||
| `researchDepth` | str | AiCallPromptWebSearch |
|
||||
| `resetToken` | str | UserInDB |
|
||||
| `resetTokenExpires` | float | UserInDB |
|
||||
| `result` | str | ActionItem |
|
||||
| `resultFormat` | str | AiCallOptions |
|
||||
| `resultLabel` | str | ActionResult, Observation |
|
||||
| `resultLabels` | Dict | TaskItem |
|
||||
| `resultType` | str | AiProcessParameters |
|
||||
| `retryCount` | int | ActionItem, TaskItem, TaskContext |
|
||||
| `retryMax` | int | ActionItem, TaskItem |
|
||||
| `revokedAt` | float | Token |
|
||||
| `revokedBy` | str | Token |
|
||||
| `role` | str | ChatMessage |
|
||||
| `roleLabel` | str | Role, AccessRule |
|
||||
| `roleLabels` | List | User |
|
||||
| `rollbackOnFailure` | bool | TaskItem |
|
||||
| `roundNumber` | int | ChatLog, ChatDocument, ChatMessage |
|
||||
| `safetyMargin` | float | AiCallOptions |
|
||||
| `schedule` | str | AutomationDefinition |
|
||||
| `schemaVersion` | str | AiResponseMetadata |
|
||||
| `section` | Dict | SectionPromptArgs |
|
||||
| `section_count` | int | ContinuationContext |
|
||||
| `sectionIndex` | int | SectionPromptArgs |
|
||||
| `sequenceNr` | int | ChatMessage |
|
||||
| `sessionId` | str | Token |
|
||||
| `size` | int, str | ContentMetadata, FilePreview, AiCallPromptImage, ObservationPreview |
|
||||
| `snippet` | str | ObservationPreview |
|
||||
| `sourceDocuments` | List | AiResponseMetadata |
|
||||
| `sourceJson` | Dict | ActionDocument, DocumentData |
|
||||
| `sourceTask` | str | TaskHandover |
|
||||
| `speedRating` | int | AiModel |
|
||||
| `stage1Selection` | dict | TaskContext |
|
||||
| `startedAt` | float | ChatWorkflow, TaskItem |
|
||||
| `stats` | List | ChatWorkflow |
|
||||
| `status` | str, TokenStatus, TaskStatus, ConnectionStatus | ChatLog, ChatWorkflow, ChatMessage, UserConnection, AutomationDefinition, ActionItem, TaskItem, TaskResult, ReviewResult, Token |
|
||||
| `style` | str | AiCallPromptImage |
|
||||
| `success` | bool | ChatMessage, ActionResult, Observation, TaskResult, AuthEvent, AiModelResponse |
|
||||
| `successCriteria` | list | TaskStep |
|
||||
| `successfulActions` | list | TaskContext |
|
||||
| `summary` | str | ChatMessage |
|
||||
| `summaryAllowed` | bool | PromptPlaceholder |
|
||||
| `taskActions` | list | ReviewContext |
|
||||
| `taskId` | str | TaskResult, TaskHandover |
|
||||
| `taskNumber` | int | ChatLog, ChatDocument, ChatMessage |
|
||||
| `taskProgress` | str | ChatMessage |
|
||||
| `tasks` | List | ChatWorkflow, TaskPlan, UnderstandingResult |
|
||||
| `taskStep` | TaskStep | TaskContext, ReviewContext |
|
||||
| `temperature` | float | AiModel, AiCallOptions |
|
||||
| `template` | str | AutomationDefinition |
|
||||
| `template_structure` | str | ContinuationContext |
|
||||
| `timestamp` | float | ChatLog, ActionItem, TaskHandover, AuthEvent |
|
||||
| `title` | str | AiResponseMetadata |
|
||||
| `tokenAccess` | str | Token |
|
||||
| `tokenExpiresAt` | float | UserConnection |
|
||||
| `tokenRefresh` | str | Token |
|
||||
| `tokensUsed` | Dict | AiModelResponse |
|
||||
| `tokenStatus` | str | UserConnection |
|
||||
| `tokenType` | str | Token |
|
||||
| `totalActions` | int | ChatWorkflow |
|
||||
| `totalTasks` | int | ChatWorkflow |
|
||||
| `type` | str | ChatLog |
|
||||
| `typeGroup` | str | ObservationPreview |
|
||||
| `unmetCriteria` | List | ReviewResult |
|
||||
| `update` | AccessLevel | AccessRule, UserPermissions |
|
||||
| `url` | str | AiCallPromptWebCrawl |
|
||||
| `userAgent` | str | AuthEvent |
|
||||
| `userId` | str | UserConnection, Token, AuthEvent |
|
||||
| `userInput` | str | TaskItem |
|
||||
| `userLanguage` | str | UserInputRequest, RequestContext |
|
||||
| `userMessage` | str | ActionItem, TaskStep, ReviewResult, TaskPlan, ActionDefinition |
|
||||
| `userPrompt` | str | SectionPromptArgs, ChapterStructurePromptArgs, CodeContentPromptArgs, CodeStructurePromptArgs |
|
||||
| `username` | str | User |
|
||||
| `validationMetadata` | Dict | ActionDocument |
|
||||
| `version` | str | AiModel |
|
||||
| `view` | bool | AccessRule, UserPermissions |
|
||||
| `weight` | float | SelectionRule |
|
||||
| `width` | int | ContentMetadata |
|
||||
| `workflow` | ChatWorkflow | TaskContext |
|
||||
| `workflowId` | str | ChatStat, ChatLog, ChatMessage, ChatWorkflow, TaskItem, TaskContext, ReviewContext |
|
||||
| `workflowMode` | WorkflowModeEnum | ChatWorkflow |
|
||||
| `workflowSummary` | str | TaskHandover |
|
||||
|
||||
|
||||
|
||||
---
|
||||
|
||||
Can you adapt following fields to Multilingual Fields (`TextMultilingual`):
|
||||
|
||||
| Field Name | Models |
|
||||
|------------|--------|
|
||||
| `description` | Role | (is already)
|
||||
|
||||
|
||||
1061
modules/datamodels/datamodelChatbot.py
Normal file
1061
modules/datamodels/datamodelChatbot.py
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -23,7 +23,7 @@ from modules.datamodels.datamodelRealEstate import (
|
|||
Land,
|
||||
)
|
||||
from modules.services import getInterface as getServices
|
||||
from modules.interfaces.interfaceDbRealEstate import getInterface as getRealEstateInterface
|
||||
from modules.interfaces.interfaceDbRealestate import getInterface as getRealEstateInterface
|
||||
from modules.connectors.connectorSwissTopoMapServer import SwissTopoMapServerConnector
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
"""
|
||||
Utility functions for automation feature.
|
||||
|
||||
Moved from interfaces/interfaceDbChatbot.py.
|
||||
Moved from interfaces/interfaceDbChat.py.
|
||||
"""
|
||||
|
||||
import json
|
||||
|
|
|
|||
1963
modules/interfaces/interfaceDbChat.py
Normal file
1963
modules/interfaces/interfaceDbChat.py
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1,8 +1,8 @@
|
|||
# Copyright (c) 2025 Patrick Motsch
|
||||
# All rights reserved.
|
||||
"""
|
||||
Interface to LucyDOM database and AI Connectors.
|
||||
Uses the JSON connector for data access with added language support.
|
||||
Interface to Chatbot database and AI Connectors.
|
||||
Uses the PostgreSQL connector for data access with user/mandate filtering.
|
||||
"""
|
||||
|
||||
import logging
|
||||
|
|
@ -59,7 +59,7 @@ def storeDebugMessageAndDocuments(message, currentUser) -> None:
|
|||
import os
|
||||
from datetime import datetime, UTC
|
||||
from modules.shared.debugLogger import _getBaseDebugDir, _ensureDir
|
||||
from modules.interfaces.interfaceDbComponentObjects import getInterface
|
||||
from modules.interfaces.interfaceDbManagement import getInterface
|
||||
|
||||
# Create base debug directory (use base debug dir, not prompts subdirectory)
|
||||
baseDebugDir = _getBaseDebugDir()
|
||||
|
|
@ -314,7 +314,7 @@ class ChatObjects:
|
|||
try:
|
||||
# Get configuration values with defaults
|
||||
dbHost = APP_CONFIG.get("DB_HOST", "_no_config_default_data")
|
||||
dbDatabase = "poweron_chat"
|
||||
dbDatabase = "poweron_chatbot"
|
||||
dbUser = APP_CONFIG.get("DB_USER")
|
||||
dbPassword = APP_CONFIG.get("DB_PASSWORD_SECRET")
|
||||
dbPort = int(APP_CONFIG.get("DB_PORT", 5432))
|
||||
|
|
@ -1668,7 +1668,7 @@ class ChatObjects:
|
|||
if not automations:
|
||||
return automations
|
||||
|
||||
from modules.interfaces.interfaceDbAppObjects import getInterface as getAppInterface
|
||||
from modules.interfaces.interfaceDbApp import getInterface as getAppInterface
|
||||
|
||||
# Collect all unique user IDs and mandate IDs
|
||||
userIds = set()
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ class ComponentObjects:
|
|||
|
||||
# Get the root interface to access the initial mandate ID
|
||||
from modules.security.rootAccess import getRootUser
|
||||
from modules.interfaces.interfaceDbAppObjects import getInterface
|
||||
from modules.interfaces.interfaceDbApp import getInterface
|
||||
rootUser = getRootUser()
|
||||
rootInterface = getInterface(rootUser)
|
||||
|
||||
|
|
@ -12,7 +12,7 @@ from fastapi import HTTPException, status
|
|||
from modules.shared.configuration import APP_CONFIG
|
||||
from modules.auth import limiter, getCurrentUser
|
||||
from modules.datamodels.datamodelUam import User
|
||||
from modules.interfaces.interfaceDbAppObjects import getRootInterface
|
||||
from modules.interfaces.interfaceDbApp import getRootInterface
|
||||
|
||||
# Static folder setup - using absolute path from app root
|
||||
baseDir = FilePath(__file__).parent.parent.parent # Go up to gateway root
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ from fastapi import status
|
|||
import logging
|
||||
|
||||
# Import interfaces and models
|
||||
import modules.interfaces.interfaceDbChatbot as interfaceDbChatbot
|
||||
import modules.interfaces.interfaceDbChat as interfaceDbChat
|
||||
from modules.auth import limiter, getRequestContext, requireSysAdmin, RequestContext
|
||||
from modules.datamodels.datamodelUam import User
|
||||
|
||||
|
|
@ -76,8 +76,8 @@ async def sync_all_automation_events(
|
|||
This will register/remove events based on active flags.
|
||||
"""
|
||||
try:
|
||||
from modules.interfaces.interfaceDbChatbot import getInterface as getChatInterface
|
||||
from modules.interfaces.interfaceDbAppObjects import getRootInterface
|
||||
from modules.interfaces.interfaceDbChat import getInterface as getChatInterface
|
||||
from modules.interfaces.interfaceDbApp import getRootInterface
|
||||
from modules.features.workflow import syncAutomationEvents
|
||||
|
||||
chatInterface = getChatInterface(currentUser)
|
||||
|
|
@ -127,7 +127,7 @@ async def remove_event(
|
|||
# Update automation's eventId if it exists
|
||||
if eventId.startswith("automation."):
|
||||
automation_id = eventId.replace("automation.", "")
|
||||
chatInterface = interfaceDbChatbot.getInterface(currentUser)
|
||||
chatInterface = interfaceDbChat.getInterface(currentUser)
|
||||
automation = chatInterface.getAutomationDefinition(automation_id)
|
||||
if automation and getattr(automation, "eventId", None) == eventId:
|
||||
chatInterface.updateAutomationDefinition(automation_id, {"eventId": None})
|
||||
|
|
@ -19,7 +19,7 @@ from pydantic import BaseModel, Field
|
|||
from modules.auth import limiter, getRequestContext, RequestContext, requireSysAdmin
|
||||
from modules.datamodels.datamodelUam import User
|
||||
from modules.datamodels.datamodelFeatures import Feature, FeatureInstance
|
||||
from modules.interfaces.interfaceDbAppObjects import getRootInterface
|
||||
from modules.interfaces.interfaceDbApp import getRootInterface
|
||||
from modules.interfaces.interfaceFeatures import getFeatureInterface
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
@ -21,7 +21,7 @@ from pydantic import BaseModel, Field
|
|||
from modules.auth import limiter, getRequestContext, RequestContext, requireSysAdmin
|
||||
from modules.datamodels.datamodelUam import User
|
||||
from modules.datamodels.datamodelRbac import Role, AccessRule
|
||||
from modules.interfaces.interfaceDbAppObjects import getRootInterface
|
||||
from modules.interfaces.interfaceDbApp import getRootInterface
|
||||
from modules.shared.timeUtils import getUtcTimestamp
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
@ -17,7 +17,7 @@ from modules.auth import limiter, requireSysAdmin
|
|||
from modules.datamodels.datamodelUam import User, UserInDB
|
||||
from modules.datamodels.datamodelRbac import Role
|
||||
from modules.datamodels.datamodelMembership import UserMandate, UserMandateRole
|
||||
from modules.interfaces.interfaceDbAppObjects import getInterface, getRootInterface
|
||||
from modules.interfaces.interfaceDbApp import getInterface, getRootInterface
|
||||
|
||||
# Configure logger
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ from modules.auth import limiter, getRequestContext, requireSysAdmin, RequestCon
|
|||
from modules.datamodels.datamodelUam import User, UserPermissions, AccessLevel
|
||||
from modules.datamodels.datamodelRbac import AccessRuleContext, AccessRule, Role
|
||||
from modules.datamodels.datamodelPagination import PaginationParams, PaginatedResponse, PaginationMetadata, normalize_pagination_dict
|
||||
from modules.interfaces.interfaceDbAppObjects import getInterface, getRootInterface
|
||||
from modules.interfaces.interfaceDbApp import getInterface, getRootInterface
|
||||
|
||||
# Configure logger
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
@ -13,7 +13,7 @@ import logging
|
|||
import json
|
||||
|
||||
# Import interfaces and models
|
||||
from modules.interfaces.interfaceDbChatbot import getInterface as getChatInterface
|
||||
from modules.interfaces.interfaceDbChat import getInterface as getChatInterface
|
||||
from modules.auth import getCurrentUser, limiter
|
||||
from modules.datamodels.datamodelChat import AutomationDefinition, ChatWorkflow
|
||||
from modules.datamodels.datamodelPagination import PaginationParams, PaginatedResponse, PaginationMetadata, normalize_pagination_dict
|
||||
|
|
|
|||
|
|
@ -21,9 +21,9 @@ from modules.datamodels.datamodelUam import User, UserConnection, AuthAuthority,
|
|||
from modules.datamodels.datamodelSecurity import Token
|
||||
from modules.auth import getCurrentUser, limiter
|
||||
from modules.datamodels.datamodelPagination import PaginationParams, PaginatedResponse, PaginationMetadata, normalize_pagination_dict
|
||||
from modules.interfaces.interfaceDbAppObjects import getInterface
|
||||
from modules.interfaces.interfaceDbApp import getInterface
|
||||
from modules.shared.timeUtils import getUtcTimestamp, parseTimestamp
|
||||
from modules.interfaces.interfaceDbComponentObjects import ComponentObjects
|
||||
from modules.interfaces.interfaceDbManagement import ComponentObjects
|
||||
|
||||
# Configure logger
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import json
|
|||
from modules.auth import limiter, getCurrentUser
|
||||
|
||||
# Import interfaces
|
||||
import modules.interfaces.interfaceDbComponentObjects as interfaceDbComponentObjects
|
||||
import modules.interfaces.interfaceDbManagement as interfaceDbManagement
|
||||
from modules.datamodels.datamodelFiles import FileItem, FilePreview
|
||||
from modules.shared.attributeUtils import getModelAttributeDefinitions
|
||||
from modules.datamodels.datamodelUam import User
|
||||
|
|
@ -69,7 +69,7 @@ async def get_files(
|
|||
detail=f"Invalid pagination parameter: {str(e)}"
|
||||
)
|
||||
|
||||
managementInterface = interfaceDbComponentObjects.getInterface(currentUser)
|
||||
managementInterface = interfaceDbManagement.getInterface(currentUser)
|
||||
result = managementInterface.getAllFiles(pagination=paginationParams)
|
||||
|
||||
# If pagination was requested, result is PaginatedResult
|
||||
|
|
@ -112,17 +112,17 @@ async def upload_file(
|
|||
file.fileName = file.filename
|
||||
"""Upload a file"""
|
||||
try:
|
||||
managementInterface = interfaceDbComponentObjects.getInterface(currentUser)
|
||||
managementInterface = interfaceDbManagement.getInterface(currentUser)
|
||||
|
||||
# Read file
|
||||
fileContent = await file.read()
|
||||
|
||||
# Check size limits
|
||||
maxSize = int(interfaceDbComponentObjects.APP_CONFIG.get("File_Management_MAX_UPLOAD_SIZE_MB")) * 1024 * 1024 # in bytes
|
||||
maxSize = int(interfaceDbManagement.APP_CONFIG.get("File_Management_MAX_UPLOAD_SIZE_MB")) * 1024 * 1024 # in bytes
|
||||
if len(fileContent) > maxSize:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_413_REQUEST_ENTITY_TOO_LARGE,
|
||||
detail=f"File too large. Maximum size: {interfaceDbComponentObjects.APP_CONFIG.get('File_Management_MAX_UPLOAD_SIZE_MB')}MB"
|
||||
detail=f"File too large. Maximum size: {interfaceDbManagement.APP_CONFIG.get('File_Management_MAX_UPLOAD_SIZE_MB')}MB"
|
||||
)
|
||||
|
||||
# Save file via LucyDOM interface in the database
|
||||
|
|
@ -155,7 +155,7 @@ async def upload_file(
|
|||
"isDuplicate": duplicateType != "new_file"
|
||||
})
|
||||
|
||||
except interfaceDbComponentObjects.FileStorageError as e:
|
||||
except interfaceDbManagement.FileStorageError as e:
|
||||
logger.error(f"Error during file upload (storage): {str(e)}")
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||
|
|
@ -177,7 +177,7 @@ async def get_file(
|
|||
) -> FileItem:
|
||||
"""Get a file"""
|
||||
try:
|
||||
managementInterface = interfaceDbComponentObjects.getInterface(currentUser)
|
||||
managementInterface = interfaceDbManagement.getInterface(currentUser)
|
||||
|
||||
# Get file via LucyDOM interface from the database
|
||||
fileData = managementInterface.getFile(fileId)
|
||||
|
|
@ -189,19 +189,19 @@ async def get_file(
|
|||
|
||||
return fileData
|
||||
|
||||
except interfaceDbComponentObjects.FileNotFoundError as e:
|
||||
except interfaceDbManagement.FileNotFoundError as e:
|
||||
logger.warning(f"File not found: {str(e)}")
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_404_NOT_FOUND,
|
||||
detail=str(e)
|
||||
)
|
||||
except interfaceDbComponentObjects.FilePermissionError as e:
|
||||
except interfaceDbManagement.FilePermissionError as e:
|
||||
logger.warning(f"No permission for file: {str(e)}")
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
detail=str(e)
|
||||
)
|
||||
except interfaceDbComponentObjects.FileError as e:
|
||||
except interfaceDbManagement.FileError as e:
|
||||
logger.error(f"Error retrieving file: {str(e)}")
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||
|
|
@ -224,7 +224,7 @@ async def update_file(
|
|||
) -> FileItem:
|
||||
"""Update file info"""
|
||||
try:
|
||||
managementInterface = interfaceDbComponentObjects.getInterface(currentUser)
|
||||
managementInterface = interfaceDbManagement.getInterface(currentUser)
|
||||
|
||||
# Get the file from the database
|
||||
file = managementInterface.getFile(fileId)
|
||||
|
|
@ -270,7 +270,7 @@ async def delete_file(
|
|||
currentUser: User = Depends(getCurrentUser)
|
||||
) -> Dict[str, Any]:
|
||||
"""Delete a file"""
|
||||
managementInterface = interfaceDbComponentObjects.getInterface(currentUser)
|
||||
managementInterface = interfaceDbManagement.getInterface(currentUser)
|
||||
|
||||
# Check if the file exists
|
||||
existingFile = managementInterface.getFile(fileId)
|
||||
|
|
@ -297,7 +297,7 @@ async def get_file_stats(
|
|||
) -> Dict[str, Any]:
|
||||
"""Returns statistics about the stored files"""
|
||||
try:
|
||||
managementInterface = interfaceDbComponentObjects.getInterface(currentUser)
|
||||
managementInterface = interfaceDbManagement.getInterface(currentUser)
|
||||
|
||||
# Get all files - metadata only
|
||||
allFiles = managementInterface.getAllFiles()
|
||||
|
|
@ -336,7 +336,7 @@ async def download_file(
|
|||
) -> Response:
|
||||
"""Download a file"""
|
||||
try:
|
||||
managementInterface = interfaceDbComponentObjects.getInterface(currentUser)
|
||||
managementInterface = interfaceDbManagement.getInterface(currentUser)
|
||||
|
||||
# Get file data
|
||||
fileData = managementInterface.getFile(fileId)
|
||||
|
|
@ -384,7 +384,7 @@ async def preview_file(
|
|||
) -> FilePreview:
|
||||
"""Preview a file's content"""
|
||||
try:
|
||||
managementInterface = interfaceDbComponentObjects.getInterface(currentUser)
|
||||
managementInterface = interfaceDbManagement.getInterface(currentUser)
|
||||
|
||||
# Get file preview using the correct method
|
||||
preview = managementInterface.getFileContent(fileId)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ from pydantic import BaseModel, Field
|
|||
from modules.auth import limiter, requireSysAdmin, getRequestContext, RequestContext
|
||||
|
||||
# Import interfaces
|
||||
import modules.interfaces.interfaceDbAppObjects as interfaceDbAppObjects
|
||||
import modules.interfaces.interfaceDbApp as interfaceDbApp
|
||||
from modules.shared.attributeUtils import getModelAttributeDefinitions
|
||||
from modules.shared.auditLogger import audit_logger
|
||||
|
||||
|
|
@ -107,7 +107,7 @@ async def get_mandates(
|
|||
detail=f"Invalid pagination parameter: {str(e)}"
|
||||
)
|
||||
|
||||
appInterface = interfaceDbAppObjects.getRootInterface()
|
||||
appInterface = interfaceDbApp.getRootInterface()
|
||||
result = appInterface.getAllMandates(pagination=paginationParams)
|
||||
|
||||
# If pagination was requested, result is PaginatedResult
|
||||
|
|
@ -150,7 +150,7 @@ async def get_mandate(
|
|||
MULTI-TENANT: SysAdmin-only.
|
||||
"""
|
||||
try:
|
||||
appInterface = interfaceDbAppObjects.getRootInterface()
|
||||
appInterface = interfaceDbApp.getRootInterface()
|
||||
mandate = appInterface.getMandate(mandateId)
|
||||
|
||||
if not mandate:
|
||||
|
|
@ -195,7 +195,7 @@ async def create_mandate(
|
|||
description = mandateData.get('description')
|
||||
enabled = mandateData.get('enabled', True)
|
||||
|
||||
appInterface = interfaceDbAppObjects.getRootInterface()
|
||||
appInterface = interfaceDbApp.getRootInterface()
|
||||
|
||||
# Create mandate
|
||||
newMandate = appInterface.createMandate(
|
||||
|
|
@ -237,7 +237,7 @@ async def update_mandate(
|
|||
try:
|
||||
logger.debug(f"Updating mandate {mandateId} with data: {mandateData}")
|
||||
|
||||
appInterface = interfaceDbAppObjects.getRootInterface()
|
||||
appInterface = interfaceDbApp.getRootInterface()
|
||||
|
||||
# Check if mandate exists
|
||||
existingMandate = appInterface.getMandate(mandateId)
|
||||
|
|
@ -280,7 +280,7 @@ async def delete_mandate(
|
|||
MULTI-TENANT: SysAdmin-only.
|
||||
"""
|
||||
try:
|
||||
appInterface = interfaceDbAppObjects.getRootInterface()
|
||||
appInterface = interfaceDbApp.getRootInterface()
|
||||
|
||||
# Check if mandate exists
|
||||
existingMandate = appInterface.getMandate(mandateId)
|
||||
|
|
@ -347,7 +347,7 @@ async def listMandateUsers(
|
|||
)
|
||||
|
||||
try:
|
||||
rootInterface = interfaceDbAppObjects.getRootInterface()
|
||||
rootInterface = interfaceDbApp.getRootInterface()
|
||||
|
||||
# Verify mandate exists
|
||||
mandate = rootInterface.getMandate(targetMandateId)
|
||||
|
|
@ -518,7 +518,7 @@ async def addUserToMandate(
|
|||
)
|
||||
|
||||
try:
|
||||
rootInterface = interfaceDbAppObjects.getRootInterface()
|
||||
rootInterface = interfaceDbApp.getRootInterface()
|
||||
|
||||
# 3. Verify mandate exists
|
||||
mandate = rootInterface.getMandate(targetMandateId)
|
||||
|
|
@ -627,7 +627,7 @@ async def removeUserFromMandate(
|
|||
)
|
||||
|
||||
try:
|
||||
rootInterface = interfaceDbAppObjects.getRootInterface()
|
||||
rootInterface = interfaceDbApp.getRootInterface()
|
||||
|
||||
# Verify mandate exists
|
||||
mandate = rootInterface.getMandate(targetMandateId)
|
||||
|
|
@ -707,7 +707,7 @@ async def updateUserRolesInMandate(
|
|||
)
|
||||
|
||||
try:
|
||||
rootInterface = interfaceDbAppObjects.getRootInterface()
|
||||
rootInterface = interfaceDbApp.getRootInterface()
|
||||
|
||||
# Get user's membership
|
||||
membership = rootInterface.getUserMandate(targetUserId, targetMandateId)
|
||||
|
|
@ -810,7 +810,7 @@ def _hasMandateAdminRole(context: RequestContext, mandateId: str) -> bool:
|
|||
return False
|
||||
|
||||
try:
|
||||
rootInterface = interfaceDbAppObjects.getRootInterface()
|
||||
rootInterface = interfaceDbApp.getRootInterface()
|
||||
|
||||
for roleId in context.roleIds:
|
||||
roleRecords = rootInterface.db.getRecordset(Role, recordFilter={"id": roleId})
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import json
|
|||
from modules.auth import limiter, getCurrentUser
|
||||
|
||||
# Import interfaces
|
||||
import modules.interfaces.interfaceDbComponentObjects as interfaceDbComponentObjects
|
||||
import modules.interfaces.interfaceDbManagement as interfaceDbManagement
|
||||
from modules.datamodels.datamodelUtils import Prompt
|
||||
from modules.datamodels.datamodelUam import User
|
||||
from modules.datamodels.datamodelPagination import PaginationParams, PaginatedResponse, PaginationMetadata, normalize_pagination_dict
|
||||
|
|
@ -58,7 +58,7 @@ async def get_prompts(
|
|||
detail=f"Invalid pagination parameter: {str(e)}"
|
||||
)
|
||||
|
||||
managementInterface = interfaceDbComponentObjects.getInterface(currentUser)
|
||||
managementInterface = interfaceDbManagement.getInterface(currentUser)
|
||||
result = managementInterface.getAllPrompts(pagination=paginationParams)
|
||||
|
||||
# If pagination was requested, result is PaginatedResult
|
||||
|
|
@ -89,7 +89,7 @@ async def create_prompt(
|
|||
currentUser: User = Depends(getCurrentUser)
|
||||
) -> Prompt:
|
||||
"""Create a new prompt"""
|
||||
managementInterface = interfaceDbComponentObjects.getInterface(currentUser)
|
||||
managementInterface = interfaceDbManagement.getInterface(currentUser)
|
||||
|
||||
# Create prompt
|
||||
newPrompt = managementInterface.createPrompt(prompt)
|
||||
|
|
@ -104,7 +104,7 @@ async def get_prompt(
|
|||
currentUser: User = Depends(getCurrentUser)
|
||||
) -> Prompt:
|
||||
"""Get a specific prompt"""
|
||||
managementInterface = interfaceDbComponentObjects.getInterface(currentUser)
|
||||
managementInterface = interfaceDbManagement.getInterface(currentUser)
|
||||
|
||||
# Get prompt
|
||||
prompt = managementInterface.getPrompt(promptId)
|
||||
|
|
@ -125,7 +125,7 @@ async def update_prompt(
|
|||
currentUser: User = Depends(getCurrentUser)
|
||||
) -> Prompt:
|
||||
"""Update an existing prompt"""
|
||||
managementInterface = interfaceDbComponentObjects.getInterface(currentUser)
|
||||
managementInterface = interfaceDbManagement.getInterface(currentUser)
|
||||
|
||||
# Check if the prompt exists
|
||||
existingPrompt = managementInterface.getPrompt(promptId)
|
||||
|
|
@ -160,7 +160,7 @@ async def delete_prompt(
|
|||
currentUser: User = Depends(getCurrentUser)
|
||||
) -> Dict[str, Any]:
|
||||
"""Delete a prompt"""
|
||||
managementInterface = interfaceDbComponentObjects.getInterface(currentUser)
|
||||
managementInterface = interfaceDbManagement.getInterface(currentUser)
|
||||
|
||||
# Check if the prompt exists
|
||||
existingPrompt = managementInterface.getPrompt(promptId)
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import logging
|
|||
import json
|
||||
|
||||
# Import interfaces and models
|
||||
import modules.interfaces.interfaceDbAppObjects as interfaceDbAppObjects
|
||||
import modules.interfaces.interfaceDbApp as interfaceDbApp
|
||||
from modules.auth import limiter, getRequestContext, RequestContext
|
||||
|
||||
# Import the attribute definition and helper functions
|
||||
|
|
@ -179,7 +179,7 @@ async def get_users(
|
|||
detail=f"Invalid pagination parameter: {str(e)}"
|
||||
)
|
||||
|
||||
appInterface = interfaceDbAppObjects.getInterface(context.user)
|
||||
appInterface = interfaceDbApp.getInterface(context.user)
|
||||
|
||||
# MULTI-TENANT: Use mandateId from context (header)
|
||||
# SysAdmin without mandateId can see all users
|
||||
|
|
@ -278,7 +278,7 @@ async def get_user(
|
|||
MULTI-TENANT: User must be in the same mandate (via UserMandate) or caller is SysAdmin.
|
||||
"""
|
||||
try:
|
||||
appInterface = interfaceDbAppObjects.getInterface(context.user)
|
||||
appInterface = interfaceDbApp.getInterface(context.user)
|
||||
# Get user without filtering by enabled status
|
||||
user = appInterface.getUser(userId)
|
||||
|
||||
|
|
@ -333,7 +333,7 @@ async def create_user(
|
|||
Create a new user.
|
||||
MULTI-TENANT: User is created and automatically added to the current mandate.
|
||||
"""
|
||||
appInterface = interfaceDbAppObjects.getInterface(context.user)
|
||||
appInterface = interfaceDbApp.getInterface(context.user)
|
||||
|
||||
# Extract fields from request model and call createUser with individual parameters
|
||||
from modules.datamodels.datamodelUam import AuthAuthority
|
||||
|
|
@ -375,7 +375,7 @@ async def update_user(
|
|||
Update an existing user.
|
||||
MULTI-TENANT: Can only update users in the same mandate (unless SysAdmin).
|
||||
"""
|
||||
appInterface = interfaceDbAppObjects.getInterface(context.user)
|
||||
appInterface = interfaceDbApp.getInterface(context.user)
|
||||
|
||||
# Check if the user exists
|
||||
existingUser = appInterface.getUser(userId)
|
||||
|
|
@ -430,7 +430,7 @@ async def reset_user_password(
|
|||
)
|
||||
|
||||
# Get user interface
|
||||
appInterface = interfaceDbAppObjects.getInterface(context.user)
|
||||
appInterface = interfaceDbApp.getInterface(context.user)
|
||||
|
||||
# Get target user
|
||||
target_user = appInterface.getUser(userId)
|
||||
|
|
@ -525,7 +525,7 @@ async def change_password(
|
|||
"""
|
||||
try:
|
||||
# Get user interface
|
||||
appInterface = interfaceDbAppObjects.getInterface(context.user)
|
||||
appInterface = interfaceDbApp.getInterface(context.user)
|
||||
|
||||
# Verify current password
|
||||
if not appInterface.verifyPassword(currentPassword, context.user.passwordHash):
|
||||
|
|
@ -612,10 +612,10 @@ async def sendPasswordLink(
|
|||
"""
|
||||
try:
|
||||
from modules.shared.configuration import APP_CONFIG
|
||||
from modules.interfaces.interfaceDbAppObjects import getRootInterface
|
||||
from modules.interfaces.interfaceDbApp import getRootInterface
|
||||
|
||||
# Get user interface
|
||||
appInterface = interfaceDbAppObjects.getInterface(context.user)
|
||||
appInterface = interfaceDbApp.getInterface(context.user)
|
||||
|
||||
# Get target user
|
||||
targetUser = appInterface.getUser(userId)
|
||||
|
|
@ -742,7 +742,7 @@ async def delete_user(
|
|||
Delete a user.
|
||||
MULTI-TENANT: Can only delete users in the same mandate (unless SysAdmin).
|
||||
"""
|
||||
appInterface = interfaceDbAppObjects.getInterface(context.user)
|
||||
appInterface = interfaceDbApp.getInterface(context.user)
|
||||
|
||||
# Check if the user exists
|
||||
existingUser = appInterface.getUser(userId)
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ from fastapi import APIRouter, HTTPException, Depends, Body, Path, Query, Respon
|
|||
from modules.auth import limiter, getCurrentUser
|
||||
|
||||
# Import interfaces
|
||||
import modules.interfaces.interfaceDbChatbot as interfaceDbChatbot
|
||||
from modules.interfaces.interfaceDbChatbot import getInterface
|
||||
import modules.interfaces.interfaceDbChat as interfaceDbChat
|
||||
from modules.interfaces.interfaceDbChat import getInterface
|
||||
from modules.interfaces.interfaceRbac import getRecordsetWithRBAC
|
||||
|
||||
# Import models
|
||||
|
|
@ -45,7 +45,7 @@ router = APIRouter(
|
|||
)
|
||||
|
||||
def getServiceChat(currentUser: User):
|
||||
return interfaceDbChatbot.getInterface(currentUser)
|
||||
return interfaceDbChat.getInterface(currentUser)
|
||||
|
||||
# Consolidated endpoint for getting all workflows
|
||||
@router.get("/", response_model=PaginatedResponse[ChatWorkflow])
|
||||
|
|
@ -13,7 +13,7 @@ from fastapi import APIRouter, HTTPException, Depends, Body, Path, Query, Reques
|
|||
from modules.auth import limiter, getRequestContext, RequestContext
|
||||
|
||||
# Import interfaces
|
||||
import modules.interfaces.interfaceDbChatbot as interfaceDbChatbot
|
||||
import modules.interfaces.interfaceDbChat as interfaceDbChat
|
||||
|
||||
# Import models
|
||||
from modules.datamodels.datamodelChat import ChatWorkflow, UserInputRequest, WorkflowModeEnum
|
||||
|
|
@ -32,7 +32,7 @@ router = APIRouter(
|
|||
)
|
||||
|
||||
def _getServiceChat(context: RequestContext):
|
||||
return interfaceDbChatbot.getInterface(context.user, mandateId=str(context.mandateId) if context.mandateId else None)
|
||||
return interfaceDbChat.getInterface(context.user, mandateId=str(context.mandateId) if context.mandateId else None)
|
||||
|
||||
# Workflow start endpoint
|
||||
@router.post("/start", response_model=ChatWorkflow)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ from modules.shared.timeUtils import parseTimestamp
|
|||
from modules.auth import limiter, getRequestContext, RequestContext
|
||||
|
||||
# Import interfaces
|
||||
import modules.interfaces.interfaceDbChatbot as interfaceDbChatbot
|
||||
import modules.interfaces.interfaceDbChat as interfaceDbChat
|
||||
from modules.interfaces.interfaceRbac import getRecordsetWithRBAC
|
||||
|
||||
# Import models
|
||||
|
|
@ -43,7 +43,7 @@ router = APIRouter(
|
|||
)
|
||||
|
||||
def _getServiceChat(context: RequestContext):
|
||||
return interfaceDbChatbot.getInterface(context.user, mandateId=str(context.mandateId) if context.mandateId else None)
|
||||
return interfaceDbChat.getInterface(context.user, mandateId=str(context.mandateId) if context.mandateId else None)
|
||||
|
||||
# Chatbot streaming endpoint (SSE)
|
||||
@router.post("/start/stream")
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ from modules.datamodels.datamodelRealEstate import (
|
|||
)
|
||||
|
||||
# Import interfaces
|
||||
from modules.interfaces.interfaceDbRealEstate import getInterface as getRealEstateInterface
|
||||
from modules.interfaces.interfaceDbRealestate import getInterface as getRealEstateInterface
|
||||
|
||||
# Import feature logic for AI-powered commands
|
||||
from modules.features.realEstate.mainRealEstate import (
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import io
|
|||
|
||||
from modules.auth import limiter, getRequestContext, RequestContext
|
||||
from modules.interfaces.interfaceDbTrustee import getInterface
|
||||
from modules.interfaces.interfaceDbAppObjects import getRootInterface
|
||||
from modules.interfaces.interfaceDbApp import getRootInterface
|
||||
from modules.interfaces.interfaceFeatures import getFeatureInterface
|
||||
from modules.datamodels.datamodelTrustee import (
|
||||
TrusteeOrganisation,
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ from pydantic import BaseModel, Field
|
|||
|
||||
from modules.auth import limiter, getCurrentUser
|
||||
from modules.datamodels.datamodelUam import User
|
||||
from modules.interfaces.interfaceDbAppObjects import getRootInterface
|
||||
from modules.interfaces.interfaceDbApp import getRootInterface
|
||||
from modules.shared.timeUtils import getUtcTimestamp
|
||||
from modules.shared.auditLogger import audit_logger
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ from pydantic import BaseModel, Field
|
|||
from modules.auth import limiter, getRequestContext, RequestContext, getCurrentUser
|
||||
from modules.datamodels.datamodelUam import User
|
||||
from modules.datamodels.datamodelInvitation import Invitation
|
||||
from modules.interfaces.interfaceDbAppObjects import getRootInterface
|
||||
from modules.interfaces.interfaceDbApp import getRootInterface
|
||||
from modules.shared.timeUtils import getUtcTimestamp
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ from modules.auth import limiter, getCurrentUser, getRequestContext, RequestCont
|
|||
from modules.datamodels.datamodelRbac import Role
|
||||
|
||||
# Import interfaces
|
||||
import modules.interfaces.interfaceDbComponentObjects as interfaceDbComponentObjects
|
||||
import modules.interfaces.interfaceDbManagement as interfaceDbManagement
|
||||
from modules.datamodels.datamodelMessaging import (
|
||||
MessagingSubscription,
|
||||
MessagingSubscriptionRegistration,
|
||||
|
|
@ -55,7 +55,7 @@ async def getSubscriptions(
|
|||
detail=f"Invalid pagination parameter: {str(e)}"
|
||||
)
|
||||
|
||||
managementInterface = interfaceDbComponentObjects.getInterface(currentUser)
|
||||
managementInterface = interfaceDbManagement.getInterface(currentUser)
|
||||
result = managementInterface.getAllSubscriptions(pagination=paginationParams)
|
||||
|
||||
if paginationParams:
|
||||
|
|
@ -85,7 +85,7 @@ async def createSubscription(
|
|||
currentUser: User = Depends(getCurrentUser)
|
||||
) -> MessagingSubscription:
|
||||
"""Create a new subscription"""
|
||||
managementInterface = interfaceDbComponentObjects.getInterface(currentUser)
|
||||
managementInterface = interfaceDbManagement.getInterface(currentUser)
|
||||
|
||||
subscriptionData = subscription.model_dump(exclude={"id"})
|
||||
newSubscription = managementInterface.createSubscription(subscriptionData)
|
||||
|
|
@ -101,7 +101,7 @@ async def getSubscription(
|
|||
currentUser: User = Depends(getCurrentUser)
|
||||
) -> MessagingSubscription:
|
||||
"""Get a specific subscription"""
|
||||
managementInterface = interfaceDbComponentObjects.getInterface(currentUser)
|
||||
managementInterface = interfaceDbManagement.getInterface(currentUser)
|
||||
|
||||
subscription = managementInterface.getSubscription(subscriptionId)
|
||||
if not subscription:
|
||||
|
|
@ -122,7 +122,7 @@ async def updateSubscription(
|
|||
currentUser: User = Depends(getCurrentUser)
|
||||
) -> MessagingSubscription:
|
||||
"""Update an existing subscription"""
|
||||
managementInterface = interfaceDbComponentObjects.getInterface(currentUser)
|
||||
managementInterface = interfaceDbManagement.getInterface(currentUser)
|
||||
|
||||
existingSubscription = managementInterface.getSubscription(subscriptionId)
|
||||
if not existingSubscription:
|
||||
|
|
@ -151,7 +151,7 @@ async def deleteSubscription(
|
|||
currentUser: User = Depends(getCurrentUser)
|
||||
) -> Dict[str, Any]:
|
||||
"""Delete a subscription"""
|
||||
managementInterface = interfaceDbComponentObjects.getInterface(currentUser)
|
||||
managementInterface = interfaceDbManagement.getInterface(currentUser)
|
||||
|
||||
existingSubscription = managementInterface.getSubscription(subscriptionId)
|
||||
if not existingSubscription:
|
||||
|
|
@ -192,7 +192,7 @@ async def getSubscriptionRegistrations(
|
|||
detail=f"Invalid pagination parameter: {str(e)}"
|
||||
)
|
||||
|
||||
managementInterface = interfaceDbComponentObjects.getInterface(currentUser)
|
||||
managementInterface = interfaceDbManagement.getInterface(currentUser)
|
||||
result = managementInterface.getAllRegistrations(
|
||||
subscriptionId=subscriptionId,
|
||||
pagination=paginationParams
|
||||
|
|
@ -227,7 +227,7 @@ async def subscribeUser(
|
|||
currentUser: User = Depends(getCurrentUser)
|
||||
) -> MessagingSubscriptionRegistration:
|
||||
"""Subscribe user to a subscription with a specific channel"""
|
||||
managementInterface = interfaceDbComponentObjects.getInterface(currentUser)
|
||||
managementInterface = interfaceDbManagement.getInterface(currentUser)
|
||||
|
||||
registration = managementInterface.subscribeUser(
|
||||
subscriptionId=subscriptionId,
|
||||
|
|
@ -248,7 +248,7 @@ async def unsubscribeUser(
|
|||
currentUser: User = Depends(getCurrentUser)
|
||||
) -> Dict[str, Any]:
|
||||
"""Unsubscribe user from a subscription for a specific channel"""
|
||||
managementInterface = interfaceDbComponentObjects.getInterface(currentUser)
|
||||
managementInterface = interfaceDbManagement.getInterface(currentUser)
|
||||
|
||||
success = managementInterface.unsubscribeUser(
|
||||
subscriptionId=subscriptionId,
|
||||
|
|
@ -284,7 +284,7 @@ async def getMyRegistrations(
|
|||
detail=f"Invalid pagination parameter: {str(e)}"
|
||||
)
|
||||
|
||||
managementInterface = interfaceDbComponentObjects.getInterface(currentUser)
|
||||
managementInterface = interfaceDbManagement.getInterface(currentUser)
|
||||
result = managementInterface.getAllRegistrations(
|
||||
userId=currentUser.id,
|
||||
pagination=paginationParams
|
||||
|
|
@ -318,7 +318,7 @@ async def updateRegistration(
|
|||
currentUser: User = Depends(getCurrentUser)
|
||||
) -> MessagingSubscriptionRegistration:
|
||||
"""Update a registration"""
|
||||
managementInterface = interfaceDbComponentObjects.getInterface(currentUser)
|
||||
managementInterface = interfaceDbManagement.getInterface(currentUser)
|
||||
|
||||
existingRegistration = managementInterface.getRegistration(registrationId)
|
||||
if not existingRegistration:
|
||||
|
|
@ -347,7 +347,7 @@ async def deleteRegistration(
|
|||
currentUser: User = Depends(getCurrentUser)
|
||||
) -> Dict[str, Any]:
|
||||
"""Delete a registration"""
|
||||
managementInterface = interfaceDbComponentObjects.getInterface(currentUser)
|
||||
managementInterface = interfaceDbManagement.getInterface(currentUser)
|
||||
|
||||
existingRegistration = managementInterface.getRegistration(registrationId)
|
||||
if not existingRegistration:
|
||||
|
|
@ -417,7 +417,7 @@ def _hasTriggerPermission(context: RequestContext) -> bool:
|
|||
return False
|
||||
|
||||
try:
|
||||
from modules.interfaces.interfaceDbAppObjects import getRootInterface
|
||||
from modules.interfaces.interfaceDbApp import getRootInterface
|
||||
rootInterface = getRootInterface()
|
||||
|
||||
for roleId in context.roleIds:
|
||||
|
|
@ -458,7 +458,7 @@ async def getDeliveries(
|
|||
detail=f"Invalid pagination parameter: {str(e)}"
|
||||
)
|
||||
|
||||
managementInterface = interfaceDbComponentObjects.getInterface(currentUser)
|
||||
managementInterface = interfaceDbManagement.getInterface(currentUser)
|
||||
result = managementInterface.getDeliveries(
|
||||
subscriptionId=subscriptionId,
|
||||
userId=currentUser.id, # Users can only see their own deliveries
|
||||
|
|
@ -492,7 +492,7 @@ async def getDelivery(
|
|||
currentUser: User = Depends(getCurrentUser)
|
||||
) -> MessagingDelivery:
|
||||
"""Get a specific delivery"""
|
||||
managementInterface = interfaceDbComponentObjects.getInterface(currentUser)
|
||||
managementInterface = interfaceDbManagement.getInterface(currentUser)
|
||||
|
||||
delivery = managementInterface.getDelivery(deliveryId)
|
||||
if not delivery:
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import logging
|
|||
|
||||
from modules.auth import getCurrentUser, limiter, requireSysAdmin
|
||||
from modules.connectors.connectorDbPostgre import DatabaseConnector
|
||||
from modules.interfaces.interfaceDbAppObjects import getRootInterface
|
||||
from modules.interfaces.interfaceDbApp import getRootInterface
|
||||
from modules.datamodels.datamodelUam import User, UserInDB, AuthAuthority
|
||||
from modules.datamodels.datamodelSecurity import Token
|
||||
from modules.shared.configuration import APP_CONFIG
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ from requests_oauthlib import OAuth2Session
|
|||
import httpx
|
||||
|
||||
from modules.shared.configuration import APP_CONFIG
|
||||
from modules.interfaces.interfaceDbAppObjects import getInterface, getRootInterface
|
||||
from modules.interfaces.interfaceDbApp import getInterface, getRootInterface
|
||||
from modules.datamodels.datamodelUam import AuthAuthority, User, ConnectionStatus, UserConnection
|
||||
from modules.auth import getCurrentUser, limiter
|
||||
from modules.auth import createAccessToken, setAccessTokenCookie, createRefreshToken, setRefreshTokenCookie
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ from jose import jwt
|
|||
# Import auth modules
|
||||
from modules.auth import getCurrentUser, limiter, SECRET_KEY, ALGORITHM
|
||||
from modules.auth import createAccessToken, createRefreshToken, setAccessTokenCookie, setRefreshTokenCookie, clearAccessTokenCookie, clearRefreshTokenCookie
|
||||
from modules.interfaces.interfaceDbAppObjects import getInterface, getRootInterface
|
||||
from modules.interfaces.interfaceDbApp import getInterface, getRootInterface
|
||||
from modules.datamodels.datamodelUam import User, UserInDB, AuthAuthority
|
||||
from modules.datamodels.datamodelSecurity import Token
|
||||
from modules.shared.configuration import APP_CONFIG
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import msal
|
|||
import httpx
|
||||
|
||||
from modules.shared.configuration import APP_CONFIG
|
||||
from modules.interfaces.interfaceDbAppObjects import getInterface, getRootInterface
|
||||
from modules.interfaces.interfaceDbApp import getInterface, getRootInterface
|
||||
from modules.datamodels.datamodelUam import AuthAuthority, User, ConnectionStatus, UserConnection
|
||||
from modules.datamodels.datamodelSecurity import Token
|
||||
from modules.auth import getCurrentUser, limiter
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ from fastapi import APIRouter, HTTPException, Depends, Path, Query, Request, sta
|
|||
|
||||
from modules.auth import limiter, getCurrentUser
|
||||
from modules.datamodels.datamodelUam import User, UserConnection
|
||||
from modules.interfaces.interfaceDbAppObjects import getInterface
|
||||
from modules.interfaces.interfaceDbApp import getInterface
|
||||
from modules.services import getInterface as getServices
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
|
|||
|
|
@ -49,13 +49,13 @@ class Services:
|
|||
|
||||
# Initialize interfaces with explicit mandateId
|
||||
|
||||
from modules.interfaces.interfaceDbChatbot import getInterface as getChatInterface
|
||||
from modules.interfaces.interfaceDbChat import getInterface as getChatInterface
|
||||
self.interfaceDbChat = getChatInterface(user, mandateId=mandateId)
|
||||
|
||||
from modules.interfaces.interfaceDbAppObjects import getInterface as getAppInterface
|
||||
from modules.interfaces.interfaceDbApp import getInterface as getAppInterface
|
||||
self.interfaceDbApp = getAppInterface(user, mandateId=mandateId)
|
||||
|
||||
from modules.interfaces.interfaceDbComponentObjects import getInterface as getComponentInterface
|
||||
from modules.interfaces.interfaceDbManagement import getInterface as getComponentInterface
|
||||
self.interfaceDbComponent = getComponentInterface(user, mandateId=mandateId)
|
||||
|
||||
from modules.interfaces.interfaceDbTrustee import getInterface as getTrusteeInterface
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class ExtractionService:
|
|||
results: List[ContentExtracted] = []
|
||||
|
||||
# Lazy import to avoid circular deps and heavy init at module import
|
||||
from modules.interfaces.interfaceDbComponentObjects import getInterface
|
||||
from modules.interfaces.interfaceDbManagement import getInterface
|
||||
dbInterface = getInterface()
|
||||
|
||||
totalDocs = len(documents)
|
||||
|
|
|
|||
|
|
@ -157,11 +157,11 @@ class UtilsService:
|
|||
|
||||
def storeDebugMessageAndDocuments(self, message, currentUser):
|
||||
"""
|
||||
Wrapper to store debug messages and documents via interfaceDbChatbot.
|
||||
Mirrors storeDebugMessageAndDocuments() in modules.interfaces.interfaceDbChatbot.
|
||||
Wrapper to store debug messages and documents via interfaceDbChat.
|
||||
Mirrors storeDebugMessageAndDocuments() in modules.interfaces.interfaceDbChat.
|
||||
"""
|
||||
try:
|
||||
from modules.interfaces.interfaceDbChatbot import storeDebugMessageAndDocuments as _storeDebugMessageAndDocuments
|
||||
from modules.interfaces.interfaceDbChat import storeDebugMessageAndDocuments as _storeDebugMessageAndDocuments
|
||||
_storeDebugMessageAndDocuments(message, currentUser)
|
||||
except Exception:
|
||||
# Silent fail to never break main flow
|
||||
|
|
|
|||
|
|
@ -452,10 +452,10 @@ def extractLatestRefinementFeedback(context: Any) -> str:
|
|||
# First check for ERROR level logs in workflow
|
||||
if hasattr(context, 'workflow') and context.workflow:
|
||||
try:
|
||||
import modules.interfaces.interfaceDbChatbot as interfaceDbChatbot
|
||||
from modules.interfaces.interfaceDbAppObjects import getRootInterface
|
||||
import modules.interfaces.interfaceDbChat as interfaceDbChat
|
||||
from modules.interfaces.interfaceDbApp import getRootInterface
|
||||
rootInterface = getRootInterface()
|
||||
interfaceDbChat = interfaceDbChatbot.getInterface(rootInterface.currentUser)
|
||||
interfaceDbChat = interfaceDbChat.getInterface(rootInterface.currentUser)
|
||||
|
||||
# Get workflow logs
|
||||
chatData = interfaceDbChat.getUnifiedChatData(context.workflow.id, None)
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class MethodAiOperationsTester:
|
|||
|
||||
def __init__(self):
|
||||
# Use root user for testing (has full access to everything)
|
||||
from modules.interfaces.interfaceDbAppObjects import getRootInterface
|
||||
from modules.interfaces.interfaceDbApp import getRootInterface
|
||||
rootInterface = getRootInterface()
|
||||
self.testUser = rootInterface.currentUser
|
||||
|
||||
|
|
@ -94,8 +94,8 @@ class MethodAiOperationsTester:
|
|||
logging.getLogger().setLevel(logging.DEBUG)
|
||||
|
||||
# Import and initialize services - use the same approach as routeChatPlayground
|
||||
import modules.interfaces.interfaceDbChatbot as interfaceDbChatbot
|
||||
interfaceDbChat = interfaceDbChatbot.getInterface(self.testUser)
|
||||
import modules.interfaces.interfaceDbChat as interfaceDbChat
|
||||
interfaceDbChat = interfaceDbChat.getInterface(self.testUser)
|
||||
|
||||
# Import and initialize services
|
||||
from modules.services import getInterface as getServices
|
||||
|
|
@ -201,8 +201,8 @@ class MethodAiOperationsTester:
|
|||
|
||||
# Save message to database
|
||||
if self.services.workflow:
|
||||
import modules.interfaces.interfaceDbChatbot as interfaceDbChatbot
|
||||
interfaceDbChat = interfaceDbChatbot.getInterface(self.testUser)
|
||||
import modules.interfaces.interfaceDbChat as interfaceDbChat
|
||||
interfaceDbChat = interfaceDbChat.getInterface(self.testUser)
|
||||
messageDict = testMessage.model_dump()
|
||||
interfaceDbChat.createMessage(messageDict)
|
||||
|
||||
|
|
@ -283,8 +283,8 @@ class MethodAiOperationsTester:
|
|||
maxSteps=5
|
||||
)
|
||||
# Save workflow to database
|
||||
import modules.interfaces.interfaceDbChatbot as interfaceDbChatbot
|
||||
interfaceDbChat = interfaceDbChatbot.getInterface(self.testUser)
|
||||
import modules.interfaces.interfaceDbChat as interfaceDbChat
|
||||
interfaceDbChat = interfaceDbChat.getInterface(self.testUser)
|
||||
workflowDict = testWorkflow.model_dump()
|
||||
interfaceDbChat.createWorkflow(workflowDict)
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ from modules.datamodels.datamodelWorkflow import AiResponse
|
|||
class AIBehaviorTester:
|
||||
def __init__(self):
|
||||
# Use root user for testing (has full access to everything)
|
||||
from modules.interfaces.interfaceDbAppObjects import getRootInterface
|
||||
from modules.interfaces.interfaceDbApp import getRootInterface
|
||||
rootInterface = getRootInterface()
|
||||
self.testUser = rootInterface.currentUser
|
||||
|
||||
|
|
@ -45,7 +45,7 @@ class AIBehaviorTester:
|
|||
from modules.datamodels.datamodelChat import ChatWorkflow, WorkflowModeEnum
|
||||
import uuid
|
||||
import time
|
||||
import modules.interfaces.interfaceDbChatbot as interfaceDbChatbot
|
||||
import modules.interfaces.interfaceDbChat as interfaceDbChat
|
||||
|
||||
currentTimestamp = time.time()
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ class AIBehaviorTester:
|
|||
)
|
||||
|
||||
# SAVE workflow to database so it exists for access control
|
||||
interfaceDbChat = interfaceDbChatbot.getInterface(self.testUser)
|
||||
interfaceDbChat = interfaceDbChat.getInterface(self.testUser)
|
||||
workflowDict = testWorkflow.model_dump()
|
||||
interfaceDbChat.createWorkflow(workflowDict)
|
||||
|
||||
|
|
|
|||
|
|
@ -23,13 +23,13 @@ from modules.services import getInterface as getServices
|
|||
from modules.datamodels.datamodelChat import UserInputRequest, WorkflowModeEnum
|
||||
from modules.datamodels.datamodelUam import User
|
||||
from modules.features.workflow import chatStart
|
||||
import modules.interfaces.interfaceDbChatbot as interfaceDbChatbot
|
||||
import modules.interfaces.interfaceDbChat as interfaceDbChat
|
||||
|
||||
|
||||
class WorkflowWithDocumentsTester:
|
||||
def __init__(self):
|
||||
# Use root user for testing (has full access to everything)
|
||||
from modules.interfaces.interfaceDbAppObjects import getRootInterface
|
||||
from modules.interfaces.interfaceDbApp import getRootInterface
|
||||
rootInterface = getRootInterface()
|
||||
self.testUser = rootInterface.currentUser
|
||||
|
||||
|
|
@ -192,7 +192,7 @@ class WorkflowWithDocumentsTester:
|
|||
return False
|
||||
|
||||
# Get current workflow status
|
||||
interfaceDbChat = interfaceDbChatbot.getInterface(self.testUser)
|
||||
interfaceDbChat = interfaceDbChat.getInterface(self.testUser)
|
||||
currentWorkflow = interfaceDbChat.getWorkflow(self.workflow.id)
|
||||
|
||||
if not currentWorkflow:
|
||||
|
|
@ -225,7 +225,7 @@ class WorkflowWithDocumentsTester:
|
|||
if not self.workflow:
|
||||
return {"error": "No workflow to analyze"}
|
||||
|
||||
interfaceDbChat = interfaceDbChatbot.getInterface(self.testUser)
|
||||
interfaceDbChat = interfaceDbChat.getInterface(self.testUser)
|
||||
workflow = interfaceDbChat.getWorkflow(self.workflow.id)
|
||||
|
||||
if not workflow:
|
||||
|
|
|
|||
|
|
@ -25,13 +25,13 @@ from modules.services import getInterface as getServices
|
|||
from modules.datamodels.datamodelChat import UserInputRequest, WorkflowModeEnum
|
||||
from modules.datamodels.datamodelUam import User
|
||||
from modules.features.workflow import chatStart
|
||||
import modules.interfaces.interfaceDbChatbot as interfaceDbChatbot
|
||||
import modules.interfaces.interfaceDbChat as interfaceDbChat
|
||||
|
||||
|
||||
class WorkflowPromptVariationsTester:
|
||||
def __init__(self):
|
||||
# Use root user for testing (has full access to everything)
|
||||
from modules.interfaces.interfaceDbAppObjects import getRootInterface
|
||||
from modules.interfaces.interfaceDbApp import getRootInterface
|
||||
rootInterface = getRootInterface()
|
||||
self.testUser = rootInterface.currentUser
|
||||
|
||||
|
|
@ -115,7 +115,7 @@ class WorkflowPromptVariationsTester:
|
|||
return False
|
||||
|
||||
# Get current workflow status
|
||||
interfaceDbChat = interfaceDbChatbot.getInterface(self.testUser)
|
||||
interfaceDbChat = interfaceDbChat.getInterface(self.testUser)
|
||||
currentWorkflow = interfaceDbChat.getWorkflow(workflow.id)
|
||||
|
||||
if not currentWorkflow:
|
||||
|
|
@ -140,7 +140,7 @@ class WorkflowPromptVariationsTester:
|
|||
|
||||
def _analyzeWorkflowResults(self, workflow: Any) -> Dict[str, Any]:
|
||||
"""Analyze workflow results and extract information."""
|
||||
interfaceDbChat = interfaceDbChatbot.getInterface(self.testUser)
|
||||
interfaceDbChat = interfaceDbChat.getInterface(self.testUser)
|
||||
workflow = interfaceDbChat.getWorkflow(workflow.id)
|
||||
|
||||
if not workflow:
|
||||
|
|
|
|||
|
|
@ -24,13 +24,13 @@ from modules.services import getInterface as getServices
|
|||
from modules.datamodels.datamodelChat import UserInputRequest, WorkflowModeEnum
|
||||
from modules.datamodels.datamodelUam import User
|
||||
from modules.features.workflow import chatStart
|
||||
import modules.interfaces.interfaceDbChatbot as interfaceDbChatbot
|
||||
import modules.interfaces.interfaceDbChat as interfaceDbChat
|
||||
|
||||
|
||||
class DocumentGenerationFormatsTester:
|
||||
def __init__(self):
|
||||
# Use root user for testing (has full access to everything)
|
||||
from modules.interfaces.interfaceDbAppObjects import getRootInterface
|
||||
from modules.interfaces.interfaceDbApp import getRootInterface
|
||||
rootInterface = getRootInterface()
|
||||
self.testUser = rootInterface.currentUser
|
||||
|
||||
|
|
@ -251,7 +251,7 @@ class DocumentGenerationFormatsTester:
|
|||
startTime = time.time()
|
||||
lastStatus = None
|
||||
|
||||
interfaceDbChat = interfaceDbChatbot.getInterface(self.testUser)
|
||||
interfaceDbChat = interfaceDbChat.getInterface(self.testUser)
|
||||
|
||||
if timeout is None:
|
||||
print("Waiting indefinitely (no timeout)")
|
||||
|
|
@ -296,7 +296,7 @@ class DocumentGenerationFormatsTester:
|
|||
if not self.workflow:
|
||||
return {"error": "No workflow to analyze"}
|
||||
|
||||
interfaceDbChat = interfaceDbChatbot.getInterface(self.testUser)
|
||||
interfaceDbChat = interfaceDbChat.getInterface(self.testUser)
|
||||
workflow = interfaceDbChat.getWorkflow(self.workflow.id)
|
||||
|
||||
if not workflow:
|
||||
|
|
|
|||
|
|
@ -24,13 +24,13 @@ from modules.services import getInterface as getServices
|
|||
from modules.datamodels.datamodelChat import UserInputRequest, WorkflowModeEnum
|
||||
from modules.datamodels.datamodelUam import User
|
||||
from modules.features.workflow import chatStart
|
||||
import modules.interfaces.interfaceDbChatbot as interfaceDbChatbot
|
||||
import modules.interfaces.interfaceDbChat as interfaceDbChat
|
||||
|
||||
|
||||
class DocumentGenerationFormatsTester10:
|
||||
def __init__(self):
|
||||
# Use root user for testing (has full access to everything)
|
||||
from modules.interfaces.interfaceDbAppObjects import getRootInterface
|
||||
from modules.interfaces.interfaceDbApp import getRootInterface
|
||||
rootInterface = getRootInterface()
|
||||
self.testUser = rootInterface.currentUser
|
||||
|
||||
|
|
@ -248,7 +248,7 @@ class DocumentGenerationFormatsTester10:
|
|||
startTime = time.time()
|
||||
lastStatus = None
|
||||
|
||||
interfaceDbChat = interfaceDbChatbot.getInterface(self.testUser)
|
||||
interfaceDbChat = interfaceDbChat.getInterface(self.testUser)
|
||||
|
||||
if timeout is None:
|
||||
print("Waiting indefinitely (no timeout)")
|
||||
|
|
@ -293,7 +293,7 @@ class DocumentGenerationFormatsTester10:
|
|||
if not self.workflow:
|
||||
return {"error": "No workflow to analyze"}
|
||||
|
||||
interfaceDbChat = interfaceDbChatbot.getInterface(self.testUser)
|
||||
interfaceDbChat = interfaceDbChat.getInterface(self.testUser)
|
||||
workflow = interfaceDbChat.getWorkflow(self.workflow.id)
|
||||
|
||||
if not workflow:
|
||||
|
|
|
|||
|
|
@ -26,13 +26,13 @@ from modules.services import getInterface as getServices
|
|||
from modules.datamodels.datamodelChat import UserInputRequest, WorkflowModeEnum
|
||||
from modules.datamodels.datamodelUam import User
|
||||
from modules.features.workflow import chatStart
|
||||
import modules.interfaces.interfaceDbChatbot as interfaceDbChatbot
|
||||
import modules.interfaces.interfaceDbChat as interfaceDbChat
|
||||
|
||||
|
||||
class CodeGenerationFormatsTester11:
|
||||
def __init__(self):
|
||||
# Use root user for testing (has full access to everything)
|
||||
from modules.interfaces.interfaceDbAppObjects import getRootInterface
|
||||
from modules.interfaces.interfaceDbApp import getRootInterface
|
||||
rootInterface = getRootInterface()
|
||||
self.testUser = rootInterface.currentUser
|
||||
|
||||
|
|
@ -190,7 +190,7 @@ class CodeGenerationFormatsTester11:
|
|||
startTime = time.time()
|
||||
lastStatus = None
|
||||
|
||||
interfaceDbChat = interfaceDbChatbot.getInterface(self.testUser)
|
||||
interfaceDbChat = interfaceDbChat.getInterface(self.testUser)
|
||||
|
||||
if timeout is None:
|
||||
print("Waiting indefinitely (no timeout)")
|
||||
|
|
@ -235,7 +235,7 @@ class CodeGenerationFormatsTester11:
|
|||
if not self.workflow:
|
||||
return {"error": "No workflow to analyze"}
|
||||
|
||||
interfaceDbChat = interfaceDbChatbot.getInterface(self.testUser)
|
||||
interfaceDbChat = interfaceDbChat.getInterface(self.testUser)
|
||||
workflow = interfaceDbChat.getWorkflow(self.workflow.id)
|
||||
|
||||
if not workflow:
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import pytest
|
|||
import secrets
|
||||
from fastapi.testclient import TestClient
|
||||
from modules.datamodels.datamodelUam import User
|
||||
from modules.interfaces.interfaceDbAppObjects import getRootInterface
|
||||
from modules.interfaces.interfaceDbApp import getRootInterface
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
|
|
|||
Loading…
Reference in a new issue