Skip to content

Commit bd4ade5

Browse files
authored
additional tests and a bugfix for the metrics calculations (#269)
1 parent 1ff83d5 commit bd4ade5

File tree

2 files changed

+551
-4
lines changed

2 files changed

+551
-4
lines changed

llm-service/app/services/metrics.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,11 @@ def generate_metrics(metric_filter: Optional[MetricFilter] = None) -> Metrics:
209209
output_word_count_over_time.append(
210210
(run.info.start_time, run.data.metrics.get("output_word_count", 0))
211211
)
212-
faithfulness_total += run.data.metrics.get("faithfulness", 0)
213-
relevance_total += run.data.metrics.get("relevance", 0)
212+
213+
# Only accumulate faithfulness and relevance for non-direct LLM runs
214+
if run.data.tags.get("direct_llm") != "True":
215+
faithfulness_total += run.data.metrics.get("faithfulness", 0)
216+
relevance_total += run.data.metrics.get("relevance", 0)
214217

215218
artifact: FileInfo
216219
for artifact in artifacts:

0 commit comments

Comments
 (0)