Using trim_messages and RunnableWithMessageHistory in LangChain together
from operator import itemgetter from langchain_core.runnables import RunnablePassthrough chain = ( RunnablePassthrough.assign(messages=itemgetter(“messages”) | trimmer) | prompt | model ) response = chain.invoke( { “messages”: messages + [HumanMessage(content=”what’s my name?”)], “language”: “English”, } ) The above code is from the LangChain documentation for creating a chatbot with memory. They use trim_messages to reduce the messages to […]
S3FileLoader doesn’t support password file
Unable to get a page count.
Command Line Error: Incorrect password
Input Variable Error in Prompt When Using Example Selector in Langchain
I’m new to using LangChain and currently experimenting with the SemanticSimilarityExampleSelector to avoiding adding unnecessary examples in the prompt. However, I’ve encountered an issue when trying to integrate an ExampleSelector with a ChatPromptTemplate.
‘RunnableSequence’ object has no attribute ‘prompt’ error
I wanted to setup a chain as follows:
Langchain SQL Agent Customize Restrictions
I am working for a company that has some data restrictions. I have been using the Langchain SQL agent with these imports:
Querying a single column from the Excel file using LangChain
I have a regular .xlsx file that has just a few columns:
| Class | Name | Comments |
| — | — | —|
| 1 | Jack |Lorem ipsum dolor sit amet|
| 2 | Mary |Lorem ipsum dolor sit amet|
| 2 | Tony |Lorem ipsum dolor sit amet|
| … | …|Lorem ipsum dolor sit amet|
Error when loading simple excel files using UnstructuredExcelLoader()
I am trying to load a simple one sheet Excel file (.xlsx) using the langchain UnstructuredExcelLoader:
A chat LangChain Runnable that runs, appends some messages and then runs once more
Basically, as a toy problem, I’m attempting to replicate this hilarious Twitter thread where someone created a Shopify plugin generator that would read in Shopify websites, brainstorm plugin ideas, and then send marketing emails to storefront owners to see if they were interested in the plugin.
Loading Docs using langchain
When I run the following code block to load the docs using langchain, I get SSL verification error. I am not an expert using langchain. Please share tips on how to fix this issue.
Langchain only read some part, But not the Whole JSON File
I am using this example as is
and trying to read the the Json, using JSONLoader