mirror of
https://github.com/suitenumerique/meet.git
synced 2026-09-04 14:45:40 +00:00
wip create openai client
This commit is contained in:
@@ -3,9 +3,14 @@ from rest_framework.decorators import api_view
|
|||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
from minio import Minio
|
from minio import Minio
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
import openai
|
||||||
|
|
||||||
MINIO_BUCKET = "livekit-staging-livekit-egress"
|
MINIO_BUCKET = "livekit-staging-livekit-egress"
|
||||||
|
|
||||||
|
openai_client = openai.OpenAI(
|
||||||
|
api_key=settings.OPENAI_API_KEY,
|
||||||
|
)
|
||||||
|
|
||||||
# todo - discuss retry policy if the webhook fail
|
# todo - discuss retry policy if the webhook fail
|
||||||
@api_view(["POST"])
|
@api_view(["POST"])
|
||||||
def minio_webhook(request):
|
def minio_webhook(request):
|
||||||
|
|||||||
@@ -396,6 +396,10 @@ class Base(Configuration):
|
|||||||
MINIO_URL = values.Value(
|
MINIO_URL = values.Value(
|
||||||
None, environ_name="MINIO_URL", environ_prefix=None
|
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
|
# pylint: disable=invalid-name
|
||||||
@property
|
@property
|
||||||
def ENVIRONMENT(self):
|
def ENVIRONMENT(self):
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ dependencies = [
|
|||||||
"mozilla-django-oidc==4.0.1",
|
"mozilla-django-oidc==4.0.1",
|
||||||
"livekit-api==0.7.0",
|
"livekit-api==0.7.0",
|
||||||
"minio==7.2.9",
|
"minio==7.2.9",
|
||||||
|
"openai==1.51.2"
|
||||||
]
|
]
|
||||||
|
|
||||||
[project.urls]
|
[project.urls]
|
||||||
|
|||||||
@@ -109,6 +109,10 @@ backend:
|
|||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: backend
|
name: backend
|
||||||
key: MINIO_URL
|
key: MINIO_URL
|
||||||
|
OPENAI_API_KEY:
|
||||||
|
secretKeyRef:
|
||||||
|
name: backend
|
||||||
|
key: OPENAI_API_KEY
|
||||||
|
|
||||||
createsuperuser:
|
createsuperuser:
|
||||||
command:
|
command:
|
||||||
|
|||||||
@@ -24,3 +24,6 @@ stringData:
|
|||||||
{{- if .Values.minioUrl }}
|
{{- if .Values.minioUrl }}
|
||||||
MINIO_URL: {{ .Values.minioUrl }}
|
MINIO_URL: {{ .Values.minioUrl }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if .Values.openaiApiKey }}
|
||||||
|
OPENAI_API_KEY: {{ .Values.openaiApiKey }}
|
||||||
|
{{- end }}
|
||||||
|
|||||||
Reference in New Issue
Block a user