decomposer: generate deliverable files for Define the normalized ingestion contract and pluggable source-connector interface for SCM, CMS, and other content sources.; Implement a GitHub SCM connector that conforms to the normalized ingestion contract and supports scoped full and incremental ingestion of Markdown, plain-text, and source files with webhook and revision metadata.; Implement a SharePoint CMS connector that conforms to the normalized ingestion contract and supports scoped full and incremental ingestion of PDF, DOCX, and HTML files with webhook and revision metadata.; Implement ingestion orchestration and triggers; Normalize, govern, and publish ingested content to the shared knowledge store.; Add deployment/configuration, tests, and documentation for the ingestion agent.; Validate end-to-end ingestion and downstream content availability.
Some checks failed
ci / test (push) Failing after 8s
Some checks failed
ci / test (push) Failing after 8s
This commit is contained in:
17
kab_ingestion/triggers.py
Normal file
17
kab_ingestion/triggers.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from dataclasses import dataclass
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class Trigger:
|
||||
connector: str
|
||||
tenant_id: str
|
||||
mode: str = 'incremental'
|
||||
idempotency_key: str = ''
|
||||
source: str = 'on_demand'
|
||||
|
||||
class TriggerValidator:
|
||||
@staticmethod
|
||||
def validate(trigger):
|
||||
if trigger.mode not in ('full', 'incremental'): raise ValueError('invalid mode')
|
||||
if trigger.source not in ('on_demand', 'schedule', 'webhook'): raise ValueError('invalid source')
|
||||
if not trigger.tenant_id or not trigger.connector: raise ValueError('tenant and connector required')
|
||||
return trigger
|
||||
Reference in New Issue
Block a user