Skip to content

RelevancyEvaluator problem #4902

@alfonso-lendinez

Description

@alfonso-lendinez

Bug description
method evaluate of RelevancyEvaluator always returns passing false

Problem is with Git commit caed4b3 of @remeio

https://github.com/spring-projects/spring-ai/commit/caed4b3705126ed8dfd2077c3177c9c7c2b8a963

specifically with this condition:

if ("yes".equalsIgnoreCase(evaluationResponse))

Because LLM response is "YES\n", due to DEFAULT_PROMPT_TEMPLATE:

"Answer YES, if the response for the query is in line with context information otherwise NO."

And the condition fails because of the line break after "YES" (because the using of "equals" instead of "contains")

Environment
Spring AI version 1.1.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions