Pythagora-io / gpt-pilot

The first real AI developer
Other
29.82k stars 2.96k forks source link

[Bug]: Could not resolve authentication method #1090

Open yuesam opened 3 weeks ago

yuesam commented 3 weeks ago

Version

VisualStudio Code extension

Operating System

Windows 11

What happened?

I added my OpenAI api key only, and then tried to create a new app. Here's the error I got.

self._validate_headers(headers_dict, custom_headers) File "...\pythagora\gpt-pilot\venv\Lib\site-packages\anthropic_client.py", line 458, in _validate_headers raise TypeError( TypeError: "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"

yamasammy commented 1 week ago

Hello everyone experiencing this error. This issue arises when the Anthropic key is not configured properly. As indicated in the config.json file, some agents are set up with the Anthropic provider instead of OpenAI, which results in this error. Just replace antropic agent by open ai agent (changing provider + model)