-
-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GSK-4033] Fix correctness aggregation error #2090
base: main
Are you sure you want to change the base?
[GSK-4033] Fix correctness aggregation error #2090
Conversation
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, however I'm thinking it would be better to add those check inside the parse_json_output
since it has a builtin feature to ask the llm to correct the json output
out.content, | ||
llm_client=llm_client, | ||
keys=["correctness", "correctness_reason"], | ||
caller_id=self.__class__.__name__, | ||
) | ||
|
||
if "correctness" in json_output and not isinstance(json_output["correctness"], bool): | ||
raise LLMGenerationError( | ||
f"Error in correctness evaluation: {json_output['correctness']}. Please make sure the agent answer is correctly formatted." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching to repr
is better so we can differentiate "True"
from True
, also
f"Error in correctness evaluation: {json_output['correctness']}. Please make sure the agent answer is correctly formatted." | |
f"Error in correctness evaluation: {repr(json_output['correctness'])}. Please make sure the agent answer is correctly formatted. Correctness value should be of boolean type." |
Description
Related Issue
Type of Change
Checklist
CODE_OF_CONDUCT.md
document.CONTRIBUTING.md
guide.pdm.lock
runningpdm update-lock
(only applicable whenpyproject.toml
has beenmodified)