Open msmygit opened 2 weeks ago
To address the deprecation warnings and update your project to use the langchain_community
package, follow these steps:
langchain_community
instead of langchain
. For instance, replace:from langchain.output_parsers import GuardrailsOutputParser
with:
from langchain_community.output_parsers.rail_parser import GuardrailsOutputParser
And:
from langchain.tools.json import JsonSpec
with:
from langchain_community.tools.json.tool import JsonSpec
Review Dynamic Imports: If your project dynamically imports modules, ensure the import strings reflect the new langchain_community
package name.
Handle Mixed Imports Carefully: If your project uses both langchain
and langchain_community
, update only the deprecated parts to langchain_community
. Keep imports from langchain
that don't have equivalents in the new package as they are.
Test Your Application: After making these changes, thoroughly test your application to ensure all functionalities work as expected without introducing new issues.
By following these steps, you'll migrate away from deprecated langchain
imports to the supported langchain_community
package, aligning your project with the latest standards and avoiding deprecation warnings.
To continue the conversation, mention @dosu.
@dosu
I have the same issue but this warning appear when I import PydanticOutputParser
from langchain.output_parsers import PydanticOutputParser
when I'tried change it on GuardrailsOutputParser it was completly different class.
Do you have any idea how to fix it this warning?
@dosu I don't know why I did not import that package but still get the same warnning
I am getting the same issue, and nowhere in my code I import the GuardrailsOutputParser
package. This must be something imported by some other langchain
module.
I am getting the same issue, and nowhere in my code I import the
GuardrailsOutputParser
package. This must be something imported by some otherlangchain
module.
I had to revert to this version to not get that warning
Tried changing to @dongtandung2001 versions did not work for me.
Tried @dosu (bot) suggestion to use from langchain_community.output_parsers instead of what I have below also did not work:
from langchain_community.llms import Ollama
from langchain.prompts import ChatPromptTemplate, PromptTemplate, HumanMessagePromptTemplate
from langchain_core.messages import SystemMessage
from langchain.output_parsers import ResponseSchema, StructuredOutputParser
Guessing its something to do with the StructuredOutputParser import, but have not had time to dig any further into it.
Hey all
This should be related to the some of the LangchainTypeCreators that are being fazed out soon.
pip install langchain==0.1.19 solved it for me. This Stack Overflow discussion has some info.
Describe the bug Currently within the dev branch, we are leveraging deprecated output parsers package from langchain. We need to update to use the community and supported version.
Browser and Version n/a
To Reproduce Steps to reproduce the behavior:
langflow run
to see the deprecation warnings as below,Screenshots n/a
Additional context n/a