diff options
author | Fullstop000 <fullstop1005@gmail.com> | 2024-04-23 18:29:12 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-23 12:29:12 +0200 |
commit | 86bdbb82b19dfb58fb483f9f32bad81b8e5b9e32 (patch) | |
tree | 2da6073ba27c0e9be5910433e5377ca38181fc8f /autogpts | |
parent | fix(agent): Full fix for CLI breakage introduced in cf00c33 (diff) | |
download | Auto-GPT-86bdbb82b19dfb58fb483f9f32bad81b8e5b9e32.tar.gz Auto-GPT-86bdbb82b19dfb58fb483f9f32bad81b8e5b9e32.tar.bz2 Auto-GPT-86bdbb82b19dfb58fb483f9f32bad81b8e5b9e32.zip |
fix(agent): Support OpenAI Project API keys (#7099)
Amend regex expression in config.py that OpenAI API keys are validated against
Signed-off-by: Fullstop000 <fullstop1005@gmail.com>
Diffstat (limited to 'autogpts')
-rw-r--r-- | autogpts/autogpt/autogpt/config/config.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/autogpts/autogpt/autogpt/config/config.py b/autogpts/autogpt/autogpt/config/config.py index 4ea94fc77..475ad745d 100644 --- a/autogpts/autogpt/autogpt/config/config.py +++ b/autogpts/autogpt/autogpt/config/config.py @@ -289,7 +289,7 @@ class ConfigBuilder(Configurable[Config]): def assert_config_has_openai_api_key(config: Config) -> None: """Check if the OpenAI API key is set in config.py or as an environment variable.""" - key_pattern = r"^sk-\w{48}" + key_pattern = r"^sk-(proj-)?\w{48}" openai_api_key = ( config.openai_credentials.api_key.get_secret_value() if config.openai_credentials |