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
0 answers

Struggling with implementing Update, Delete, and View in LangChain API

I have successfully implemented the "create" and "askquestion" LangChain API endpoints, which are working as expected. However, I am facing challenges with the "update," "delete," and "view" functionalities. I am using LangChain in conjunction with…
0
votes
0 answers

Token indices sequence length error with langchain

Getting the following error when running load_qa_chain with map_reduce: Token indices sequence length is longer than the specified maximum sequence length for this model (2108 > 1024 The code: from transformers import AutoModelForCausalLM,…
U Avalos
  • 6,538
  • 7
  • 48
  • 81
0
votes
0 answers

langchain and python-docx mac m1 error : symbol not found in flat namespace

Python Version : 3.9 System Version : Mac M1 12.5.1 I have the following problems in the process of using langchain Sample code : from langchain.document_loaders import DirectoryLoader if __name__ == '__main__': loader =…
0
votes
0 answers

How to incorporate ChatGPT's knowledge into LangChain's SQLChain

I am using LangChain to perform text-to-SQL procedures like so: db = SQLDatabase.from_uri(xx) db_chain = SQLDatabaseChain(llm=llm, database=db, verbose=True) It's working quite well, but I'm wondering if there is a way to incorporate data from…
Ben Wilson
  • 2,271
  • 3
  • 26
  • 35
0
votes
0 answers

Python: Unable to get page count. Is poppler installed and in PATH?

I am creating Python Flask app in Mac Os (first time using Macbook). I am facing a strange error: pdf2image.exceptions.PDFInfoNotInstalledError: Unable to get page count. Is poppler installed and in PATH? echo $PATH in terminal…
devZ
  • 606
  • 1
  • 7
  • 23
0
votes
2 answers

Langchain exceed output token limits

I've read there are ways to exceed token limitations for inputs. These are the following methods: Stuff, Map Reduce, Refine, Map Rerank. In my context, I want to produce a large JSON document. The issue with JSON documents is that GPT models aside…
NotAPhoenix
  • 171
  • 4
  • 15
0
votes
1 answer

LangChain python - ability to abstract chunk of confidential text before submitting to LLM

If there are confidential document on which organization like to leverage LLM (e.g. OpenAI CHATGPT4) but just as precaution if they would like to abstract confidential information automatically then is it possible using langchain API (without…
R007
  • 101
  • 1
  • 13
0
votes
0 answers

How to output the intermediate steps of a langchain agent when max_tokens for an OpenAI model is breached?

Example: Thought: I need to filter the dataframe to get the rows that match the criteria Action: python_repl_ast Action Input: df[(df['COUNTRY'] == 'USA') & (df['PRODUCTLINE'] == 'Motorcycles') & (df['YEAR_ID'] == 2003)] My agent's action input is…
0
votes
0 answers

How can i change the actual output to be in another languages in Langchain (like German or France) with a local files and simlary search?

I have been trying to find some documentation about chaning the actual languages (like France or German) of the LMM output by langchain framework when i use a local file as a knowlegde for my LMM. Here is the full code: from PyPDF2 import…
0
votes
0 answers

How much CPU memory does langchain program use while running in jupyter notebook?

I want to know how much CPU memory is used when we run a langchain program with a specific LLM model. Also I want to know how much memory does it use based on the size of the data set that we pass in the program. I use a 64 bit Windows 11 OS. I…
-1
votes
0 answers

Langchain token exceeded issue

I am building a chatbot using langchain and in side, openAi model I chose the text-davinci-003 model my input token size is 1596 and the output is never be completed because the token limit exceeded how to fix the problem this issue is neve come if…
-1
votes
0 answers

How do we create GPT prompt using openai in which we can get result from api

For example we have weather api, we have url https://weather.org/city=berlin and want to know weather news of 'berlin', so it hit the api, api has data like (Temperature: 14°C (57°F),Precipitation: 7% Humidity: 90%, Wind Speed: 11 km/h) and get…
-1
votes
0 answers

Langchain Chatbot validation Error with custom template

I am trying to create simpl chatbot with Langchain and want to store conversation history as well but it's throwing error while reading data.json while using qa_chain to render chain conversation. instance of VectorStore expected…
BJ Coder
  • 350
  • 5
  • 16
-1
votes
1 answer

Name 'partition_pdf' is not defined

I do ai program take question from user and give him answer from pdf file with Azure OpenAI nltk and langchain. this problem is showing to me while i am runnig the programm => {name 'partition_pdf' is not defined. Did you mean: 'partition_xml'? } i…
-1
votes
1 answer

How to fix `transformers` package not found error in a Python project with `py-langchain`, `llama-index`, and `gradio`?

I get this error ModuleNotFoundError: No module named 'transformers' even though I did the pip install transformers command. Could you kindly help me? Thank you My code: import os import sys from dotenv import load_dotenv import gradio as gr from…
1 2 3
10
11