mirror of
https://github.com/kennethreitz/simplemind.git
synced 2026-06-05 22:50:18 +00:00
test
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import os
|
||||
|
||||
class AIProviderClient:
|
||||
|
||||
def __init__(self, *, api_key=None, environ_name=None):
|
||||
self._environ_name = environ_name
|
||||
# TODO: reverse order, potentially?
|
||||
self._api_key = api_key or self._load_from_environ()
|
||||
|
||||
def _load_from_environ(self):
|
||||
if self._environ_name:
|
||||
self.api_key = os.environ.get(self._environ_name)
|
||||
else:
|
||||
self.api_key = None
|
||||
|
||||
def test_connection(self):
|
||||
raise NotImplementedError("This method must be implemented by the AI provider client.")
|
||||
|
||||
def generate_response(self, request):
|
||||
raise NotImplementedError("This method must be implemented by the AI provider client.")
|
||||
|
||||
def health_check(self):
|
||||
raise NotImplementedError("This method must be implemented by the AI provider client.")
|
||||
|
||||
|
||||
# TODO: logging provider.
|
||||
#
|
||||
Reference in New Issue
Block a user