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

python langchain Tool() param

I want to pass params to a Tool's "func" in the code. But chat model has all the control of the "func" (as I know). So I want to give info to the func in Tool() directly. Is there a way to pass? realistic_vision_tool = Tool( …
0
votes
1 answer

How to use LangChain to load the index generated by LlamaIndex and perform a query?

I used LlamaIndex to generate an index for a section of text, which is stored in the myindex folder. How should I use LangChain to load it and query it? At present, I can only use LlamaIndex for querying, but this will lack the functionality of…
chenkun
  • 45
  • 6
0
votes
0 answers

Getting a single answer from the RetrievalQA chain

I'm trying to setup a RetrievalQA chain using python that given a question (ie: "What are the total sales for food related items?") can identify from a vector database that has indexed all known sources which is the right one to use; the output…
Frank Pinto
  • 134
  • 12
0
votes
1 answer

Langchain's SQLDatabaseSequentialChain to query database

I am trying to create a chatbot with langchain and openAI that can query the database with large number of tables based on user query. I have used SQLDatabaseSequentialChain which is said to be best if you have large number of tables in the…
0
votes
0 answers

Issue with langchain llm and huggingface. The SSL issue

I an getting an SSL when using huggingface hub when using langchain LLM. Below is the error. I tried options input my username and password and did not work.. please help HTTPSConnectionPool(host='api-inference.huggingface.co', port=443): Max…
Nick
  • 1
0
votes
0 answers

Using SQLdatabase chains with Multiprompt chain in langchain

I was using single sqldatabasechain but my default prompt is too long and utilizing too much credits from openai. In following code my default prompt has two messages inside 1st one is return result in table format if required else return simple…
0
votes
0 answers

How to measure accuracy in Langchain + OpenAI project

We created something similar to internal chatbot, where we processed a lot of internal documents. We have testing dataset with question and correct answer. Right now we are focusing on better accurancy and we are trying to find a way how to compare…
0
votes
0 answers

How can I use only specific ZapierNLA Tools in my Agent

How can i use only specific tools from ZapierToolkit. I want to select a specific tool out of the available ones based on the output of LLMChain and then pass only that tool to the agent. If i provide all the tools at once then the query becomes…
Talha
  • 23
  • 5
0
votes
1 answer

How to combine multiple FAISS indexes into one to get a single retriever

pdf = load_pdf(help_doc_name) faiss_index_ft9Help = FAISS.from_documents(pdf, OpenAIEmbeddings()) faiss_index_ft9Help.save_local(index_path + "/" + help_doc_name) # load newsletters pdf = load_pdf(newsletters_doc_name) faiss_index_newsletters =…
0
votes
1 answer

LangChain SQLDatabase Agent always has errors querying database

I tried to ask it a simple task which involves joining two different tables and the agents seems to be including extra an ' which leads to this error (this error does not appear when the prompt is simple and just asks about one table) has anyone…
Adam Xia
  • 53
  • 4
0
votes
0 answers

Extracting shape information from Visio xml files in Python for graph computation and chatbot creation with langchain

How can I read the activities, arrows and teams in a visio cross functional diagram using python? I want to be able to pass this information to langchain to be able to create a chatbot based on the process map. I have managed to extract the…
0
votes
0 answers

LangChain - complex queries break down

I'm using a chat-conversational-react-description agent that has tools that can fetch information about 'product reviews', with an non-vector DB that stores documents for product reviews, text, 1-5 star rating, date, etc. Given the following query…
Aviran
  • 5,160
  • 7
  • 44
  • 76
0
votes
1 answer

Combine agent with tools and MultiRootChain

I would like to use a MultiRootChain to use one QA chain, and an "agents" with tools. But, to use tools, I need to create an agent, via initialize_agent(tools,llm,agent=agent_type,...). For MultiRootChain, I need a Chain, and not an Agent. How can I…
Philippe Prados
  • 461
  • 3
  • 12
0
votes
0 answers

Langchain Plan Plans answers to questions

I need to build a langchain agent that plans an answer to a specific question, that requires multiple steps to be answerd. So, the idea (taken from this work: https://arxiv.org/pdf/2305.04091.pdf), is the following: The agent is faced with a…
Alfred
  • 503
  • 1
  • 5
  • 20
0
votes
0 answers

Langchain Agent Errors and Recommendations for chatbot (Error: json.decoder.JSONDecodeError: Unterminated string starting)

I'm using langchain python because I'm working on creating a custom knowledge chatbot. I have created the vecstores and everything works fine until I introduced LangChain's agents. The CHAT_CONVERSATIONAL_REACT_DESCRIPTION works well but sometimes I…