Closed marklysze closed 1 month ago
OpenAI's API key has changed in format recently and the validation function in OpenAI doesn't accurately validate the format.
OpenAI has not published the format of the key, so information gathered so far is that it can start with: sk- sk-proj- sk-None- sk-svcaat-
sk-
sk-proj-
sk-None-
sk-svcaat-
This is followed by segments of alphanumeric characters (including underscores) separated by dashes.
As the exact format is not defined, the regular expression in the validation function will be expanded to support keys:
The tests have been updated.
Closes #26
I tested this PR within my use case, where I run Autogen using uvicorn. The API key validation warning issue was resolved, and everything works as expected now. Thanks for the fix!
Why are these changes needed?
OpenAI's API key has changed in format recently and the validation function in OpenAI doesn't accurately validate the format.
OpenAI has not published the format of the key, so information gathered so far is that it can start with:
sk-
sk-proj-
sk-None-
sk-svcaat-
This is followed by segments of alphanumeric characters (including underscores) separated by dashes.
As the exact format is not defined, the regular expression in the validation function will be expanded to support keys:
sk-
The tests have been updated.
Related issue number
Closes #26
Checks