Replies: 1 comment 1 reply
-
Hello, @HaoGuo98! I'm here to help you with any bugs, questions, or contributions you may have. Let's tackle this together! The error you're encountering is likely due to a circular import issue caused by having a file named To resolve this, you should rename your Additionally, ensure you are using the correct methods to manage the Here's an example of how to set and get the verbose setting: from langchain.globals import set_verbose, get_verbose
# Set the verbose setting
set_verbose(True)
# Get the current verbose setting
current_verbose = get_verbose()
print(f"Verbose is set to: {current_verbose}") By following these steps, you should be able to resolve the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
I tried to follow the tutorial,but i meet error.
File "c:\Users\hao\Desktop\llmdev\l1\langchain.py", line 1, in
import langchain
File "c:\Users\hao\Desktop\llmdev\l1\langchain.py", line 9, in
model = ChatOpenAI(model="gpt-4")
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\pydantic\v1\main.py", line 339, in init
values, fields_set, validation_error = validate_model(pydantic_self.class, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\pydantic\v1\main.py", line 1064, in validate_model
value = field.get_default()
^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\pydantic\v1\fields.py", line 437, in get_default
return smart_deepcopy(self.default) if self.default_factory is None else self.default_factory()
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\langchain_core\language_models\base.py", line 72, in _get_verbosity
return get_verbose()
^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\langchain_core\globals.py", line 72, in get_verbose
old_verbose = langchain.verbose
^^^^^^^^^^^^^^^^^
AttributeError: partially initialized module 'langchain' has no attribute 'verbose' (most likely due to a circular import)
System Info
pip install langchain
pip install -qU langchain-openai
python 3.11
Beta Was this translation helpful? Give feedback.
All reactions