py-langchain Questions

4

Solved

Following LangChain docs in my Jupyter notebook with the following code : from langchain_openai import ChatOpenAI from langchain_core.prompts import ChatPromptTemplate from langchain_core.output_pa...
Hermetic asked 8/1 at 17:16

4

Solved

I am doing a microservice with a document loader, and the app can't launch at the import level, when trying to import langchain's UnstructuredMarkdownLoader $ flask --app main run --debug Traceback...
Crutcher asked 23/5, 2023 at 10:6

4

Solved

I'm using langchain to process a whole bunch of documents which are in an Mongo database. I can load all documents fine into the chromadb vector storage using langchain. Nothing fancy being done he...
Dentate asked 5/5, 2023 at 17:9

2

Solved

import os from langchain.llms import OpenAI import bs4 import langchain from langchain import hub from langchain.document_loaders import UnstructuredFileLoader from langchain.embeddings import Open...
Poleaxe asked 27/11, 2023 at 8:1

6

Solved

I am trying to use a custom embedding model in Langchain with chromaDB. I can't seem to find a way to use the base embedding class without having to use some other provider (like OpenAIEmbeddings o...
Protestation asked 2/10, 2023 at 16:51

1

I got this error loading embeddings with FAISS: The de-serialization relies loading a pickle file. Pickle files can be modified to deliver a malicious payload that results in execution of ar...
Cheops asked 7/3 at 9:35

3

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, with...
Spenserian asked 7/7, 2023 at 19:1

1

I have a very simple code using the langchain library to query a pandas dataframe. model = AzureOpenAI( deployment_name="text-davinci-003", openai_api_version="2023-05-15", o...
Flagstaff asked 23/8, 2023 at 9:29

3

Please bear with me as this is literally the first major code I have ever written and its for OpenAI's ChatGPT API. What I intend to do with this code is load a pdf document or a group of pdf docum...
Openhearth asked 21/5, 2023 at 21:9

2

I'm trying to build a chatbot that can chat about pdfs, and I got it working with memory using ConversationBufferMemory and ConversationalRetrievalChain like in this example. https://python.langcha...
Loupe asked 5/5, 2023 at 4:58

7

I have written LangChain code using Chroma DB to vector store the data from a website url. It currently works to get the data from the URL, store it into the project folder and then use that data t...
Twostep asked 12/5, 2023 at 0:15

2

I am new to LangChain and I'm trying to create a simple Q&A bot (over documents). Following the documentation and guide on their website, I've created a simple working bot, but I'm struggling t...
Lingam asked 21/8, 2023 at 17:43

2

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 s...
Sporogony asked 16/7, 2023 at 10:4

1

I am trying to create chunks (max) 350 characters long with 100 chunk overlap. I understand that chunk_size is an upper limit, so I may get chunks shorter than that. But why am I not getting any ch...
Enravish asked 13/7, 2023 at 15:56

1

I'm new to langchain, so I'm guessing this is possible but demonstrates my lack of a full understanding of the components in langchain. I have successfully created and used the Pandas Dataframe Age...
Ophir asked 29/6, 2023 at 16:59

2

I have written an application in langchain that passes a number of chains to a Sequential Chain to run. The problem I'm having is that the prompts are so large that they are exceeding the 4K token ...
Suchta asked 21/6, 2023 at 12:52

4

Solved

How do i add memory to RetrievalQA.from_chain_type? or, how do I add a custom prompt to ConversationalRetrievalChain? For the past 2 weeks ive been trying to make a chatbot that can chat over docum...

1

Solved

Whats the recommended way to define an output schema for a nested json, the method I use doesn't feel ideal. # adding to planner -> from langchain.experimental.plan_and_execute import load_chat_...
Clinch asked 5/6, 2023 at 15:11

0

I am using Langchain version 0.218, and was wondering if anyone was able to filter a seeded vectorstore dynamically during runtime? Such as when running by a Agent. My motive is to put this dynamic...

1

I am writing a question-answering bot using langchain. For storing my data in a database, I have chosen Chromadb. I have written the code below and it works fine persist_directory = "./db&quot...
Autosuggestion asked 29/5, 2023 at 14:41

1

Solved

Im using a conversational agent, with some tools, one of them is a calculator tool (for the sake of example). Agent initializated as follows: conversational_agent = initialize_agent( agent='chat-c...
Governorship asked 30/5, 2023 at 12:1

1

I am trying to load a folder of JSON files in Langchain as: loader = DirectoryLoader(r'C:...') documents = loader.load() But I got such an error message: ValueError: Json schema does not match th...
Bard asked 17/5, 2023 at 15:31

0

I have not found documentation regarding Question-Answering based on multiple text files, while referencing the text files individually. Example: I have file1.txt through file20.txt. file1.txt is f...
Shortchange asked 22/4, 2023 at 2:39
1

© 2022 - 2024 — McMap. All rights reserved.