Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 Overview
This PR introduces a complete RAG evaluation pipeline using DeepEval, including dynamic generation of answers and contexts via a pytest fixture.
Este PR introduz um pipeline completo de avaliação de RAG usando DeepEval, incluindo geração dinâmica de respostas e contextos via fixture do pytest.
The goal is to ensure consistent and reproducible evaluation of the RAG system without relying on pre-generated data.
O objetivo é garantir uma avaliação consistente e reproduzível do sistema RAG sem depender de dados pré-gerados.
What was done
Implemented dynamic dataset enrichment inside conftest.py (answers and retrieval contexts generated on-the-fly via RAGPipeline).
Implementado enriquecimento dinâmico do dataset dentro do conftest.py (respostas e contextos gerados em tempo de execução via RAGPipeline).
Replaced deprecated/non-existent AnswerCorrectnessMetric with GEval using custom correctness criteria.
Substituído o AnswerCorrectnessMetric (depreciado/inexistente) por GEval com critérios customizados de corretude.
Added evaluation test suite with standard and domain-specific metrics.
Adicionada suíte de testes de avaliação com métricas padrão e específicas de domínio.
test_evaluate.pyuses standard metrics such as faithfulness, relevancy, and context evaluation.O test_evaluate.py utiliza métricas padrão como faithfulness, relevância e avaliação de contexto.
test_geval.pyevaluates domain-specific aspects such as AI history accuracy.O test_geval.py avalia aspectos específicos do domínio, como precisão histórica da IA.
Integrated a session-scoped pytest fixture to avoid reprocessing and improve performance.
Integrado um fixture com escopo de sessão no pytest para evitar reprocessamento e melhorar a performance.
Added HTML evaluation reports generated by DeepEval.
Adicionados relatórios HTML de avaliação gerados pelo DeepEval.
Metrics Coverage
Standard metrics include faithfulness, answer relevancy, context precision, and context recall.
As métricas padrão incluem faithfulness, relevância da resposta, precisão de contexto e recall de contexto.
Custom evaluation with GEval includes correctness, historical accuracy, completeness, and no external knowledge leakage.
A avaliação customizada com GEval inclui corretude, precisão histórica, completude e ausência de uso de conhecimento externo.
Key Improvement
Previously, the dataset was incomplete and evaluation was limited.
Antes, o dataset era incompleto e a avaliação era limitada.
Now, the dataset is dynamically enriched and evaluation better reflects real RAG behavior.
Agora, o dataset é enriquecido dinamicamente e a avaliação reflete melhor o comportamento real do RAG.
The same dataset is reused across multiple metrics for consistency.
O mesmo dataset é reutilizado entre múltiplas métricas para garantir consistência.
The .env.local file was excluded due to sensitive data.
O arquivo .env.local foi excluído por conter dados sensíveis.
HTML evaluation reports were included for analysis purposes.
Os relatórios HTML foram incluídos para análise.
How to test
Run tests locally using pytest (this does not send data to Confident AI).
Execute os testes localmente com pytest (isso não envia dados para o Confident AI).
pytest tests/test_evaluate.py -vPara ver no Confident AI
Passo 1 — fazer login (uma vez só)
deepeval login
Vai pedir a API key que você copia em app.confident-ai.com → Settings → Project API Key.
Passo 2 — rodar com o comando do DeepEval, não com pytest direto
deepeval test run tests/test_evaluate.pyEsse comando faz as duas coisas: roda os testes E sincroniza os resultados com o Confident AI automaticamente.
Depois de rodar
deepeval viewAbre o browser direto no dashboard com os resultados daquela execução.Cada pergunta, cada score, cada reasoning, tudo que você viu no terminal mas agora navegável e visual.