-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.py
48 lines (39 loc) · 926 Bytes
/
settings.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
37
38
39
40
41
42
43
44
45
46
47
48
# -*- coding: utf-8 -*-
"""Settings for the app."""
import os
from dotenv import load_dotenv
from app.exceptions import ConfigurationException
# Load environment variables from .env file if available
load_dotenv()
# OpenAI API settings
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY", None)
OPENAI_API_MODEL = "gpt-3.5-turbo"
OPENAI_API_TEMPERATURE = 0.0
OPENAI_API_MAX_TOKENS = 64
# application settings
LANGUAGES = [
"English",
"Spanish",
"Italian",
"French",
"Gereman",
"Polish",
"Hebrew",
"Chinese",
"Mandarin",
"Japanese",
"Hindi",
"Russian",
"Portuguese",
"Bengali",
"Urdu",
"Indonesian",
"Nigerian Pidgin",
"Marathi",
"Telugu",
"Turkish",
"Tamil",
]
# application configuration validations
if OPENAI_API_KEY in (None, "SET-ME-PLEASE"):
raise ConfigurationException("No OpenAI API key found. Please add it to your .env file.")