Skip to content

Commit

Permalink
over
Browse files Browse the repository at this point in the history
  • Loading branch information
AmoghTantradi committed Jan 25, 2025
1 parent f93f7ed commit 38ff87d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lotus/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,15 @@ class Settings:
parallel_groupby_max_threads: int = 8

def configure(self, **kwargs):

if 'rm' in kwargs and 'vs' in kwargs:
raise ValueError('Invalid settings: you can only set a retriever module or a vector store, but not both')


for key, value in kwargs.items():
if not hasattr(self, key):
raise ValueError(f"Invalid setting: {key}")
if (key == 'vs' and getattr(self, 'rm') is not None) or (key == 'rm' and getattr(self, 'vs') is not None):
if (key == 'vs' and (getattr(self, 'rm') is not None)) or (key == 'rm' and (getattr(self, 'vs') is not None)):
raise ValueError('Invalid settings: you can only set a retriever module or a vector store, but not both')

setattr(self, key, value)
Expand Down

0 comments on commit 38ff87d

Please sign in to comment.