402 questions
1
vote
1
answer
35
views
agent.invoke() with Gemini gives inconsistent output types
I am using the LangChain 1.0 new agent = create_agent() method to create an agent but I am getting inconsistent output response types.
Case 1: str as output
When the user query is simple such as "...
-4
votes
1
answer
77
views
Troubles with the creation of tools and agents in langchain [closed]
I’m trying to create an agent in LangChain using Google Gemini, but I’m running into some issues because of the latest LangChain updates. As a result, I haven’t been able to create a chain with the ...
0
votes
0
answers
46
views
Langchain: How to let an AgentExecutor Propagate RunnableConfig["configurable"] to @tool?
I'm encountering a critical issue using LangChain's AgentExecutor where a dynamic, per-call variable passed via the config dictionary is not being propagated to a custom @tool called by the agent. ...
1
vote
0
answers
62
views
How to let Gitlab/Langchain continue finding file?
I want to use Langchain to automatically update a helm chart via Gitlab-Python API. I realise it might work without langchain/llm with a more deterministic approach. However, i use it for testing ...
0
votes
1
answer
59
views
LangChain FAISS similarity_search returns empty list despite populated index
I’m trying to use LangChain with FAISS to build a simple document retriever. I’ve indexed several documents, but when I call similarity_search, I always get an empty list.
from langchain.embeddings....
1
vote
1
answer
77
views
How to find package version that is compatible with other package [closed]
How can I find the package version that can work with other package requirement. For my case, I have hard requirement for numpy==1.24.4 and I am looking to install langchain-core which the latest ...
1
vote
1
answer
240
views
Running Ollama as a k8s STS with external script as entrypoint to load models
I manage to run Ollama as a k8s STS. I am using it for Python Langchain LLM/RAG application. However the following Dockerfile ENTRYPOINT script which tries to pull a list of images exported as MODELS ...
0
votes
0
answers
23
views
Trying to deploy my first modal app with a chrona database but the data is not being used. Need help debugging retrieveInfoForQuery function?
I am having trouble figuring out why I can't see the print statements in the terminal for my retrieveInfoForQuery function and trying to figure out what is wrong. I have verified the chroma db is on ...
1
vote
1
answer
257
views
RegexTextSplitter does not exist in langchain_text_splitters?
Trying to import RegexTextSplitter using
from langchain.text_splitter import RegexTextSplitter ,RecursiveCharacterTextSplitter
And I get the error
from langchain.text_splitter import RegexTextSplitter ...
1
vote
1
answer
298
views
Assistant: Error: fake_search is not a valid tool, try one of [tool]
I can't figure out how to use a custom function as a tool with langgraph + ChatOpenAI and Ollama. The "TavilySearchResults" and "DuckDuckGoSearchResults" community tools work fine,...
0
votes
1
answer
337
views
Unable to log mlflow model when using databricks_langchain package
I am currently trying to work on the following code to log my Langchain - chain using mlflow. But it throws me following error while doing mlflow.langchain.log_model and I am not sure what exactly is ...
0
votes
1
answer
252
views
How to check total no. of tokens while using Langchain's 'create_pandas_dataframe_agent'?
I am using langchain's create_pandas_dataframe_agent agent to analyse a dataframe. The code looks like below:
from langchain_experimental.agents import create_pandas_dataframe_agent
import pandas as ...
0
votes
0
answers
129
views
Merge multiple FAISS chunks in a single chunk
I have loaded data in FAISS using the chunks as my data was very large. So, after the process 110 chunks have been made with respective .faiss & .pkl files. I have written this code
import faiss
...
0
votes
0
answers
76
views
aapply call failing in LLMChain - OpenAIObject
I had a working code to translate documents (pdf, docx and text). Suddenly since past few days, I am getting following error. There has been no change in the code.
Error in doc_translate_openai of ...
2
votes
1
answer
2k
views
Langchain tool calling not returning any content
I am trying to get Langchain working with tool calling. I've been following the tutorial on their website and am getting some unexpected behaviour.
This is the tutorial: https://python.langchain.com/...
0
votes
0
answers
196
views
LangChain tools invoke - Template error: unknown filter: filter string is unknown
I am following the tutorial given here, trying to create a very simple tool-calling function. I have followed the code exactly, only changing the tool itself.
from langchain_huggingface import ...
0
votes
0
answers
362
views
Memory Management for FastAPI Langchain App
I have a Fast API Python app that streams output from a bot using Langchain and Langgraph, deployed on a Render Web Service (Currently free tier). Currently it uses threads to distinguish between ...
1
vote
0
answers
350
views
How to stream openai response with metadata
I have implemented streaming response in our rag(Retrieval-Augmented-Generation) chatbot. However, I am unable to figure out a proper way to send the metadata information with the streaming response....
0
votes
0
answers
61
views
Combing runnable sequence pipeline with constitutional chain
After updating my code to replace LLMChain (deprecated) with the new pipeline approach, I am getting an error because Constitutional Chain does expect the old LLMChain format. Can anyone suggest a ...
0
votes
2
answers
370
views
How the recursive text splitter in langchain works?
While learning text splitter, i got a doubt, here is the code below
from langchain.text_splitter import RecursiveCharacterTextSplitter
rsplitter = RecursiveCharacterTextSplitter(chunk_size=10,...
0
votes
1
answer
220
views
langchain: 'NoneType' object is not iterable
async def get_response(self, messages, model):
try:
memory = self.memory
llm = ChatOllama(model=model)
config = {"configurable": {"thread_id&...
2
votes
0
answers
482
views
Langchain : troubles to pass a custom runtime arguments to tools, via an AgentExecutor
First of all, let's see how I set up my tool, model, agent, callback handler and AgentExecutor :
Tool :
from datetime import datetime
from typing import Literal, Annotated
from langchain_core.tools ...
0
votes
2
answers
449
views
Getting Document Similarity Scores with SelfQueryRetriever - Langchain
I want to be able to get the similarity scores of the retrieved documents when using the SelfQueryRetriever as seen below.
I have made a selfquery retriever as follows:
retriever = SelfQueryRetriever....
1
vote
2
answers
255
views
How do I store the output of a lang chain pandas dataframe agent to a variable?
I am currently using two data frames and I wish to compare two columns across them, and then create an output variable. However, I want to store the output in the form of a pandas dataframe, or ...
0
votes
0
answers
115
views
Issues with PDF extraction using pdfminer in a Telegram bot with Langchain
I'm developing a Telegram bot that allows users to send PDF files. The bot should extract text from the PDFs using pdfminer and respond to user queries. However, I'm facing dependency issues, ...