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

TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard' #56

Open
kking124 opened this issue Oct 14, 2024 · 1 comment

Comments

@kking124
Copy link

When trying to run the project I get:

$ python main.py --targetlang nodejs
Traceback (most recent call last):
  File "/workspaces/gpt-migrate/gpt_migrate/main.py", line 7, in <module>
    from ai import AI
  File "/workspaces/gpt-migrate/gpt_migrate/ai.py", line 1, in <module>
    from langchain.chat_models import ChatOpenAI
  File "/home/vscode/.local/lib/python3.12/site-packages/langchain/chat_models/__init__.py", line 24, in <module>
    from langchain.chat_models.base import init_chat_model
  File "/home/vscode/.local/lib/python3.12/site-packages/langchain/chat_models/base.py", line 5, in <module>
    from langchain_core.language_models.chat_models import (
  File "/home/vscode/.local/lib/python3.12/site-packages/langchain_core/language_models/__init__.py", line 25, in <module>
    from langchain_core.language_models.base import (
  File "/home/vscode/.local/lib/python3.12/site-packages/langchain_core/language_models/base.py", line 75, in <module>
    class BaseLanguageModel(
  File "/home/vscode/.local/lib/python3.12/site-packages/pydantic/main.py", line 286, in __new__
    cls.__try_update_forward_refs__()
  File "/home/vscode/.local/lib/python3.12/site-packages/pydantic/main.py", line 808, in __try_update_forward_refs__
    update_model_forward_refs(cls, cls.__fields__.values(), cls.__config__.json_encoders, localns, (NameError,))
  File "/home/vscode/.local/lib/python3.12/site-packages/pydantic/typing.py", line 562, in update_model_forward_refs
    update_field_forward_refs(f, globalns=globalns, localns=localns)
  File "/home/vscode/.local/lib/python3.12/site-packages/pydantic/typing.py", line 528, in update_field_forward_refs
    field.type_ = evaluate_forwardref(field.type_, globalns, localns or None)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vscode/.local/lib/python3.12/site-packages/pydantic/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'
@eNODE-1
Copy link

eNODE-1 commented Oct 26, 2024

Use Python 3.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants