Skip to content

Commit

Permalink
fix: corrected how input metrics influence output columns
Browse files Browse the repository at this point in the history
  • Loading branch information
kmaphoenix committed Oct 10, 2024
1 parent 326f4cf commit 468b56d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/dfcx_scrapi/tools/evaluations.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ def __init__(
self.generation_model = self.model_setup(generation_model)
self.embedding_model = self.model_setup(embedding_model)

self.user_input_metrics = metrics
self.metrics = build_metrics(
metrics=metrics,
metrics=self.user_input_metrics,
generation_model=self.generation_model,
embedding_model=self.embedding_model
)
Expand Down Expand Up @@ -189,7 +190,7 @@ def add_response_columns(self, df: pd.DataFrame) -> pd.DataFrame:
df.loc[:, "session_id"] = pd.Series(dtype="str")
df.loc[:, "res_playbook_name"] = pd.Series(dtype="str")

if "tool_call_quality" in self.metrics:
if "tool_call_quality" in self.user_input_metrics:
df.loc[:, "res_tool_name"] = pd.Series(dtype="str")
df.loc[:, "res_tool_action"] = pd.Series(dtype="str")
df.loc[:, "res_input_params"] = pd.Series(dtype="str")
Expand Down Expand Up @@ -243,7 +244,7 @@ def run_detect_intent_queries(self, df: pd.DataFrame) -> pd.DataFrame:
)

# Handle Tool Invocations
if "tool_call_quality" in self.metrics:
if "tool_call_quality" in self.user_input_metrics:
tool_responses = self.s.collect_tool_responses(res)
if len(tool_responses) > 0:
df = self.process_tool_invocations(
Expand Down
2 changes: 0 additions & 2 deletions tests/dfcx_scrapi/core/test_agents.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Test Class for Agent Methods in SCRAPI."""

# pylint: disable=redefined-outer-name

# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down

0 comments on commit 468b56d

Please sign in to comment.