Langchain
- LangChain Expression Language crashes on pydantic v2 inputs
LangChain Expression Language crashes on pydantic v2 inputs Hooked a simple chain into LEL: from langchain_experimental.expression_language import chain from pydantic import BaseModel class Input(BaseModel): q: str result = chain("{q}").run(Input(q="hi")) Traceback: AttributeError: 'str' object has no attribute 'model_dump' Python 3.12.1, langchain 0.3.0, expression-language 0.0.5, pydantic 2.8.2. Same code worked with pydantic 1.10.
- langchain.tools.SerpAPIWrapper throws Invalid API Key despite valid key
langchain.tools.SerpAPIWrapper throws Invalid API Key despite valid key Spotted this today while wiring a quick search tool. from langchain.tools import SerpAPIWrapper tool = SerpAPIWrapper() print(tool.run("Sydney weather")) Console spat back: SerpApiError: Invalid API key Key worked in curl. Quota fine. Python 3.11, langchain 0.1.12, serpapi 0.6.2. Environment variable SERPAPI_API_KEY was set.
- langchain.chains.ConversationalRetrievalChain() fails with FAISS store
langchain.chains.ConversationalRetrievalChain() fails with FAISS store Tried to wire ConversationalRetrievalChain with a FAISS vector store. The constructor crashed. ValueError: Provided embeddings are incompatible with stored index dimension Embeddings built with sentence-transformers/all-MiniLM-L6-v2, dim 384. LangChain 0.0.286, faiss‑cpu 1.7.4, Python 3.11 on macOS.
- langchain load_tools() throws KeyError for requests
langchain load_tools() throws KeyError for ‘requests’ Yesterday I was wiring up a quick agent and called: from langchain.agents import load_tools tools = load_tools(["requests"]) The import blew up with: File ".../langchain/agents/load_tools.py", line 78, in load_tools tool = TOOL_NAME_TO_CLASS[name] KeyError: 'requests' Python 3.11, langchain 0.0.259, running on Windows 11 PowerShell.