-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
MultiQueryRetriever is failing #17352
Comments
🤖 Hey there @jswift24! Good to see you diving into another LangChain adventure. 🚀 Thank you for providing detailed information about the issue you're facing. The error message you're seeing is related to the Pydantic library, which is used in LangChain for data validation and settings management. The error message suggests that the This error might be occurring in the Here's the relevant part of the code from the def generate_queries(self, query: str, run_manager: CallbackManagerForRetrieverRun) -> List[str]:
response = self.llm_chain(
{self.input_key: query},
run_manager=run_manager,
)
return [line.text for line in response[self.output_key]] And here's the def parse_result(self, json_object: Any) -> Any:
try:
return self.pydantic_object.parse_obj(json_object)
except ValidationError as e:
msg = f"Failed to parse {self.pydantic_object.__name__} from completion {json_object}. Got: {e}"
raise OutputParserException(msg, llm_output=json_object) To resolve this issue, you might need to check the output of the language model to ensure it's in the expected format. If the language model is not returning the expected output, you might need to adjust its parameters or use a different model. If you're still facing the issue after checking the language model's output, it would be helpful if you could provide more information about the language model you're using and its output. This will help us understand the issue better and provide a more accurate solution. For more information about the Sources
|
This is not useful. The LM is fine. The problem is with LangChain code. |
I'm having this issue too. This seems like a regression introduced by #16914 It seems that List parser used in the MultiRetriever chain that extends PydanticOutputParser now depends on JsonOutputParser, that fails to parse generation coming back from the LLM. |
Even I am facing the the same issue
TypeError Traceback (most recent call last) TypeError: 'int' object is not iterable The above exception was the direct cause of the following exception: ValidationError Traceback (most recent call last) During handling of the above exception, another exception occurred: OutputParserException Traceback (most recent call last) OutputParserException: Failed to parse LineList from completion 1. Got: 1 validation error for LineList |
just to confirm that #16914 is root cause, can someone confirm that downgrading to |
I still get the error with langchain==0.1.5 and langchain-community 0.1.21 so i'm not sure it's #16914 |
Not sure if there is another missing piece but langchain==0.1.5 was working for me. |
|
I am having the same issue as well: TypeError Traceback (most recent call last) TypeError: 'int' object is not iterable The above exception was the direct cause of the following exception: ValidationError Traceback (most recent call last) File c:\Users\TMOCo\Project_AI.venv\Lib\site-packages\pydantic\v1\main.py:525, in BaseModel.parse_obj(cls, obj) ValidationError: 1 validation error for LineList OutputParserException: Failed to parse LineList from completion 1. Got: 1 validation error for LineList I tried downgrading langchain to 0.1.5 and cloned the repo linked above with no success. |
Downgrading the version of langchain to 0.1.5 solved the problem for me as well. |
this should be fixed in |
I think that the problem is with the LangChain code.
|
This suggestion helps. I had to use
Here's my prompt.
|
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
Description
Trying to use MultiQueryRetriever and getting an error.
The base
retriever
works. Theprimary_qa_llm
works too.Using windows.
System Info
Platform: Windows
Python version: 3.11.7
The text was updated successfully, but these errors were encountered: