I used this code with langchain 0.2.8 and it worked fine. I have to move the code to a new environment where I am limited to using langchain 0.1.12. When I run this code in the new environment I keep getting an error that .init takes 1 positional argument but 2 were provided. The error gets thrown with this line -> propositioning_llm = self.llm.with_structured_output(Sentences).
Is there some sort of different syntax I need to use for langchain 0.1.12?
system_string = """
[THIS CONTAINS INSTRUCTIONS ABOUT WHAT THE SYSTEM IS SUPPOSED TO DO]
"""
propositioning_prompt = ChatPromptTemplate([
("system", system_string),
("human", "Decompose the following: {input}"),
])
class Sentences(BaseModel):
sentences: list[str]
propositioning_llm = self.llm.with_structured_output(Sentences)
propositioning_chain = propositioning_prompt | propositioning_llm
if len(paragraph.lstrip()) > 5:
sentences = propositioning_chain.invoke(paragraph)
returned_list = sentences.sentences
return returned_list