Questions tagged [py-langchain]

LangChain is an open-source framework for developing applications powered by language models. Use this tag for the python-specific package.

LangChain is an open-source framework for developing applications powered by language models. Use this tag for the python-specific package.

Official Python LangChain documentation: https://python.langchain.com/en/latest/

153 questions
0
votes
1 answer

How do I solve working around "Models maximum content length exceeded" errors

I am using LangChain and OpenAI to interract with my postgres database. It works well on small databases. But when the database is larger (say over 10K rows), I get the following error This model's maximum context length is 4097 tokens. However,…
steve landiss
  • 1,833
  • 3
  • 19
  • 30
0
votes
0 answers

Could not load Llama model from path: ./Models/llama-7b.ggmlv3.q2_K.bin. Received error Llama.__init__() got an unexpected keyword argument 'input'

from langchain.llms import LlamaCpp from langchain import PromptTemplate, LLMChain from langchain.callbacks.manager import CallbackManager from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler template = """Question:…
rahularyansharma
  • 11,156
  • 18
  • 79
  • 135
0
votes
0 answers

Which Loader on LangChain is suitable for uploading video directly from your computer for processing?

I'm trying to build a program that transcribes a downloaded video on my computer. The app is built using LangChain. I see a lot of tutorials for how I can transcribe YouTube videos in LangChain using their YouTubeLoader + the WhisperParser, but I'm…
0
votes
0 answers

LangChain no Observation return

I am trying to build a bot using gpt-3.5-turbo and the langchain tools. I am trying to create an own Tool/Agent for that. The point of the Bot will be, that it can answer questions asked about specific topics, where information can only be found on…
0
votes
0 answers

how do i get file name in folder document search

I am using "Directory Loader" in Langhian for reading content. loader = DirectoryLoader('../data/gauravCustomCvPdf/', glob='**/*.pdf') documents = loader.load() In search result I also need file name in which search is performed. Ex. i have 50 cv…
0
votes
0 answers

Quality of answers gets drastically bad with longer chains in Langchain

I think most of the people who works with Langchain in building products or automating stuff noticed how bad the quality of answers degrades when you ask multiple of questions using the same chain (e.g: the chain gets longer). It gets to answer the…
moayad
  • 11
  • 2
0
votes
0 answers

RESOLVED: langflow application stucked at the thinking stage without responding

I have successfully installed langflow (0.4.0). I test the first application "Basic Chat with Prompt and History". After inputting the openai_key at the ChatOpenAI panel, and setting "input key" as "text", I build successfully the application.…
pengchy
  • 732
  • 2
  • 14
  • 26
0
votes
1 answer

How to pass a CSV file or a dataframe to Pandas REPL tool in Langchain?

I am trying to utilize Python Repl Tool in langchain with a CSV file and send me the answer based on the CSV file content. The problem is that it gets the action_input step of writing the code to execute right. However, it fails to answer because it…
moayad
  • 11
  • 2
0
votes
1 answer

Langchain Embeddings with multiple datasources

first of sorry if my question would result stupid or have no so much sense, i don't have so much experience with langchain and in general with LLM. So, i have the following scenario i need to use as an Embedding a book ( 300 pages ) to instruct…
Andrea Mucci
  • 747
  • 2
  • 9
  • 25
0
votes
2 answers

How does similarity_search_with_score() calculate the scores while retrieving the most similar document from embedding

I am trying to retrieve most similar documents based on question and i am getting top_k =5 docs. but, How does similarity_search_with_score() calculate the scores while retrieving the most similar document from embedding. I want to know the…
0
votes
0 answers

Error when using ConversationBufferMemory and more than one prompt template arguments in Langchain

In the code below I try to use three inputs in template, namely context, chat_history and question. # Sources. # Memory: . # Imports. from langchain.chains import LLMChain from langchain.llms…
Adriaan
  • 715
  • 10
  • 22
0
votes
0 answers

How to add Prompt in retriver in Retrievalqa in langchain

i am trying to use retrievalqa from langchain to implement a chatmodel.while using the retrievalQA i get know that there is no option to add the retrival. how to add the retrieval in retrivalqa vectordb=Weaviate(client,'Document',…
0
votes
1 answer

LangChain Downloading data from youtube

Im downloading data from youtube but facing an issue how can i fix it ? i downloaded ffmpeg and set path to envirnment variable but didn't work loading data from youtube throug langchian documentloader see image to get more
0
votes
0 answers

Missing data in answers from using private json data in LangChain App w/ LLMs

I'm designing an AI app using LangChain to load a private json file, use text splitter, embeddings, vectorstore & retriever to create an Q&A session. However when asking questions about some of the json items in array list, the answer from LLMs…
ArtC
  • 1
  • 1
0
votes
0 answers

How to add conversational memory to langchain create_pandas_dataframe_agent agent?

I did follow the instructions for solving this based on How to add conversational memory to pandas toolkit agent? llm_code = ChatOpenAI(temperature=0, model_name="gpt-4-0613") llm_context = ChatOpenAI(temperature=0.5,…