diff --git a/requirements/base.in b/requirements/base.in index e3cd27c5..5dccf33f 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -14,4 +14,5 @@ django-choices django-filter openedx-events openai +litellm pandas diff --git a/taxonomy/openai/client.py b/taxonomy/openai/client.py index 10521e6b..f2d9e4c0 100644 --- a/taxonomy/openai/client.py +++ b/taxonomy/openai/client.py @@ -1,10 +1,10 @@ """openai client""" -import openai +import litellm from django.conf import settings -openai.api_key = settings.OPENAI_API_KEY +litellm.api_key = settings.OPENAI_API_KEY def chat_completion(prompt): @@ -14,7 +14,7 @@ def chat_completion(prompt): Arguments: prompt (str): chatGPT prompt """ - response = openai.ChatCompletion.create( + response = litellm.completion( model="gpt-3.5-turbo", messages=[ {"role": "user", "content": prompt},