79558648

Date: 2025-04-06 19:37:40
Score: 1.5
Natty:
Report link

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

Reasons:
  • Blacklisted phrase (0.5): I need
  • Blacklisted phrase (1): any ideas
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Syrnnik