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

Feat/bump openai #159

Merged
merged 3 commits into from
Feb 6, 2024
Merged

Feat/bump openai #159

merged 3 commits into from
Feb 6, 2024

Conversation

0xArdi
Copy link
Collaborator

@0xArdi 0xArdi commented Feb 6, 2024

This PR bumps the openai version to v1.11.0, due to #820.

Comment on lines +33 to +45
def init_openai_client(api_key: str) -> OpenAI:
"""Initialize the OpenAI client"""
global client
if client is None:
client = OpenAI(api_key=api_key)
return client

def close_openai_client() -> None:
"""Close the OpenAI client"""
global client
if client is not None:
client.close()
client = None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about a context manager instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have another PR overlapping this, I can address there.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Adamantios merging this as-is. Will be addressed in an upcoming PR.

@0xArdi 0xArdi merged commit 0f36b71 into main Feb 6, 2024
6 checks passed
@0xArdi 0xArdi deleted the feat/bump-openai branch February 6, 2024 16:06
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 this pull request may close these issues.

3 participants