forked from Eloquent-Algorithmics/GPT_ALL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
65 lines (48 loc) · 1.83 KB
/
config.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# !/usr/bin/env python
# coding: utf-8
# Filename: config.py
# Path: /config.py
"""
This module loads environment variables from the .env file.
The .env file is not included in the repository for security reasons.
"""
import os
from dotenv import load_dotenv
from rich.live import Live
from rich.spinner import Spinner
# Load the .env file
load_dotenv()
# Define the live_spinner
live_spinner = Live(Spinner("pong", " "), auto_refresh=True)
# Main app system prompt.
MAIN_SYSTEM_PROMPT = os.getenv("MAIN_SYSTEM_PROMPT")
# Main app OpenAI API key.
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
if OPENAI_API_KEY is None:
raise ValueError("OPENAI_API_KEY not set")
# Main app OpenAI organization ID.
OPENAI_ORG_ID = os.getenv("OPENAI_ORG_ID")
if OPENAI_ORG_ID is None:
raise ValueError("OPENAI_ORG_ID not set")
# Main app OpenAI model ID.
OPENAI_MODEL = os.getenv("OPENAI_MODEL")
if OPENAI_MODEL is None:
raise ValueError("OPENAI_MODEL not set")
# Main app OpenAI Temperature.
OPENAI_TEMP = float(os.getenv("OPENAI_TEMP", str(0.5)))
# Main app OpenAI Top P.
OPENAI_TOP_P = float(os.getenv("OPENAI_TOP_P", str(0.5)))
# Main app OpenAI MAX Response token limit.
OPENAI_MAX_TOKENS = int(os.getenv("OPENAI_MAX_TOKENS", str(1500)))
# Configures the main app to use the local system TTS engine.
TTS_ENGINE = os.getenv("TTS_ENGINE")
if TTS_ENGINE is None:
raise ValueError("TTS_ENGINE not set")
# Configures the main app to use the local system TTS voice ID.
TTS_VOICE_ID = os.getenv("TTS_VOICE_ID")
if TTS_VOICE_ID is None:
raise ValueError("TTS_VOICE_ID not set")
# Configures the main app to use the local system TTS rate.
TTS_RATE = int(os.getenv("TTS_RATE", str(150)))
ELEVENLABS_API_KEY = os.getenv("ELEVENLABS_API_KEY")
ELEVENLABS_VOICE = os.getenv("ELEVENLABS_VOICE", "Rachel")