docs: update RagasEvaluator to reflect Ragas 0.4.3 API changes#11186
Open
ritikraj2425 wants to merge 1 commit intodeepset-ai:mainfrom
Open
docs: update RagasEvaluator to reflect Ragas 0.4.3 API changes#11186ritikraj2425 wants to merge 1 commit intodeepset-ai:mainfrom
ritikraj2425 wants to merge 1 commit intodeepset-ai:mainfrom
Conversation
|
@ritikraj2425 is attempting to deploy a commit to the deepset Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
Hey @ritikraj2425 thanks for opening! Could you handle the merge conflict? |
sjrl
reviewed
Apr 29, 2026
Comment on lines
+54
to
57
| #### Evaluate Answer Relevancy | ||
|
|
||
| To create a context-relevance evaluation pipeline: | ||
| To create an answer relevancy evaluation pipeline: | ||
|
|
Contributor
There was a problem hiding this comment.
Let's add a note that the env variable OPENAI_API_KEY must be set for the code block below to work.
sjrl
reviewed
Apr 29, 2026
| pipeline = Pipeline() | ||
| evaluator = RagasEvaluator( | ||
| metric=RagasMetric.ANSWER_RELEVANCY, | ||
| ragas_metrics=[AnswerRelevancy(llm=llm)], |
Contributor
There was a problem hiding this comment.
If we want to make this an example about AnswerRelevancy we also need to set the embeddings param
embeddings=embedding_factory("openai", model="text-embedding-3-small", client=client)
AnswerRelevancy(llm=llm, embeddings=embeddings)
sjrl
reviewed
Apr 29, 2026
| RagasEvaluator, | ||
| RagasMetric, | ||
| ) | ||
| from haystack_integrations.components.evaluators.ragas import RagasEvaluator |
Contributor
There was a problem hiding this comment.
Please run this code block locally to make sure it works
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.
Related Issues
Proposed Changes:
Update the
RagasEvaluatordocumentation to reflect the breaking changes in the Ragas 0.4.3 integration:RagasMetricenum andmetric_paramsto the modern Ragas metrics API. Documentation now reflects that metrics should be initialized as classes fromragas.metrics.collections(e.g.,AnswerRelevancy(llm=llm)).run()Method: Reflected the change in therun()method signature. The component now accepts explicit arguments likequery,response,documents, andreferenceinstead of a nestedinputsdictionary.AsyncOpenAIandllm_factory, which is the new recommended pattern for configuring Ragas metrics.ragasevaluator.mdxfile.How did you test it?
RagasEvaluatorimplementation in thehaystack-core-integrationsrepository (PR #3207).Notes for the reviewer
.mdxdocumentation in sync with the automatically generated API reference (which was already updated in the main repository).Checklist
docs: