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

Upgrade instructor version to resolve the bug caused by removal of "classmethod properties" feature in python3.13 #657

Open
xTayEx opened this issue Dec 23, 2024 · 2 comments

Comments

@xTayEx
Copy link

xTayEx commented Dec 23, 2024

Hi shell_gpt community! I am using shell_gpt with python3.13 recently, and encountered a bug when functions are installed.

Traceback (most recent call last):
  File "/home/xx/Downloads/sgpt_install/venv/bin/sgpt", line 5, in <module>
    from sgpt import cli
  File "/home/xx/Downloads/sgpt_install/venv/lib/python3.13/site-packages/sgpt/__init__.py", line 1, in <module>
    from .app import main as main
  File "/home/xx/Downloads/sgpt_install/venv/lib/python3.13/site-packages/sgpt/app.py", line 12, in <module>
    from sgpt.function import get_openai_schemas
  File "/home/xx/Downloads/sgpt_install/venv/lib/python3.13/site-packages/sgpt/function.py", line 53, in <module>
    functions = [Function(str(path)) for path in functions_folder.glob("*.py")]
                 ~~~~~~~~^^^^^^^^^^^
  File "/home/xx/Downloads/sgpt_install/venv/lib/python3.13/site-packages/sgpt/function.py", line 17, in __init__
    self._name = self._openai_schema["name"]
                 ~~~~~~~~~~~~~~~~~~~^^^^^^^^
TypeError: 'method' object is not subscriptable

This is caused by the removal of "classmethod properties" feature in python3.13.(https://docs.python.org/3.13/library/functions.html#classmethod). Unfortuanetly, this feature is used by the instructor package, and shell_gpt relies on this package in the implementation of function calling. To solve this problem, the instructor community has implemented a classproperty decorator. So upgrade the instructor version can solve the bug. I have noticed that shell_gpt is still using instructor < 1.0.0, maybe we can try to upgrade it?

@ugjka
Copy link

ugjka commented Dec 28, 2024

This a problem on Archlinux now that they've upgraded Python to 3.13.1, shell_gpt is broken, i get the same output as above

@ugjka
Copy link

ugjka commented Dec 29, 2024

last commit 4 months ago, seems i need to shop around for an alternative

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