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

Could not resolve authentication method. #1192

Open
Zhou-Shilin opened this issue Jul 25, 2024 · 7 comments
Open

Could not resolve authentication method. #1192

Zhou-Shilin opened this issue Jul 25, 2024 · 7 comments
Labels
bug Something isn't working triage Interesting but stale issue. Will be close if inactive for 3 more days after label added.

Comments

@Zhou-Shilin
Copy link

Policy and info

  • Maintainers will close issues that have been stale for 14 days if they contain relevant answers.
  • Adding the label "sweep" will automatically turn the issue into a coded pull request. Works best for mechanical tasks. More info/syntax at: https://docs.sweep.dev/

Expected Behavior

gpte works properly.

Current Behavior

I get an error after I try to run gpte. I am sure that I set the environment variables OPENAI_API_KEY and OPENAI_API_BASE.

>> gpte -m claude-3-5-sonnet-20240620 -i

Error while improving the project: "Could not resolve authentication method. Expected either api_key or auth_token to be set. Or for one of the `X-Api-Key` or `Authorization` headers to be explicitly omitted"

>> echo %OPENAI_API_KEY%
sk-***********************************

>> echo %OPENAI_API_BASE%
https://api.chatanywhere.com.cn

Failure Information

Error message: Error while improving the project: "Could not resolve authentication method. Expected either api_key or auth_token to be set. Or for one of the X-Api-KeyorAuthorization headers to be explicitly omitted"

Failure Logs

debug_log_file.txt

System Information

>> gpte --sysinfo
Usage: gpte [OPTIONS] [PROJECT_PATH]
Try 'gpte -h' for help.
╭─ Error ──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ No such option: --sysinfo                                                                                            │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
@Zhou-Shilin Zhou-Shilin added bug Something isn't working triage Interesting but stale issue. Will be close if inactive for 3 more days after label added. labels Jul 25, 2024
@captivus
Copy link
Collaborator

Please pull the latest version of GPT-Engineer and feedback if you are still having the same issue.

@Zhou-Shilin
Copy link
Author

I'm using version 0.3.1. This appears to be the latest version.

@captivus
Copy link
Collaborator

captivus commented Jul 25, 2024

I assume you've installed using pip. Does running the latest development version resolve this for you?

https://github.com/gpt-engineer-org/gpt-engineer#install-gpt-engineer

@captivus
Copy link
Collaborator

@Zhou-Shilin actually, I think I see where the issue is. You need to set your ANTHROPIC_API_KEY environment variable, not the OPENAI_API_KEY environment variable, as you're trying to use Claude.

@Zhou-Shilin
Copy link
Author

Zhou-Shilin commented Jul 25, 2024

@captivus My situation is a bit strange: I'm using the Claude model in the openai request format. I used the one-api project to make models from 25 providers available in openai's request format (including GPT, Claude, Gemini, Moonshot, Minimax, etc.). So I'm using the openai api key here and using an api base built on oneapi. I have tested it and am convinced that claude's model is indeed called properly via openai's request format, see the picture.
image

@Zhou-Shilin
Copy link
Author

May I ask if you have any clue about this? @gpt-engineer-org

@viborc
Copy link
Collaborator

viborc commented Aug 1, 2024

We'll need to check that in more detail.

@captivus can you take a look at this, given new comments from @Zhou-Shilin, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Interesting but stale issue. Will be close if inactive for 3 more days after label added.
Projects
None yet
Development

No branches or pull requests

3 participants