nikeshn commited on
Commit
4d33aa5
·
verified ·
1 Parent(s): 325bca9

Update src/config.py

Browse files
Files changed (1) hide show
  1. src/config.py +3 -7
src/config.py CHANGED
@@ -1,11 +1,9 @@
1
  from functools import lru_cache
2
  from pathlib import Path
3
  from typing import Literal
4
-
5
  from pydantic import field_validator
6
  from pydantic_settings import BaseSettings, SettingsConfigDict
7
 
8
-
9
  class Settings(BaseSettings):
10
  model_config = SettingsConfigDict(
11
  case_sensitive=False,
@@ -13,18 +11,14 @@ class Settings(BaseSettings):
13
  env_file_encoding="utf-8",
14
  extra="ignore",
15
  )
16
-
17
  openai_api_key: str = ""
18
  anthropic_api_key: str = ""
19
  primo_api_key: str = ""
20
-
21
  admin_password: str = ""
22
  session_secret: str = "change-me"
23
-
24
  environment: Literal["development", "production"] = "production"
25
  maintenance_mode: bool = False
26
  max_results: int = 5
27
-
28
  runtime_dir: str = "/tmp/libbee_runtime"
29
  feedback_store_path: str = ""
30
  metrics_store_path: str = ""
@@ -32,6 +26,9 @@ class Settings(BaseSettings):
32
  rag_index_dir: str = ""
33
  knowledge_dir: str = ""
34
  rate_limit_per_minute: int = 40
 
 
 
35
 
36
  @field_validator("max_results")
37
  @classmethod
@@ -75,7 +72,6 @@ class Settings(BaseSettings):
75
  return Path("/app/data/knowledge")
76
  return Path("data/knowledge")
77
 
78
-
79
  @lru_cache
80
  def get_settings() -> Settings:
81
  settings = Settings()
 
1
  from functools import lru_cache
2
  from pathlib import Path
3
  from typing import Literal
 
4
  from pydantic import field_validator
5
  from pydantic_settings import BaseSettings, SettingsConfigDict
6
 
 
7
  class Settings(BaseSettings):
8
  model_config = SettingsConfigDict(
9
  case_sensitive=False,
 
11
  env_file_encoding="utf-8",
12
  extra="ignore",
13
  )
 
14
  openai_api_key: str = ""
15
  anthropic_api_key: str = ""
16
  primo_api_key: str = ""
 
17
  admin_password: str = ""
18
  session_secret: str = "change-me"
 
19
  environment: Literal["development", "production"] = "production"
20
  maintenance_mode: bool = False
21
  max_results: int = 5
 
22
  runtime_dir: str = "/tmp/libbee_runtime"
23
  feedback_store_path: str = ""
24
  metrics_store_path: str = ""
 
26
  rag_index_dir: str = ""
27
  knowledge_dir: str = ""
28
  rate_limit_per_minute: int = 40
29
+ # Cloudflare Worker URL for persistent analytics
30
+ # Set this in HF Space secrets as: CLOUDFLARE_WORKER_URL=https://steep-haze-e1f8.nikeshn.workers.dev
31
+ cloudflare_worker_url: str = ""
32
 
33
  @field_validator("max_results")
34
  @classmethod
 
72
  return Path("/app/data/knowledge")
73
  return Path("data/knowledge")
74
 
 
75
  @lru_cache
76
  def get_settings() -> Settings:
77
  settings = Settings()