wip create openai client

This commit is contained in:
lebaudantoine
2024-10-16 10:23:01 +02:00
parent 5e57647b34
commit 3614b1e803
5 changed files with 17 additions and 0 deletions
+5
View File
@@ -3,9 +3,14 @@ from rest_framework.decorators import api_view
from rest_framework.response import Response
from minio import Minio
from django.conf import settings
import openai
MINIO_BUCKET = "livekit-staging-livekit-egress"
openai_client = openai.OpenAI(
api_key=settings.OPENAI_API_KEY,
)
# todo - discuss retry policy if the webhook fail
@api_view(["POST"])
def minio_webhook(request):
+4
View File
@@ -396,6 +396,10 @@ class Base(Configuration):
MINIO_URL = values.Value(
None, environ_name="MINIO_URL", environ_prefix=None
)
OPENAI_API_KEY = values.Value(
None, environ_name="OPENAI_API_KEY", environ_prefix=None
)
# pylint: disable=invalid-name
@property
def ENVIRONMENT(self):
+1
View File
@@ -59,6 +59,7 @@ dependencies = [
"mozilla-django-oidc==4.0.1",
"livekit-api==0.7.0",
"minio==7.2.9",
"openai==1.51.2"
]
[project.urls]
@@ -109,6 +109,10 @@ backend:
secretKeyRef:
name: backend
key: MINIO_URL
OPENAI_API_KEY:
secretKeyRef:
name: backend
key: OPENAI_API_KEY
createsuperuser:
command:
+3
View File
@@ -24,3 +24,6 @@ stringData:
{{- if .Values.minioUrl }}
MINIO_URL: {{ .Values.minioUrl }}
{{- end }}
{{- if .Values.openaiApiKey }}
OPENAI_API_KEY: {{ .Values.openaiApiKey }}
{{- end }}