Wire judge-prompt localization into factory and inline scorer
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -24,6 +24,7 @@ from ragas.metrics.collections import (
|
||||
SemanticSimilarity,
|
||||
)
|
||||
|
||||
from .judge_prompts import localize_pipeline_prompts
|
||||
from .pipeline import MetricPipeline
|
||||
|
||||
|
||||
@@ -133,7 +134,11 @@ def build_metric_pipeline(
|
||||
|
||||
# Build the full registry once using the shared factory, then slice by requested metrics.
|
||||
registry = build_metric_registry(llm, embeddings)
|
||||
selected = {name: registry[name] for name in scenario.metrics}
|
||||
# Apply language-specific judge prompt localization (no-op for 'en').
|
||||
language = scenario.judge_language or settings.ragas_judge_language or "en"
|
||||
localize_pipeline_prompts(selected, language)
|
||||
return MetricPipeline(
|
||||
metrics={name: registry[name] for name in scenario.metrics},
|
||||
metrics=selected,
|
||||
metric_timeout_seconds=settings.ragas_metric_timeout_seconds,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user