Skip to content
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

LLM-based evaluators not always returning a valid JSON #7668

Closed
davidsbatista opened this issue May 8, 2024 · 0 comments · Fixed by #7692
Closed

LLM-based evaluators not always returning a valid JSON #7668

davidsbatista opened this issue May 8, 2024 · 0 comments · Fixed by #7692
Assignees
Labels
2.x Related to Haystack v2.0 P1 High priority, add to the next sprint topic:LLM
Milestone

Comments

@davidsbatista
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Having an issue with LLM-based evaluators, they do not always return a valid JSON and break the whole evaluation process.

Describe the solution you'd like
One possible (only for ChatGP) is to explicitly ask for JSON-only responses:

passing the following parameter to the call response_format={ "type": "json_object" }

Probably a simple change in the LLMEvaluator starting here:

self.generator = OpenAIGenerator(api_key=api_key)

@davidsbatista davidsbatista added P1 High priority, add to the next sprint topic:LLM 2.x Related to Haystack v2.0 labels May 8, 2024
@masci masci assigned davidsbatista and unassigned julian-risch May 10, 2024
@shadeMe shadeMe added this to the 2.1.2 milestone May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Related to Haystack v2.0 P1 High priority, add to the next sprint topic:LLM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants