Got the same problem when migrated from LangChain
v0.1
to v0.3
.
I didn't really want to refactor half of my project, so I had to think a bit.
The only idea I had was to create my own LLMChain
and just replace the imports.
Here's what I got:
from langchain.chains.llm import BaseMessage
from langchain_core.runnables import RunnableSerializable
LLMChain = RunnableSerializable[dict, BaseMessage]
And all you need is replace this
from langchain.chains.llm import LLMChain
to this
from path.to.llm_chain import LLMChain
But then I ran into the fact that my LLMChain
doesn't have a run
method and that I need to use invoke
.
I had no idea so I replaced it, but if anyone has any ideas please add to this discussion.
Hope I helped anyone in some way :D