letzte bereinigungen

This commit is contained in:
Lars committed 2025-12-18 14:30:24 +01:00
1 parent 136c3bb43f
commit e47241740d
3 files changed
+90 -71

No files matched your search

+8 -4
View File
@@ -1,10 +1,10 @@
"""
FILE: app/models/dto.py
DESCRIPTION: Pydantic-Modelle (DTOs) für Request/Response Bodies. Definiert das API-Schema.
VERSION: 0.6.3 (WP-22 Semantic Graph Routing & Lifecycle)
VERSION: 0.6.4 (WP-22 Semantic Graph Routing, Lifecycle & Provenance)
STATUS: Active
DEPENDENCIES: pydantic, typing, uuid
LAST_ANALYSIS: 2025-12-15
LAST_ANALYSIS: 2025-12-18
"""
from __future__ import annotations
@@ -12,6 +12,7 @@ from pydantic import BaseModel, Field
from typing import List, Literal, Optional, Dict, Any
import uuid
# WP-22: Definition der gültigen Kanten-Typen gemäß Manual
EdgeKind = Literal["references", "references_at", "backlink", "next", "prev", "belongs_to", "depends_on", "related_to", "similar_to", "caused_by", "derived_from", "based_on", "solves", "blocks", "uses", "guides"]
@@ -40,6 +41,9 @@ class EdgeDTO(BaseModel):
target: str
weight: float
direction: Literal["out", "in", "undirected"] = "out"
# WP-22: Provenance Tracking (Herkunft und Vertrauen)
provenance: Optional[Literal["explicit", "rule", "smart", "structure"]] = "explicit"
confidence: float = 1.0
# --- Request Models ---
@@ -65,7 +69,7 @@ class QueryRequest(BaseModel):
class FeedbackRequest(BaseModel):
"""
User-Feedback zu einem spezifischen Treffer oder der Gesamtantwort.
User-Feedback zu einem spezifischen Treffer oder der Gesamtantwort (Basis für WP-08).
"""
query_id: str = Field(..., description="ID der ursprünglichen Suche")
# node_id ist optional: Wenn leer oder "generated_answer", gilt es für die Antwort.
@@ -90,7 +94,7 @@ class ChatRequest(BaseModel):
# --- WP-04b Explanation Models ---
class ScoreBreakdown(BaseModel):
"""Aufschlüsselung der Score-Komponenten."""
"""Aufschlüsselung der Score-Komponenten nach der WP-22 Formel."""
semantic_contribution: float
edge_contribution: float
centrality_contribution: float