Skip to content

Commit

Permalink
fix (bug): resolve TypeError: get_field_value_from_trace_tree() missi…
Browse files Browse the repository at this point in the history
…ng 1 required positional argument: 'version'
  • Loading branch information
aybruhm committed Nov 25, 2024
1 parent b71bba8 commit 3c63f76
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions agenta-backend/agenta_backend/services/evaluators_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,9 +957,13 @@ async def rag_faithfulness(
trace = process_distributed_trace_into_trace_tree(trace, version)

# Get value of required keys for rag evaluator
question_val: Any = get_field_value_from_trace_tree(trace, question_key)
answer_val: Any = get_field_value_from_trace_tree(trace, answer_key)
contexts_val: Any = get_field_value_from_trace_tree(trace, contexts_key)
question_val: Any = get_field_value_from_trace_tree(
trace, question_key, version
)
answer_val: Any = get_field_value_from_trace_tree(trace, answer_key, version)
contexts_val: Any = get_field_value_from_trace_tree(
trace, contexts_key, version
)

if None in [question_val, answer_val, contexts_val]:
logging.error(
Expand Down Expand Up @@ -1065,9 +1069,13 @@ async def rag_context_relevancy(
trace = process_distributed_trace_into_trace_tree(trace, version)

# Get value of required keys for rag evaluator
question_val: Any = get_field_value_from_trace_tree(trace, question_key)
answer_val: Any = get_field_value_from_trace_tree(trace, answer_key)
contexts_val: Any = get_field_value_from_trace_tree(trace, contexts_key)
question_val: Any = get_field_value_from_trace_tree(
trace, question_key, version
)
answer_val: Any = get_field_value_from_trace_tree(trace, answer_key, version)
contexts_val: Any = get_field_value_from_trace_tree(
trace, contexts_key, version
)

if None in [question_val, answer_val, contexts_val]:
logging.error(
Expand Down

0 comments on commit 3c63f76

Please sign in to comment.