@@ -36,24 +36,28 @@ def uri(self) -> str:
3636 return f"{ self .host } :{ self .port } "
3737
3838
39- class AppSettings (BaseModel ):
40- embedders_config_dir_path : str = Field ("./configs/balanced/" )
41- use_cuda : bool = Field (False )
42- recursive_indexing : bool = Field (False )
43- batch_size : int = Field (100 )
44- num_embedding_workers : int = Field (4 )
39+ class QuerySettings (BaseModel ):
40+ default_num_images_to_retrieve : int = Field (20 )
41+ default_num_images_to_generate : int = Field (4 )
42+ default_generated_image_size : int = Field (512 )
43+ include_base_images_in_preview : bool = Field (False )
44+
45+
46+ class DirectorySettings (BaseModel ):
4547 num_watcher_workers : int = Field (4 )
48+ num_embedding_workers : int = Field (4 )
49+ batch_size : int = Field (50 )
50+ recursive_indexing : bool = Field (False )
4651
4752
48- class IndexSettings (BaseModel ):
49- index_type : str = Field ("HNSW " )
50- metric_type : str = Field ("COSINE" )
53+ class ServiceSettings (BaseModel ):
54+ embedders_config_dir_path : str = Field ("./configs/balanced/ " )
55+ use_cuda : bool = Field (False )
5156
5257
53- class GeneratorsSettings (BaseModel ):
58+ class ImageGeneratorSettings (BaseModel ):
5459 host : str = Field ("0.0.0.0" )
5560 port : int = Field (8001 )
56- default_engine : str = Field ("sdxl_lightning" )
5761
5862 @property
5963 def url (self ) -> str :
@@ -64,8 +68,10 @@ class Settings(BaseSettings):
6468 # Environment-based settings
6569 postgres : PostgresSettings = PostgresSettings ()
6670 milvus : MilvusSettings = MilvusSettings ()
67- app : AppSettings = AppSettings ()
68- generators : GeneratorsSettings = GeneratorsSettings ()
71+ service : ServiceSettings = ServiceSettings ()
72+ generators : ImageGeneratorSettings = ImageGeneratorSettings ()
73+ directory : DirectorySettings = DirectorySettings ()
74+ query : QuerySettings = QuerySettings ()
6975
7076 # JSON config
7177 json_config : Optional [JSONConfig ] = None
@@ -78,7 +84,7 @@ def load_json_config(self):
7884 """
7985 Load and parse the JSON configuration file specified in app.config_path.
8086 """
81- config_path = Path (self .app .embedders_config_dir_path , "config.json" )
87+ config_path = Path (self .service .embedders_config_dir_path , "config.json" )
8288 if config_path .exists ():
8389 with open (config_path , "r" ) as file :
8490 json_data = json .load (file )
0 commit comments