Closed lfoppiano closed 9 months ago
🤖
Hello @lfoppiano! Good to see you again. Hope you're doing well and coding is going smoothly. Let's dive into this issue you're having.
Based on the context provided, it appears that the WebResearchRetriever
in LangChain is currently designed to work with the GoogleSearchAPIWrapper
as the search engine. This is evident from the method signature of WebResearchRetriever.from_llm
:
@classmethod
def from_llm(
cls,
vectorstore: VectorStore,
llm: BaseLLM,
search: GoogleSearchAPIWrapper,
prompt: Optional[BasePromptTemplate] = None,
num_search_results: int = 1,
text_splitter: RecursiveCharacterTextSplitter = RecursiveCharacterTextSplitter(
chunk_size=1500, chunk_overlap=150
),
) -> "WebResearchRetriever":
Here, search
is expected to be an instance of GoogleSearchAPIWrapper
. This is likely the reason why you're encountering a ValidationError
when trying to use DuckDuckGoSearchAPIWrapper
as the search engine.
While LangChain does have a DuckDuckGoSearchAPIWrapper
class, it seems that it's not currently compatible with the WebResearchRetriever
. This could be due to differences in the methods or data returned by the two search engine wrappers.
If you want to use DuckDuckGo as the search engine with WebResearchRetriever
, it might require modifications to the WebResearchRetriever
class or the creation of a new retriever class that is compatible with DuckDuckGoSearchAPIWrapper
.
I hope this helps clarify the issue. If you have further questions or need more assistance, feel free to ask.
Sources:
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
Issue with current documentation:
I've got this code:
but I get this error:
I wonder if the webresearch retriever works also with non-google search engines..
Thank you in advance
Idea or request for content:
No response