Closed eiger8 closed 4 months ago
sgpt --role bash_script_generator "generate basic shell script" 2> err-role.txt
stack trace
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /usr/local/lib/python3.11/site-packages/sgpt/app.py:199 in main │
│ │
│ 196 │ role_class = ( │
│ 197 │ │ DefaultRoles.check_get(shell, describe_shell, code) │
│ 198 │ │ if not role │
│ ❱ 199 │ │ else SystemRole.get(role) │
│ 200 │ ) │
│ 201 │ │
│ 202 │ function_schemas = (get_openai_schemas() or None) if functions else None │
│ │
│ ╭────────────────────── locals ───────────────────────╮ │
│ │ cache = True │ │
│ │ chat = None │ │
│ │ code = False │ │
│ │ create_role = None │ │
│ │ describe_shell = False │ │
│ │ editor = False │ │
│ │ functions = True │ │
│ │ install_functions = None │ │
│ │ install_integration = None │ │
│ │ interaction = True │ │
│ │ list_chats = None │ │
│ │ list_roles = None │ │
│ │ model = 'gpt-4' │ │
│ │ prompt = 'generate basic shell script' │ │
│ │ repl = None │ │
│ │ role = 'bash_script_generator' │ │
│ │ shell = False │ │
│ │ show_chat = None │ │
│ │ show_role = None │ │
│ │ stdin_passed = False │ │
│ │ temperature = 0.0 │ │
│ │ top_p = 1.0 │ │
│ │ version = None │ │
│ ╰─────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/sgpt/role.py:79 in get │
│ │
│ 76 │ │ file_path = cls.storage / f"{name}.json" │
│ 77 │ │ if not file_path.exists(): │
│ 78 │ │ │ raise BadArgumentUsage(f'Role "{name}" not found.') │
│ ❱ 79 │ │ return cls(**json.loads(file_path.read_text())) │
│ 80 │ │
│ 81 │ @classmethod │
│ 82 │ @option_callback │
│ │
│ ╭───────────────────────────────────────── locals ─────────────────────────────────────────╮ │
│ │ cls = <class 'sgpt.role.SystemRole'> │ │
│ │ file_path = PosixPath('/Users/oorys/.config/shell_gpt/roles/bash_script_generator.json') │ │
│ │ name = 'bash_script_generator' │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: SystemRole.__init__() got an unexpected keyword argument 'expecting'
Hi @eiger8, in one of our latest releases, there were significant changes to the roles logic. Old roles are not compatible with version 1.0.0 and above. You can read about the version 1.0.0 changes here. Given that I'm closing this issue, but feel free to reopen it.
Because of significant changes in roles, unfortunately previously created custom roles and chats will not work with ShellGPT v1.0.0 and you will need to re-create them using new version.
When I want to use or check the role i get this error:
shell_gpt version: 1.2.0 Expected result: no error, role is used, shown
Note: on the old version - 0.9.x it was working on the same machine.
sgpt --show-role code 2> err-role.txt
stack trace:Here is my .sgptrc for ref: