diff --git a/scripts/ingest.sh b/scripts/ingest.sh index 46b2060d..fd898b4e 100755 --- a/scripts/ingest.sh +++ b/scripts/ingest.sh @@ -20,7 +20,7 @@ for arg in "$@"; do echo "Ingest a document into Vektra." echo "" echo "Arguments:" - echo " FILE Path to the document (PDF, DOCX, PPTX)" + echo " FILE Path to the document (PDF, DOCX, PPTX, MD)" echo " NAMESPACE Target namespace (default: 'default')" echo "" echo "Environment:" @@ -62,7 +62,7 @@ case "${FILENAME##*.}" in pdf) CONTENT_TYPE="application/pdf" ;; docx) CONTENT_TYPE="application/vnd.openxmlformats-officedocument.wordprocessingml.document" ;; pptx) CONTENT_TYPE="application/vnd.openxmlformats-officedocument.presentationml.presentation" ;; - md) CONTENT_TYPE="text/markdown" ;; + md|markdown) CONTENT_TYPE="text/markdown" ;; *) CONTENT_TYPE="application/octet-stream" ;; esac diff --git a/vektra-core/src/vektra_core/safeguards/__init__.py b/vektra-core/src/vektra_core/safeguards/__init__.py index 8ea802a2..01eaa747 100644 --- a/vektra-core/src/vektra_core/safeguards/__init__.py +++ b/vektra-core/src/vektra_core/safeguards/__init__.py @@ -24,7 +24,9 @@ def create_safeguard(mode: str, *, pii_chunk_threshold: int = 3) -> SafeguardHoo Returns: A SafeguardHook implementation. """ - if mode == "presidio": + normalized = mode.strip().lower() + + if normalized == "presidio": try: from vektra_core.safeguards.presidio import PresidioPIISafeguard @@ -37,7 +39,7 @@ def create_safeguard(mode: str, *, pii_chunk_threshold: int = 3) -> SafeguardHoo ) return PassthroughSafeguard() - if mode != "passthrough": + if normalized != "passthrough": log.warning("safeguard_unknown_mode", mode=mode, fallback="passthrough") return PassthroughSafeguard() diff --git a/vektra-learn/src/vektra_learn/service.py b/vektra-learn/src/vektra_learn/service.py index fed4af37..cf872643 100644 --- a/vektra-learn/src/vektra_learn/service.py +++ b/vektra-learn/src/vektra_learn/service.py @@ -52,6 +52,7 @@ class TokenRequest(BaseModel): course_id: str = Field(min_length=1, max_length=255) namespace: str | None = Field( default=None, + min_length=1, max_length=64, description="Override namespace in JWT. When omitted, course_id is used as namespace convention.", )