You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I am new to coding, have some patience with me.
i followed your steps and get this error, can somebody help me, i changed nothing on your Assistant.py file
i have a .env file with an open.ai api.
i installed all req. python libs
This is my output in widows:
Traceback (most recent call last):
File "C:\assistant\assistant.py", line 8, in
from langchain.prompts import ChatPromptTemplate, MessagesPlaceholder
File "D:\Python\Lib\site-packages\langchain\prompts_init_.py", line 32, in
from langchain_core.example_selectors import (
File "D:\Python\Lib\site-packages\langchain_core\example_selectors_init_.py", line 6, in
from langchain_core.example_selectors.length_based import (
File "D:\Python\Lib\site-packages\langchain_core\example_selectors\length_based.py", line 6, in
from langchain_core.prompts.prompt import PromptTemplate
File "D:\Python\Lib\site-packages\langchain_core\prompts_init_.py", line 27, in
from langchain_core.prompts.base import (
File "D:\Python\Lib\site-packages\langchain_core\prompts\base.py", line 22, in
from langchain_core.output_parsers.base import BaseOutputParser
File "D:\Python\Lib\site-packages\langchain_core\output_parsers_init_.py", line 15, in
from langchain_core.output_parsers.base import (
File "D:\Python\Lib\site-packages\langchain_core\output_parsers\base.py", line 18, in
from langchain_core.language_models import LanguageModelOutput
File "D:\Python\Lib\site-packages\langchain_core\language_models_init_.py", line 25, in
from langchain_core.language_models.base import (
File "D:\Python\Lib\site-packages\langchain_core\language_models\base.py", line 75, in
class BaseLanguageModel(
File "D:\Python\Lib\site-packages\pydantic\v1\main.py", line 286, in new
cls.try_update_forward_refs()
File "D:\Python\Lib\site-packages\pydantic\v1\main.py", line 807, in try_update_forward_refs
update_model_forward_refs(cls, cls.fields.values(), cls.config.json_encoders, localns, (NameError,))
File "D:\Python\Lib\site-packages\pydantic\v1\typing.py", line 554, in update_model_forward_refs
update_field_forward_refs(f, globalns=globalns, localns=localns)
File "D:\Python\Lib\site-packages\pydantic\v1\typing.py", line 520, in update_field_forward_refs
field.type_ = evaluate_forwardref(field.type_, globalns, localns or None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Python\Lib\site-packages\pydantic\v1\typing.py", line 66, in evaluate_forwardref
return cast(Any, type_)._evaluate(globalns, localns, set())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'
so, yeah, i would be glad if you can provide help
The text was updated successfully, but these errors were encountered:
This is typical of a problem with Pydantic's unstable version 1 bibnlioeka.
Specifically, TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard' indicates a problem with the use of ForwardRef in Pydantic.
probably sounds like spaghetti with marmalade, well let's humanely write it.
First, make sure you have the latest version of Pydantic. Just fire up this command in the terminal:
pipinstall--upgradepydantic
next....
pipinstall--upgradelangchain
After updating, fire up your script again to see if the problem has disappeared. I'm keeping my fingers crossed! ✊
If the problem still exists:
Create a new virtual environment:
Sometimes creating a new virtual environment can work wonders.
python-mvenvmyenv
Activate the virtual environment:
On Windows:
.```myenvScriptsactivate
On macOS/Linux:
```source myenv/bin/activate
Install the required libraries:
Now install the required libraries in the new environment:
pip install pydantic langchain openai
Fire up the script in the new virtual environment and see if the problem has disappeared. If not, you may have to ask the universe for a little more patience.... Or reset your computer, it always works! 😜
Hello,
I am new to coding, have some patience with me.
i followed your steps and get this error, can somebody help me, i changed nothing on your Assistant.py file
i have a .env file with an open.ai api.
i installed all req. python libs
This is my output in widows:
Traceback (most recent call last):
File "C:\assistant\assistant.py", line 8, in
from langchain.prompts import ChatPromptTemplate, MessagesPlaceholder
File "D:\Python\Lib\site-packages\langchain\prompts_init_.py", line 32, in
from langchain_core.example_selectors import (
File "D:\Python\Lib\site-packages\langchain_core\example_selectors_init_.py", line 6, in
from langchain_core.example_selectors.length_based import (
File "D:\Python\Lib\site-packages\langchain_core\example_selectors\length_based.py", line 6, in
from langchain_core.prompts.prompt import PromptTemplate
File "D:\Python\Lib\site-packages\langchain_core\prompts_init_.py", line 27, in
from langchain_core.prompts.base import (
File "D:\Python\Lib\site-packages\langchain_core\prompts\base.py", line 22, in
from langchain_core.output_parsers.base import BaseOutputParser
File "D:\Python\Lib\site-packages\langchain_core\output_parsers_init_.py", line 15, in
from langchain_core.output_parsers.base import (
File "D:\Python\Lib\site-packages\langchain_core\output_parsers\base.py", line 18, in
from langchain_core.language_models import LanguageModelOutput
File "D:\Python\Lib\site-packages\langchain_core\language_models_init_.py", line 25, in
from langchain_core.language_models.base import (
File "D:\Python\Lib\site-packages\langchain_core\language_models\base.py", line 75, in
class BaseLanguageModel(
File "D:\Python\Lib\site-packages\pydantic\v1\main.py", line 286, in new
cls.try_update_forward_refs()
File "D:\Python\Lib\site-packages\pydantic\v1\main.py", line 807, in try_update_forward_refs
update_model_forward_refs(cls, cls.fields.values(), cls.config.json_encoders, localns, (NameError,))
File "D:\Python\Lib\site-packages\pydantic\v1\typing.py", line 554, in update_model_forward_refs
update_field_forward_refs(f, globalns=globalns, localns=localns)
File "D:\Python\Lib\site-packages\pydantic\v1\typing.py", line 520, in update_field_forward_refs
field.type_ = evaluate_forwardref(field.type_, globalns, localns or None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Python\Lib\site-packages\pydantic\v1\typing.py", line 66, in evaluate_forwardref
return cast(Any, type_)._evaluate(globalns, localns, set())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'
so, yeah, i would be glad if you can provide help
The text was updated successfully, but these errors were encountered: