-
Notifications
You must be signed in to change notification settings - Fork 10
IV LLM refactoring #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,7 @@ | |||||||
| from cais.tools.input_parser_tool import input_parser_tool | ||||||||
| from cais.tools.dataset_analyzer_tool import dataset_analyzer_tool | ||||||||
| from cais.tools.query_interpreter_tool import query_interpreter_tool | ||||||||
| from cais.tools.iv_discovery_tool import iv_discovery_tool | ||||||||
| from cais.tools.method_selector_tool import method_selector_tool | ||||||||
| from cais.tools.controls_selector_tool import controls_selector_tool | ||||||||
| from cais.tools.method_validator_tool import method_validator_tool | ||||||||
|
|
@@ -49,6 +50,11 @@ | |||||||
|
|
||||||||
| # Set up basic logging | ||||||||
| os.makedirs('./logs/', exist_ok=True) | ||||||||
| logging.basicConfig( | ||||||||
| filename='./logs/agent_debug.log', | ||||||||
| level=logging.INFO, | ||||||||
| format='%(asctime)s - %(name)s - %(levelname)s - %(message)s' | ||||||||
| ) | ||||||||
| logger = logging.getLogger(__name__) | ||||||||
|
|
||||||||
|
|
||||||||
|
|
@@ -60,9 +66,11 @@ def __init__( | |||||||
| dataset_description: Optional[str] = None, # Description of the dataset | ||||||||
| model_name: Optional[str] = None, | ||||||||
| provider: Optional[str] = None, | ||||||||
| use_iv_pipeline: bool = False, | ||||||||
| ): | ||||||||
| # Query not passed to constructor or saved so we can rerun different queries on the same dataset | ||||||||
|
|
||||||||
| self.use_iv_pipeline = use_iv_pipeline | ||||||||
| self.llm_info = { | ||||||||
| 'model_name' : model_name, | ||||||||
| 'provider' : provider | ||||||||
|
|
@@ -121,6 +129,7 @@ def analyse_dataset(self, query=None): | |||||||
| dataset_path=self.dataset_path, | ||||||||
| dataset_description=self.dataset_description, | ||||||||
| original_query=query, | ||||||||
| use_iv_pipeline=self.use_iv_pipeline, | ||||||||
| llm=self.llm | ||||||||
| ).analysis_results | ||||||||
|
|
||||||||
|
|
@@ -153,6 +162,23 @@ def select_method(self, query=None, llm_decision=True): | |||||||
| self.selected_method = self.method_info.selected_method | ||||||||
| return self.selected_method | ||||||||
|
|
||||||||
| def discover_instruments(self, query=None): | ||||||||
| query = self.checkq(query) | ||||||||
|
|
||||||||
| iv_discovery_output = iv_discovery_tool.func( | ||||||||
| variables=self.variables, | ||||||||
| dataset_analysis=self.dataset_analysis, | ||||||||
| dataset_description=self.dataset_description, | ||||||||
| original_query=query | ||||||||
|
||||||||
| original_query=query | |
| original_query=query, | |
| llm=self.llm, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logging.basicConfig(...)at import time reconfigures global logging for any library consumer and for the whole test suite. Prefer leaving logging configuration to the application entrypoint/CLI; here, set a module logger and emit logs without callingbasicConfig(or gate it behindif __name__ == "__main__").