Forward glossary provenance without transcript substitution
This commit is contained in:
@@ -355,6 +355,11 @@ def render_glossary_terms(entries: Iterable[GlossaryEntry]) -> list[str]:
|
||||
return rendered
|
||||
|
||||
|
||||
def glossary_alias_mapping(entries: Iterable[GlossaryEntry]) -> dict[str, str]:
|
||||
"""Return explicit alias configuration for provenance, not substitution."""
|
||||
return {alias: entry.canonical_term for entry in entries for alias in entry.aliases}
|
||||
|
||||
|
||||
def _timestamp() -> str:
|
||||
return datetime.now(UTC).isoformat(timespec="seconds")
|
||||
|
||||
|
||||
@@ -15,7 +15,11 @@ from uuid import uuid4
|
||||
import yaml
|
||||
|
||||
from mka.application.config import AppSettings
|
||||
from mka.application.glossary import GlossaryRepository, render_glossary_terms
|
||||
from mka.application.glossary import (
|
||||
GlossaryRepository,
|
||||
glossary_alias_mapping,
|
||||
render_glossary_terms,
|
||||
)
|
||||
from mka.application.performance import DEFAULT_PERFORMANCE_PROFILE, resolve_ollama_num_thread
|
||||
|
||||
STAGES = ("preparing", "transcription", "diarization", "protocol_generation")
|
||||
@@ -231,6 +235,7 @@ class MeetingProcessingService:
|
||||
"model": self.settings.protocol_model,
|
||||
"ollama_endpoint": self.settings.ollama_endpoint,
|
||||
"protocol_num_ctx": self.settings.protocol_num_ctx,
|
||||
"glossary_aliases": glossary_alias_mapping(self.glossary.list(active_only=True)),
|
||||
"protocol_num_thread": resolve_ollama_num_thread(options.performance_profile),
|
||||
"protocol_safe_input_token_budget": (
|
||||
self.settings.protocol_safe_input_token_budget
|
||||
@@ -405,6 +410,7 @@ class MeetingProcessingService:
|
||||
model=self.settings.protocol_model,
|
||||
ollama_endpoint=self.settings.ollama_endpoint,
|
||||
protocol_num_ctx=self.settings.protocol_num_ctx,
|
||||
glossary_aliases=glossary_alias_mapping(self.glossary.list(active_only=True)),
|
||||
protocol_num_thread=resolve_ollama_num_thread(performance_profile),
|
||||
protocol_safe_input_token_budget=(self.settings.protocol_safe_input_token_budget),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user