-
-
Notifications
You must be signed in to change notification settings - Fork 407
/
Copy pathconfig.py
50 lines (37 loc) · 1.29 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
from typing import Optional
from dotenv import load_dotenv
from langchain.pydantic_v1 import BaseSettings, SecretStr
from langchain.schema import SystemMessage
from codeinterpreterapi.prompts import code_interpreter_system_message
# .env file
load_dotenv(dotenv_path="./.env")
class CodeInterpreterAPISettings(BaseSettings):
"""
CodeInterpreter API Config
"""
DEBUG: bool = False
# Models
OPENAI_API_KEY: Optional[str] = None
AZURE_API_KEY: Optional[str] = None
AZURE_API_BASE: Optional[str] = None
AZURE_API_VERSION: Optional[str] = None
AZURE_DEPLOYMENT_NAME: Optional[str] = None
ANTHROPIC_API_KEY: Optional[SecretStr] = None
# LLM Settings
MODEL: str = "gpt-3.5-turbo"
TEMPERATURE: float = 0.03
DETAILED_ERROR: bool = True
SYSTEM_MESSAGE: SystemMessage = code_interpreter_system_message
REQUEST_TIMEOUT: int = 3 * 60
MAX_ITERATIONS: int = 12
MAX_RETRY: int = 3
# Production Settings
HISTORY_BACKEND: Optional[str] = None
REDIS_URL: str = "redis://localhost:6379"
POSTGRES_URL: str = "postgresql://postgres:postgres@localhost:5432/postgres"
# CodeBox
CODEBOX_API_KEY: Optional[str] = None
CUSTOM_PACKAGES: list[str] = []
# deprecated
VERBOSE: bool = DEBUG
settings = CodeInterpreterAPISettings()