Skip to content

Commit

Permalink
Merge branch 'main' into patchwork
Browse files Browse the repository at this point in the history
  • Loading branch information
prithvi2226 authored Jul 6, 2024
2 parents 0772fb9 + 82903f5 commit 79dbb7b
Show file tree
Hide file tree
Showing 6 changed files with 278 additions and 307 deletions.
2 changes: 1 addition & 1 deletion autogen/oai/openai_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def is_valid_api_key(api_key: str) -> bool:
Returns:
bool: A boolean that indicates if input is valid OpenAI API key.
"""
api_key_re = re.compile(r"^sk-(proj-)?[A-Za-z0-9]{32,}$")
api_key_re = re.compile(r"^sk-([A-Za-z0-9]+(-+[A-Za-z0-9]+)*-)?[A-Za-z0-9]{32,}$")
return bool(re.fullmatch(api_key_re, api_key))


Expand Down
Loading

0 comments on commit 79dbb7b

Please sign in to comment.