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

Fix incomplete json output in guideline evaluator #12646

Merged
merged 4 commits into from
Apr 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion llama-index-core/llama_index/core/evaluation/guideline.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def __init__(
llm: Optional[LLM] = None,
guidelines: Optional[str] = None,
eval_template: Optional[Union[str, BasePromptTemplate]] = None,
output_parser: Optional[PydanticOutputParser] = None,
# deprecated
service_context: Optional[ServiceContext] = None,
) -> None:
Expand All @@ -71,7 +72,9 @@ def __init__(
else:
self._eval_template = eval_template or DEFAULT_EVAL_TEMPLATE

self._output_parser = PydanticOutputParser(output_cls=EvaluationData)
self._output_parser = output_parser or PydanticOutputParser(
output_cls=EvaluationData
)
self._eval_template.output_parser = self._output_parser

def _get_prompts(self) -> PromptDictType:
Expand Down
Loading