refactor: Remove name 'llm' from LLMEvaluator output (#7479)

This commit is contained in:
Julian Risch 2024-04-04 17:19:30 +02:00 committed by GitHub
parent 8b8a93bc0d
commit 8ef6062748
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 2 deletions

View File

@ -166,7 +166,6 @@ class LLMEvaluator:
self.validate_outputs(expected=self.outputs, received=result["replies"][0])
parsed_result = json.loads(result["replies"][0])
parsed_result["name"] = "llm"
results.append(parsed_result)
return {"results": results}

View File

@ -265,7 +265,7 @@ class TestLLMEvaluator:
monkeypatch.setattr("haystack.components.generators.openai.OpenAIGenerator.run", generator_run)
results = component.run(questions=["What is the capital of Germany?"], responses=["Berlin"])
assert results == {"results": [{"score": 0.5, "name": "llm"}]}
assert results == {"results": [{"score": 0.5}]}
def test_prepare_template(self, monkeypatch):
monkeypatch.setenv("OPENAI_API_KEY", "test-api-key")