diff options
author | Fullstop000 <fullstop1005@gmail.com> | 2024-04-23 18:29:12 +0800 |
---|---|---|
committer | Reinier van der Leer <pwuts@agpt.co> | 2024-04-26 19:33:08 +0200 |
commit | 7430e011f1e28e8f4cc5b479f513d624e0ef4583 (patch) | |
tree | 234394f399b57673528815a466f16c388ad6a356 | |
parent | fix(agent): Full fix for CLI breakage introduced in cf00c33 (diff) | |
download | Auto-GPT-7430e011f1e28e8f4cc5b479f513d624e0ef4583.tar.gz Auto-GPT-7430e011f1e28e8f4cc5b479f513d624e0ef4583.tar.bz2 Auto-GPT-7430e011f1e28e8f4cc5b479f513d624e0ef4583.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>
-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 e99fec9d8..6d932abf0 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 |