-
Notifications
You must be signed in to change notification settings - Fork 0
/
globals.py
36 lines (23 loc) · 992 Bytes
/
globals.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from dotenv import load_dotenv
from openai_manager import OpenAiManager
from azure_speech import AzureSpeechAIManager
from obs_websocket import OBSWebsocketsManager
load_dotenv(dotenv_path=".env.local")
obswebsockets_manager: OBSWebsocketsManager | None = None
def getOBSWebsocketsManager() -> OBSWebsocketsManager:
global obswebsockets_manager
if not obswebsockets_manager:
obswebsockets_manager = OBSWebsocketsManager()
return obswebsockets_manager
openai_manager: OpenAiManager | None = None
def getOpenAiManager() -> OpenAiManager:
global openai_manager
if openai_manager is None:
openai_manager = OpenAiManager()
return openai_manager
speechtotext_manager: AzureSpeechAIManager | None = None
def getAzureSpeechAIManager() -> AzureSpeechAIManager:
global speechtotext_manager
if not speechtotext_manager:
speechtotext_manager = AzureSpeechAIManager()
return speechtotext_manager