This commit is contained in:
1 parent
5225090490
commit
e93bab6ea7
50 files changed
+66
-164
No files matched your search
@@ -64,7 +64,7 @@ import urllib.error
|
||||
import urllib.request
|
||||
from typing import Any, Dict, List
|
||||
|
||||
from app.core.qdrant import QdrantConfig, get_client, collection_names
|
||||
from app.core.database.qdrant import QdrantConfig, get_client, collection_names
|
||||
|
||||
REQUIRED = {
|
||||
"notes": ["note_id", "type", "title", "updated", "tags"],
|
||||
|
||||
@@ -61,9 +61,10 @@ import argparse, glob, json, os
|
||||
from typing import List, Tuple
|
||||
|
||||
from app.core.parser import read_markdown # gibt je nach Implementierung ein Objekt ODER ein (fm, body)-Tuple
|
||||
from app.core.qdrant import QdrantConfig, get_client, ensure_collections
|
||||
from app.core.qdrant_points import points_for_edges, upsert_batch
|
||||
from app.core.derive_edges import build_note_index, derive_wikilink_edges
|
||||
from app.core.database.qdrant import QdrantConfig, get_client, ensure_collections
|
||||
from app.core.database.qdrant_points import points_for_edges, upsert_batch
|
||||
# TODO: build_note_index und derive_wikilink_edges müssen noch implementiert werden
|
||||
# from app.core.graph.graph_derive_edges import build_note_index, derive_wikilink_edges
|
||||
|
||||
|
||||
def _coerce_parsed(note_or_tuple):
|
||||
|
||||
@@ -71,7 +71,7 @@ from pathlib import Path
|
||||
sys.path.insert(0, os.path.abspath("."))
|
||||
|
||||
from app.core.chunking import assemble_chunks
|
||||
from app.core.derive_edges import build_edges_for_note
|
||||
from app.core.graph.graph_derive_edges import build_edges_for_note
|
||||
from app.core.parser import extract_wikilinks
|
||||
from app.core.graph.graph_extractors import extract_typed_relations, extract_callout_relations
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ v1.0.0: Initial Release
|
||||
"""
|
||||
from __future__ import annotations
|
||||
import argparse, os, json
|
||||
from app.core.qdrant import QdrantConfig, get_client
|
||||
from app.core.database.qdrant import QdrantConfig, get_client
|
||||
|
||||
def count_points(client, collection: str) -> int:
|
||||
try:
|
||||
|
||||
@@ -60,7 +60,7 @@ import urllib.request
|
||||
import urllib.error
|
||||
from typing import Any, Dict
|
||||
|
||||
from app.core.qdrant import QdrantConfig, get_client, collection_names
|
||||
from app.core.database.qdrant import QdrantConfig, get_client, collection_names
|
||||
|
||||
|
||||
def _safe_model_dump(obj: Any) -> Dict[str, Any]:
|
||||
|
||||
@@ -76,7 +76,7 @@ from pathlib import Path
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
from app.core.parser import read_markdown, normalize_frontmatter
|
||||
from app.core.derive_edges import build_edges_for_note
|
||||
from app.core.graph.graph_derive_edges import build_edges_for_note
|
||||
|
||||
def _iter_markdown(vault: str):
|
||||
for p in Path(vault).rglob("*.md"):
|
||||
|
||||
@@ -67,7 +67,7 @@ import json
|
||||
from collections import Counter, defaultdict
|
||||
from typing import Dict, Any, List, Tuple
|
||||
|
||||
from app.core.qdrant import QdrantConfig, get_client
|
||||
from app.core.database.qdrant import QdrantConfig, get_client
|
||||
from qdrant_client.http import models as rest
|
||||
|
||||
|
||||
|
||||
@@ -80,8 +80,7 @@ from typing import Dict, List, Optional, Tuple, Any
|
||||
import yaml
|
||||
from qdrant_client.http import models as rest
|
||||
|
||||
from app.core.qdrant import QdrantConfig, get_client
|
||||
from app.core.qdrant import ensure_collections # safety
|
||||
from app.core.database.qdrant import QdrantConfig, get_client, ensure_collections
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Helpers
|
||||
|
||||
@@ -77,7 +77,7 @@ from qdrant_client import QdrantClient
|
||||
from qdrant_client.http import models as rest
|
||||
|
||||
from app.core.parser import read_markdown, normalize_frontmatter, validate_required_frontmatter # :contentReference[oaicite:5]{index=5}
|
||||
from app.core.qdrant import QdrantConfig, get_client, collection_names # :contentReference[oaicite:6]{index=6}
|
||||
from app.core.database.qdrant import QdrantConfig, get_client, collection_names # :contentReference[oaicite:6]{index=6}
|
||||
|
||||
def iter_note_ids_from_vault(vault_root: str) -> Set[str]:
|
||||
"""Liest alle Markdown-Dateien im Vault und sammelt valide Frontmatter-IDs."""
|
||||
|
||||
@@ -73,7 +73,7 @@ from app.core.parser import read_markdown, normalize_frontmatter, validate_requi
|
||||
from app.core.chunking import assemble_chunks
|
||||
from app.core.ingestion.ingestion_note_payload import make_note_payload
|
||||
from app.core.ingestion.ingestion_chunk_payload import make_chunk_payloads
|
||||
from app.core.derive_edges import build_edges_for_note
|
||||
from app.core.graph.graph_derive_edges import build_edges_for_note
|
||||
|
||||
async def process_file(path: str, root: str, args):
|
||||
"""Verarbeitet eine einzelne Datei asynchron."""
|
||||
|
||||
@@ -85,7 +85,7 @@ from typing import Dict, List, Set, Tuple
|
||||
from qdrant_client import QdrantClient
|
||||
from qdrant_client.http import models as rest
|
||||
|
||||
from app.core.qdrant import QdrantConfig, get_client, collection_names
|
||||
from app.core.database.qdrant import QdrantConfig, get_client, collection_names
|
||||
from app.core.parser import read_markdown, normalize_frontmatter
|
||||
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ import os
|
||||
from typing import List, Dict, Any
|
||||
|
||||
from qdrant_client.http import models as rest
|
||||
from app.core.qdrant import QdrantConfig, get_client
|
||||
from app.core.database.qdrant import QdrantConfig, get_client
|
||||
|
||||
def collections(prefix: str):
|
||||
return f"{prefix}_notes", f"{prefix}_chunks", f"{prefix}_edges"
|
||||
|
||||
@@ -83,7 +83,7 @@ from dotenv import load_dotenv
|
||||
from qdrant_client import QdrantClient
|
||||
from qdrant_client.http import models as rest
|
||||
|
||||
from app.core.qdrant import (
|
||||
from app.core.database.qdrant import (
|
||||
QdrantConfig,
|
||||
get_client,
|
||||
ensure_collections,
|
||||
|
||||
@@ -70,8 +70,8 @@ import uuid
|
||||
from typing import List, Dict, Any, Iterable
|
||||
|
||||
from qdrant_client import models
|
||||
from app.core.qdrant import QdrantConfig, get_client
|
||||
from app.core.qdrant_points import points_for_edges
|
||||
from app.core.database.qdrant import QdrantConfig, get_client
|
||||
from app.core.database.qdrant_points import points_for_edges
|
||||
|
||||
# Logging Setup
|
||||
logging.basicConfig(level=logging.INFO, format="%(asctime)s [%(levelname)s] %(message)s")
|
||||
|
||||
@@ -67,7 +67,7 @@ from typing import Dict, List, Tuple, Optional
|
||||
|
||||
from qdrant_client.http import models as rest
|
||||
|
||||
from app.core.qdrant import QdrantConfig, get_client, collection_names
|
||||
from app.core.database.qdrant import QdrantConfig, get_client, collection_names
|
||||
|
||||
def _chunk_sort_key(p: Dict, pid: str) -> Tuple[int,int,str]:
|
||||
# Primär: payload.chunk_index, sekundär: Nummer am Ende der ID (#cNN oder #NN), sonst 0
|
||||
|
||||
Reference in new issue
Block a user