Questions tagged [langchain]

LangChain is an open-source framework for developing applications powered by language models. Use [py-langchain] for the python-specific package.

LangChain is an open-source framework for developing applications powered by language models. Use [py-langchain] for the python-specific package.

672 questions
2
votes
1 answer

How to connect LLM to Multiple SQL database with LangChain SQLChain

I want to connect LLM to more than 2 SQL database with SQLDatabaseChain. Please let me know if it is possible or any other way. I have connected to 1 DB and able to work. bUt my case i need to connect to more than 1 DB and its table
2
votes
0 answers

langchain ValueError: One input key expected got ['input', 'chat_history_lines']

Trying to combine multiple memory types with a langchain conversational chain. import os from langchain.chains import ConversationChain from langchain.memory import ( ConversationBufferMemory, CombinedMemory, …
Soerendip
  • 7,684
  • 15
  • 61
  • 128
2
votes
0 answers

How to save vector embeddings `FAISS` in MongoDB?

I am using LangChain for building some stuff and came across one of the most prominent index-based vector database FAISS. Following is the command of how I am using the FAISS vector database: from langchain.document_loaders import PyMuPDFLoader from…
2
votes
0 answers

AzureOpenAI not Available in Langchain

I am trying to use the langchain package in Python to interact with Azure Open AI. In my personal laptop, once I run pip install langchain I am successfully able to import using from langchain.llms import AzureOpenAI. But when I perform the same…
Kenneth Singh
  • 335
  • 1
  • 3
  • 15
2
votes
2 answers

Initialise qdrant for langchain

I want to experiment with adding my existing qdrant vector database to langchain for a chatGPT project. However, I cannot seem to find a way to initialise the Qdrant object without providing docs and embeddings, which seems weird to me, as I should…
MDan
  • 295
  • 2
  • 13
2
votes
0 answers

How to you add context to be passed along with agent.run in ReAct LangChain framework

I've previously built a pdf searching tool in LangChain which uses the chain.run(input_documents=, question=) syntax to ask the model questions along with context from that pdf. I want to integrate this with the agents provided by langchain. I am…
2
votes
1 answer

Limit tokens per minute in LangChain, using OpenAI-embeddings and Chroma vector store

I am looking for a way to limit the tokens per minute when saving embeddings in a Chroma vector store. Here is my code: [...] # split the documents into chunks text_splitter = CharacterTextSplitter(chunk_size=1500, chunk_overlap=0) texts =…
Heka
  • 73
  • 1
  • 8
2
votes
1 answer

LangChain ConversationalRetrieval with JSONloader

I modified the data loader of this source code https://github.com/techleadhd/chatgpt-retrieval for ConversationalRetrievalChain to accept data as JSON. I created a dummy JSON file and according to the LangChain documentation, it fits JSON structure…
Utku Can
  • 683
  • 3
  • 12
2
votes
0 answers

I am getting a TypeError for Langchain imports on CoLab. I'm relatively new to coding and am not sure what it means

**This is the error: ** --------------------------------------------------------------------------- TypeError Traceback (most recent call last) in () 1 from…
Nour Zein
  • 21
  • 2
2
votes
0 answers

TypeError: issubclass() arg 1 must be a class when using langchain in azure

I have a simple python app with streamlit and langchain, I am deploying this to Azure via CI/CD with the following YAML definition stages: - stage: Build displayName: Build stage jobs: - job: BuildJob pool: vmImage: $(vmImageName) …
Luis Valencia
  • 32,619
  • 93
  • 286
  • 506
2
votes
1 answer

UnstructuredURLLoader not able to see libmagic

I tried to use UnstructuredURLLoader as below from langchain.document_loaders import UnstructuredURLLoader loaders = UnstructuredURLLoader(urls=urls) data = loaders.load() but some pages report that libmagic is unavailable but assists in filetype…
mCs
  • 2,591
  • 6
  • 39
  • 66
2
votes
2 answers

What does langchain CharacterTextSplitter's chunk_size param even do?

My default assumption was that the chunk_size parameter would set a ceiling on the size of the chunks/splits that come out of the split_text method, but that's clearly not right: from langchain.text_splitter import RecursiveCharacterTextSplitter,…
Max Power
  • 8,265
  • 13
  • 50
  • 91
2
votes
1 answer

Self-querying retrieval in langchain returning only 4 results

I want all the articles related to specific tag example sustainability from documents. But it is only returing me Four articles. There are total 7 articles related to sustainability in vectorstore out of 20 articles. Here is my code: import…
2
votes
2 answers

Anybody is able to run langchain gpt4all successfully?

The following piece of code is from https://python.langchain.com/docs/modules/model_io/models/llms/integrations/gpt4all from langchain import PromptTemplate, LLMChain from langchain.llms import GPT4All from langchain.callbacks.streaming_stdout…
Wu Zhao
  • 29
  • 2
2
votes
1 answer

Using NextJS 13 with Langchain's recommended vectorstore giving Error: HNSWLib is not installed

I'm creating an app with the help of Langchain and OpenAI. I'm loading my data with JSONLoader and want to store it in a vectorstore, so I can retrieve on user request to answer questions specific to my data. The Langchain docs are describing…
Benji
  • 280
  • 3
  • 15