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.
py-langchain
395
questions
0
votes
0
answers
113
views
ImportError: cannot import name 'TypeBaseModel' from 'langchain_core.utils.pydantic'
from pydantic import BaseModel
from langchain.chains import RetrievalQA
chain = RetrievalQA.from_chain_type(llm=llm,chain_type="stuff",retriever=retriever,input_key="query",...
0
votes
0
answers
39
views
Langchain: Output of one chain as input for another using LCEL
I've started working with Langchain to get a feel of it and a lot of the videos seem outdated. After some research I learned about LCEL being used as the other methods seem to be deprecated.
In my ...
0
votes
0
answers
38
views
How to fix "AttributeError: 'str' object has no attribute 'query'" in langchain?
retriver = PineconeVectorStore(
pinecone_api_key=pc_key,
index="index-1",
embedding=OpenAIEmbeddings()
).as_retriever()
qa_chain = (
{
"context": ...
0
votes
0
answers
20
views
Why llm_chain.invoke(ques_VN) output is interrupted when it is being printed?
I have a problem related to using llm_chain.invoke() to return the answer from ChatGPT. More specificially, when I want the function to return the answer, the output cannot be completed and is ...
0
votes
0
answers
25
views
TypeError while executing Langchain RunnablePassThrough. Question is not passed correctly
I get this error message
<ipython-input-141-b8110c573881> in <cell line: 1>()
----> 1 final_chain.invoke({"question":"Count of Agencies?"})
25 frames
/usr/local/lib/...
0
votes
0
answers
22
views
Parsing structured output and generating a summary about the parsing simultaneously using langchain?
I am using langchain for one of my applications. Here the client sends a query regarding a search criteria. In the app the search criteria gets decomposed into multiple sub search criteria which will ...
0
votes
0
answers
20
views
LangChain agent can't see a tool
I use mistral-7b-instruct-v0.2.Q2_K.
@tool
def create_new_specialist(text):
'''Describe some specialist who you want.'''
# some code
global specialist
specialist = # some code
...
0
votes
0
answers
50
views
langchain_text_splitters.RecursiveCharacterTextSplitter: Why does this need "" as a separator?
https://python.langchain.com/v0.2/docs/how_to/recursive_text_splitter/
The default value of separators argument contains "" (the 4th element). I wonder why it is needed because I doubt "...
0
votes
1
answer
85
views
Attribute Scope Issues with FastEmbedEmbeddings in Flask-based RAG Server
I am very new to python... in every way. Which, may be the root of the problem. I was attempting to follow a RAG tutorial watching Llama3 Full Rag - API with Ollama, LangChain and ChromaDB with Flask ...
-1
votes
0
answers
16
views
Issue with SQLDatabase.from_uri in langchain when including materialized views
This is not working for views ( working for tables in the same database)
db = SQLDatabase.from_uri(rds_uri,include_tables=["mv_complete_dur_info_update_new"],view_support=True,schema="...
0
votes
0
answers
40
views
SQL query is not correctly generated using langchain, nlp and llm
I have created a application which takes input question and converts it in SQL query using langchain, llm and nlp but sometimes it creating wrong query especially in the beginning following is the ...
0
votes
1
answer
54
views
Return fastapi http exception to fron from langchain runnable
My backend is running langchain routes with certain runnables. I want to be able to return an http exception like "404 Not found" to the front end, but when I raise it with with raise ...
1
vote
0
answers
62
views
Need to call an async instance method from a sync instance method
send_message() gets called from a thread. Since my_channel.send() is async, I think it is necessary to have a synchronous send_message() call the asynchronous asend_message(). How can it be done?
#@...
0
votes
0
answers
49
views
Impossible to get replies out of LLama3
As the question says, I am trying to run Llama3 but to no avail. Most people recommend using Ollama, which I cannot use due to personal circumstances (I am running the code on a cluster and I cannot ...
0
votes
0
answers
76
views
Having problems with Langchain and SQLDatabaseToolkit: 'sql_db_list_tables' and others doesn't work
everyone. I'm trying to query a MySQL database using Python and Langchain. However, some features seem to return nothing, while others work. sql_db_list_tables, get,usable_table_names, table_info and ...