Spaces:
Sleeping
Sleeping
| import os | |
| from typing import Optional | |
| class Config: | |
| """Configuration class for the chatbot""" | |
| # OpenAI Configuration | |
| OPENAI_API_KEY: str = os.getenv("OPENAI_API_KEY", "") | |
| OPENAI_MODEL: str = os.getenv("OPENAI_MODEL", "gpt-3.5-turbo") | |
| MAX_TOKENS: int = int(os.getenv("MAX_TOKENS", "500")) | |
| TEMPERATURE: float = float(os.getenv("TEMPERATURE", "0.7")) | |
| # System prompt | |
| SYSTEM_PROMPT: str = os.getenv( | |
| "SYSTEM_PROMPT", | |
| "You are a helpful and friendly AI assistant with knowledge about Health Tech Hub Copenhagen. Use the provided PDF information when relevant to answer questions accurately and comprehensively. Keep your responses concise and engaging." | |
| ) | |
| # Gradio Configuration | |
| GRADIO_THEME: str = "soft" | |
| GRADIO_HEIGHT: int = 500 | |
| GRADIO_TITLE: str = "AI Chatbot" | |
| def validate(cls) -> bool: | |
| """Validate that required configuration is present""" | |
| if not cls.OPENAI_API_KEY: | |
| raise ValueError( | |
| "OPENAI_API_KEY environment variable is required. " | |
| "Please set it before running the application." | |
| ) | |
| return True |