Skip to content

Commit

Permalink
⚙️ improve settings interface
Browse files Browse the repository at this point in the history
  • Loading branch information
shroominic committed Aug 28, 2023
1 parent 0feb803 commit 7ef01d8
Showing 1 changed file with 32 additions and 4 deletions.
36 changes: 32 additions & 4 deletions codeinterpreterapi/config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from typing import Optional

from dotenv import load_dotenv
from pydantic_settings import BaseSettings
from langchain.pydantic_v1 import BaseSettings
from langchain.schema import SystemMessage

from codeinterpreterapi.prompts import code_interpreter_system_message

# .env file
load_dotenv(dotenv_path="./.env")
Expand All @@ -12,14 +15,39 @@ class CodeInterpreterAPISettings(BaseSettings):
CodeInterpreter API Config
"""

VERBOSE: bool = False
DEBUG: bool = False

# Models
OPENAI_API_KEY: Optional[str] = None
CODEBOX_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[str] = None
OPENROUTER_API_KEY: Optional[str] = None
OPENROUTER_API_BASE: Optional[str] = "https://openrouter.ai/api/v1"
OPENROUTER_DEFAULT_CHAT_MODEL = "openai/gpt-4"

# LLM Settings
MODEL: str = "gpt-3.5-turbo"
TEMPERATURE: float = 0.02
DETAILED_ERROR: bool = True
SYSTEM_MESSAGE: SystemMessage = code_interpreter_system_message
REQUEST_TIMEOUT: int = 3 * 60
MAX_ITERATIONS: int = 15
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] = [] # implement custom logic for codebox

# deprecated
VERBOSE: bool = DEBUG


settings = CodeInterpreterAPISettings()

0 comments on commit 7ef01d8

Please sign in to comment.