Upload app/config.py with huggingface_hub
Browse files- app/config.py +67 -0
app/config.py
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Configuration for ContextFlow Research
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
import os
|
| 6 |
+
from dataclasses import dataclass, field
|
| 7 |
+
from typing import List, Optional
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
@dataclass
|
| 11 |
+
class LLMConfig:
|
| 12 |
+
api_key: str = os.environ.get('LLM_API_KEY', '')
|
| 13 |
+
base_url: str = os.environ.get('LLM_BASE_URL', 'https://api.openai.com/v1')
|
| 14 |
+
model: str = os.environ.get('LLM_MODEL', 'gpt-4-turbo')
|
| 15 |
+
temperature: float = 0.7
|
| 16 |
+
max_tokens: int = 4000
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
@dataclass
|
| 20 |
+
class SupabaseConfig:
|
| 21 |
+
url: str = os.environ.get('SUPABASE_URL', '')
|
| 22 |
+
anon_key: str = os.environ.get('SUPABASE_ANON_KEY', '')
|
| 23 |
+
service_key: str = os.environ.get('SUPABASE_SERVICE_KEY', '')
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
@dataclass
|
| 27 |
+
class NotionConfig:
|
| 28 |
+
api_key: str = os.environ.get('NOTION_API_KEY', '')
|
| 29 |
+
database_id: str = os.environ.get('NOTION_DATABASE_ID', '')
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
@dataclass
|
| 33 |
+
class ZepConfig:
|
| 34 |
+
api_key: str = os.environ.get('ZEP_API_KEY', '')
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
@dataclass
|
| 38 |
+
class Config:
|
| 39 |
+
secret_key: str = os.environ.get('SECRET_KEY', 'contextflow-research-secret-2024')
|
| 40 |
+
debug: bool = os.environ.get('DEBUG', 'False').lower() == 'true'
|
| 41 |
+
host: str = os.environ.get('HOST', '0.0.0.0')
|
| 42 |
+
port: int = int(os.environ.get('PORT', 5001))
|
| 43 |
+
|
| 44 |
+
llm: LLMConfig = field(default_factory=LLMConfig)
|
| 45 |
+
supabase: SupabaseConfig = field(default_factory=SupabaseConfig)
|
| 46 |
+
notion: NotionConfig = field(default_factory=NotionConfig)
|
| 47 |
+
zep: ZepConfig = field(default_factory=ZepConfig)
|
| 48 |
+
|
| 49 |
+
upload_folder: str = 'uploads'
|
| 50 |
+
max_content_length: int = 100 * 1024 * 1024
|
| 51 |
+
|
| 52 |
+
allowed_domains: List[str] = field(default_factory=lambda: [
|
| 53 |
+
'wikipedia.org', 'khanacademy.org', 'coursera.org', 'edx.org',
|
| 54 |
+
'stackoverflow.com', 'developer.mozilla.org', 'geeksforgeeks.org',
|
| 55 |
+
'chatgpt.com', 'claude.ai', 'gemini.google', 'chat.google.com',
|
| 56 |
+
'github.com', 'huggingface.co', 'arxiv.org', 'arxiv.org',
|
| 57 |
+
'youtube.com', ' Khanacademy', ' Brilliant', ' Brilliant.org',
|
| 58 |
+
'udemy.com', 'pluralsight.com', 'w3schools.com', 'tutorialspoint.com',
|
| 59 |
+
'medium.com', 'dev.to', 'stackoverflow.com', 'stackexchange.com',
|
| 60 |
+
'learn.microsoft.com', 'docs.python.org', 'docs.oracle.com',
|
| 61 |
+
'pandas.pydata.org', 'numpy.org', 'scikit-learn.org', 'tensorflow.org',
|
| 62 |
+
'pytorch.org', 'keras.io', 'huggingface.co/docs', 'langchain.ai'
|
| 63 |
+
])
|
| 64 |
+
|
| 65 |
+
rl_training_interval: int = 100
|
| 66 |
+
simulation_rounds: int = 50
|
| 67 |
+
graph_batch_size: int = 5
|