datakeel 0.27.0__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.
- datakeel/THIRD_PARTY_NOTICES.md +223 -0
- datakeel/__init__.py +8 -0
- datakeel/_contracts/agents/catalog-analyst.yaml +11 -0
- datakeel/_contracts/agents/evidence-reviewer.yaml +9 -0
- datakeel/_contracts/agents/kg-standard-analyst.yaml +12 -0
- datakeel/_contracts/agents/metric-manager.yaml +10 -0
- datakeel/_contracts/agents/production-ops.yaml +18 -0
- datakeel/_contracts/agents/training-auditor.yaml +12 -0
- datakeel/_contracts/annotation_qa/normal-single.json +27 -0
- datakeel/_contracts/ask/enterprise-reviews.yaml +20 -0
- datakeel/_contracts/ask/knowledge.yaml +311 -0
- datakeel/_contracts/ask/questions.yaml +90 -0
- datakeel/_contracts/assets/ranking.yaml +10 -0
- datakeel/_contracts/delivery-manifest.schema.json +181 -0
- datakeel/_contracts/evidence/lexicon.yaml +22 -0
- datakeel/_contracts/evidence/near_duplicate.yaml +12 -0
- datakeel/_contracts/evidence/questions.yaml +139 -0
- datakeel/_contracts/golden/01-read-only.yaml +20 -0
- datakeel/_contracts/golden/02-filtered-search.yaml +22 -0
- datakeel/_contracts/golden/03-reversible.yaml +44 -0
- datakeel/_contracts/golden/04-irreversible-approval.yaml +45 -0
- datakeel/_contracts/golden/05-rejected.yaml +42 -0
- datakeel/_contracts/golden/06-frozen-approval.yaml +45 -0
- datakeel/_contracts/golden/07-repeated-loop.yaml +37 -0
- datakeel/_contracts/golden/08-budget.yaml +22 -0
- datakeel/_contracts/golden/09-cross-turn-reference.yaml +49 -0
- datakeel/_contracts/golden/10-unknown-tool.yaml +21 -0
- datakeel/_contracts/golden/11-dry-run.yaml +39 -0
- datakeel/_contracts/golden/12-long-conversation.yaml +124 -0
- datakeel/_contracts/golden/13-evidence-query.yaml +105 -0
- datakeel/_contracts/golden/14-evidence-unknown.yaml +70 -0
- datakeel/_contracts/golden/15-evidence-version.yaml +134 -0
- datakeel/_contracts/golden/16-evidence-approval.yaml +134 -0
- datakeel/_contracts/golden/17-ask-answer.yaml +149 -0
- datakeel/_contracts/golden/18-ask-clarification.yaml +75 -0
- datakeel/_contracts/golden/19-ask-unanswerable.yaml +78 -0
- datakeel/_contracts/golden/20-ask-updated-metric.yaml +328 -0
- datakeel/_contracts/golden/21-delegation-catalog.yaml +48 -0
- datakeel/_contracts/golden/22-delegation-scope.yaml +51 -0
- datakeel/_contracts/golden/23-delegation-depth.yaml +75 -0
- datakeel/_contracts/golden/24-delegation-concurrency.yaml +65 -0
- datakeel/_contracts/golden/25-canary-text.yaml +18 -0
- datakeel/_contracts/golden/26-canary-arguments.yaml +25 -0
- datakeel/_contracts/golden/27-injection-approval.yaml +49 -0
- datakeel/_contracts/golden/28-memory-write.yaml +42 -0
- datakeel/_contracts/golden/29-memory-cross-session.yaml +38 -0
- datakeel/_contracts/golden/30-memory-delete.yaml +39 -0
- datakeel/_contracts/golden/31-memory-minimum-overlap.yaml +38 -0
- datakeel/_contracts/golden/32-canary-prefix.yaml +18 -0
- datakeel/_contracts/golden/33-kg-query.yaml +77 -0
- datakeel/_contracts/golden/34-kg-explain-review.yaml +90 -0
- datakeel/_contracts/golden/35-kg-replay-action.yaml +32 -0
- datakeel/_contracts/golden/36-kg-external-approval.yaml +35 -0
- datakeel/_contracts/golden/37-ask-knowledge-owner.yaml +107 -0
- datakeel/_contracts/golden/38-ask-knowledge-upstream.yaml +81 -0
- datakeel/_contracts/golden/39-ask-knowledge-clarification.yaml +64 -0
- datakeel/_contracts/golden/40-ask-knowledge-reviewed.yaml +65 -0
- datakeel/_contracts/golden/41-image-kg-explain.yaml +81 -0
- datakeel/_contracts/golden/41-standard-coverage.yaml +52 -0
- datakeel/_contracts/golden/42-image-kg-replay.yaml +27 -0
- datakeel/_contracts/golden/42-standard-usage.yaml +44 -0
- datakeel/_contracts/golden/43-image-kg-external.yaml +27 -0
- datakeel/_contracts/golden/44-annotation-quality.yaml +81 -0
- datakeel/_contracts/golden/44-asset-access.yaml +35 -0
- datakeel/_contracts/golden/44-quality-failures.yaml +54 -0
- datakeel/_contracts/golden/45-quality-table-history.yaml +50 -0
- datakeel/_contracts/golden/46-training-distribution.yaml +53 -0
- datakeel/_contracts/golden/46-training-quality.yaml +43 -0
- datakeel/_contracts/golden/47-training-leakage.yaml +51 -0
- datakeel/_contracts/golden/48-one-sentence-clarify.yaml +24 -0
- datakeel/_contracts/golden/48-one-sentence-multistep.yaml +23 -0
- datakeel/_contracts/golden/48-one-sentence-overreach.yaml +19 -0
- datakeel/_contracts/golden/49-one-sentence-permission-first.yaml +19 -0
- datakeel/_contracts/golden/49-one-sentence-unknown-param.yaml +21 -0
- datakeel/_contracts/golden/49-one-sentence-unsupported.yaml +18 -0
- datakeel/_contracts/kg/demo/image-truncated.png +0 -0
- datakeel/_contracts/kg/demo/image-truncated.yaml +18 -0
- datakeel/_contracts/kg/demo/long-documents.yaml +38 -0
- datakeel/_contracts/kg/eval/cases.yaml +1243 -0
- datakeel/_contracts/kg/eval/examples.yaml +80 -0
- datakeel/_contracts/kg/eval/image/SOURCES.md +5 -0
- datakeel/_contracts/kg/eval/image/cases.yaml +6552 -0
- datakeel/_contracts/kg/eval/image/images/b01.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b02.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b03.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b04.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b05.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b06.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b07.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b08.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b09.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b10.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b11.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b12.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en01_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en01_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en02_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en02_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en03_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en03_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en04_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en04_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en05_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en05_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en06_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en06_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en07_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en07_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en08_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en08_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en09_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en09_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en10_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en10_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en11_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en11_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en12_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en12_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh01_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh01_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh02_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh02_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh03_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh03_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh04_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh04_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh05_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh05_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh06_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh06_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh07_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh07_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh08_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh08_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh09_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh09_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh10_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh10_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh11_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh11_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh12_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh12_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image-auto/SOURCES.md +17 -0
- datakeel/_contracts/kg/eval/image-auto/cases.yaml +183 -0
- datakeel/_contracts/kg/eval/image-auto/images/connector.png +0 -0
- datakeel/_contracts/kg/eval/image-auto/images/grey.png +0 -0
- datakeel/_contracts/kg/eval/image-auto/images/strike.png +0 -0
- datakeel/_contracts/kg/eval/image-auto/images/text-lineage.png +0 -0
- datakeel/_contracts/kg/eval/image-auto/images/text-location.png +0 -0
- datakeel/_contracts/kg/eval/image-auto/images/text-staff.png +0 -0
- datakeel/_contracts/kg/eval/truncated.yaml +2 -0
- datakeel/_contracts/kg/profiles/cloud.yaml +16 -0
- datakeel/_contracts/kg/profiles/fake-long.yaml +14 -0
- datakeel/_contracts/kg/profiles/fake.yaml +14 -0
- datakeel/_contracts/kg/profiles/ollama.yaml +19 -0
- datakeel/_contracts/kg/profiles/replay-demo.yaml +14 -0
- datakeel/_contracts/kg/profiles/replay-enterprise.yaml +14 -0
- datakeel/_contracts/kg/profiles/replay-flash.yaml +14 -0
- datakeel/_contracts/kg/profiles/replay-image-auto.yaml +10 -0
- datakeel/_contracts/kg/profiles/replay-image-cloud-flash.yaml +9 -0
- datakeel/_contracts/kg/profiles/replay-image-flash.yaml +9 -0
- datakeel/_contracts/kg/profiles/replay-image-qwen.yaml +9 -0
- datakeel/_contracts/kg/profiles/replay-image-rapidocr-qwen.yaml +9 -0
- datakeel/_contracts/kg/prompts/image-transcription-v1.txt +9 -0
- datakeel/_contracts/kg/recordings/auto-extraction.yaml +215 -0
- datakeel/_contracts/kg/recordings/auto-transcription.yaml +248 -0
- datakeel/_contracts/kg/recordings/deepseek-flash.yaml +2607 -0
- datakeel/_contracts/kg/recordings/fake-long.yaml +345 -0
- datakeel/_contracts/kg/recordings/image-cloud-flash.yaml +3784 -0
- datakeel/_contracts/kg/recordings/image-flash.yaml +3796 -0
- datakeel/_contracts/kg/recordings/image-qwen.yaml +1334 -0
- datakeel/_contracts/kg/recordings/image-rapidocr-qwen.yaml +4528 -0
- datakeel/_contracts/kg/recordings/qwen-flash-image.yaml +3711 -0
- datakeel/_contracts/kg/recordings/qwen-image.yaml +3754 -0
- datakeel/_contracts/kg/recordings/qwen3.5.yaml +2463 -0
- datakeel/_contracts/kg/recordings/rapidocr-image.yaml +4092 -0
- datakeel/_contracts/kg/schema.yaml +155 -0
- datakeel/_contracts/kg/transcription-profiles/bailian-qwen35-flash-auto.yaml +21 -0
- datakeel/_contracts/kg/transcription-profiles/bailian-qwen35-flash-coordinates.yaml +16 -0
- datakeel/_contracts/kg/transcription-profiles/bailian-qwen35-flash.yaml +16 -0
- datakeel/_contracts/kg/transcription-profiles/fake.yaml +7 -0
- datakeel/_contracts/kg/transcription-profiles/ollama-vision-local.yaml +16 -0
- datakeel/_contracts/kg/transcription-profiles/rapidocr-local.yaml +12 -0
- datakeel/_contracts/kg/transcription-profiles/replay-image-auto-ocr.yaml +7 -0
- datakeel/_contracts/kg/transcription-profiles/replay-image-auto-vlm.yaml +7 -0
- datakeel/_contracts/kg/transcription-profiles/replay-image-auto.yaml +8 -0
- datakeel/_contracts/kg/transcription-profiles/replay-image-demo-failure.yaml +14 -0
- datakeel/_contracts/kg/transcription-profiles/replay-image-demo.yaml +8 -0
- datakeel/_contracts/kg/transcription-profiles/replay-image-flash.yaml +8 -0
- datakeel/_contracts/kg/transcription-profiles/replay-image-ocr.yaml +8 -0
- datakeel/_contracts/model-prices.yaml +107 -0
- datakeel/_contracts/quality-rules/example.yaml +17 -0
- datakeel/_contracts/quality-rules/schema.json +348 -0
- datakeel/_contracts/routing/intent-cases.yaml +382 -0
- datakeel/_contracts/routing/intent-regression.yaml +168 -0
- datakeel/_contracts/routing/model-tier-cases.yaml +103 -0
- datakeel/_contracts/routing/models-tiered.example.yaml +47 -0
- datakeel/_contracts/routing/models.yaml +41 -0
- datakeel/_contracts/semantic-layer/dimensions.yaml +186 -0
- datakeel/_contracts/semantic-layer/metrics.yaml +467 -0
- datakeel/_contracts/semantic-layer/owners.yaml +22 -0
- datakeel/_contracts/semantic-layer/terms.yaml +184 -0
- datakeel/_contracts/standards/enterprise.yaml +935 -0
- datakeel/_contracts/standards/standards.schema.json +331 -0
- datakeel/_contracts/standards/synonyms.yaml +65 -0
- datakeel/_contracts/workflows/dataset-health.yaml +147 -0
- datakeel/_contracts/workflows/low-quality-cleanup.yaml +153 -0
- datakeel/_contracts/workflows/metric-change.yaml +158 -0
- datakeel/action_store/__init__.py +4 -0
- datakeel/action_store/file_handlers.py +120 -0
- datakeel/action_store/lifecycle.py +206 -0
- datakeel/action_store/validation.py +85 -0
- datakeel/actions/__init__.py +4 -0
- datakeel/actions/action_language.py +245 -0
- datakeel/actions/approvals.py +8 -0
- datakeel/actions/authorization.json +155 -0
- datakeel/actions/authorization.py +47 -0
- datakeel/actions/budget.py +104 -0
- datakeel/actions/catalog_parameters.py +63 -0
- datakeel/actions/custom_runs.py +49 -0
- datakeel/actions/data_asset_parameters.py +57 -0
- datakeel/actions/datasheet_parameters.py +59 -0
- datakeel/actions/declarations.py +141 -0
- datakeel/actions/dq_parameters.py +50 -0
- datakeel/actions/execution.py +8 -0
- datakeel/actions/execution_targets.json +67 -0
- datakeel/actions/file_declarations.json +244 -0
- datakeel/actions/file_declarations.py +58 -0
- datakeel/actions/identity_parameters.py +85 -0
- datakeel/actions/ir.py +102 -0
- datakeel/actions/kg_parameters.py +34 -0
- datakeel/actions/label_draft_parameters.py +62 -0
- datakeel/actions/llm_data_parameters.py +18 -0
- datakeel/actions/models.py +254 -0
- datakeel/actions/parameters.py +248 -0
- datakeel/actions/planning.py +8 -0
- datakeel/actions/policy.py +65 -0
- datakeel/actions/production_catalog_parameters.py +170 -0
- datakeel/actions/production_language.py +174 -0
- datakeel/actions/production_parameters.py +231 -0
- datakeel/actions/production_references.py +60 -0
- datakeel/actions/receipts.py +61 -0
- datakeel/actions/recovery.py +48 -0
- datakeel/actions/reference_assets.json +16 -0
- datakeel/actions/references.py +192 -0
- datakeel/actions/registry.py +141 -0
- datakeel/actions/release_parameters.py +43 -0
- datakeel/actions/selection_parameters.py +13 -0
- datakeel/actions/service.py +25 -0
- datakeel/actions/standard_parameters.py +48 -0
- datakeel/actions/worker.py +8 -0
- datakeel/agent/__init__.py +4 -0
- datakeel/agent/confirm.py +34 -0
- datakeel/agent/context.py +92 -0
- datakeel/agent/demo.py +173 -0
- datakeel/agent/dispatch.py +100 -0
- datakeel/agent/evidence_demo.py +152 -0
- datakeel/agent/factory.py +41 -0
- datakeel/agent/guards.py +97 -0
- datakeel/agent/memory.py +142 -0
- datakeel/agent/metering.py +151 -0
- datakeel/agent/models.py +59 -0
- datakeel/agent/providers.py +34 -0
- datakeel/agent/recovery.py +38 -0
- datakeel/agent/service.py +185 -0
- datakeel/agent/tools.py +196 -0
- datakeel/annotation_qa/__init__.py +61 -0
- datakeel/annotation_qa/categorical.py +99 -0
- datakeel/annotation_qa/classification.py +80 -0
- datakeel/annotation_qa/confidence_tiers.py +142 -0
- datakeel/annotation_qa/consensus.py +291 -0
- datakeel/annotation_qa/findings.py +215 -0
- datakeel/annotation_qa/geometry.py +187 -0
- datakeel/annotation_qa/grouping.py +32 -0
- datakeel/annotation_qa/labels.py +144 -0
- datakeel/annotation_qa/outliers.py +192 -0
- datakeel/annotation_qa/polygon_area.py +92 -0
- datakeel/annotation_qa/prelabel_crosscheck.py +64 -0
- datakeel/annotation_qa/prelabel_match.py +166 -0
- datakeel/annotation_qa/prelabel_metrics.py +72 -0
- datakeel/annotation_qa/review_messages.py +139 -0
- datakeel/annotation_qa/review_rules.py +257 -0
- datakeel/annotation_qa/rework.py +154 -0
- datakeel/annotation_qa/risk_scoring.py +109 -0
- datakeel/annotation_qa/service.py +64 -0
- datakeel/api/__init__.py +4 -0
- datakeel/api/app.py +112 -0
- datakeel/api/dependencies.py +18 -0
- datakeel/api/errors.py +43 -0
- datakeel/api/identity_access.py +128 -0
- datakeel/api/routes/__init__.py +4 -0
- datakeel/api/routes/actions.py +120 -0
- datakeel/api/routes/agent.py +396 -0
- datakeel/api/routes/annotation_qa.py +94 -0
- datakeel/api/routes/ask.py +82 -0
- datakeel/api/routes/catalog.py +92 -0
- datakeel/api/routes/custom_operators.py +82 -0
- datakeel/api/routes/data_assets.py +136 -0
- datakeel/api/routes/datasets.py +122 -0
- datakeel/api/routes/datasheets.py +101 -0
- datakeel/api/routes/delivery.py +50 -0
- datakeel/api/routes/evidence.py +68 -0
- datakeel/api/routes/governance.py +93 -0
- datakeel/api/routes/harness.py +42 -0
- datakeel/api/routes/intents.py +47 -0
- datakeel/api/routes/kg.py +191 -0
- datakeel/api/routes/lineage.py +70 -0
- datakeel/api/routes/llm_data.py +94 -0
- datakeel/api/routes/memories.py +56 -0
- datakeel/api/routes/metadata_imports.py +46 -0
- datakeel/api/routes/ontology.py +42 -0
- datakeel/api/routes/openlineage.py +46 -0
- datakeel/api/routes/production.py +170 -0
- datakeel/api/routes/quality_rules.py +85 -0
- datakeel/api/routes/releases.py +62 -0
- datakeel/api/routes/search.py +20 -0
- datakeel/api/routes/standards.py +102 -0
- datakeel/api/routes/standards_reporting.py +26 -0
- datakeel/api/routes/system.py +32 -0
- datakeel/api/routes/tasks.py +71 -0
- datakeel/api/routes/training.py +126 -0
- datakeel/api/routes/uploads.py +61 -0
- datakeel/api/routes/workflow_runs.py +113 -0
- datakeel/api/workflow_stream.py +62 -0
- datakeel/ask/__init__.py +4 -0
- datakeel/ask/access.py +42 -0
- datakeel/ask/charts.py +107 -0
- datakeel/ask/comparisons.py +113 -0
- datakeel/ask/consumption.py +278 -0
- datakeel/ask/dimension_cues.py +50 -0
- datakeel/ask/dimensions.py +237 -0
- datakeel/ask/evaluation.py +153 -0
- datakeel/ask/evaluation_checks.py +102 -0
- datakeel/ask/followup.py +335 -0
- datakeel/ask/followup_cues.py +162 -0
- datakeel/ask/followup_frames.py +60 -0
- datakeel/ask/generic.py +62 -0
- datakeel/ask/interpretation_en.py +48 -0
- datakeel/ask/knowledge_claims.py +229 -0
- datakeel/ask/knowledge_count.py +102 -0
- datakeel/ask/knowledge_focus.py +197 -0
- datakeel/ask/knowledge_frames.py +187 -0
- datakeel/ask/knowledge_intent_candidates.py +158 -0
- datakeel/ask/knowledge_names.py +59 -0
- datakeel/ask/knowledge_parser.py +259 -0
- datakeel/ask/knowledge_roles.py +352 -0
- datakeel/ask/knowledge_routing.py +227 -0
- datakeel/ask/knowledge_scope.py +161 -0
- datakeel/ask/knowledge_service.py +225 -0
- datakeel/ask/knowledge_subjects.py +255 -0
- datakeel/ask/knowledge_system.py +119 -0
- datakeel/ask/knowledge_vocabulary.py +351 -0
- datakeel/ask/matching.py +173 -0
- datakeel/ask/models.py +72 -0
- datakeel/ask/parser.py +20 -0
- datakeel/ask/profile.py +224 -0
- datakeel/ask/reasons.py +77 -0
- datakeel/ask/rerank.py +44 -0
- datakeel/ask/resolution.py +98 -0
- datakeel/ask/service.py +357 -0
- datakeel/ask/time.py +189 -0
- datakeel/ask/time_atoms.py +321 -0
- datakeel/ask/time_vocabulary.py +126 -0
- datakeel/assets/__init__.py +4 -0
- datakeel/assets/access.py +8 -0
- datakeel/assets/ranking.py +29 -0
- datakeel/assets/service.py +82 -0
- datakeel/catalog/__init__.py +4 -0
- datakeel/catalog/importers/__init__.py +4 -0
- datakeel/catalog/importers/airflow.py +306 -0
- datakeel/catalog/importers/airflow_rest.py +178 -0
- datakeel/catalog/importers/base.py +17 -0
- datakeel/catalog/importers/database.py +180 -0
- datakeel/catalog/importers/dbt.py +276 -0
- datakeel/catalog/importers/dbt_models.py +138 -0
- datakeel/catalog/importers/dbt_objects.py +283 -0
- datakeel/catalog/importers/dbt_retention.py +69 -0
- datakeel/catalog/importers/dbt_runs.py +95 -0
- datakeel/catalog/importers/dbt_semantics.py +200 -0
- datakeel/catalog/importers/helpers.py +30 -0
- datakeel/catalog/importers/models.py +23 -0
- datakeel/catalog/importers/sql.py +226 -0
- datakeel/catalog/importers/tabular.py +87 -0
- datakeel/catalog/metadata_service.py +101 -0
- datakeel/catalog/service.py +66 -0
- datakeel/cli/__init__.py +302 -0
- datakeel/cli/__main__.py +9 -0
- datakeel/cli/agent.py +285 -0
- datakeel/cli/ask.py +38 -0
- datakeel/cli/ask_evaluation.py +44 -0
- datakeel/cli/asset_demo.py +107 -0
- datakeel/cli/catalog.py +17 -0
- datakeel/cli/custom_operators.py +117 -0
- datakeel/cli/data_assets.py +125 -0
- datakeel/cli/database.py +77 -0
- datakeel/cli/delivery.py +122 -0
- datakeel/cli/demo.py +239 -0
- datakeel/cli/enterprise.py +89 -0
- datakeel/cli/evaluation.py +45 -0
- datakeel/cli/evidence.py +36 -0
- datakeel/cli/evidence_benchmark.py +69 -0
- datakeel/cli/evidence_evaluation.py +89 -0
- datakeel/cli/image_kg_demo.py +80 -0
- datakeel/cli/intents.py +57 -0
- datakeel/cli/kg_demo.py +93 -0
- datakeel/cli/kg_evaluation.py +148 -0
- datakeel/cli/kg_image_evaluation.py +176 -0
- datakeel/cli/llm_data.py +27 -0
- datakeel/cli/mcp.py +23 -0
- datakeel/cli/media_demo.py +88 -0
- datakeel/cli/memory.py +105 -0
- datakeel/cli/metadata_imports.py +80 -0
- datakeel/cli/parsers.py +15 -0
- datakeel/cli/production.py +94 -0
- datakeel/cli/production_demo.py +166 -0
- datakeel/cli/quality.py +83 -0
- datakeel/cli/release_plans.py +63 -0
- datakeel/cli/routing.py +61 -0
- datakeel/cli/standards.py +145 -0
- datakeel/cli/timeseries_demo.py +124 -0
- datakeel/cli/training.py +124 -0
- datakeel/cli/workflow.py +247 -0
- datakeel/core/__init__.py +4 -0
- datakeel/core/agent_models.py +177 -0
- datakeel/core/annotation_aql.py +77 -0
- datakeel/core/annotation_models.py +342 -0
- datakeel/core/annotation_sampling.py +156 -0
- datakeel/core/ask_chart_models.py +29 -0
- datakeel/core/ask_conversation_models.py +22 -0
- datakeel/core/ask_eval.py +109 -0
- datakeel/core/ask_frame_models.py +51 -0
- datakeel/core/ask_models.py +326 -0
- datakeel/core/canary.py +93 -0
- datakeel/core/catalog_canonical.py +67 -0
- datakeel/core/catalog_identity.py +16 -0
- datakeel/core/catalog_models.py +184 -0
- datakeel/core/catalog_projection.py +40 -0
- datakeel/core/catalog_vocabulary.py +30 -0
- datakeel/core/context_tokens.py +30 -0
- datakeel/core/custom_operators.py +84 -0
- datakeel/core/custom_requests.py +27 -0
- datakeel/core/custom_review.py +112 -0
- datakeel/core/custom_sandbox.py +78 -0
- datakeel/core/custom_schema.py +122 -0
- datakeel/core/data_asset_models.py +226 -0
- datakeel/core/datasheet_execution.py +58 -0
- datakeel/core/datasheet_models.py +133 -0
- datakeel/core/datasheet_types.py +85 -0
- datakeel/core/delivery_models.py +100 -0
- datakeel/core/dq_cron.py +98 -0
- datakeel/core/dq_models.py +208 -0
- datakeel/core/dq_monitor.py +83 -0
- datakeel/core/dq_views.py +38 -0
- datakeel/core/envelopes.py +42 -0
- datakeel/core/errors.py +58 -0
- datakeel/core/evidence_cache.py +139 -0
- datakeel/core/evidence_drafts.py +37 -0
- datakeel/core/evidence_eval.py +105 -0
- datakeel/core/evidence_execution.py +58 -0
- datakeel/core/evidence_inputs.py +43 -0
- datakeel/core/evidence_models.py +268 -0
- datakeel/core/evidence_replay.py +36 -0
- datakeel/core/file_queries.py +17 -0
- datakeel/core/harness_eval.py +162 -0
- datakeel/core/harness_models.py +149 -0
- datakeel/core/harness_pricing.py +67 -0
- datakeel/core/identity_models.py +77 -0
- datakeel/core/image_orientation.py +189 -0
- datakeel/core/intent_models.py +151 -0
- datakeel/core/json_schema.py +81 -0
- datakeel/core/keypoint_models.py +42 -0
- datakeel/core/kg_cache.py +28 -0
- datakeel/core/kg_contracts.py +181 -0
- datakeel/core/kg_costs.py +17 -0
- datakeel/core/kg_errors.py +26 -0
- datakeel/core/kg_eval_models.py +219 -0
- datakeel/core/kg_execution.py +264 -0
- datakeel/core/kg_image_auto_eval.py +36 -0
- datakeel/core/kg_image_eval.py +31 -0
- datakeel/core/kg_image_request.py +19 -0
- datakeel/core/kg_images.py +95 -0
- datakeel/core/kg_models.py +79 -0
- datakeel/core/kg_product.py +51 -0
- datakeel/core/kg_queries.py +119 -0
- datakeel/core/kg_registry.py +46 -0
- datakeel/core/knowledge_citations.py +33 -0
- datakeel/core/knowledge_eval.py +91 -0
- datakeel/core/knowledge_models.py +148 -0
- datakeel/core/knowledge_reviews.py +33 -0
- datakeel/core/label_guidelines.py +82 -0
- datakeel/core/link_matching.py +115 -0
- datakeel/core/link_models.py +74 -0
- datakeel/core/llm_data_governance.py +80 -0
- datakeel/core/llm_data_models.py +120 -0
- datakeel/core/logging.py +56 -0
- datakeel/core/media_alignment.py +42 -0
- datakeel/core/media_metadata.py +43 -0
- datakeel/core/media_models.py +139 -0
- datakeel/core/memory_models.py +95 -0
- datakeel/core/metadata_imports.py +102 -0
- datakeel/core/metadata_projection.py +100 -0
- datakeel/core/metric_history_models.py +30 -0
- datakeel/core/metric_models.py +217 -0
- datakeel/core/model_parameters.py +22 -0
- datakeel/core/models.py +113 -0
- datakeel/core/object_kinds.py +52 -0
- datakeel/core/orchestration.py +126 -0
- datakeel/core/orchestration_airflow.py +109 -0
- datakeel/core/orchestration_catalog.py +162 -0
- datakeel/core/orchestration_sources.py +72 -0
- datakeel/core/pii.py +338 -0
- datakeel/core/pii_credentials.py +201 -0
- datakeel/core/pii_patterns.py +153 -0
- datakeel/core/portable_metadata.py +92 -0
- datakeel/core/predicate_registry.py +154 -0
- datakeel/core/prelabel_models.py +273 -0
- datakeel/core/production_attributes.py +178 -0
- datakeel/core/production_catalog_models.py +286 -0
- datakeel/core/production_keypoints.py +112 -0
- datakeel/core/production_kinds.py +39 -0
- datakeel/core/production_models.py +254 -0
- datakeel/core/production_prediction_models.py +31 -0
- datakeel/core/production_reads.py +129 -0
- datakeel/core/production_segments.py +104 -0
- datakeel/core/production_team_models.py +158 -0
- datakeel/core/production_upgrade_models.py +79 -0
- datakeel/core/profile_models.py +140 -0
- datakeel/core/question_models.py +42 -0
- datakeel/core/recovery.py +27 -0
- datakeel/core/release_models.py +149 -0
- datakeel/core/routing_models.py +59 -0
- datakeel/core/schema.py +170 -0
- datakeel/core/search_models.py +43 -0
- datakeel/core/settings.py +102 -0
- datakeel/core/standard_history_models.py +50 -0
- datakeel/core/standard_models.py +280 -0
- datakeel/core/standard_reporting_models.py +59 -0
- datakeel/core/training_export_models.py +167 -0
- datakeel/core/training_models.py +159 -0
- datakeel/core/transcription_auto.py +90 -0
- datakeel/core/transcription_coordinates.py +103 -0
- datakeel/core/transcription_errors.py +26 -0
- datakeel/core/transcription_models.py +177 -0
- datakeel/core/transcription_wire.py +37 -0
- datakeel/core/uploads.py +127 -0
- datakeel/core/vector_assertion_rules.py +73 -0
- datakeel/core/vector_measurements.py +56 -0
- datakeel/core/vector_models.py +325 -0
- datakeel/core/vector_query.py +64 -0
- datakeel/core/vector_results.py +172 -0
- datakeel/core/workbench_models.py +251 -0
- datakeel/core/workflow_models.py +103 -0
- datakeel/dataset_store/__init__.py +8 -0
- datakeel/dataset_store/dataset_service.py +344 -0
- datakeel/dataset_store/datasets.py +251 -0
- datakeel/dataset_store/display_order.py +112 -0
- datakeel/dataset_store/events.py +33 -0
- datakeel/dataset_store/file_discovery.py +250 -0
- datakeel/dataset_store/file_pages.py +122 -0
- datakeel/dataset_store/file_rows.py +64 -0
- datakeel/dataset_store/file_state.py +104 -0
- datakeel/dataset_store/image_geometry.py +143 -0
- datakeel/dataset_store/import_sources.py +40 -0
- datakeel/dataset_store/lineage_service.py +259 -0
- datakeel/dataset_store/media_artifacts.py +50 -0
- datakeel/dataset_store/media_observations.py +96 -0
- datakeel/dataset_store/metadata_store.py +129 -0
- datakeel/dataset_store/object_projection.py +232 -0
- datakeel/dataset_store/object_queries.py +143 -0
- datakeel/dataset_store/openlineage_store.py +102 -0
- datakeel/dataset_store/profile_queries.py +132 -0
- datakeel/dataset_store/rows.py +77 -0
- datakeel/dataset_store/schema.py +62 -0
- datakeel/dataset_store/search.py +78 -0
- datakeel/dataset_store/search_sources.py +157 -0
- datakeel/dataset_store/upload_files.py +115 -0
- datakeel/dataset_store/upload_folders.py +79 -0
- datakeel/dataset_store/upload_service.py +168 -0
- datakeel/dataset_store/version_diff.py +191 -0
- datakeel/dataset_store/version_stream.py +110 -0
- datakeel/datasets/__init__.py +4 -0
- datakeel/datasets/openlineage_projection.py +162 -0
- datakeel/datasets/records.py +33 -0
- datakeel/datasets/views.py +126 -0
- datakeel/datasheets/__init__.py +4 -0
- datakeel/datasheets/destination.py +50 -0
- datakeel/datasheets/matching.py +171 -0
- datakeel/datasheets/measurement_labels.py +135 -0
- datakeel/datasheets/names.py +144 -0
- datakeel/datasheets/number_labels.py +107 -0
- datakeel/datasheets/number_words.py +141 -0
- datakeel/datasheets/numeric.py +276 -0
- datakeel/datasheets/prompt.py +81 -0
- datakeel/datasheets/render.py +134 -0
- datakeel/datasheets/sentences.py +64 -0
- datakeel/datasheets/templates.py +170 -0
- datakeel/datasheets/units.py +176 -0
- datakeel/datasheets/validation.py +89 -0
- datakeel/datasheets/vocabulary.py +327 -0
- datakeel/delegation/__init__.py +4 -0
- datakeel/delegation/demo.py +34 -0
- datakeel/delegation/loader.py +99 -0
- datakeel/delegation/models.py +72 -0
- datakeel/delegation/parallel.py +123 -0
- datakeel/delegation/policy.py +51 -0
- datakeel/delegation/scripts.py +30 -0
- datakeel/delegation/service.py +166 -0
- datakeel/delegation/tree.py +58 -0
- datakeel/delivery/__init__.py +4 -0
- datakeel/delivery/checks.py +205 -0
- datakeel/delivery/manifest.py +69 -0
- datakeel/delivery/reconcile.py +143 -0
- datakeel/docs/p9/enterprise-docs.yaml +542 -0
- datakeel/docs/p9/enterprise-flash.yaml +372 -0
- datakeel/evidence/__init__.py +4 -0
- datakeel/evidence/cache.py +8 -0
- datakeel/evidence/execution.py +52 -0
- datakeel/evidence/kg_images.py +106 -0
- datakeel/evidence/models.py +38 -0
- datakeel/evidence/presentation.py +140 -0
- datakeel/evidence/query_models.py +117 -0
- datakeel/evidence/registry.py +15 -0
- datakeel/evidence/runtime_compute.py +130 -0
- datakeel/evidence/runtime_inputs.py +198 -0
- datakeel/evidence/runtime_publication.py +61 -0
- datakeel/evidence/vector_cloud.py +200 -0
- datakeel/evidence/vector_duplicate.py +114 -0
- datakeel/evidence/vector_execution.py +322 -0
- datakeel/evidence/vector_parameters.py +16 -0
- datakeel/evidence/vector_payload.py +127 -0
- datakeel/evidence/vector_plan.py +133 -0
- datakeel/evidence/vector_plan_sets.py +77 -0
- datakeel/evidence/vector_publication.py +138 -0
- datakeel/evidence/vector_set_execution.py +133 -0
- datakeel/evidence/vector_set_publication.py +60 -0
- datakeel/evidence/vector_sets.py +207 -0
- datakeel/evidence/vector_transport.py +171 -0
- datakeel/extraction_runtime/__init__.py +4 -0
- datakeel/extraction_runtime/adapter.py +240 -0
- datakeel/extraction_runtime/factory.py +77 -0
- datakeel/extraction_runtime/transport.py +156 -0
- datakeel/governance/__init__.py +9 -0
- datakeel/governance/compliance.py +134 -0
- datakeel/governance/models.py +15 -0
- datakeel/governance/validation.py +145 -0
- datakeel/harness/__init__.py +4 -0
- datakeel/harness/annotation_cases.py +192 -0
- datakeel/harness/assessment.py +131 -0
- datakeel/harness/asset_cases.py +40 -0
- datakeel/harness/cases.py +128 -0
- datakeel/harness/dq_cases.py +74 -0
- datakeel/harness/enterprise_cases.py +33 -0
- datakeel/harness/enterprise_kg.py +101 -0
- datakeel/harness/enterprise_reviews.py +60 -0
- datakeel/harness/evaluation.py +38 -0
- datakeel/harness/evidence_cases.py +42 -0
- datakeel/harness/evidence_evaluation.py +163 -0
- datakeel/harness/evidence_metrics.py +141 -0
- datakeel/harness/evidence_questions.py +96 -0
- datakeel/harness/execution.py +220 -0
- datakeel/harness/image_kg_cases.py +66 -0
- datakeel/harness/injection_cases.py +41 -0
- datakeel/harness/kg_cases.py +53 -0
- datakeel/harness/knowledge_checks.py +123 -0
- datakeel/harness/knowledge_evaluation.py +110 -0
- datakeel/harness/llm_data_cases.py +19 -0
- datakeel/harness/operations.py +56 -0
- datakeel/harness/otel.py +199 -0
- datakeel/harness/otel_checked.py +146 -0
- datakeel/harness/pricing.py +29 -0
- datakeel/harness/resources.py +14 -0
- datakeel/harness/service.py +20 -0
- datakeel/harness/standard_cases.py +126 -0
- datakeel/harness/team_cases.py +33 -0
- datakeel/harness/tool_assessment.py +48 -0
- datakeel/harness/training_cases.py +53 -0
- datakeel/http.py +17 -0
- datakeel/intents/__init__.py +4 -0
- datakeel/intents/already.py +173 -0
- datakeel/intents/answers.py +221 -0
- datakeel/intents/capability.py +79 -0
- datakeel/intents/catalog.py +360 -0
- datakeel/intents/catalog_lookup.py +74 -0
- datakeel/intents/chain_replan.py +162 -0
- datakeel/intents/chains.py +221 -0
- datakeel/intents/choices.py +45 -0
- datakeel/intents/created.py +98 -0
- datakeel/intents/derived.py +193 -0
- datakeel/intents/describe.py +374 -0
- datakeel/intents/drafts.py +60 -0
- datakeel/intents/duplicates.py +168 -0
- datakeel/intents/edits.py +335 -0
- datakeel/intents/estimates.py +108 -0
- datakeel/intents/exclusions.py +83 -0
- datakeel/intents/explore.py +263 -0
- datakeel/intents/field_names.py +397 -0
- datakeel/intents/fill.py +388 -0
- datakeel/intents/fill_state.py +158 -0
- datakeel/intents/grounding.py +92 -0
- datakeel/intents/group_fill.py +394 -0
- datakeel/intents/impossible.py +165 -0
- datakeel/intents/landing.py +73 -0
- datakeel/intents/model_calls.py +120 -0
- datakeel/intents/model_parse.py +398 -0
- datakeel/intents/named_kinds.py +78 -0
- datakeel/intents/object_answers.py +114 -0
- datakeel/intents/object_edits.py +178 -0
- datakeel/intents/outcomes.py +110 -0
- datakeel/intents/partial.py +115 -0
- datakeel/intents/plain_words.py +27 -0
- datakeel/intents/planner.py +400 -0
- datakeel/intents/precondition_reasons.py +134 -0
- datakeel/intents/preconditions.py +396 -0
- datakeel/intents/public_text.py +276 -0
- datakeel/intents/read_scope.py +197 -0
- datakeel/intents/readonly.py +79 -0
- datakeel/intents/recipes.py +291 -0
- datakeel/intents/replanning.py +143 -0
- datakeel/intents/resolve.py +397 -0
- datakeel/intents/rules.py +118 -0
- datakeel/intents/scene.py +58 -0
- datakeel/intents/scope_words.py +49 -0
- datakeel/intents/segments.py +83 -0
- datakeel/intents/selectors.py +227 -0
- datakeel/intents/signatures.py +157 -0
- datakeel/intents/singular.py +50 -0
- datakeel/intents/step_values.py +80 -0
- datakeel/intents/task_files.py +78 -0
- datakeel/intents/task_scope.py +315 -0
- datakeel/intents/turns.py +157 -0
- datakeel/intents/validate.py +397 -0
- datakeel/intents/verify.py +398 -0
- datakeel/intents/what_changes.py +113 -0
- datakeel/intents/wording.py +397 -0
- datakeel/kg/__init__.py +4 -0
- datakeel/kg/aliases.py +173 -0
- datakeel/kg/assembly.py +208 -0
- datakeel/kg/cache.py +67 -0
- datakeel/kg/endpoints.py +56 -0
- datakeel/kg/extractors.py +117 -0
- datakeel/kg/gliner.py +80 -0
- datakeel/kg/identity.py +92 -0
- datakeel/kg/loader.py +65 -0
- datakeel/kg/policy.py +32 -0
- datakeel/kg/prompt.py +132 -0
- datakeel/kg/retention.py +63 -0
- datakeel/kg/text.py +41 -0
- datakeel/kg/verification.py +77 -0
- datakeel/kg_eval/__init__.py +6 -0
- datakeel/kg_eval/alignment.py +90 -0
- datakeel/kg_eval/counts.py +95 -0
- datakeel/kg_eval/execution.py +110 -0
- datakeel/kg_eval/image_auto_metrics.py +61 -0
- datakeel/kg_eval/image_execution.py +220 -0
- datakeel/kg_eval/image_loader.py +68 -0
- datakeel/kg_eval/image_metrics.py +146 -0
- datakeel/kg_eval/image_projection.py +52 -0
- datakeel/kg_eval/image_service.py +120 -0
- datakeel/kg_eval/loader.py +81 -0
- datakeel/kg_eval/projection.py +106 -0
- datakeel/kg_eval/scoring.py +112 -0
- datakeel/kg_eval/service.py +88 -0
- datakeel/label_drafts/__init__.py +4 -0
- datakeel/label_drafts/answer.py +249 -0
- datakeel/label_drafts/checked.py +143 -0
- datakeel/label_drafts/complete.py +200 -0
- datakeel/label_drafts/model.py +311 -0
- datakeel/label_drafts/models.py +71 -0
- datakeel/label_drafts/offline.py +174 -0
- datakeel/label_drafts/standards.py +211 -0
- datakeel/lineage/__init__.py +4 -0
- datakeel/lineage/collapse.py +122 -0
- datakeel/lineage/exports.py +202 -0
- datakeel/lineage/models.py +122 -0
- datakeel/lineage/service.py +231 -0
- datakeel/llm_data/__init__.py +9 -0
- datakeel/llm_data/acceleration.py +117 -0
- datakeel/llm_data/checks.py +203 -0
- datakeel/llm_data/contamination.py +175 -0
- datakeel/llm_data/engine.py +293 -0
- datakeel/llm_data/index.py +222 -0
- datakeel/llm_data/language.py +76 -0
- datakeel/llm_data/parsing.py +309 -0
- datakeel/llm_data/similarity.py +114 -0
- datakeel/llm_data/streaming.py +97 -0
- datakeel/mcp/__init__.py +8 -0
- datakeel/mcp/catalog.py +45 -0
- datakeel/mcp/dispatch.py +51 -0
- datakeel/mcp/local_tools.py +168 -0
- datakeel/mcp/server.py +134 -0
- datakeel/memory/__init__.py +4 -0
- datakeel/memory/consolidation.py +95 -0
- datakeel/memory/retrieval.py +112 -0
- datakeel/memory/service.py +160 -0
- datakeel/memory/tools.py +52 -0
- datakeel/metrics/__init__.py +4 -0
- datakeel/metrics/compiler.py +126 -0
- datakeel/metrics/compiler_filters.py +59 -0
- datakeel/metrics/date_boundaries.py +40 -0
- datakeel/metrics/execution.py +141 -0
- datakeel/metrics/loader.py +45 -0
- datakeel/metrics/projection.py +176 -0
- datakeel/metrics/resolution.py +37 -0
- datakeel/metrics/sql_safety.py +29 -0
- datakeel/metrics/time_grouping.py +36 -0
- datakeel/ontology/__init__.py +4 -0
- datakeel/ontology/annotation_demo.py +58 -0
- datakeel/ontology/annotation_functions.py +23 -0
- datakeel/ontology/annotation_parameters.py +15 -0
- datakeel/ontology/catalog_functions.py +137 -0
- datakeel/ontology/catalog_parameters.py +32 -0
- datakeel/ontology/data_asset_access.py +20 -0
- datakeel/ontology/dq_functions.py +99 -0
- datakeel/ontology/evidence_functions.py +39 -0
- datakeel/ontology/function_language.py +242 -0
- datakeel/ontology/functions.py +330 -0
- datakeel/ontology/kg_functions.py +40 -0
- datakeel/ontology/language_check.py +32 -0
- datakeel/ontology/llm_data_functions.py +25 -0
- datakeel/ontology/models.py +244 -0
- datakeel/ontology/parameters.py +56 -0
- datakeel/ontology/production_functions.py +171 -0
- datakeel/ontology/production_links.py +62 -0
- datakeel/ontology/properties.py +61 -0
- datakeel/ontology/registry.py +148 -0
- datakeel/ontology/standard_functions.py +65 -0
- datakeel/ontology/tool_batch.py +134 -0
- datakeel/ontology/tool_history.py +249 -0
- datakeel/ontology/tool_models.py +80 -0
- datakeel/ontology/tool_refs.py +106 -0
- datakeel/ontology/tool_search.py +147 -0
- datakeel/ontology/tooling.py +218 -0
- datakeel/ontology/training_functions.py +69 -0
- datakeel/ontology/training_parameters.py +26 -0
- datakeel/operators/__init__.py +92 -0
- datakeel/operators/audio/__init__.py +13 -0
- datakeel/operators/audio/clipping.py +74 -0
- datakeel/operators/audio/clipping_stream.py +121 -0
- datakeel/operators/audio/common.py +130 -0
- datakeel/operators/audio/dedup.py +73 -0
- datakeel/operators/audio/fingerprint.py +179 -0
- datakeel/operators/audio/flat_tops.py +149 -0
- datakeel/operators/audio/loudness.py +165 -0
- datakeel/operators/audio/models.py +57 -0
- datakeel/operators/audio/params.py +78 -0
- datakeel/operators/audio/probe.py +27 -0
- datakeel/operators/audio/streaming.py +124 -0
- datakeel/operators/audio/trim_silence.py +66 -0
- datakeel/operators/audio/vad.py +27 -0
- datakeel/operators/base.py +241 -0
- datakeel/operators/custom_container.py +393 -0
- datakeel/operators/custom_job.py +42 -0
- datakeel/operators/custom_memory.py +74 -0
- datakeel/operators/custom_output.py +135 -0
- datakeel/operators/custom_process.py +95 -0
- datakeel/operators/custom_sandbox.py +88 -0
- datakeel/operators/custom_subprocess.py +132 -0
- datakeel/operators/custom_usage.py +35 -0
- datakeel/operators/evidence/__init__.py +4 -0
- datakeel/operators/evidence/annotation_labels.py +148 -0
- datakeel/operators/evidence/caption_mentions.py +88 -0
- datakeel/operators/evidence/common.py +58 -0
- datakeel/operators/evidence/contracts.py +81 -0
- datakeel/operators/evidence/facts.py +56 -0
- datakeel/operators/evidence/image_phash.py +78 -0
- datakeel/operators/evidence/label_gap.py +61 -0
- datakeel/operators/evidence/llm_extractor.py +50 -0
- datakeel/operators/evidence/near_duplicate.py +99 -0
- datakeel/operators/evidence/near_duplicate_hashes.py +149 -0
- datakeel/operators/evidence/vector.py +43 -0
- datakeel/operators/failures.py +97 -0
- datakeel/operators/file/__init__.py +4 -0
- datakeel/operators/file/corrupt_check.py +44 -0
- datakeel/operators/file/dedup.py +30 -0
- datakeel/operators/file/empty_check.py +31 -0
- datakeel/operators/image/__init__.py +4 -0
- datakeel/operators/image/batch.py +34 -0
- datakeel/operators/image/convert.py +29 -0
- datakeel/operators/image/helpers.py +102 -0
- datakeel/operators/image/limits.py +24 -0
- datakeel/operators/image/parallel.py +45 -0
- datakeel/operators/image/quality.py +88 -0
- datakeel/operators/image/quality_scores.py +157 -0
- datakeel/operators/image/quality_signals.py +177 -0
- datakeel/operators/image/resize.py +37 -0
- datakeel/operators/image/thumbnail.py +35 -0
- datakeel/operators/media/__init__.py +4 -0
- datakeel/operators/media/align.py +191 -0
- datakeel/operators/media/command.py +165 -0
- datakeel/operators/media/isolation.py +104 -0
- datakeel/operators/media/probe_annotation.py +50 -0
- datakeel/operators/media/provenance.py +79 -0
- datakeel/operators/media/tools.py +284 -0
- datakeel/operators/pointcloud/__init__.py +4 -0
- datakeel/operators/pointcloud/artifacts.py +65 -0
- datakeel/operators/pointcloud/batch.py +42 -0
- datakeel/operators/pointcloud/cells.py +74 -0
- datakeel/operators/pointcloud/clean.py +36 -0
- datakeel/operators/pointcloud/codec.py +101 -0
- datakeel/operators/pointcloud/components.py +308 -0
- datakeel/operators/pointcloud/downsample.py +45 -0
- datakeel/operators/pointcloud/io.py +37 -0
- datakeel/operators/pointcloud/models.py +253 -0
- datakeel/operators/pointcloud/neighbors.py +168 -0
- datakeel/operators/pointcloud/outliers.py +44 -0
- datakeel/operators/pointcloud/pcd.py +98 -0
- datakeel/operators/pointcloud/ply.py +112 -0
- datakeel/operators/pointcloud/preview.py +83 -0
- datakeel/operators/pointcloud/probe.py +197 -0
- datakeel/operators/pointcloud/shape.py +111 -0
- datakeel/operators/pointcloud/statistics.py +105 -0
- datakeel/operators/pointcloud/unit_check.py +112 -0
- datakeel/operators/table/__init__.py +4 -0
- datakeel/operators/table/inference.py +166 -0
- datakeel/operators/table/io.py +146 -0
- datakeel/operators/table/models.py +99 -0
- datakeel/operators/table/params.py +30 -0
- datakeel/operators/table/profile.py +175 -0
- datakeel/operators/table/relations.py +77 -0
- datakeel/operators/table/statistics.py +62 -0
- datakeel/operators/text/__init__.py +4 -0
- datakeel/operators/text/dedup.py +40 -0
- datakeel/operators/text/encoding_fix.py +39 -0
- datakeel/operators/text/pii_redact.py +39 -0
- datakeel/operators/text/quality.py +46 -0
- datakeel/operators/text/training_quality.py +44 -0
- datakeel/operators/timeseries/__init__.py +4 -0
- datakeel/operators/timeseries/anomaly.py +119 -0
- datakeel/operators/timeseries/common.py +125 -0
- datakeel/operators/timeseries/gaps.py +80 -0
- datakeel/operators/timeseries/models.py +182 -0
- datakeel/operators/timeseries/order_dedup.py +91 -0
- datakeel/operators/timeseries/parsing.py +109 -0
- datakeel/operators/timeseries/resample.py +123 -0
- datakeel/operators/timeseries/rules.py +184 -0
- datakeel/operators/timeseries/timestamp_normalize.py +107 -0
- datakeel/operators/timeseries/unit_check.py +99 -0
- datakeel/operators/video/__init__.py +12 -0
- datakeel/operators/video/analysis.py +197 -0
- datakeel/operators/video/dedup.py +215 -0
- datakeel/operators/video/frames.py +163 -0
- datakeel/operators/video/freeze.py +160 -0
- datakeel/operators/video/invalid_frames.py +118 -0
- datakeel/operators/video/normalize.py +62 -0
- datakeel/operators/video/probe.py +27 -0
- datakeel/operators/video/render.py +79 -0
- datakeel/operators/video/segment.py +103 -0
- datakeel/operators/video/sequence.py +341 -0
- datakeel/persistence/__init__.py +21 -0
- datakeel/persistence/canonical.py +73 -0
- datakeel/persistence/canonical_tables.json +695 -0
- datakeel/persistence/legacy.py +157 -0
- datakeel/persistence/legacy_rows.py +153 -0
- datakeel/persistence/task_completion.py +141 -0
- datakeel/persistence/task_queries.py +34 -0
- datakeel/persistence/task_queue.py +32 -0
- datakeel/persistence/task_vector.py +74 -0
- datakeel/persistence/vector.py +13 -0
- datakeel/persistence/vector_tables.json +23 -0
- datakeel/pipeline/__init__.py +19 -0
- datakeel/pipeline/defaults.py +54 -0
- datakeel/pipeline/evidence.py +36 -0
- datakeel/pipeline/execution.py +200 -0
- datakeel/pipeline/image_pointcloud.py +40 -0
- datakeel/pipeline/media.py +75 -0
- datakeel/pipeline/models.py +62 -0
- datakeel/pipeline/sharding.py +32 -0
- datakeel/pipeline/tabular.py +59 -0
- datakeel/pipeline/validation.py +136 -0
- datakeel/prelabel/__init__.py +37 -0
- datakeel/prelabel/client.py +116 -0
- datakeel/prelabel/credential_source.py +56 -0
- datakeel/prelabel/estimate.py +98 -0
- datakeel/prelabel/images.py +59 -0
- datakeel/prelabel/parse.py +177 -0
- datakeel/prelabel/prompt.py +53 -0
- datakeel/quality/__init__.py +9 -0
- datakeel/quality/annotation.py +108 -0
- datakeel/quality/annotation_report.py +43 -0
- datakeel/quality/dq_constraints.py +208 -0
- datakeel/quality/dq_contracts.py +21 -0
- datakeel/quality/dq_engine.py +222 -0
- datakeel/quality/dq_evaluation.py +53 -0
- datakeel/quality/dq_regex.py +75 -0
- datakeel/quality/dq_report.py +13 -0
- datakeel/quality/dq_source.py +257 -0
- datakeel/quality/dq_statistics.py +146 -0
- datakeel/quality/dq_types.py +134 -0
- datakeel/quality/image_pointcloud.py +253 -0
- datakeel/quality/llm_data.py +68 -0
- datakeel/quality/media.py +251 -0
- datakeel/quality/models.py +84 -0
- datakeel/quality/report.py +222 -0
- datakeel/quality/scoring.py +379 -0
- datakeel/quality/standards.py +139 -0
- datakeel/quality/tabular.py +188 -0
- datakeel/quality/tabular_models.py +58 -0
- datakeel/quality/tabular_report.py +51 -0
- datakeel/routing/__init__.py +4 -0
- datakeel/routing/accounting.py +128 -0
- datakeel/routing/attempts.py +37 -0
- datakeel/routing/classifier.py +96 -0
- datakeel/routing/concepts.py +140 -0
- datakeel/routing/config.py +156 -0
- datakeel/routing/evaluation.py +113 -0
- datakeel/routing/intent.py +253 -0
- datakeel/routing/models.py +68 -0
- datakeel/routing/questions.py +172 -0
- datakeel/routing/scopes.py +137 -0
- datakeel/routing/service.py +89 -0
- datakeel/routing/tiers.py +36 -0
- datakeel/runtime/__init__.py +8 -0
- datakeel/runtime/chat.py +229 -0
- datakeel/runtime/chat_provider.py +139 -0
- datakeel/runtime/delegation_graph.py +120 -0
- datakeel/runtime/graph.py +370 -0
- datakeel/runtime/saver.py +172 -0
- datakeel/runtime/serializer.py +75 -0
- datakeel/runtime/tracing.py +26 -0
- datakeel/runtime/workflow_graph.py +239 -0
- datakeel/runtime/workflow_service.py +119 -0
- datakeel/sample.py +42 -0
- datakeel/sample_annotation_qa.py +127 -0
- datakeel/sample_enterprise/__init__.py +9 -0
- datakeel/sample_enterprise/common.py +27 -0
- datakeel/sample_enterprise/crm.py +68 -0
- datakeel/sample_enterprise/ecommerce.py +91 -0
- datakeel/sample_enterprise/erp.py +68 -0
- datakeel/sample_enterprise/generator.py +59 -0
- datakeel/sample_enterprise/gold.py +150 -0
- datakeel/sample_enterprise/models.py +68 -0
- datakeel/sample_enterprise/service.py +62 -0
- datakeel/sample_evidence/__init__.py +9 -0
- datakeel/sample_evidence/generator.py +159 -0
- datakeel/sample_evidence/images.py +65 -0
- datakeel/sample_evidence/models.py +82 -0
- datakeel/sample_image_kg.py +48 -0
- datakeel/sample_kg.py +68 -0
- datakeel/sample_media/__init__.py +8 -0
- datakeel/sample_media/generator.py +103 -0
- datakeel/sample_standards.py +66 -0
- datakeel/sample_timeseries.py +82 -0
- datakeel/sandbox_entry.py +186 -0
- datakeel/sandbox_worker.py +59 -0
- datakeel/semantic/__init__.py +270 -0
- datakeel/semantic/_snapshot.json +939 -0
- datakeel/semantic/_snapshot.py +11 -0
- datakeel/semantic/snapshot.ts +940 -0
- datakeel/standards/__init__.py +4 -0
- datakeel/standards/checks.py +279 -0
- datakeel/standards/coverage.py +88 -0
- datakeel/standards/lexical.py +223 -0
- datakeel/standards/loader.py +77 -0
- datakeel/standards/mapping.py +106 -0
- datakeel/standards/matching.py +378 -0
- datakeel/standards/names.py +197 -0
- datakeel/storage/__init__.py +4 -0
- datakeel/storage/action_access.py +101 -0
- datakeel/storage/action_approvals.py +106 -0
- datakeel/storage/action_deferred.py +88 -0
- datakeel/storage/action_execution.py +194 -0
- datakeel/storage/action_export.py +142 -0
- datakeel/storage/action_locks.py +66 -0
- datakeel/storage/action_operations.py +168 -0
- datakeel/storage/action_planning.py +277 -0
- datakeel/storage/action_reads.py +64 -0
- datakeel/storage/action_requests.py +80 -0
- datakeel/storage/action_rows.py +78 -0
- datakeel/storage/action_selection.py +105 -0
- datakeel/storage/action_snapshot.py +118 -0
- datakeel/storage/action_store.py +78 -0
- datakeel/storage/action_targets.py +70 -0
- datakeel/storage/action_worker.py +103 -0
- datakeel/storage/annotation_actions.py +63 -0
- datakeel/storage/annotation_frames.py +102 -0
- datakeel/storage/annotation_legacy.py +57 -0
- datakeel/storage/annotation_rework.py +90 -0
- datakeel/storage/annotation_rows.py +48 -0
- datakeel/storage/annotation_sampling.py +161 -0
- datakeel/storage/annotation_store.py +218 -0
- datakeel/storage/approval_evidence.py +29 -0
- datakeel/storage/ask_conversation_rows.py +24 -0
- datakeel/storage/ask_conversations.py +162 -0
- datakeel/storage/ask_evaluations.py +37 -0
- datakeel/storage/ask_evidence.py +189 -0
- datakeel/storage/ask_review.py +68 -0
- datakeel/storage/ask_rows.py +32 -0
- datakeel/storage/ask_store.py +164 -0
- datakeel/storage/base.py +8 -0
- datakeel/storage/budget_accounts.py +76 -0
- datakeel/storage/budget_rows.py +42 -0
- datakeel/storage/budget_service.py +90 -0
- datakeel/storage/catalog_action_state.py +86 -0
- datakeel/storage/catalog_actions.py +100 -0
- datakeel/storage/catalog_details.py +62 -0
- datakeel/storage/catalog_fields.py +56 -0
- datakeel/storage/catalog_graph.py +132 -0
- datakeel/storage/catalog_locks.py +17 -0
- datakeel/storage/catalog_pages.py +65 -0
- datakeel/storage/catalog_projection.py +120 -0
- datakeel/storage/catalog_queries.py +130 -0
- datakeel/storage/catalog_reads.py +31 -0
- datakeel/storage/catalog_rows.py +33 -0
- datakeel/storage/catalog_store.py +124 -0
- datakeel/storage/checkpoint_store.py +189 -0
- datakeel/storage/conversation_asset_refs.py +122 -0
- datakeel/storage/conversation_authorization.py +111 -0
- datakeel/storage/conversation_lock.py +62 -0
- datakeel/storage/conversation_memory_sources.py +57 -0
- datakeel/storage/conversation_resume.py +51 -0
- datakeel/storage/conversation_rows.py +58 -0
- datakeel/storage/conversation_secrets.py +19 -0
- datakeel/storage/conversation_store.py +183 -0
- datakeel/storage/custom_rows.py +31 -0
- datakeel/storage/custom_store.py +176 -0
- datakeel/storage/custom_validation.py +22 -0
- datakeel/storage/data_asset_access.py +218 -0
- datakeel/storage/data_asset_action_state.py +64 -0
- datakeel/storage/data_asset_actions.py +85 -0
- datakeel/storage/data_asset_cards.py +155 -0
- datakeel/storage/data_asset_context.py +87 -0
- datakeel/storage/data_asset_events.py +31 -0
- datakeel/storage/data_asset_grants.py +312 -0
- datakeel/storage/data_asset_native.py +113 -0
- datakeel/storage/data_asset_quality.py +88 -0
- datakeel/storage/data_asset_reads.py +17 -0
- datakeel/storage/data_asset_review.py +49 -0
- datakeel/storage/data_asset_rows.py +101 -0
- datakeel/storage/data_asset_store.py +229 -0
- datakeel/storage/data_asset_targets.py +142 -0
- datakeel/storage/database.py +127 -0
- datakeel/storage/datasheet_actions.py +121 -0
- datakeel/storage/datasheet_facts.py +192 -0
- datakeel/storage/datasheet_job_rows.py +25 -0
- datakeel/storage/datasheet_jobs.py +161 -0
- datakeel/storage/datasheet_rows.py +22 -0
- datakeel/storage/datasheet_sources.py +208 -0
- datakeel/storage/datasheet_store.py +159 -0
- datakeel/storage/datasheet_values.py +105 -0
- datakeel/storage/delivery_rows.py +21 -0
- datakeel/storage/delivery_service.py +213 -0
- datakeel/storage/dq_actions.py +191 -0
- datakeel/storage/dq_issues.py +154 -0
- datakeel/storage/dq_jobs.py +196 -0
- datakeel/storage/dq_reads.py +114 -0
- datakeel/storage/dq_results.py +125 -0
- datakeel/storage/dq_rows.py +96 -0
- datakeel/storage/dq_store.py +109 -0
- datakeel/storage/dq_views.py +173 -0
- datakeel/storage/dq_webhooks.py +60 -0
- datakeel/storage/draft_metering.py +104 -0
- datakeel/storage/evidence_actions.py +274 -0
- datakeel/storage/evidence_artifacts.py +50 -0
- datakeel/storage/evidence_cache.py +148 -0
- datakeel/storage/evidence_constraints.py +80 -0
- datakeel/storage/evidence_decisions.py +144 -0
- datakeel/storage/evidence_evaluations.py +51 -0
- datakeel/storage/evidence_filters.py +68 -0
- datakeel/storage/evidence_import.py +54 -0
- datakeel/storage/evidence_projection.py +212 -0
- datakeel/storage/evidence_queries.py +172 -0
- datakeel/storage/evidence_rows.py +49 -0
- datakeel/storage/evidence_runs.py +37 -0
- datakeel/storage/evidence_snapshot.py +102 -0
- datakeel/storage/evidence_store.py +274 -0
- datakeel/storage/governance_service.py +294 -0
- datakeel/storage/harness_evaluations.py +55 -0
- datakeel/storage/harness_rows.py +41 -0
- datakeel/storage/harness_service.py +150 -0
- datakeel/storage/identity_actions.py +115 -0
- datakeel/storage/identity_authorization.py +97 -0
- datakeel/storage/identity_mutations.py +192 -0
- datakeel/storage/identity_rows.py +54 -0
- datakeel/storage/identity_sessions.py +66 -0
- datakeel/storage/identity_store.py +146 -0
- datakeel/storage/intent_chains.py +100 -0
- datakeel/storage/intent_reads.py +212 -0
- datakeel/storage/intent_rows.py +22 -0
- datakeel/storage/kg_context.py +80 -0
- datakeel/storage/kg_eval_rows.py +22 -0
- datakeel/storage/kg_evaluations.py +60 -0
- datakeel/storage/kg_graph.py +96 -0
- datakeel/storage/kg_image_attribution.py +42 -0
- datakeel/storage/kg_image_eval_store.py +61 -0
- datakeel/storage/kg_image_preparation.py +203 -0
- datakeel/storage/kg_image_sources.py +205 -0
- datakeel/storage/kg_inputs.py +110 -0
- datakeel/storage/kg_preparation.py +176 -0
- datakeel/storage/kg_pricing.py +51 -0
- datakeel/storage/kg_progress.py +61 -0
- datakeel/storage/kg_provenance.py +39 -0
- datakeel/storage/kg_publication.py +268 -0
- datakeel/storage/kg_queries.py +241 -0
- datakeel/storage/kg_reviews.py +82 -0
- datakeel/storage/kg_rows.py +34 -0
- datakeel/storage/kg_run_reads.py +39 -0
- datakeel/storage/kg_source_documents.py +48 -0
- datakeel/storage/kg_store.py +208 -0
- datakeel/storage/kg_transcription_selection.py +40 -0
- datakeel/storage/label_drafts.py +308 -0
- datakeel/storage/link_context.py +105 -0
- datakeel/storage/link_drafts.py +129 -0
- datakeel/storage/link_queries.py +108 -0
- datakeel/storage/link_reviews.py +76 -0
- datakeel/storage/link_store.py +119 -0
- datakeel/storage/llm_data_access.py +51 -0
- datakeel/storage/llm_data_actions.py +233 -0
- datakeel/storage/llm_data_constraints.py +42 -0
- datakeel/storage/llm_data_evaluations.py +90 -0
- datakeel/storage/llm_data_facts.py +46 -0
- datakeel/storage/llm_data_reads.py +60 -0
- datakeel/storage/llm_data_rows.py +43 -0
- datakeel/storage/llm_data_selection.py +58 -0
- datakeel/storage/llm_data_sources.py +92 -0
- datakeel/storage/llm_data_store.py +253 -0
- datakeel/storage/memory_rows.py +45 -0
- datakeel/storage/memory_store.py +262 -0
- datakeel/storage/metric_audit.py +69 -0
- datakeel/storage/metric_drafts.py +125 -0
- datakeel/storage/metric_store.py +159 -0
- datakeel/storage/migrations.py +45 -0
- datakeel/storage/objects.py +221 -0
- datakeel/storage/pg_triggers.py +29 -0
- datakeel/storage/prediction_frames.py +133 -0
- datakeel/storage/production_acceptance.py +209 -0
- datakeel/storage/production_action_state.py +120 -0
- datakeel/storage/production_actions.py +169 -0
- datakeel/storage/production_ai_audit.py +100 -0
- datakeel/storage/production_ai_facts.py +158 -0
- datakeel/storage/production_ai_review.py +126 -0
- datakeel/storage/production_ai_rows.py +62 -0
- datakeel/storage/production_ai_rules.py +140 -0
- datakeel/storage/production_assignments.py +275 -0
- datakeel/storage/production_catalog.py +276 -0
- datakeel/storage/production_catalog_actions.py +115 -0
- datakeel/storage/production_catalog_changes.py +228 -0
- datakeel/storage/production_catalog_impact.py +76 -0
- datakeel/storage/production_catalog_plans.py +200 -0
- datakeel/storage/production_catalog_rows.py +113 -0
- datakeel/storage/production_cloud_labeling.py +198 -0
- datakeel/storage/production_cloud_prelabel.py +233 -0
- datakeel/storage/production_cloud_runner.py +317 -0
- datakeel/storage/production_counters.py +64 -0
- datakeel/storage/production_dispatch.py +206 -0
- datakeel/storage/production_dispatch_plans.py +36 -0
- datakeel/storage/production_dispatch_rules.py +161 -0
- datakeel/storage/production_finalize.py +167 -0
- datakeel/storage/production_human.py +8 -0
- datakeel/storage/production_idempotency.py +67 -0
- datakeel/storage/production_keypoint_upgrades.py +80 -0
- datakeel/storage/production_leases.py +175 -0
- datakeel/storage/production_load_locks.py +60 -0
- datakeel/storage/production_members.py +49 -0
- datakeel/storage/production_native.py +59 -0
- datakeel/storage/production_objects.py +188 -0
- datakeel/storage/production_prediction_parsing.py +369 -0
- datakeel/storage/production_predictions.py +190 -0
- datakeel/storage/production_prelabel_reads.py +107 -0
- datakeel/storage/production_prelabel_refs.py +84 -0
- datakeel/storage/production_prelabel_runs.py +188 -0
- datakeel/storage/production_prelabel_writes.py +133 -0
- datakeel/storage/production_projects.py +250 -0
- datakeel/storage/production_queries.py +252 -0
- datakeel/storage/production_reaper.py +152 -0
- datakeel/storage/production_review_policy.py +69 -0
- datakeel/storage/production_reviews.py +161 -0
- datakeel/storage/production_revisions.py +134 -0
- datakeel/storage/production_rows.py +162 -0
- datakeel/storage/production_schema.py +74 -0
- datakeel/storage/production_separation.py +81 -0
- datakeel/storage/production_statistics.py +160 -0
- datakeel/storage/production_task_images.py +46 -0
- datakeel/storage/production_tasks.py +85 -0
- datakeel/storage/production_team_reads.py +141 -0
- datakeel/storage/production_team_rows.py +86 -0
- datakeel/storage/production_template_upgrade.py +275 -0
- datakeel/storage/production_template_versions.py +140 -0
- datakeel/storage/production_tiers.py +75 -0
- datakeel/storage/release_actions.py +212 -0
- datakeel/storage/release_constraints.py +96 -0
- datakeel/storage/release_rows.py +43 -0
- datakeel/storage/release_service.py +105 -0
- datakeel/storage/standard_changes.py +222 -0
- datakeel/storage/standard_observations.py +121 -0
- datakeel/storage/standard_profiles.py +94 -0
- datakeel/storage/standard_queries.py +55 -0
- datakeel/storage/standard_store.py +109 -0
- datakeel/storage/term_changes.py +59 -0
- datakeel/storage/tool_invocations.py +127 -0
- datakeel/storage/tool_rows.py +29 -0
- datakeel/storage/training_download.py +67 -0
- datakeel/storage/training_export.py +175 -0
- datakeel/storage/training_import.py +67 -0
- datakeel/storage/training_inputs.py +220 -0
- datakeel/storage/training_rows.py +81 -0
- datakeel/storage/training_store.py +283 -0
- datakeel/storage/transcription_pricing.py +38 -0
- datakeel/storage/transcription_rows.py +19 -0
- datakeel/storage/transcription_store.py +65 -0
- datakeel/storage/vector_authorization.py +154 -0
- datakeel/storage/vector_budget.py +195 -0
- datakeel/storage/vector_cache.py +106 -0
- datakeel/storage/vector_current.py +37 -0
- datakeel/storage/vector_cursor.py +68 -0
- datakeel/storage/vector_integrity.py +70 -0
- datakeel/storage/vector_planning.py +86 -0
- datakeel/storage/vector_queries.py +196 -0
- datakeel/storage/vector_query_snapshot.py +188 -0
- datakeel/storage/vector_references.py +63 -0
- datakeel/storage/vector_reports.py +90 -0
- datakeel/storage/vector_rows.py +49 -0
- datakeel/storage/vector_set_integrity.py +74 -0
- datakeel/storage/workbench_assignees.py +63 -0
- datakeel/storage/workbench_pixels.py +20 -0
- datakeel/storage/workbench_reads.py +282 -0
- datakeel/storage/workbench_risk.py +121 -0
- datakeel/storage/workbench_samples.py +179 -0
- datakeel/storage/workflow_recovery.py +149 -0
- datakeel/storage/workflow_rows.py +66 -0
- datakeel/storage/workflow_store.py +202 -0
- datakeel/training/__init__.py +4 -0
- datakeel/training/export.py +153 -0
- datakeel/training/export_common.py +264 -0
- datakeel/training/export_detection.py +188 -0
- datakeel/training/export_hf.py +76 -0
- datakeel/training/export_keypoints.py +92 -0
- datakeel/training/export_records.py +76 -0
- datakeel/training/export_segments.py +63 -0
- datakeel/training/importers.py +143 -0
- datakeel/training/leakage.py +157 -0
- datakeel/training/native.py +38 -0
- datakeel/training/proportions.py +224 -0
- datakeel/training/refinement.py +147 -0
- datakeel/training/single_prevalence.py +196 -0
- datakeel/training/splitting.py +248 -0
- datakeel/training/text_hashes.py +62 -0
- datakeel/transcription/__init__.py +4 -0
- datakeel/transcription/adapters.py +103 -0
- datakeel/transcription/alignment.py +144 -0
- datakeel/transcription/auto.py +192 -0
- datakeel/transcription/auto_adapter.py +84 -0
- datakeel/transcription/auto_document.py +77 -0
- datakeel/transcription/auto_rows.py +123 -0
- datakeel/transcription/cache.py +38 -0
- datakeel/transcription/coordinates.py +58 -0
- datakeel/transcription/factory.py +140 -0
- datakeel/transcription/images.py +36 -0
- datakeel/transcription/loader.py +56 -0
- datakeel/transcription/ocr.py +117 -0
- datakeel/transcription/policy.py +28 -0
- datakeel/transcription/prompt.py +54 -0
- datakeel/transcription/quality.py +89 -0
- datakeel/transcription/transport.py +157 -0
- datakeel/versioning/__init__.py +66 -0
- datakeel/versioning/campaign.py +257 -0
- datakeel/versioning/campaign_v2.py +304 -0
- datakeel/versioning/campaign_v3.py +304 -0
- datakeel/versioning/configuration.py +56 -0
- datakeel/versioning/facts_v2.py +82 -0
- datakeel/versioning/inspect.py +185 -0
- datakeel/versioning/inspect_v2.py +224 -0
- datakeel/versioning/inspect_v3.py +184 -0
- datakeel/versioning/location.py +48 -0
- datakeel/versioning/lock.py +25 -0
- datakeel/versioning/models.py +76 -0
- datakeel/versioning/recovery.py +144 -0
- datakeel/versioning/recovery_models.py +34 -0
- datakeel/versioning/references.py +55 -0
- datakeel/versioning/registry.py +14 -0
- datakeel/versioning/sqlite_b1.json +1598 -0
- datakeel/versioning/sqlite_b2.json +1628 -0
- datakeel/versioning/sqlite_b2_altered_shards.json +6 -0
- datakeel/versioning/sqlite_b3.json +1628 -0
- datakeel/versioning/v1.py +106 -0
- datakeel/versioning/v2.py +66 -0
- datakeel/versioning/v3.py +68 -0
- datakeel/web_dist/.runtime-dependencies.json +16 -0
- datakeel/web_dist/.source-hash +1 -0
- datakeel/web_dist/THIRD-PARTY-LICENSES.txt +446 -0
- datakeel/web_dist/action-runs/index.html +19 -0
- datakeel/web_dist/assets/index-DMt5we1u.css +1 -0
- datakeel/web_dist/assets/index-N04GGpcG.js +69 -0
- datakeel/web_dist/assets/source-code-pro-latin-400-normal-DEXWLoHG.woff2 +0 -0
- datakeel/web_dist/assets/source-code-pro-latin-500-normal-DrRT_DWv.woff2 +0 -0
- datakeel/web_dist/assets/source-serif-4-latin-600-normal-DouSKlru.woff2 +0 -0
- datakeel/web_dist/assets/source-serif-4-latin-700-normal-CGGdTIBe.woff2 +0 -0
- datakeel/web_dist/favicon.svg +1 -0
- datakeel/web_dist/index.html +19 -0
- datakeel/web_dist/lineage/index.html +19 -0
- datakeel/web_dist/report/index.html +19 -0
- datakeel/web_dist/tasks/index.html +19 -0
- datakeel/worker/__init__.py +4 -0
- datakeel/worker/custom_runner.py +148 -0
- datakeel/worker/datasheet_model.py +144 -0
- datakeel/worker/datasheet_runner.py +57 -0
- datakeel/worker/dq_runner.py +63 -0
- datakeel/worker/dq_webhooks.py +65 -0
- datakeel/worker/heartbeat.py +15 -0
- datakeel/worker/kg_execution.py +183 -0
- datakeel/worker/kg_metering.py +131 -0
- datakeel/worker/kg_report.py +129 -0
- datakeel/worker/kg_runner.py +111 -0
- datakeel/worker/kg_transcription.py +259 -0
- datakeel/worker/media_observations.py +68 -0
- datakeel/worker/observations.py +112 -0
- datakeel/worker/queue.py +9 -0
- datakeel/worker/runner.py +159 -0
- datakeel/worker/transcription_consent.py +30 -0
- datakeel/worker/transcription_metering.py +140 -0
- datakeel/worker_store/__init__.py +4 -0
- datakeel/worker_store/completion.py +65 -0
- datakeel/worker_store/rows.py +59 -0
- datakeel/worker_store/schema.py +13 -0
- datakeel/worker_store/task_models.py +42 -0
- datakeel/worker_store/task_queries.py +29 -0
- datakeel/worker_store/task_queue.py +389 -0
- datakeel/worker_store/task_terminal.py +100 -0
- datakeel/worker_store/task_views.py +51 -0
- datakeel/workflows/__init__.py +4 -0
- datakeel/workflows/execution.py +129 -0
- datakeel/workflows/loader.py +104 -0
- datakeel/workflows/models.py +158 -0
- datakeel/workflows/resolver.py +152 -0
- datakeel/workflows/schemas.py +116 -0
- datakeel/workflows/validation.py +143 -0
- datakeel-0.27.0.dist-info/METADATA +248 -0
- datakeel-0.27.0.dist-info/RECORD +1430 -0
- datakeel-0.27.0.dist-info/WHEEL +4 -0
- datakeel-0.27.0.dist-info/entry_points.txt +2 -0
- datakeel-0.27.0.dist-info/licenses/LICENSE +202 -0
datakeel/agent/models.py
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Copyright 2026 Datakeel contributors
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Typed conversation views and server-sent events for the public Agent API."""
|
|
5
|
+
|
|
6
|
+
from datetime import datetime
|
|
7
|
+
from typing import Literal
|
|
8
|
+
|
|
9
|
+
from pydantic import Field
|
|
10
|
+
|
|
11
|
+
from datakeel.actions.models import ActionPlan
|
|
12
|
+
from datakeel.core.agent_models import ChatMessage, ConversationCreate, ToolCall
|
|
13
|
+
from datakeel.core.intent_models import IntentResult
|
|
14
|
+
from datakeel.core.models import BoundaryModel, new_id
|
|
15
|
+
from datakeel.core.routing_models import ModelRouteDecision, RouteDecision
|
|
16
|
+
from datakeel.ontology.tool_models import ToolOutcome
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class AgentEvent(BoundaryModel):
|
|
20
|
+
"""Carry an authoritative observation or a transient live text delta."""
|
|
21
|
+
|
|
22
|
+
id: str = Field(default_factory=new_id)
|
|
23
|
+
event: Literal[
|
|
24
|
+
"text",
|
|
25
|
+
"text_delta",
|
|
26
|
+
"tool_call",
|
|
27
|
+
"tool_result",
|
|
28
|
+
"plan",
|
|
29
|
+
"receipt",
|
|
30
|
+
"stopped",
|
|
31
|
+
"done",
|
|
32
|
+
"route",
|
|
33
|
+
"intent",
|
|
34
|
+
]
|
|
35
|
+
text: str | None = None
|
|
36
|
+
call: ToolCall | None = None
|
|
37
|
+
outcome: ToolOutcome | None = None
|
|
38
|
+
stop_reason: str | None = None
|
|
39
|
+
route: RouteDecision | None = None
|
|
40
|
+
model_routes: list[ModelRouteDecision] = Field(default_factory=list[ModelRouteDecision])
|
|
41
|
+
agent_path: str = "main"
|
|
42
|
+
agent_name: str = "main"
|
|
43
|
+
conversation_id: str | None = None
|
|
44
|
+
tokens: int = Field(default=0, ge=0)
|
|
45
|
+
used_memory_ids: list[str] = Field(default_factory=list[str])
|
|
46
|
+
intent: IntentResult | None = None
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class ConversationView(BoundaryModel):
|
|
50
|
+
"""Expose complete memory with current approval and execution card state."""
|
|
51
|
+
|
|
52
|
+
id: str
|
|
53
|
+
actor: Literal["local"] = "local"
|
|
54
|
+
config: ConversationCreate
|
|
55
|
+
created_at: datetime
|
|
56
|
+
messages: list[ChatMessage]
|
|
57
|
+
events: list[AgentEvent]
|
|
58
|
+
turns: int
|
|
59
|
+
pending_plans: list[ActionPlan] = Field(default_factory=list[ActionPlan])
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Copyright 2026 Datakeel contributors
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Deterministic provider scripts retained independently of the model runtime."""
|
|
5
|
+
|
|
6
|
+
import json
|
|
7
|
+
from collections.abc import Sequence
|
|
8
|
+
|
|
9
|
+
from datakeel.core.agent_models import ModelRequest, ModelResponse
|
|
10
|
+
from datakeel.core.harness_models import TokenUsage
|
|
11
|
+
from datakeel.delegation.scripts import prepare_script
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class FakeProvider:
|
|
15
|
+
"""Replay an explicit script while retaining every request for assertions."""
|
|
16
|
+
|
|
17
|
+
def __init__(self, script: Sequence[ModelResponse]) -> None:
|
|
18
|
+
"""Copy the scripted response queue so fixtures cannot mutate it accidentally."""
|
|
19
|
+
self.script = list(script)
|
|
20
|
+
self.requests: list[ModelRequest] = []
|
|
21
|
+
self.script_errors: list[str] = []
|
|
22
|
+
|
|
23
|
+
def complete(self, request: ModelRequest) -> ModelResponse:
|
|
24
|
+
"""Return the next script entry, deriving fixture usage when omitted."""
|
|
25
|
+
self.requests.append(request)
|
|
26
|
+
result = self.script.pop(0) if self.script else ModelResponse(content="Complete.")
|
|
27
|
+
result = prepare_script(request, result, self.script_errors)
|
|
28
|
+
if result.usage.input_tokens:
|
|
29
|
+
return result
|
|
30
|
+
usage = TokenUsage(
|
|
31
|
+
input_tokens=sum(segment.tokens for segment in request.segments),
|
|
32
|
+
output_tokens=max(1, len(json.dumps(result.model_dump(mode="json"))) // 4),
|
|
33
|
+
)
|
|
34
|
+
return result.model_copy(update={"usage": usage})
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Copyright 2026 Datakeel contributors
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Resume controlled effects through their durable plan operation identities."""
|
|
5
|
+
|
|
6
|
+
from datakeel.action_store.lifecycle import get_runs_by_plan_ids
|
|
7
|
+
from datakeel.actions.authorization import authorization_for
|
|
8
|
+
from datakeel.actions.models import ExecuteRequest
|
|
9
|
+
from datakeel.actions.service import execute_plan, get_plan
|
|
10
|
+
from datakeel.core.data_asset_models import AccessContext
|
|
11
|
+
from datakeel.ontology.tool_models import ToolOutcome
|
|
12
|
+
from datakeel.storage.database import Database
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def execute_approved(db: Database, plan_id: str) -> ToolOutcome:
|
|
16
|
+
"""Reuse an existing receipt or execute the approved plan with its frozen operation ID."""
|
|
17
|
+
plan = get_plan(db, plan_id)
|
|
18
|
+
run = next(
|
|
19
|
+
(run for run in get_runs_by_plan_ids(db, [plan_id])[plan_id] if run.status != "DENIED"),
|
|
20
|
+
None,
|
|
21
|
+
)
|
|
22
|
+
if run is None:
|
|
23
|
+
run = execute_plan(
|
|
24
|
+
db,
|
|
25
|
+
plan.id,
|
|
26
|
+
ExecuteRequest(
|
|
27
|
+
plan_digest=plan.plan_digest, operation_id=plan.operation_id, actor=plan.actor
|
|
28
|
+
),
|
|
29
|
+
access=AccessContext(actor=plan.actor, entry="agent", scope="query")
|
|
30
|
+
if authorization_for(plan.action_type).human_only
|
|
31
|
+
else None,
|
|
32
|
+
)
|
|
33
|
+
return ToolOutcome(
|
|
34
|
+
name="execute_plan",
|
|
35
|
+
status="FAILED" if run.status in {"FAILED", "DENIED"} else "SUCCEEDED",
|
|
36
|
+
run=run,
|
|
37
|
+
error=run.error,
|
|
38
|
+
)
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# Copyright 2026 Datakeel contributors
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Public conversation creation, replay, and controlled response streaming."""
|
|
5
|
+
|
|
6
|
+
from collections.abc import Generator, Iterator
|
|
7
|
+
from contextlib import closing
|
|
8
|
+
|
|
9
|
+
from datakeel.agent.factory import provider_session
|
|
10
|
+
from datakeel.agent.memory import close_interrupted, conversation_view, conversation_views
|
|
11
|
+
from datakeel.agent.models import AgentEvent, ConversationView
|
|
12
|
+
from datakeel.agent.providers import FakeProvider
|
|
13
|
+
from datakeel.core.agent_models import (
|
|
14
|
+
ConversationCreate,
|
|
15
|
+
ConversationDefaults,
|
|
16
|
+
MessageInput,
|
|
17
|
+
Provider,
|
|
18
|
+
ResumeInput,
|
|
19
|
+
)
|
|
20
|
+
from datakeel.core.errors import ValidationError
|
|
21
|
+
from datakeel.core.models import JsonDocument
|
|
22
|
+
from datakeel.core.settings import get_settings
|
|
23
|
+
from datakeel.dataset_store.dataset_service import get_dataset
|
|
24
|
+
from datakeel.delegation.loader import list_agents
|
|
25
|
+
from datakeel.intents.turns import planner_events
|
|
26
|
+
from datakeel.routing.config import load_config, openai_host, route_problem
|
|
27
|
+
from datakeel.routing.service import model_decisions, route_message
|
|
28
|
+
from datakeel.runtime.graph import AgentGraph
|
|
29
|
+
from datakeel.storage import conversation_store as memory
|
|
30
|
+
from datakeel.storage.conversation_lock import response_lock
|
|
31
|
+
from datakeel.storage.conversation_resume import abandoned_token, begin_resume
|
|
32
|
+
from datakeel.storage.data_asset_context import read_agent_histories, require_agent_history
|
|
33
|
+
from datakeel.storage.database import Database
|
|
34
|
+
from datakeel.storage.identity_sessions import (
|
|
35
|
+
bind_session_actor,
|
|
36
|
+
require_session_actor,
|
|
37
|
+
session_actors,
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def create_conversation(
|
|
42
|
+
db: Database, request: ConversationCreate, *, actor: str = "local"
|
|
43
|
+
) -> ConversationView:
|
|
44
|
+
"""Validate an optional workspace and persist the new session configuration."""
|
|
45
|
+
load_config()
|
|
46
|
+
list_agents()
|
|
47
|
+
if request.dataset_id is not None:
|
|
48
|
+
get_dataset(db, request.dataset_id)
|
|
49
|
+
conversation = memory.create(db, request)
|
|
50
|
+
bind_session_actor(db, conversation.id, actor)
|
|
51
|
+
return conversation_view(db, conversation)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def get_conversation(
|
|
55
|
+
db: Database, conversation_id: str, *, actor: str | None = None
|
|
56
|
+
) -> ConversationView:
|
|
57
|
+
"""Read all messages and hydrate plan cards with the latest human decisions."""
|
|
58
|
+
if actor is not None:
|
|
59
|
+
require_session_actor(db, conversation_id, actor)
|
|
60
|
+
return conversation_view(db, read_agent_histories(db, [memory.get(db, conversation_id)])[0])
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def list_conversations(db: Database, *, actor: str | None = None) -> list[ConversationView]:
|
|
64
|
+
"""List persisted local conversations with complete transcript views."""
|
|
65
|
+
conversations = memory.list_all(db)
|
|
66
|
+
actors = session_actors(db, [item.id for item in conversations]) if actor is not None else {}
|
|
67
|
+
selected = [item for item in conversations if actor is None or actors[item.id] == actor]
|
|
68
|
+
return conversation_views(db, read_agent_histories(db, selected))
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def send_message(
|
|
72
|
+
db: Database,
|
|
73
|
+
conversation_id: str,
|
|
74
|
+
request: MessageInput,
|
|
75
|
+
*,
|
|
76
|
+
provider: Provider | None = None,
|
|
77
|
+
actor: str | None = None,
|
|
78
|
+
) -> Iterator[AgentEvent]:
|
|
79
|
+
"""Stream durable events; replay a completed request without executing it again."""
|
|
80
|
+
yield from _respond(db, conversation_id, request, provider, actor)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def resume_conversation(
|
|
84
|
+
db: Database,
|
|
85
|
+
conversation_id: str,
|
|
86
|
+
request: ResumeInput,
|
|
87
|
+
*,
|
|
88
|
+
provider: Provider | None = None,
|
|
89
|
+
actor: str | None = None,
|
|
90
|
+
) -> Iterator[AgentEvent]:
|
|
91
|
+
"""Resume a signed pause with a separate response lease and no synthetic user turn."""
|
|
92
|
+
yield from _respond(db, conversation_id, request, provider, actor)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def _respond(
|
|
96
|
+
db: Database,
|
|
97
|
+
session_id: str,
|
|
98
|
+
request: MessageInput | ResumeInput,
|
|
99
|
+
provider: Provider | None,
|
|
100
|
+
actor: str | None,
|
|
101
|
+
) -> Iterator[AgentEvent]:
|
|
102
|
+
with response_lock(db, session_id):
|
|
103
|
+
if actor is not None:
|
|
104
|
+
require_session_actor(db, session_id, actor)
|
|
105
|
+
if token := abandoned_token(db, session_id):
|
|
106
|
+
close_interrupted(db, session_id, token)
|
|
107
|
+
memory.finish(db, session_id, token, completed=False)
|
|
108
|
+
lease = (
|
|
109
|
+
memory.begin(db, session_id, request)
|
|
110
|
+
if isinstance(request, MessageInput)
|
|
111
|
+
else begin_resume(db, session_id, request)
|
|
112
|
+
)
|
|
113
|
+
with closing(_response_events(db, session_id, lease.token, provider, request)) as events:
|
|
114
|
+
if lease.replay is not None:
|
|
115
|
+
require_agent_history(db, session_id)
|
|
116
|
+
yield from (AgentEvent.model_validate(document.root) for document in lease.replay)
|
|
117
|
+
return
|
|
118
|
+
completed = False
|
|
119
|
+
try:
|
|
120
|
+
for event in events:
|
|
121
|
+
if event.event != "text_delta":
|
|
122
|
+
memory.append(
|
|
123
|
+
db,
|
|
124
|
+
session_id,
|
|
125
|
+
lease.token,
|
|
126
|
+
event=JsonDocument.model_validate(event.model_dump(mode="json")),
|
|
127
|
+
)
|
|
128
|
+
if event.event == "done" and event.agent_path == "main":
|
|
129
|
+
completed = True
|
|
130
|
+
yield event
|
|
131
|
+
finally:
|
|
132
|
+
if not completed:
|
|
133
|
+
close_interrupted(db, session_id, lease.token)
|
|
134
|
+
memory.finish(db, session_id, lease.token, completed=completed)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
def _response_events(
|
|
138
|
+
db: Database,
|
|
139
|
+
conversation_id: str,
|
|
140
|
+
token: str,
|
|
141
|
+
provider: Provider | None,
|
|
142
|
+
request: MessageInput | ResumeInput,
|
|
143
|
+
) -> Generator[AgentEvent]:
|
|
144
|
+
conversation = memory.get(db, conversation_id)
|
|
145
|
+
graph = AgentGraph(db, conversation_id, token, provider)
|
|
146
|
+
events = graph.resume(request) if isinstance(request, ResumeInput) else graph.run()
|
|
147
|
+
route = None
|
|
148
|
+
try:
|
|
149
|
+
with provider_session(conversation.config, provider) as chosen:
|
|
150
|
+
graph.provider = chosen
|
|
151
|
+
if isinstance(request, MessageInput):
|
|
152
|
+
offline = isinstance(chosen, FakeProvider)
|
|
153
|
+
route = route_message(db, conversation, chosen, offline_classifier=offline)
|
|
154
|
+
graph.workflow_confirmation_required = route is not None and route.requires_confirmation
|
|
155
|
+
planned = (
|
|
156
|
+
planner_events(db, conversation, chosen, request.context, token, mode=request.mode)
|
|
157
|
+
if isinstance(request, MessageInput)
|
|
158
|
+
and route is not None
|
|
159
|
+
and route.workflow_id is None
|
|
160
|
+
else None
|
|
161
|
+
)
|
|
162
|
+
yield from events if planned is None else planned
|
|
163
|
+
if route is not None and route.workflow_id is not None:
|
|
164
|
+
yield AgentEvent(event="route", route=route)
|
|
165
|
+
except ValidationError as error:
|
|
166
|
+
yield AgentEvent(event="stopped", stop_reason="configuration_error", text=str(error))
|
|
167
|
+
yield AgentEvent(
|
|
168
|
+
event="done",
|
|
169
|
+
route=route if route is not None and route.workflow_id is None else None,
|
|
170
|
+
model_routes=model_decisions(db, conversation_id, conversation.turns),
|
|
171
|
+
used_memory_ids=graph.used_memories(),
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
def conversation_defaults() -> ConversationDefaults:
|
|
176
|
+
"""Offer routed models when configured, otherwise the offline demo with its reason."""
|
|
177
|
+
settings = get_settings()
|
|
178
|
+
problem = route_problem(settings)
|
|
179
|
+
if problem is not None:
|
|
180
|
+
endpoint = openai_host(settings) if problem == "unrouted_endpoint" else None
|
|
181
|
+
return ConversationDefaults(
|
|
182
|
+
provider="fake", model="fake-demo", problem=problem, endpoint=endpoint
|
|
183
|
+
)
|
|
184
|
+
provider = "openai" if settings.openai_api_key is not None else "anthropic"
|
|
185
|
+
return ConversationDefaults(provider=provider, model="auto")
|
datakeel/agent/tools.py
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
# Copyright 2026 Datakeel contributors
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Keep legacy reads resident and discover catalog reads and controlled actions on demand."""
|
|
5
|
+
|
|
6
|
+
from collections.abc import Callable
|
|
7
|
+
from time import perf_counter
|
|
8
|
+
|
|
9
|
+
from pydantic import ValidationError
|
|
10
|
+
|
|
11
|
+
from datakeel.actions.policy import digest
|
|
12
|
+
from datakeel.actions.registry import action_definitions
|
|
13
|
+
from datakeel.core.agent_models import Conversation, ToolCall, ToolDefinition
|
|
14
|
+
from datakeel.core.ask_models import ASK_DATA_DESCRIPTION
|
|
15
|
+
from datakeel.core.json_schema import compact_schema
|
|
16
|
+
from datakeel.core.llm_data_governance import TRAINING_QUALITY_DESCRIPTION
|
|
17
|
+
from datakeel.core.models import JsonDocument
|
|
18
|
+
from datakeel.delegation.loader import delegate_tool_description
|
|
19
|
+
from datakeel.delegation.models import DelegateParams
|
|
20
|
+
from datakeel.delegation.policy import tool_allowed
|
|
21
|
+
from datakeel.memory.tools import invoke_memory, memory_tool
|
|
22
|
+
from datakeel.ontology.functions import PARAMETER_MODELS, function_definitions
|
|
23
|
+
from datakeel.ontology.standard_functions import STANDARD_TOOL_DESCRIPTIONS
|
|
24
|
+
from datakeel.ontology.tool_history import DEFERRED_READ_FUNCTIONS
|
|
25
|
+
from datakeel.ontology.tool_models import ToolCallContext, ToolInvocationStart, ToolOutcome
|
|
26
|
+
from datakeel.ontology.tool_search import ToolSearchParams, search_tools, tool_search_definition
|
|
27
|
+
from datakeel.ontology.tooling import invoke_tool
|
|
28
|
+
from datakeel.ontology.training_functions import TRAINING_TOOL_DESCRIPTIONS
|
|
29
|
+
from datakeel.storage.conversation_authorization import record_audit
|
|
30
|
+
from datakeel.storage.database import Database
|
|
31
|
+
from datakeel.storage.tool_invocations import (
|
|
32
|
+
begin_invocation,
|
|
33
|
+
finish_invocation,
|
|
34
|
+
invocation_identity,
|
|
35
|
+
replay_invocation,
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def resident_tools() -> list[ToolDefinition]:
|
|
40
|
+
"""Preserve the nine original read schemas and the bounded discovery tool."""
|
|
41
|
+
return [
|
|
42
|
+
ToolDefinition(
|
|
43
|
+
name=item.id,
|
|
44
|
+
description=f"Read {item.id}",
|
|
45
|
+
parameters=compact_schema(item.input_schema),
|
|
46
|
+
)
|
|
47
|
+
for item in function_definitions()
|
|
48
|
+
if item.id not in DEFERRED_READ_FUNCTIONS
|
|
49
|
+
] + [tool_search_definition()]
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def deferred_tools() -> list[ToolDefinition]:
|
|
53
|
+
"""Never advertise approval or execution authority to the model."""
|
|
54
|
+
descriptions = {
|
|
55
|
+
**STANDARD_TOOL_DESCRIPTIONS,
|
|
56
|
+
**TRAINING_TOOL_DESCRIPTIONS,
|
|
57
|
+
"get_training_quality": TRAINING_QUALITY_DESCRIPTION,
|
|
58
|
+
"ask_data": ASK_DATA_DESCRIPTION,
|
|
59
|
+
}
|
|
60
|
+
reads = [
|
|
61
|
+
ToolDefinition(
|
|
62
|
+
name=item.id,
|
|
63
|
+
description=descriptions.get(item.id, f"Read {item.id}"),
|
|
64
|
+
parameters=compact_schema(item.input_schema),
|
|
65
|
+
)
|
|
66
|
+
for item in function_definitions()
|
|
67
|
+
if item.id in DEFERRED_READ_FUNCTIONS
|
|
68
|
+
]
|
|
69
|
+
return [
|
|
70
|
+
*reads,
|
|
71
|
+
memory_tool(),
|
|
72
|
+
ToolDefinition(
|
|
73
|
+
name="delegate_agent",
|
|
74
|
+
description=delegate_tool_description(),
|
|
75
|
+
parameters=compact_schema(
|
|
76
|
+
JsonDocument.model_validate(DelegateParams.model_json_schema())
|
|
77
|
+
),
|
|
78
|
+
),
|
|
79
|
+
*[
|
|
80
|
+
ToolDefinition(
|
|
81
|
+
name=item.id,
|
|
82
|
+
description=f"Prepare {item.id}: {', '.join(item.effects)}"
|
|
83
|
+
+ "; ".join(
|
|
84
|
+
text
|
|
85
|
+
for texts in (*item.phrases.values(), *item.examples.values())
|
|
86
|
+
for text in texts
|
|
87
|
+
),
|
|
88
|
+
parameters=compact_schema(item.params_schema),
|
|
89
|
+
)
|
|
90
|
+
for item in action_definitions()
|
|
91
|
+
],
|
|
92
|
+
]
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
class ToolCatalog:
|
|
96
|
+
"""Track discovered schemas within a persisted conversation."""
|
|
97
|
+
|
|
98
|
+
def __init__(self, conversation: Conversation) -> None:
|
|
99
|
+
"""Recover only discoverable read and action schemas from persisted search results."""
|
|
100
|
+
self.conversation = conversation
|
|
101
|
+
self.core = [
|
|
102
|
+
tool for tool in resident_tools() if tool_allowed(conversation.allowed_tools, tool.name)
|
|
103
|
+
]
|
|
104
|
+
self.deferred = [
|
|
105
|
+
tool for tool in deferred_tools() if tool_allowed(conversation.allowed_tools, tool.name)
|
|
106
|
+
]
|
|
107
|
+
self.loaded: dict[str, ToolDefinition] = {}
|
|
108
|
+
for message in conversation.messages:
|
|
109
|
+
if message.role == "tool" and message.name == "tool_search":
|
|
110
|
+
result = ToolOutcome.model_validate_json(message.content)
|
|
111
|
+
self._load(result)
|
|
112
|
+
|
|
113
|
+
def invoke(
|
|
114
|
+
self,
|
|
115
|
+
db: Database,
|
|
116
|
+
call: ToolCall,
|
|
117
|
+
context: ToolCallContext,
|
|
118
|
+
local: Callable[[ToolCall], ToolOutcome] | None = None,
|
|
119
|
+
) -> ToolOutcome:
|
|
120
|
+
"""Enforce model-visible capabilities even if a provider invents a hidden call."""
|
|
121
|
+
identifier = invocation_identity(context.session_id, call.id)
|
|
122
|
+
previous = replay_invocation(db, identifier, call.name, digest(call.arguments.root))
|
|
123
|
+
if previous is not None and (
|
|
124
|
+
call.name in PARAMETER_MODELS or previous.plan is not None or previous.run is not None
|
|
125
|
+
):
|
|
126
|
+
previous = invoke_tool(db, call.name, call.arguments, context, call_id=call.id)
|
|
127
|
+
if previous is not None:
|
|
128
|
+
if call.name == "tool_search":
|
|
129
|
+
self._load(previous)
|
|
130
|
+
return local(call) if call.name == "delegate_agent" and local is not None else previous
|
|
131
|
+
if call.name == "tool_search":
|
|
132
|
+
return _record_local(db, call, context, self._search(call))
|
|
133
|
+
allowed = {tool.name for tool in self.core} | self.loaded.keys()
|
|
134
|
+
if not tool_allowed(self.conversation.allowed_tools, call.name):
|
|
135
|
+
record_audit(db, self.conversation.id, "", "DELEGATION_DENIED", "tool_scope_exceeded")
|
|
136
|
+
result = ToolOutcome(
|
|
137
|
+
name=call.name, status="FAILED", error="Tool outside delegated scope"
|
|
138
|
+
)
|
|
139
|
+
return _record_local(db, call, context, result)
|
|
140
|
+
if call.name not in allowed:
|
|
141
|
+
result = ToolOutcome(
|
|
142
|
+
name=call.name,
|
|
143
|
+
status="FAILED",
|
|
144
|
+
error="Tool unavailable; discover allowed tools first",
|
|
145
|
+
)
|
|
146
|
+
elif call.name == "delegate_agent" and local is not None:
|
|
147
|
+
return local(call)
|
|
148
|
+
elif call.name == "delegate_agent":
|
|
149
|
+
result = ToolOutcome(
|
|
150
|
+
name=call.name, status="FAILED", error="Delegation requires an active agent graph"
|
|
151
|
+
)
|
|
152
|
+
elif call.name == "write_memory":
|
|
153
|
+
result = invoke_memory(db, call, context)
|
|
154
|
+
else:
|
|
155
|
+
return invoke_tool(db, call.name, call.arguments, context, call_id=call.id)
|
|
156
|
+
return _record_local(db, call, context, result)
|
|
157
|
+
|
|
158
|
+
def _search(self, call: ToolCall) -> ToolOutcome:
|
|
159
|
+
try:
|
|
160
|
+
content = search_tools(
|
|
161
|
+
self.deferred, ToolSearchParams.model_validate(call.arguments.root)
|
|
162
|
+
)
|
|
163
|
+
result = ToolOutcome(name=call.name, status="SUCCEEDED", content=content)
|
|
164
|
+
self._load(result)
|
|
165
|
+
except ValidationError as error:
|
|
166
|
+
result = ToolOutcome(name=call.name, status="FAILED", error=str(error))
|
|
167
|
+
return result
|
|
168
|
+
|
|
169
|
+
def _load(self, result: ToolOutcome) -> None:
|
|
170
|
+
values = result.content.root.get("tools", [])
|
|
171
|
+
if isinstance(values, list):
|
|
172
|
+
allowed = {tool.name for tool in self.deferred}
|
|
173
|
+
for value in values:
|
|
174
|
+
tool = ToolDefinition.model_validate(value)
|
|
175
|
+
if tool.name in allowed:
|
|
176
|
+
self.loaded[tool.name] = tool
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
def _record_local(
|
|
180
|
+
db: Database, call: ToolCall, context: ToolCallContext, outcome: ToolOutcome
|
|
181
|
+
) -> ToolOutcome:
|
|
182
|
+
started = perf_counter()
|
|
183
|
+
identifier = begin_invocation(
|
|
184
|
+
db,
|
|
185
|
+
ToolInvocationStart(
|
|
186
|
+
name=call.name,
|
|
187
|
+
arguments_digest=digest(call.arguments.root),
|
|
188
|
+
argument_keys=sorted(call.arguments.root),
|
|
189
|
+
context=context,
|
|
190
|
+
asset_refs=[],
|
|
191
|
+
identifier=invocation_identity(context.session_id, call.id),
|
|
192
|
+
),
|
|
193
|
+
)
|
|
194
|
+
result = outcome.model_copy(update={"invocation_id": identifier})
|
|
195
|
+
finish_invocation(db, result, (perf_counter() - started) * 1000)
|
|
196
|
+
return result
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Copyright 2026 Datakeel contributors
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Framework-free annotation agreement, review and repair algorithms."""
|
|
5
|
+
|
|
6
|
+
from datakeel.annotation_qa.confidence_tiers import calibrate, task_tier
|
|
7
|
+
from datakeel.annotation_qa.prelabel_crosscheck import agreements, object_confidence
|
|
8
|
+
from datakeel.annotation_qa.prelabel_match import (
|
|
9
|
+
comparable_records,
|
|
10
|
+
compare_records,
|
|
11
|
+
record_objects,
|
|
12
|
+
)
|
|
13
|
+
from datakeel.annotation_qa.prelabel_metrics import prelabel_accuracy
|
|
14
|
+
from datakeel.annotation_qa.review_rules import (
|
|
15
|
+
Draft,
|
|
16
|
+
Neighbour,
|
|
17
|
+
agrees_with_draft,
|
|
18
|
+
draft_reasons,
|
|
19
|
+
near_duplicate_reason,
|
|
20
|
+
)
|
|
21
|
+
from datakeel.annotation_qa.rework import (
|
|
22
|
+
changed_samples,
|
|
23
|
+
compare_rework,
|
|
24
|
+
export_rework_csv,
|
|
25
|
+
export_rework_json,
|
|
26
|
+
)
|
|
27
|
+
from datakeel.annotation_qa.risk_scoring import (
|
|
28
|
+
HIGH_RISK,
|
|
29
|
+
disagreement_reason,
|
|
30
|
+
finding_reason,
|
|
31
|
+
risk_score,
|
|
32
|
+
sample_draw,
|
|
33
|
+
)
|
|
34
|
+
from datakeel.annotation_qa.service import evaluate_annotations, find_suspicions
|
|
35
|
+
|
|
36
|
+
__all__ = [
|
|
37
|
+
"HIGH_RISK",
|
|
38
|
+
"Draft",
|
|
39
|
+
"Neighbour",
|
|
40
|
+
"agreements",
|
|
41
|
+
"agrees_with_draft",
|
|
42
|
+
"calibrate",
|
|
43
|
+
"changed_samples",
|
|
44
|
+
"comparable_records",
|
|
45
|
+
"compare_records",
|
|
46
|
+
"compare_rework",
|
|
47
|
+
"disagreement_reason",
|
|
48
|
+
"draft_reasons",
|
|
49
|
+
"evaluate_annotations",
|
|
50
|
+
"export_rework_csv",
|
|
51
|
+
"export_rework_json",
|
|
52
|
+
"find_suspicions",
|
|
53
|
+
"finding_reason",
|
|
54
|
+
"near_duplicate_reason",
|
|
55
|
+
"object_confidence",
|
|
56
|
+
"prelabel_accuracy",
|
|
57
|
+
"record_objects",
|
|
58
|
+
"risk_score",
|
|
59
|
+
"sample_draw",
|
|
60
|
+
"task_tier",
|
|
61
|
+
]
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Copyright 2026 Datakeel contributors
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Nominal agreement estimates implemented directly from published definitions."""
|
|
5
|
+
|
|
6
|
+
from collections import Counter
|
|
7
|
+
from collections.abc import Sequence
|
|
8
|
+
|
|
9
|
+
import numpy as np
|
|
10
|
+
|
|
11
|
+
from datakeel.core.annotation_models import AgreementValue
|
|
12
|
+
|
|
13
|
+
type Nominal = str | int | tuple[str, ...]
|
|
14
|
+
type Rating = Nominal | None
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _estimate(observed: float, expected: float, count: int) -> AgreementValue:
|
|
18
|
+
if expected >= 1:
|
|
19
|
+
return AgreementValue(
|
|
20
|
+
value=None,
|
|
21
|
+
observed_agreement=observed,
|
|
22
|
+
sample_count=count,
|
|
23
|
+
reason="No expected disagreement: the chance-corrected estimate is undefined",
|
|
24
|
+
)
|
|
25
|
+
return AgreementValue(
|
|
26
|
+
value=float((observed - expected) / (1 - expected)),
|
|
27
|
+
observed_agreement=observed,
|
|
28
|
+
sample_count=count,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def cohen_kappa(left: Sequence[Rating], right: Sequence[Rating]) -> AgreementValue:
|
|
33
|
+
"""Compute Cohen's nominal kappa on paired nonmissing observations.
|
|
34
|
+
|
|
35
|
+
Categories may be full multilabel tuples; their order must be canonicalized by
|
|
36
|
+
the caller. A single observed category is explicitly undefined, not perfect.
|
|
37
|
+
"""
|
|
38
|
+
if len(left) != len(right):
|
|
39
|
+
message = "Cohen ratings must have equal lengths"
|
|
40
|
+
raise ValueError(message)
|
|
41
|
+
paired = [(a, b) for a, b in zip(left, right, strict=True) if a is not None and b is not None]
|
|
42
|
+
count = len(paired)
|
|
43
|
+
if not count:
|
|
44
|
+
return AgreementValue(value=None, reason="No paired ratings")
|
|
45
|
+
left_counts = Counter(a for a, _ in paired)
|
|
46
|
+
right_counts = Counter(b for _, b in paired)
|
|
47
|
+
observed = float(np.mean([a == b for a, b in paired]))
|
|
48
|
+
expected = sum(n * right_counts[label] for label, n in left_counts.items()) / count**2
|
|
49
|
+
return _estimate(observed, expected, count)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def _counts(rows: Sequence[Sequence[Nominal]]) -> np.ndarray[tuple[int, int], np.dtype[np.float64]]:
|
|
53
|
+
categories = list(dict.fromkeys(value for row in rows for value in row))
|
|
54
|
+
return np.asarray(
|
|
55
|
+
[[Counter(row)[category] for category in categories] for row in rows], dtype=np.float64
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def fleiss_kappa(ratings: Sequence[Sequence[Rating]]) -> AgreementValue:
|
|
60
|
+
"""Compute Fleiss kappa with equal numbers of nonmissing ratings per unit.
|
|
61
|
+
|
|
62
|
+
Rows are units. Completely missing rows are excluded. Unequal panel sizes
|
|
63
|
+
produce an explicit undefined result; Krippendorff alpha handles that case.
|
|
64
|
+
"""
|
|
65
|
+
rows = [[value for value in row if value is not None] for row in ratings]
|
|
66
|
+
rows = [row for row in rows if row]
|
|
67
|
+
sizes = {len(row) for row in rows}
|
|
68
|
+
if not rows or len(sizes) != 1 or min(sizes) < 2: # noqa: PLR2004 # Agreement needs two ratings.
|
|
69
|
+
return AgreementValue(
|
|
70
|
+
value=None,
|
|
71
|
+
sample_count=len(rows),
|
|
72
|
+
reason="Fleiss kappa requires a constant panel size of at least two",
|
|
73
|
+
)
|
|
74
|
+
counts = _counts(rows)
|
|
75
|
+
panel = len(rows[0])
|
|
76
|
+
observed = float(np.mean((np.sum(counts**2, axis=1) - panel) / (panel * (panel - 1))))
|
|
77
|
+
proportions = np.sum(counts, axis=0) / (len(rows) * panel)
|
|
78
|
+
expected = float(np.sum(proportions**2))
|
|
79
|
+
return _estimate(observed, expected, len(rows))
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def krippendorff_alpha(ratings: Sequence[Sequence[Rating]]) -> AgreementValue:
|
|
83
|
+
"""Compute nominal alpha using pairable-unit coincidence weights.
|
|
84
|
+
|
|
85
|
+
Missing ratings and units with fewer than two observations contribute no
|
|
86
|
+
coincidences, including no category marginals. Expected disagreement uses
|
|
87
|
+
sampling without replacement, including its finite-sample correction.
|
|
88
|
+
"""
|
|
89
|
+
rows = [[value for value in row if value is not None] for row in ratings]
|
|
90
|
+
rows = [row for row in rows if len(row) > 1]
|
|
91
|
+
if not rows:
|
|
92
|
+
return AgreementValue(value=None, reason="No pairable units")
|
|
93
|
+
counts = _counts(rows)
|
|
94
|
+
sizes = np.sum(counts, axis=1)
|
|
95
|
+
total = float(np.sum(sizes))
|
|
96
|
+
disagreement = float(np.sum((sizes**2 - np.sum(counts**2, axis=1)) / (sizes - 1))) / total
|
|
97
|
+
marginals = np.sum(counts, axis=0)
|
|
98
|
+
expected = float((total**2 - np.sum(marginals**2)) / (total * (total - 1)))
|
|
99
|
+
return _estimate(1 - disagreement, 1 - expected, len(rows))
|