Spaces:
Running
Running
Commit
·
9e9bc6b
1
Parent(s):
f5747b1
chore: clean up env config and upgrade model defaults
Browse files- Remove dead HF_TOKEN from .env.example (not used in codebase)
- Remove unused enable_modal_analysis config option
- Add missing env vars: LLM_PROVIDER, SEARCH_TIMEOUT, model names
- Update default models to latest: gpt-5.1, claude-sonnet-4-5-20250929
- Reorganize .env.example with clear sections
- Remove personal attribution comments (group project)
All env vars now properly wired end-to-end.
- .env.example +17 -9
- src/utils/config.py +6 -13
.env.example
CHANGED
|
@@ -1,22 +1,30 @@
|
|
| 1 |
-
# LLM
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
OPENAI_API_KEY=sk-your-key-here
|
| 3 |
ANTHROPIC_API_KEY=sk-ant-your-key-here
|
| 4 |
|
| 5 |
-
#
|
| 6 |
-
|
|
|
|
| 7 |
|
| 8 |
-
#
|
| 9 |
-
HF_TOKEN=hf_your-token-here
|
| 10 |
|
| 11 |
-
# Agent Config
|
| 12 |
MAX_ITERATIONS=10
|
|
|
|
| 13 |
LOG_LEVEL=INFO
|
| 14 |
|
| 15 |
-
# ==============
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
-
# Modal (
|
| 18 |
MODAL_TOKEN_ID=ak-your-modal-token-id-here
|
| 19 |
MODAL_TOKEN_SECRET=your-modal-token-secret-here
|
| 20 |
|
| 21 |
-
# Vector Database
|
| 22 |
CHROMA_DB_PATH=./chroma_db
|
|
|
|
| 1 |
+
# ============== LLM CONFIGURATION ==============
|
| 2 |
+
|
| 3 |
+
# Provider: "openai" or "anthropic"
|
| 4 |
+
LLM_PROVIDER=openai
|
| 5 |
+
|
| 6 |
+
# API Keys (at least one required for full LLM analysis)
|
| 7 |
OPENAI_API_KEY=sk-your-key-here
|
| 8 |
ANTHROPIC_API_KEY=sk-ant-your-key-here
|
| 9 |
|
| 10 |
+
# Model names (optional - sensible defaults)
|
| 11 |
+
OPENAI_MODEL=gpt-5.1
|
| 12 |
+
ANTHROPIC_MODEL=claude-sonnet-4-5-20250929
|
| 13 |
|
| 14 |
+
# ============== AGENT CONFIGURATION ==============
|
|
|
|
| 15 |
|
|
|
|
| 16 |
MAX_ITERATIONS=10
|
| 17 |
+
SEARCH_TIMEOUT=30
|
| 18 |
LOG_LEVEL=INFO
|
| 19 |
|
| 20 |
+
# ============== EXTERNAL SERVICES ==============
|
| 21 |
+
|
| 22 |
+
# PubMed (optional - higher rate limits)
|
| 23 |
+
NCBI_API_KEY=your-ncbi-key-here
|
| 24 |
|
| 25 |
+
# Modal Sandbox (optional - for secure code execution)
|
| 26 |
MODAL_TOKEN_ID=ak-your-modal-token-id-here
|
| 27 |
MODAL_TOKEN_SECRET=your-modal-token-secret-here
|
| 28 |
|
| 29 |
+
# Vector Database (optional - for LlamaIndex RAG)
|
| 30 |
CHROMA_DB_PATH=./chroma_db
|
src/utils/config.py
CHANGED
|
@@ -26,8 +26,10 @@ class Settings(BaseSettings):
|
|
| 26 |
llm_provider: Literal["openai", "anthropic"] = Field(
|
| 27 |
default="openai", description="Which LLM provider to use"
|
| 28 |
)
|
| 29 |
-
openai_model: str = Field(default="gpt-
|
| 30 |
-
anthropic_model: str = Field(
|
|
|
|
|
|
|
| 31 |
|
| 32 |
# Embedding Configuration
|
| 33 |
# Note: OpenAI embeddings require OPENAI_API_KEY (Anthropic has no embeddings API)
|
|
@@ -52,23 +54,14 @@ class Settings(BaseSettings):
|
|
| 52 |
# Logging
|
| 53 |
log_level: Literal["DEBUG", "INFO", "WARNING", "ERROR"] = "INFO"
|
| 54 |
|
| 55 |
-
#
|
| 56 |
modal_token_id: str | None = Field(default=None, description="Modal token ID")
|
| 57 |
modal_token_secret: str | None = Field(default=None, description="Modal token secret")
|
| 58 |
chroma_db_path: str = Field(default="./chroma_db", description="ChromaDB storage path")
|
| 59 |
-
enable_modal_analysis: bool = Field(
|
| 60 |
-
default=False,
|
| 61 |
-
description="Opt-in flag to enable Modal analysis. Must also have modal_available=True.",
|
| 62 |
-
)
|
| 63 |
|
| 64 |
@property
|
| 65 |
def modal_available(self) -> bool:
|
| 66 |
-
"""Check if Modal credentials are configured
|
| 67 |
-
|
| 68 |
-
Note: This is a credentials check, NOT an opt-in flag.
|
| 69 |
-
Use `enable_modal_analysis` to opt-in, then check `modal_available` for credentials.
|
| 70 |
-
Typical usage: `if settings.enable_modal_analysis and settings.modal_available`
|
| 71 |
-
"""
|
| 72 |
return bool(self.modal_token_id and self.modal_token_secret)
|
| 73 |
|
| 74 |
def get_api_key(self) -> str:
|
|
|
|
| 26 |
llm_provider: Literal["openai", "anthropic"] = Field(
|
| 27 |
default="openai", description="Which LLM provider to use"
|
| 28 |
)
|
| 29 |
+
openai_model: str = Field(default="gpt-5.1", description="OpenAI model name")
|
| 30 |
+
anthropic_model: str = Field(
|
| 31 |
+
default="claude-sonnet-4-5-20250929", description="Anthropic model"
|
| 32 |
+
)
|
| 33 |
|
| 34 |
# Embedding Configuration
|
| 35 |
# Note: OpenAI embeddings require OPENAI_API_KEY (Anthropic has no embeddings API)
|
|
|
|
| 54 |
# Logging
|
| 55 |
log_level: Literal["DEBUG", "INFO", "WARNING", "ERROR"] = "INFO"
|
| 56 |
|
| 57 |
+
# External Services
|
| 58 |
modal_token_id: str | None = Field(default=None, description="Modal token ID")
|
| 59 |
modal_token_secret: str | None = Field(default=None, description="Modal token secret")
|
| 60 |
chroma_db_path: str = Field(default="./chroma_db", description="ChromaDB storage path")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
@property
|
| 63 |
def modal_available(self) -> bool:
|
| 64 |
+
"""Check if Modal credentials are configured."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
return bool(self.modal_token_id and self.modal_token_secret)
|
| 66 |
|
| 67 |
def get_api_key(self) -> str:
|