Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: #3544

Closed
BlocUnited opened this issue Sep 19, 2024 · 0 comments · Fixed by #3569
Closed

[Bug]: #3544

BlocUnited opened this issue Sep 19, 2024 · 0 comments · Fixed by #3569

Comments

@BlocUnited
Copy link

Describe the bug

I’m getting the following warning. My agents still work but this warning is annoying.

[autogen.oai.client: 09-15 17:51:15] {184} WARNING - The API key specified is not a valid OpenAI format; it won't work with the OpenAI-hosted model.

I was told in the most recent update of autogen you guys implemented the following but it seems to be still presenting this warning.

def is_valid_api_key(api_key: str) -> bool:
"""Determine if input is valid OpenAI API key.

Args:
    api_key (str): An input string to be validated.

Returns:
    bool: A boolean that indicates if input is valid OpenAI API key.
"""
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))

Steps to reproduce

No response

Model Used

Gpt4o

Expected Behavior

No warning should be given.

Screenshots and logs

No response

Additional Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant