Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Initialize the Ollama Functions Module Due to ImportError in Langchain Core Utils #24652

Closed
5 tasks done
chakravarthik27 opened this issue Jul 25, 2024 · 1 comment
Closed
5 tasks done
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature

Comments

@chakravarthik27
Copy link

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangChain documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

Example Code

from langchain_experimental.llms.ollama_functions import OllamaFunctions

Error Message and Stack Trace (if applicable)

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\KALYAN\AppData\Local\Programs\Python\Python310\lib\site-packages\langchain_experimental\llms\ollama_functions.py", line 44, in <module>
    from langchain_core.utils.pydantic import is_basemodel_instance, is_basemodel_subclass
ImportError: cannot import name 'is_basemodel_instance' from 'langchain_core.utils.pydantic' (C:\Users\<Profile>\AppData\Local\Programs\Python\Python310\lib\site-packages\langchain_core\utils\pydantic.py)

Description

I'm trying to use langchain for tooling in Ollama, but I'm encountering an ImportError when attempting to initialize the Ollama Functions module. The error states that is_basemodel_instance cannot be imported from langchain_core.utils.pydantic.

System Info

System Information

OS: Windows
OS Version: 10.0.22631
Python Version: 3.10.0 (tags/v3.10.0:b494f59, Oct 4 2021, 19:00:18) [MSC v.1929 64 bit (AMD64)]

Package Information

langchain_core: 0.2.11
langchain: 0.2.6
langchain_community: 0.2.6
langsmith: 0.1.83
langchain_experimental: 0.0.63
langchain_fireworks: 0.1.4
langchain_groq: 0.1.4
langchain_openai: 0.1.14
langchain_text_splitters: 0.2.2
langgraph: 0.1.5

Packages not installed (Not Necessarily a Problem)

The following packages were not found:

langserve

@dosubot dosubot bot added the 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature label Jul 25, 2024
@wulifu2hao
Copy link
Contributor

pip install -U langchain_core

Successfully installed langchain_core-0.2.23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants