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

Retrieval QA with custom prompt with multiple inputs and memory

I am trying to provide a custom prompt for doing Q&A in langchain. I wasn't able to do that with RetrievalQA as it was not allowing for multiple custom inputs in custom prompt.I have loaded a sample pdf file, chunked it and stored the embeddings in…
Jason
  • 676
  • 1
  • 12
  • 34
0
votes
0 answers

Attempting to create a LangChain chain in combination with a local chatbot system

Basically, I created a self-hosted AI chat system and am now in the process of tying that chat system into LangChain. I have had good success so far, but I hit an issue when it came to chains. # AI Server from flask import Flask, request,…
Erik H
  • 1
  • 2
0
votes
0 answers

Getting errors while building a PDF QA with OPEN AI & Langchain

I am trying to use Langchain & AI. So, I have installed all the libraries and tried to write the below code with Langchain documentation. But I seem to face some errors which I am not able to resolve. Here is my code: import os from…
0
votes
0 answers

langchain Rate limit error with introduction

I'm currently trying langchain, and after the first basic tutorial (this following code), i have a RateLimitError. from langchain.llms import OpenAI llm = OpenAI(temperature=0.9) llm.predict("What would be a good company name for a company that…
queng
  • 11
  • 2
0
votes
0 answers

How to work with a pdf form in Langchain?

I have a pdf file that is questionnaire. There is text that cannot be changed which are the questions and then text boxes with the answers. When I run this simple code: from langchain.document_loaders import PyPDFLoader loader =…
Cole
  • 207
  • 2
  • 11
0
votes
1 answer

UnstructuredURLLoader/SeleniumURLLoader not working in LangChain for JS based websites

I try to use document loader for websites urls. However for UnstructuredURLLoader some websites return: (Document(page_content='Please enable JS and disable any ad blocker', metadata={'source': 'https://wellfound.com/company/chorus-one'}) So I…
mCs
  • 2,591
  • 6
  • 39
  • 66
0
votes
2 answers

How to get exact message sent to LLM using LangChain's LLMChain (python)?

Currently, when using an LLMChain in LangChain, I can get the template prompt used and the response from the model, but is it possible to get the exact text message sent as query to the model, without having to manually do the prompt template…
cserpell
  • 716
  • 1
  • 7
  • 17
0
votes
0 answers

getting the following error "pydantic.error_wrappers.ValidationError: 1 validation error for SerpAPIWrapper"

Im getting the following error in vscode but when i run the code in google collab it works fine. looking for some insight into the problem. the keys I replaced for safety reasons but otherwise the code is what I run. from langchain.utilities import…
0
votes
0 answers

How to mix python_repl_ast and model result to make a fitness coach?

I have a fitness database of exercises ( csv with exercises that are available on my plateform) (id, name of exercise, link to exercise) I want to create an agent that can reply to this kind of request by returning only known exercicses in my…
0
votes
0 answers

Langchain OpenAPIEndpointChain Memory Issue

I have been working on Langchain for the past few days. I'm structuring the data from user's input using API Specs. But I'm facing issues with the memory of the chain. Technology: :Langchain LLM Module: Vertex AI Chain: OpenAPIEndPointChain, Method:…
0
votes
0 answers

intent classification- openai/ langchain

What are the ways that we can do intent classification in a conversation. If we have used conversational chain is there anyway we can do that. I need to identify the users intention to update or insert operation. But I dont know which line exactly…
0
votes
1 answer

How to run async methods in langchain?

I have a basic chain that classifies some text based on the Common European Framework of Reference for Languages. I'm timing the difference between normal chain.apply and chain.aapply but can't get it to work. What am I doing wrong? import os from…
codeananda
  • 939
  • 1
  • 10
  • 16
0
votes
0 answers

Langchain: RetrievalQAWithSourcesChain gives error 'too many values to unpack (expected 2)' after running

I'm using langchain for QA with court case documents. More specifically, the RetrievalQAWithSourcesChain to retrieve the answer and document source information. However, when running the chain with embedded documents, I get the following…
0
votes
0 answers

Using Langchain with SQLDatabaseToolkit, create_pandas_dataframe_agent and PythonREPL for data analysis

I would like to use langchain with SQLDatabaseToolkit, create_pandas_dataframe_agent and PythonREPL for data analysis. Do you have a working approach for me? My approach isn't working # Ensure the SQLite database file exists and is…
Karsten
  • 1
  • 1
0
votes
0 answers

How to use LangChain to store, load, and query Loaders on LlamaHub?

Can loaders on LlamaHub only use LlamaIndex? How can LangChain be used to store, load, and query it? For example, Mongo Loader. I saw on LlamaHub that it seems that all the examples use LlamaIndex. So what can LlamaHub provide for LangChain? If…
chenkun
  • 45
  • 6