Skip to content

Commit

Permalink
fix: output parser bug (#1864)
Browse files Browse the repository at this point in the history
fixes: #1831
  • Loading branch information
jjmachan authored Jan 21, 2025
1 parent 9da919e commit f5bc2b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ragas/prompt/pydantic_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit f5bc2b5

Please sign in to comment.