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

Unable to set keys #118

Open
ztxtz opened this issue Jul 15, 2023 · 1 comment
Open

Unable to set keys #118

ztxtz opened this issue Jul 15, 2023 · 1 comment

Comments

@ztxtz
Copy link

ztxtz commented Jul 15, 2023

➜  dev-gpt configure --openai-api-key sk-xxxx

Traceback (most recent call last):
  File "/opt/homebrew/bin/dev-gpt", line 8, in <module>
    sys.exit(main())
  File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/opt/homebrew/lib/python3.10/site-packages/dev_gpt/cli.py", line 103, in configure
    set_api_key('OPENAI_API_KEY', openai_api_key)
  File "/opt/homebrew/lib/python3.10/site-packages/dev_gpt/options/configure/key_handling.py", line 107, in set_api_key
    if f"{name}" in os.environ or is_key_set_in_config_file(key):
TypeError: is_key_set_in_config_file() missing 1 required positional argument: 'key'
@matheusfrancisco
Copy link

matheusfrancisco commented Jul 30, 2023

if you want to fix this problem you should add this function, in the image i fix the problem locally in my machine
image

file: dev_gpt/options/configure/key_handling.py line: 107
i think the name
if f"{name}" in os.environ or is_key_set_in_config_file(name, key):

then you can run python main.py configure --openai-api-key "your key"

but I'm running locally without installing it on pip

to run local you need do to this

pip install -r requirements.txt so you can run with python

python main.py --help will show you the commands

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