mirror of
https://github.com/hwchase17/langchain
synced 2024-11-10 01:10:59 +00:00
langchain: Make RetryWithErrorOutputParser.from_llm() create a correct retry chain (#25053)
Description: RetryWithErrorOutputParser.from_llm() creates a retry chain that returns a Generation instance, when it should actually just return a string. This class was forgotten when fixing the issue in PR #24687
This commit is contained in:
parent
c5cb52a3c6
commit
335894893b
@ -214,7 +214,7 @@ class RetryWithErrorOutputParser(BaseOutputParser[T]):
|
||||
Returns:
|
||||
A RetryWithErrorOutputParser.
|
||||
"""
|
||||
chain = prompt | llm
|
||||
chain = prompt | llm | StrOutputParser()
|
||||
return cls(parser=parser, retry_chain=chain, max_retries=max_retries)
|
||||
|
||||
def parse_with_prompt(self, completion: str, prompt_value: PromptValue) -> T:
|
||||
|
Loading…
Reference in New Issue
Block a user