From f5bc2b5e7628f5c68d824e085c4edc17840080b1 Mon Sep 17 00:00:00 2001 From: Jithin James Date: Tue, 21 Jan 2025 15:43:17 -0800 Subject: [PATCH] fix: output parser bug (#1864) fixes: #1831 --- src/ragas/prompt/pydantic_prompt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ragas/prompt/pydantic_prompt.py b/src/ragas/prompt/pydantic_prompt.py index a7ee6cba1..ce1fc123b 100644 --- a/src/ragas/prompt/pydantic_prompt.py +++ b/src/ragas/prompt/pydantic_prompt.py @@ -394,7 +394,7 @@ async def parse_output_string( llm: BaseRagasLLM, callbacks: Callbacks, retries_left: int = 1, - ): + ) -> OutputModel: callbacks = callbacks or [] try: jsonstr = extract_json(output_string) @@ -416,7 +416,7 @@ async def parse_output_string( retries_left=retries_left - 1, ) retry_rm.on_chain_end({"fixed_output_string": fixed_output_string}) - result = fixed_output_string + result = super().parse(fixed_output_string.text) else: raise RagasOutputParserException() return result