15 lines
339 B
Python
15 lines
339 B
Python
from openai import OpenAI
|
|
|
|
class OpenAIClient:
|
|
"""
|
|
Centralized OpenAI client to manage API interactions.
|
|
"""
|
|
def __init__(self, api_key):
|
|
self.client = OpenAI(api_key=api_key)
|
|
|
|
def get_client(self):
|
|
"""
|
|
Returns the initialized OpenAI client.
|
|
"""
|
|
return self.client
|