dspy icon indicating copy to clipboard operation
dspy copied to clipboard

Langchain Integration Broken on Change in dspy.signatures.field

Open mkotlarz opened this issue 4 months ago • 1 comments

OutputField no longer has .finalize() method.

hack.... in dspy/predict/langchain.py

Replace: from dspy.signatures.field import InputField, OutputField

With: from dspy.signatures.field import OldInputField as InputField, OldOutputField as OutputField

Im sure this probably breaks something else....

mkotlarz avatar Apr 22 '24 18:04 mkotlarz

Hi @mkotlarz , thanks for raising this. InputField and OutputField were migrated to using Pydantic types, no longer using finalize to set the prefix. . It seems like we need to make this change to langchain.py as well. Does removing those lines and keeping the original field imports resolve the issue for you? If so, feel free to push a PR so we can merge this correction!

arnavsinghvi11 avatar Apr 27 '24 23:04 arnavsinghvi11