shell_gpt icon indicating copy to clipboard operation
shell_gpt copied to clipboard

shell gpt doesnt run at all

Open 7h3pr0xy opened this issue 1 year ago • 3 comments

Tries this in kali as well as parrot and i have also provided my API keys as well

$sgpt "hello"

╭───────────────────── Traceback (most recent call last) ──────────────────────╮ │ /home/pr0xy/myenv/lib/python3.11/site-packages/sgpt/app.py:229 in main │ │ │ │ 226 │ │ │ functions=function_schemas, │ │ 227 │ │ ) │ │ 228 │ else: │ │ ❱ 229 │ │ full_completion = DefaultHandler(role_class, md).handle( │ │ 230 │ │ │ prompt=prompt, │ │ 231 │ │ │ model=model, │ │ 232 │ │ │ temperature=temperature, │ │ │ │ ╭─────────────────────────────── locals ────────────────────────────────╮ │ │ │ cache = True │ │ │ │ chat = None │ │ │ │ code = False │ │ │ │ create_role = None │ │ │ │ describe_shell = False │ │ │ │ editor = False │ │ │ │ function_schemas = None │ │ │ │ functions = True │ │ │ │ install_functions = None │ │ │ │ install_integration = None │ │ │ │ interaction = True │ │ │ │ list_chats = None │ │ │ │ list_roles = None │ │ │ │ md = True │ │ │ │ model = 'gpt-4o' │ │ │ │ prompt = 'hello' │ │ │ │ repl = None │ │ │ │ role = None │ │ │ │ role_class = <sgpt.role.SystemRole object at 0x7f11b72a60d0> │ │ │ │ shell = False │ │ │ │ show_chat = None │ │ │ │ show_role = None │ │ │ │ stdin_passed = False │ │ │ │ temperature = 0.0 │ │ │ │ top_p = 1.0 │ │ │ │ version = None │ │ │ ╰───────────────────────────────────────────────────────────────────────╯ │ │ │ │ /home/pr0xy/myenv/lib/python3.11/site-packages/sgpt/handlers/handler.py:165 │ │ in handle │ │ │ │ 162 │ │ │ caching=caching, │ │ 163 │ │ │ **kwargs, │ │ 164 │ │ ) │ │ ❱ 165 │ │ return self.printer(generator, not disable_stream) │ │ 166 │ │ │ │ ╭───────────────────────────────── locals ─────────────────────────────────╮ │ │ │ caching = True │ │ │ │ disable_stream = False │ │ │ │ functions = None │ │ │ │ generator = <generator object Cache.call..wrapper at │ │ │ │ 0x7f11b73d4b80> │ │ │ │ kwargs = {} │ │ │ │ messages = [ │ │ │ │ │ { │ │ │ │ │ │ 'role': 'system', │ │ │ │ │ │ 'content': 'You are ShellGPT\nYou are │ │ │ │ programming and system administration assistant.\nYou │ │ │ │ ar'+295 │ │ │ │ │ }, │ │ │ │ │ {'role': 'user', 'content': 'hello'} │ │ │ │ ] │ │ │ │ model = 'gpt-4o' │ │ │ │ prompt = 'hello' │ │ │ │ self = <sgpt.handlers.default_handler.DefaultHandler object at │ │ │ │ 0x7f11b73e6550> │ │ │ │ temperature = 0.0 │ │ │ │ top_p = 1.0 │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /home/pr0xy/myenv/lib/python3.11/site-packages/sgpt/printer.py:23 in │ │ call │ │ │ │ 20 │ │ │ 21 │ def call(self, chunks: Generator[str, None, None], live: bool = │ │ 22 │ │ if live: │ │ ❱ 23 │ │ │ return self.live_print(chunks) │ │ 24 │ │ with self.console.status("[bold green]Loading..."): │ │ 25 │ │ │ full_completion = "".join(chunks) │ │ 26 │ │ self.static_print(full_completion) │ │ │ │ ╭───────────────────────────────── locals ─────────────────────────────────╮ │ │ │ chunks = <generator object Cache.call..wrapper at │ │ │ │ 0x7f11b73d4b80> │ │ │ │ live = True │ │ │ │ self = <sgpt.printer.MarkdownPrinter object at 0x7f11b770b990> │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /home/pr0xy/myenv/lib/python3.11/site-packages/sgpt/printer.py:38 in │ │ live_print │ │ │ │ 35 │ def live_print(self, chunks: Generator[str, None, None]) -> str: │ │ 36 │ │ full_completion = "" │ │ 37 │ │ with Live(console=self.console) as live: │ │ ❱ 38 │ │ │ for chunk in chunks: │ │ 39 │ │ │ │ full_completion += chunk │ │ 40 │ │ │ │ markdown = Markdown(markup=full_completion, code_theme= │ │ 41 │ │ │ │ live.update(markdown, refresh=True) │ │ │ │ ╭───────────────────────────────── locals ─────────────────────────────────╮ │ │ │ chunks = <generator object Cache.call..wrapper at │ │ │ │ 0x7f11b73d4b80> │ │ │ │ full_completion = '' │ │ │ │ live = <rich.live.Live object at 0x7f11b72a6610> │ │ │ │ self = <sgpt.printer.MarkdownPrinter object at │ │ │ │ 0x7f11b770b990> │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /home/pr0xy/myenv/lib/python3.11/site-packages/sgpt/cache.py:37 in wrapper │ │ │ │ 34 │ │ │ │ yield file.read_text() │ │ 35 │ │ │ │ return │ │ 36 │ │ │ result = "" │ │ ❱ 37 │ │ │ for i in func(*args, **kwargs): │ │ 38 │ │ │ │ result += i │ │ 39 │ │ │ │ yield i │ │ 40 │ │ │ if "@FunctionCall" not in result: │ │ │ │ ╭───────────────────────────────── locals ─────────────────────────────────╮ │ │ │ args = ( │ │ │ │ │ <sgpt.handlers.default_handler.DefaultHandler object at │ │ │ │ 0x7f11b73e6550>, │ │ │ │ ) │ │ │ │ file = PosixPath('/tmp/cache/677f6ef0ec5fb21c37aa43a2e47877d6') │ │ │ │ key = '677f6ef0ec5fb21c37aa43a2e47877d6' │ │ │ │ kwargs = { │ │ │ │ │ 'model': 'gpt-4o', │ │ │ │ │ 'temperature': 0.0, │ │ │ │ │ 'top_p': 1.0, │ │ │ │ │ 'messages': [ │ │ │ │ │ │ { │ │ │ │ │ │ │ 'role': 'system', │ │ │ │ │ │ │ 'content': 'You are ShellGPT\nYou are programming │ │ │ │ and system administration assistant.\nYou ar'+295 │ │ │ │ │ │ }, │ │ │ │ │ │ {'role': 'user', 'content': 'hello'} │ │ │ │ │ ], │ │ │ │ │ 'functions': None │ │ │ │ } │ │ │ │ result = '' │ │ │ │ self = <sgpt.cache.Cache object at 0x7f11b729b390> │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /home/pr0xy/myenv/lib/python3.11/site-packages/sgpt/handlers/handler.py:105 │ │ in get_completion │ │ │ │ 102 │ │ │ additional_kwargs["tools"] = functions │ │ 103 │ │ │ additional_kwargs["parallel_tool_calls"] = False │ │ 104 │ │ │ │ ❱ 105 │ │ response = completion( │ │ 106 │ │ │ model=model, │ │ 107 │ │ │ temperature=temperature, │ │ 108 │ │ │ top_p=top_p, │ │ │ │ ╭───────────────────────────────── locals ─────────────────────────────────╮ │ │ │ arguments = '' │ │ │ │ functions = None │ │ │ │ is_code_role = False │ │ │ │ is_dsc_shell_role = False │ │ │ │ is_shell_role = False │ │ │ │ messages = [ │ │ │ │ │ { │ │ │ │ │ │ 'role': 'system', │ │ │ │ │ │ 'content': 'You are ShellGPT\nYou are │ │ │ │ programming and system administration │ │ │ │ assistant.\nYou ar'+295 │ │ │ │ │ }, │ │ │ │ │ {'role': 'user', 'content': 'hello'} │ │ │ │ ] │ │ │ │ model = 'gpt-4o' │ │ │ │ name = '' │ │ │ │ self = <sgpt.handlers.default_handler.DefaultHandler object │ │ │ │ at 0x7f11b73e6550> │ │ │ │ temperature = 0.0 │ │ │ │ top_p = 1.0 │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /home/pr0xy/myenv/lib/python3.11/site-packages/openai/_utils/_utils.py:275 │ │ in wrapper │ │ │ │ 272 │ │ │ │ │ else: │ │ 273 │ │ │ │ │ │ msg = f"Missing required argument: {quote(miss │ │ 274 │ │ │ │ raise TypeError(msg) │ │ ❱ 275 │ │ │ return func(*args, **kwargs) │ │ 276 │ │ │ │ 277 │ │ return wrapper # type: ignore │ │ 278 │ │ │ │ ╭───────────────────────────────── locals ─────────────────────────────────╮ │ │ │ _ = <openai.resources.chat.completions.Completions object at │ │ │ │ 0x7f11b729b150> │ │ │ │ args = ( │ │ │ │ │ <openai.resources.chat.completions.Completions object │ │ │ │ at 0x7f11b729b150>, │ │ │ │ ) │ │ │ │ given_params = { │ │ │ │ │ 'messages', │ │ │ │ │ 'self', │ │ │ │ │ 'stream', │ │ │ │ │ 'model', │ │ │ │ │ 'top_p', │ │ │ │ │ 'temperature' │ │ │ │ } │ │ │ │ i = 0 │ │ │ │ key = 'stream' │ │ │ │ kwargs = { │ │ │ │ │ 'model': 'gpt-4o', │ │ │ │ │ 'temperature': 0.0, │ │ │ │ │ 'top_p': 1.0, │ │ │ │ │ 'messages': [ │ │ │ │ │ │ { │ │ │ │ │ │ │ 'role': 'system', │ │ │ │ │ │ │ 'content': 'You are ShellGPT\nYou are │ │ │ │ programming and system administration assistant.\nYou │ │ │ │ ar'+295 │ │ │ │ │ │ }, │ │ │ │ │ │ {'role': 'user', 'content': 'hello'} │ │ │ │ │ ], │ │ │ │ │ 'stream': True │ │ │ │ } │ │ │ │ matches = True │ │ │ │ positional = ['self'] │ │ │ │ variant = ['messages', 'model'] │ │ │ │ variants = (['messages', 'model'], ['messages', 'model', 'stream']) │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /home/pr0xy/myenv/lib/python3.11/site-packages/openai/resources/chat/complet │ │ ions.py:829 in create │ │ │ │ 826 │ │ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, │ │ 827 │ ) -> ChatCompletion | Stream[ChatCompletionChunk]: │ │ 828 │ │ validate_response_format(response_format) │ │ ❱ 829 │ │ return self._post( │ │ 830 │ │ │ "/chat/completions", │ │ 831 │ │ │ body=maybe_transform( │ │ 832 │ │ │ │ { │ │ │ │ ╭───────────────────────────────── locals ─────────────────────────────────╮ │ │ │ audio = NOT_GIVEN │ │ │ │ extra_body = None │ │ │ │ extra_headers = None │ │ │ │ extra_query = None │ │ │ │ frequency_penalty = NOT_GIVEN │ │ │ │ function_call = NOT_GIVEN │ │ │ │ functions = NOT_GIVEN │ │ │ │ logit_bias = NOT_GIVEN │ │ │ │ logprobs = NOT_GIVEN │ │ │ │ max_completion_tokens = NOT_GIVEN │ │ │ │ max_tokens = NOT_GIVEN │ │ │ │ messages = [ │ │ │ │ │ { │ │ │ │ │ │ 'role': 'system', │ │ │ │ │ │ 'content': 'You are ShellGPT\nYou are │ │ │ │ programming and system administration │ │ │ │ assistant.\nYou ar'+295 │ │ │ │ │ }, │ │ │ │ │ {'role': 'user', 'content': 'hello'} │ │ │ │ ] │ │ │ │ metadata = NOT_GIVEN │ │ │ │ modalities = NOT_GIVEN │ │ │ │ model = 'gpt-4o' │ │ │ │ n = NOT_GIVEN │ │ │ │ parallel_tool_calls = NOT_GIVEN │ │ │ │ prediction = NOT_GIVEN │ │ │ │ presence_penalty = NOT_GIVEN │ │ │ │ response_format = NOT_GIVEN │ │ │ │ seed = NOT_GIVEN │ │ │ │ self = <openai.resources.chat.completions.Completions │ │ │ │ object at 0x7f11b729b150> │ │ │ │ service_tier = NOT_GIVEN │ │ │ │ stop = NOT_GIVEN │ │ │ │ store = NOT_GIVEN │ │ │ │ stream = True │ │ │ │ stream_options = NOT_GIVEN │ │ │ │ temperature = 0.0 │ │ │ │ timeout = NOT_GIVEN │ │ │ │ tool_choice = NOT_GIVEN │ │ │ │ tools = NOT_GIVEN │ │ │ │ top_logprobs = NOT_GIVEN │ │ │ │ top_p = 1.0 │ │ │ │ user = NOT_GIVEN │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /home/pr0xy/myenv/lib/python3.11/site-packages/openai/_base_client.py:1277 │ │ in post │ │ │ │ 1274 │ │ opts = FinalRequestOptions.construct( │ │ 1275 │ │ │ method="post", url=path, json_data=body, files=to_httpx_f │ │ 1276 │ │ ) │ │ ❱ 1277 │ │ return cast(ResponseT, self.request(cast_to, opts, stream=str │ │ 1278 │ │ │ 1279 │ def patch( │ │ 1280 │ │ self, │ │ │ │ ╭───────────────────────────────── locals ─────────────────────────────────╮ │ │ │ body = { │ │ │ │ │ 'messages': [ │ │ │ │ │ │ { │ │ │ │ │ │ │ 'role': 'system', │ │ │ │ │ │ │ 'content': 'You are ShellGPT\nYou are │ │ │ │ programming and system administration assistant.\nYou │ │ │ │ ar'+295 │ │ │ │ │ │ }, │ │ │ │ │ │ {'role': 'user', 'content': 'hello'} │ │ │ │ │ ], │ │ │ │ │ 'model': 'gpt-4o', │ │ │ │ │ 'audio': NOT_GIVEN, │ │ │ │ │ 'frequency_penalty': NOT_GIVEN, │ │ │ │ │ 'function_call': NOT_GIVEN, │ │ │ │ │ 'functions': NOT_GIVEN, │ │ │ │ │ 'logit_bias': NOT_GIVEN, │ │ │ │ │ 'logprobs': NOT_GIVEN, │ │ │ │ │ 'max_completion_tokens': NOT_GIVEN, │ │ │ │ │ 'max_tokens': NOT_GIVEN, │ │ │ │ │ ... +19 │ │ │ │ } │ │ │ │ files = None │ │ │ │ options = {} │ │ │ │ opts = FinalRequestOptions( │ │ │ │ │ method='post', │ │ │ │ │ url='/chat/completions', │ │ │ │ │ params={}, │ │ │ │ │ headers=NOT_GIVEN, │ │ │ │ │ max_retries=NOT_GIVEN, │ │ │ │ │ timeout=NOT_GIVEN, │ │ │ │ │ files=None, │ │ │ │ │ idempotency_key=None, │ │ │ │ │ post_parser=NOT_GIVEN, │ │ │ │ │ json_data={ │ │ │ │ │ │ 'messages': [ │ │ │ │ │ │ │ { │ │ │ │ │ │ │ │ 'role': 'system', │ │ │ │ │ │ │ │ 'content': 'You are ShellGPT\nYou are │ │ │ │ programming and system administration assistant.\nYou │ │ │ │ ar'+295 │ │ │ │ │ │ │ }, │ │ │ │ │ │ │ {'role': 'user', 'content': 'hello'} │ │ │ │ │ │ ], │ │ │ │ │ │ 'model': 'gpt-4o', │ │ │ │ │ │ 'stream': True, │ │ │ │ │ │ 'temperature': 0.0, │ │ │ │ │ │ 'top_p': 1.0 │ │ │ │ │ }, │ │ │ │ │ extra_json=None │ │ │ │ ) │ │ │ │ path = '/chat/completions' │ │ │ │ self = <openai.OpenAI object at 0x7f11b8af11d0> │ │ │ │ stream = True │ │ │ │ stream_cls = openai.Stream[openai.types.chat.chat_completion_chunk.Chat… │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /home/pr0xy/myenv/lib/python3.11/site-packages/openai/_base_client.py:954 in │ │ request │ │ │ │ 951 │ │ else: │ │ 952 │ │ │ retries_taken = 0 │ │ 953 │ │ │ │ ❱ 954 │ │ return self._request( │ │ 955 │ │ │ cast_to=cast_to, │ │ 956 │ │ │ options=options, │ │ 957 │ │ │ stream=stream, │ │ │ │ ╭───────────────────────────────── locals ─────────────────────────────────╮ │ │ │ options = FinalRequestOptions( │ │ │ │ │ method='post', │ │ │ │ │ url='/chat/completions', │ │ │ │ │ params={}, │ │ │ │ │ headers=NOT_GIVEN, │ │ │ │ │ max_retries=NOT_GIVEN, │ │ │ │ │ timeout=NOT_GIVEN, │ │ │ │ │ files=None, │ │ │ │ │ idempotency_key=None, │ │ │ │ │ post_parser=NOT_GIVEN, │ │ │ │ │ json_data={ │ │ │ │ │ │ 'messages': [ │ │ │ │ │ │ │ { │ │ │ │ │ │ │ │ 'role': 'system', │ │ │ │ │ │ │ │ 'content': 'You are ShellGPT\nYou │ │ │ │ are programming and system administration │ │ │ │ assistant.\nYou ar'+295 │ │ │ │ │ │ │ }, │ │ │ │ │ │ │ {'role': 'user', 'content': 'hello'} │ │ │ │ │ │ ], │ │ │ │ │ │ 'model': 'gpt-4o', │ │ │ │ │ │ 'stream': True, │ │ │ │ │ │ 'temperature': 0.0, │ │ │ │ │ │ 'top_p': 1.0 │ │ │ │ │ }, │ │ │ │ │ extra_json=None │ │ │ │ ) │ │ │ │ remaining_retries = None │ │ │ │ retries_taken = 0 │ │ │ │ self = <openai.OpenAI object at 0x7f11b8af11d0> │ │ │ │ stream = True │ │ │ │ stream_cls = openai.Stream[openai.types.chat.chat_completion_chu… │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /home/pr0xy/myenv/lib/python3.11/site-packages/openai/_base_client.py:1058 │ │ in _request │ │ │ │ 1055 │ │ │ │ err.response.read() │ │ 1056 │ │ │ │ │ 1057 │ │ │ log.debug("Re-raising status error") │ │ ❱ 1058 │ │ │ raise self._make_status_error_from_response(err.response) │ │ 1059 │ │ │ │ 1060 │ │ return self._process_response( │ │ 1061 │ │ │ cast_to=cast_to, │ │ │ │ ╭───────────────────────────────── locals ─────────────────────────────────╮ │ │ │ input_options = FinalRequestOptions( │ │ │ │ │ method='post', │ │ │ │ │ url='/chat/completions', │ │ │ │ │ params={}, │ │ │ │ │ headers=NOT_GIVEN, │ │ │ │ │ max_retries=NOT_GIVEN, │ │ │ │ │ timeout=NOT_GIVEN, │ │ │ │ │ files=None, │ │ │ │ │ idempotency_key=None, │ │ │ │ │ post_parser=NOT_GIVEN, │ │ │ │ │ json_data={ │ │ │ │ │ │ 'messages': [ │ │ │ │ │ │ │ { │ │ │ │ │ │ │ │ 'role': 'system', │ │ │ │ │ │ │ │ 'content': 'You are ShellGPT\nYou │ │ │ │ are programming and system administration │ │ │ │ assistant.\nYou ar'+295 │ │ │ │ │ │ │ }, │ │ │ │ │ │ │ {'role': 'user', 'content': 'hello'} │ │ │ │ │ │ ], │ │ │ │ │ │ 'model': 'gpt-4o', │ │ │ │ │ │ 'stream': True, │ │ │ │ │ │ 'temperature': 0.0, │ │ │ │ │ │ 'top_p': 1.0 │ │ │ │ │ }, │ │ │ │ │ extra_json=None │ │ │ │ ) │ │ │ │ kwargs = {} │ │ │ │ options = FinalRequestOptions( │ │ │ │ │ method='post', │ │ │ │ │ url='/chat/completions', │ │ │ │ │ params={}, │ │ │ │ │ headers=NOT_GIVEN, │ │ │ │ │ max_retries=NOT_GIVEN, │ │ │ │ │ timeout=NOT_GIVEN, │ │ │ │ │ files=None, │ │ │ │ │ idempotency_key=None, │ │ │ │ │ post_parser=NOT_GIVEN, │ │ │ │ │ json_data={ │ │ │ │ │ │ 'messages': [ │ │ │ │ │ │ │ { │ │ │ │ │ │ │ │ 'role': 'system', │ │ │ │ │ │ │ │ 'content': 'You are ShellGPT\nYou │ │ │ │ are programming and system administration │ │ │ │ assistant.\nYou ar'+295 │ │ │ │ │ │ │ }, │ │ │ │ │ │ │ {'role': 'user', 'content': 'hello'} │ │ │ │ │ │ ], │ │ │ │ │ │ 'model': 'gpt-4o', │ │ │ │ │ │ 'stream': True, │ │ │ │ │ │ 'temperature': 0.0, │ │ │ │ │ │ 'top_p': 1.0 │ │ │ │ │ }, │ │ │ │ │ extra_json=None │ │ │ │ ) │ │ │ │ remaining_retries = 2 │ │ │ │ request = <Request('POST', │ │ │ │ 'https://api.openai.com/v1/chat/completions')> │ │ │ │ response = <Response [404 Not Found]> │ │ │ │ retries_taken = 0 │ │ │ │ self = <openai.OpenAI object at 0x7f11b8af11d0> │ │ │ │ stream = True │ │ │ │ stream_cls = openai.Stream[openai.types.chat.chat_completion_chu… │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ ╰──────────────────────────────────────────────────────────────────────────────╯ NotFoundError: Error code: 404 - {'error': {'message': 'The model gpt-4o does not exist or you do not have access to it.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}

7h3pr0xy avatar Nov 06 '24 16:11 7h3pr0xy

I had the same issue until I subscribed to a paid plan here: https://platform.openai.com/settings/organization/billing/overview

ygalustov avatar Nov 13 '24 04:11 ygalustov

I had the same issue until I subscribed to a paid plan here: https://platform.openai.com/settings/organization/billing/overview

Same here

pdietl avatar Nov 28 '24 04:11 pdietl

@ygalustov If you don't have an OpenAI plan, you won't be able to use OpenAI services. However, if you have a good graphics card, you can consider using the LLaMA model as an alternative.

sjanaX01 avatar Dec 24 '24 15:12 sjanaX01