joshpxyne / gpt-migrate

Easily migrate your codebase from one framework or language to another.
https://gpt-migrate.com
MIT License
6.87k stars 485 forks source link

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

Open kking124 opened 1 month ago

kking124 commented 1 month ago

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 commented 1 month ago

Use Python 3.10