mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 13:18:18 +00:00
Only evaluate non-empty responses to reduce eval script latency, cost
Empty responses by Khoj will always be an incorrect response, so no need to make call to an evaluator agent to check that
This commit is contained in:
@@ -113,7 +113,11 @@ def process_batch(batch, counter, results, dataset_length):
|
||||
agent_response = get_agent_response(prompt)
|
||||
|
||||
# Evaluate response
|
||||
evaluation = evaluate_response(prompt, agent_response, answer)
|
||||
if agent_response is None or agent_response.strip() == "":
|
||||
evaluation["decision"] = False
|
||||
evaluation["explanation"] = "Agent response is empty. This maybe due to a service error."
|
||||
else:
|
||||
evaluation = evaluate_response(prompt, agent_response, answer)
|
||||
|
||||
# Store results
|
||||
results.append(
|
||||
|
||||
Reference in New Issue
Block a user