quantalogic 0.50.11__py3-none-any.whl → 0.50.17__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,110 +1,70 @@
1
1
  """Tools for the QuantaLogic agent."""
2
2
 
3
- import importlib
4
- import sys
5
- from typing import Any, Dict
3
+ from loguru import logger
6
4
 
5
+ # Direct imports of tools
6
+ from .agent_tool import AgentTool
7
+ from .download_http_file_tool import DownloadHttpFileTool
8
+ from .duckduckgo_search_tool import DuckDuckGoSearchTool
9
+ from .edit_whole_content_tool import EditWholeContentTool
10
+ from .elixir_tool import ElixirTool
11
+ from .execute_bash_command_tool import ExecuteBashCommandTool
12
+ from .grep_app_tool import GrepAppTool
13
+ from .input_question_tool import InputQuestionTool
14
+ from .jinja_tool import JinjaTool
15
+ from .list_directory_tool import ListDirectoryTool
16
+ from .llm_tool import LLMTool
17
+ from .llm_vision_tool import LLMVisionTool
18
+ from .markitdown_tool import MarkitdownTool
19
+ from .nodejs_tool import NodeJsTool
20
+ from .python_tool import PythonTool
21
+ from .read_file_block_tool import ReadFileBlockTool
22
+ from .read_file_tool import ReadFileTool
23
+ from .read_html_tool import ReadHTMLTool
24
+ from .replace_in_file_tool import ReplaceInFileTool
25
+ from .ripgrep_tool import RipgrepTool
26
+ from .safe_python_interpreter_tool import SafePythonInterpreterTool
27
+ from .search_definition_names import SearchDefinitionNames
28
+ from .sequence_tool import SequenceTool
29
+ from .serpapi_search_tool import SerpApiSearchTool
30
+ from .sql_query_tool import SQLQueryTool
31
+ from .task_complete_tool import TaskCompleteTool
32
+ from .tool import Tool, ToolArgument
33
+ from .unified_diff_tool import UnifiedDiffTool
34
+ from .wikipedia_search_tool import WikipediaSearchTool
35
+ from .write_file_tool import WriteFileTool
7
36
 
8
- class LazyLoader:
9
- """
10
- Lazily import a module only when its attributes are accessed.
11
- This helps reduce startup time by deferring imports until needed.
12
- """
13
- def __init__(self, module_path: str, optional: bool = False):
14
- self.module_path = module_path
15
- self._module = None
16
- self.optional = optional
17
-
18
- def __getattr__(self, name: str) -> Any:
19
- if self._module is None:
20
- try:
21
- self._module = importlib.import_module(self.module_path)
22
- except ImportError as e:
23
- if self.optional:
24
- # If the tool is optional, log a warning but don't raise an error
25
- print(f"Warning: Optional tool {self.module_path} could not be imported: {e}")
26
- return None
27
- raise
28
-
29
- return getattr(self._module, name)
30
-
31
-
32
- # Map of tool names to their import paths and optional status
33
- _TOOL_IMPORTS = {
34
- "AgentTool": (".agent_tool", False),
35
- "ComposioTool": (".composio.composio", True),
36
- "GenerateDatabaseReportTool": (".database.generate_database_report_tool", True),
37
- "SQLQueryToolAdvanced": (".database.sql_query_tool_advanced", True),
38
- "MarkdownToDocxTool": (".document_tools.markdown_to_docx_tool", True),
39
- "MarkdownToEpubTool": (".document_tools.markdown_to_epub_tool", True),
40
- "MarkdownToHtmlTool": (".document_tools.markdown_to_html_tool", True),
41
- "MarkdownToIpynbTool": (".document_tools.markdown_to_ipynb_tool", True),
42
- "MarkdownToLatexTool": (".document_tools.markdown_to_latex_tool", True),
43
- "MarkdownToPdfTool": (".document_tools.markdown_to_pdf_tool", True),
44
- "MarkdownToPptxTool": (".document_tools.markdown_to_pptx_tool", True),
45
- "DownloadHttpFileTool": (".download_http_file_tool", False),
46
- "DuckDuckGoSearchTool": (".duckduckgo_search_tool", False),
47
- "EditWholeContentTool": (".edit_whole_content_tool", False),
48
- "ElixirTool": (".elixir_tool", False),
49
- "ExecuteBashCommandTool": (".execute_bash_command_tool", False),
50
- "BitbucketCloneTool": (".git.bitbucket_clone_repo_tool", False),
51
- "BitbucketOperationsTool": (".git.bitbucket_operations_tool", False),
52
- "CloneRepoTool": (".git.clone_repo_tool", False),
53
- "GitOperationsTool": (".git.git_operations_tool", False),
54
- "GoogleNewsTool": (".google_packages.google_news_tool", False),
55
- "GrepAppTool": (".grep_app_tool", False),
56
- "LLMImageGenerationTool": (".image_generation.dalle_e", False),
57
- "InputQuestionTool": (".input_question_tool", False),
58
- "JinjaTool": (".jinja_tool", False),
59
- "ListDirectoryTool": (".list_directory_tool", False),
60
- "LLMTool": (".llm_tool", False),
61
- "LLMVisionTool": (".llm_vision_tool", False),
62
- "MarkitdownTool": (".markitdown_tool", False),
63
- "NasaApodTool": (".nasa_packages.nasa_apod_tool", False),
64
- "NasaNeoWsTool": (".nasa_packages.nasa_neows_tool", False),
65
- "NodeJsTool": (".nodejs_tool", False),
66
- "PresentationLLMTool": (".presentation_tools.presentation_llm_tool", False),
67
- "ProductHuntTool": (".product_hunt.product_hunt_tool", False),
68
- "PythonTool": (".python_tool", False),
69
- "RagTool": (".rag_tool.rag_tool", False),
70
- "ReadFileBlockTool": (".read_file_block_tool", False),
71
- "ReadFileTool": (".read_file_tool", False),
72
- "ReadHTMLTool": (".read_html_tool", False),
73
- "ReplaceInFileTool": (".replace_in_file_tool", False),
74
- "RipgrepTool": (".ripgrep_tool", False),
75
- "SafePythonInterpreterTool": (".safe_python_interpreter_tool", False),
76
- "SearchDefinitionNames": (".search_definition_names", False),
77
- "SequenceTool": (".sequence_tool", False),
78
- "SerpApiSearchTool": (".serpapi_search_tool", False),
79
- "SQLQueryTool": (".sql_query_tool", True),
80
- "TaskCompleteTool": (".task_complete_tool", False),
81
- "Tool": (".tool", False),
82
- "ToolArgument": (".tool", False),
83
- "UnifiedDiffTool": (".unified_diff_tool", False),
84
- "CSVProcessorTool": (".utilities.csv_processor_tool", False),
85
- "PrepareDownloadTool": (".utilities.download_file_tool", False),
86
- "MermaidValidatorTool": (".utilities.mermaid_validator_tool", False),
87
- "WikipediaSearchTool": (".wikipedia_search_tool", False),
88
- "WriteFileTool": (".write_file_tool", False),
89
- }
90
-
91
- # Create lazy loaders for each module path
92
- _lazy_modules: Dict[str, LazyLoader] = {}
93
- for tool, (path, optional) in _TOOL_IMPORTS.items():
94
- full_path = f"{__package__}{path}"
95
- if full_path not in _lazy_modules:
96
- _lazy_modules[full_path] = LazyLoader(full_path, optional)
97
-
98
- # Set up attributes for lazy loading
99
- _tools_to_lazy_modules = {}
100
- for tool, (path, optional) in _TOOL_IMPORTS.items():
101
- full_path = f"{__package__}{path}"
102
- _tools_to_lazy_modules[tool] = _lazy_modules[full_path]
103
-
104
- # Define __all__ so that import * works properly
105
- __all__ = list(_TOOL_IMPORTS.keys())
106
-
107
- # Set up lazy loading for each tool
108
- for tool, lazy_module in _tools_to_lazy_modules.items():
109
- # This will create properties that lazily load the requested tool
110
- setattr(sys.modules[__name__], tool, getattr(lazy_module, tool))
37
+ # Define __all__ to control what gets imported with `from quantalogic.tools import *`
38
+ __all__ = [
39
+ 'AgentTool',
40
+ 'DownloadHttpFileTool',
41
+ 'DuckDuckGoSearchTool',
42
+ 'EditWholeContentTool',
43
+ 'ElixirTool',
44
+ 'ExecuteBashCommandTool',
45
+ 'GrepAppTool',
46
+ 'InputQuestionTool',
47
+ 'JinjaTool',
48
+ 'ListDirectoryTool',
49
+ 'LLMTool',
50
+ 'LLMVisionTool',
51
+ 'MarkitdownTool',
52
+ 'NodeJsTool',
53
+ 'PythonTool',
54
+ 'ReadFileBlockTool',
55
+ 'ReadFileTool',
56
+ 'ReadHTMLTool',
57
+ 'ReplaceInFileTool',
58
+ 'RipgrepTool',
59
+ 'SafePythonInterpreterTool',
60
+ 'SearchDefinitionNames',
61
+ 'SequenceTool',
62
+ 'SerpApiSearchTool',
63
+ 'SQLQueryTool',
64
+ 'TaskCompleteTool',
65
+ 'Tool',
66
+ 'ToolArgument',
67
+ 'UnifiedDiffTool',
68
+ 'WikipediaSearchTool',
69
+ 'WriteFileTool'
70
+ ]
@@ -0,0 +1,18 @@
1
+ """
2
+ Composio Tools Module
3
+
4
+ This module provides tools and utilities from the Composio integration.
5
+ """
6
+
7
+ from loguru import logger
8
+
9
+ # Explicit imports of all tools in the module
10
+ from .composio import ComposioTool
11
+
12
+ # Define __all__ to control what is imported with `from ... import *`
13
+ __all__ = [
14
+ 'ComposioTool',
15
+ ]
16
+
17
+ # Optional: Add logging for import confirmation
18
+ logger.info("Composio tools module initialized successfully.")
@@ -1,32 +1,17 @@
1
1
  """Tool for interacting with Composio API services."""
2
2
 
3
- import importlib
4
- import importlib.util
5
3
  import json
6
4
  import os
7
5
  import traceback
8
6
  from datetime import datetime
9
- from typing import Any, Dict, Optional, Union, TYPE_CHECKING
10
-
11
- # Type checking imports - these are only used for type hints and not at runtime
12
- if TYPE_CHECKING:
13
- from composio import ComposioToolSet
7
+ from typing import Any, Dict, Optional
14
8
 
9
+ from composio import Action, ComposioToolSet
15
10
  from loguru import logger
16
11
  from pydantic import BaseModel, ConfigDict, Field
17
12
 
18
13
  from quantalogic.tools.tool import Tool, ToolArgument
19
14
 
20
- # Flag to check if composio is available
21
- COMPOSIO_AVAILABLE = False
22
-
23
- # Try to check if composio is importable without actually importing it
24
- try:
25
- spec = importlib.util.find_spec("composio")
26
- COMPOSIO_AVAILABLE = spec is not None
27
- except ImportError:
28
- pass
29
-
30
15
 
31
16
  def setup_logger():
32
17
  """Configure Loguru logger with custom format and levels."""
@@ -87,7 +72,7 @@ class ComposioTool(Tool):
87
72
  )
88
73
  action: str = Field(default="") # Single action per tool instance
89
74
  action_schema: Optional[ActionSchema] = None
90
- toolset: Optional['ComposioToolSet'] = None
75
+ toolset: Optional[ComposioToolSet] = None
91
76
 
92
77
  # Performance tracking
93
78
  _last_execution_time: Optional[datetime] = None
@@ -111,20 +96,6 @@ class ComposioTool(Tool):
111
96
  need_validation: Whether this specific instance needs validation
112
97
  **data: Additional data for tool initialization
113
98
  """
114
- # Check if composio is available
115
- if not COMPOSIO_AVAILABLE:
116
- logger.error("ComposioTool cannot be initialized: composio module is not installed")
117
- raise ImportError("The 'composio' package is required to use ComposioTool. "
118
- "Install it with 'pip install composio' or include it in your dependencies.")
119
-
120
- # Import composio only when needed
121
- try:
122
- from composio import Action, ComposioToolSet
123
- except ImportError:
124
- logger.error("Failed to import composio module")
125
- raise ImportError("The 'composio' package is required to use ComposioTool. "
126
- "Install it with 'pip install composio' or include it in your dependencies.")
127
-
128
99
  logger.info(f"Initializing ComposioTool for action: {action}")
129
100
  start_time = datetime.now()
130
101
 
@@ -179,14 +150,6 @@ class ComposioTool(Tool):
179
150
 
180
151
  def _setup_action(self) -> None:
181
152
  """Set up the Composio action with its schema and parameters."""
182
- # Import composio only when needed
183
- try:
184
- from composio import Action, ComposioToolSet
185
- except ImportError:
186
- logger.error("Failed to import composio module")
187
- raise ImportError("The 'composio' package is required to use ComposioTool. "
188
- "Install it with 'pip install composio' or include it in your dependencies.")
189
-
190
153
  logger.debug(f"Setting up action: {self.action}")
191
154
  start_time = datetime.now()
192
155
 
@@ -382,14 +345,6 @@ class ComposioTool(Tool):
382
345
 
383
346
  def execute(self, **kwargs: Any) -> str:
384
347
  """Execute the Composio action with the given parameters."""
385
- # Import composio only when needed
386
- try:
387
- from composio import Action, ComposioToolSet
388
- except ImportError:
389
- logger.error("Failed to import composio module")
390
- raise ImportError("The 'composio' package is required to use ComposioTool. "
391
- "Install it with 'pip install composio' or include it in your dependencies.")
392
-
393
348
  start_time = datetime.now()
394
349
  self._execution_count += 1
395
350
  self._last_execution_time = start_time
@@ -0,0 +1,20 @@
1
+ """
2
+ Database Tools Module
3
+
4
+ This module provides database-related tools and utilities.
5
+ """
6
+
7
+ from loguru import logger
8
+
9
+ # Explicit imports of all tools in the module
10
+ from .generate_database_report_tool import GenerateDatabaseReportTool
11
+ from .sql_query_tool_advanced import SQLQueryToolAdvanced
12
+
13
+ # Define __all__ to control what is imported with `from ... import *`
14
+ __all__ = [
15
+ 'GenerateDatabaseReportTool',
16
+ 'SQLQueryToolAdvanced',
17
+ ]
18
+
19
+ # Optional: Add logging for import confirmation
20
+ logger.info("Database tools module initialized successfully.")
@@ -1,27 +1,13 @@
1
1
  """Tool for executing SQL queries and performing database operations with safety checks."""
2
2
 
3
- import importlib.util
4
3
  import json
5
4
  from enum import Enum
6
- from typing import Any, Dict, List, Optional, TYPE_CHECKING
5
+ from typing import Any, Dict, List, Optional
7
6
 
8
7
  from loguru import logger
9
8
  from pydantic import Field
10
-
11
- # Check if sqlalchemy is available
12
- SQLALCHEMY_AVAILABLE = False
13
- try:
14
- spec = importlib.util.find_spec("sqlalchemy")
15
- SQLALCHEMY_AVAILABLE = spec is not None
16
- if SQLALCHEMY_AVAILABLE:
17
- from sqlalchemy import create_engine, inspect, text
18
- from sqlalchemy.engine import Engine
19
- except ImportError:
20
- pass
21
-
22
- # Type checking imports
23
- if TYPE_CHECKING:
24
- from sqlalchemy.engine import Engine
9
+ from sqlalchemy import create_engine, inspect, text
10
+ from sqlalchemy.engine import Engine
25
11
 
26
12
  from quantalogic.tools.tool import Tool, ToolArgument
27
13
 
@@ -86,9 +72,6 @@ class SQLQueryToolAdvanced(Tool):
86
72
 
87
73
  def __init__(self, **data):
88
74
  super().__init__(**data)
89
- if not SQLALCHEMY_AVAILABLE:
90
- raise ImportError("The 'sqlalchemy' package is required to use SQLQueryToolAdvanced. "
91
- "Install it with 'pip install sqlalchemy' or include it in your dependencies.")
92
75
  self._engine = create_engine(self.connection_string)
93
76
  logger.info(f"Initialized SQL tool with engine for {self.connection_string}")
94
77
 
@@ -217,10 +200,10 @@ class SQLQueryToolAdvanced(Tool):
217
200
  raise ValueError("DROP DATABASE operations are not allowed")
218
201
 
219
202
  inspector = inspect(self._engine)
220
- existing_tables = inspector.get_table_names()
203
+ _existing_tables = inspector.get_table_names()
221
204
 
222
205
  # Additional safety checks could be added here
223
- logger.debug(f"Schema validation passed for operation")
206
+ logger.debug("Schema validation passed for operation")
224
207
 
225
208
  def _convert_row_number(self, value: Any, field_name: str) -> int:
226
209
  """Convert and validate row number input."""
@@ -0,0 +1,30 @@
1
+ """
2
+ Document Tools Module
3
+
4
+ This module provides tools for converting Markdown to various document formats.
5
+ """
6
+
7
+ from loguru import logger
8
+
9
+ # Explicit imports of all tools in the module
10
+ from .markdown_to_docx_tool import MarkdownToDocxTool
11
+ from .markdown_to_epub_tool import MarkdownToEpubTool
12
+ from .markdown_to_html_tool import MarkdownToHtmlTool
13
+ from .markdown_to_ipynb_tool import MarkdownToIpynbTool
14
+ from .markdown_to_latex_tool import MarkdownToLatexTool
15
+ from .markdown_to_pdf_tool import MarkdownToPdfTool
16
+ from .markdown_to_pptx_tool import MarkdownToPptxTool
17
+
18
+ # Define __all__ to control what is imported with `from ... import *`
19
+ __all__ = [
20
+ 'MarkdownToDocxTool',
21
+ 'MarkdownToEpubTool',
22
+ 'MarkdownToHtmlTool',
23
+ 'MarkdownToIpynbTool',
24
+ 'MarkdownToLatexTool',
25
+ 'MarkdownToPdfTool',
26
+ 'MarkdownToPptxTool',
27
+ ]
28
+
29
+ # Optional: Add logging for import confirmation
30
+ logger.info("Document tools module initialized successfully.")
@@ -0,0 +1,32 @@
1
+ """
2
+ Finance Tools Module
3
+
4
+ This module provides finance-related tools and utilities.
5
+ """
6
+
7
+ from loguru import logger
8
+
9
+ # Explicit imports of all tools in the module
10
+ from .alpha_vantage_tool import AlphaVantageTool
11
+ from .ccxt_tool import CcxtTool
12
+ from .finance_llm_tool import FinanceLLMTool
13
+ from .google_finance import GoogleFinanceTool
14
+ from .market_intelligence_tool import MarketIntelligenceTool
15
+ from .technical_analysis_tool import TechnicalAnalysisTool
16
+ from .tradingview_tool import TradingViewTool
17
+ from .yahoo_finance import YahooFinanceTool
18
+
19
+ # Define __all__ to control what is imported with `from ... import *`
20
+ __all__ = [
21
+ 'AlphaVantageTool',
22
+ 'CcxtTool',
23
+ 'FinanceLLMTool',
24
+ 'GoogleFinanceTool',
25
+ 'MarketIntelligenceTool',
26
+ 'TechnicalAnalysisTool',
27
+ 'TradingViewTool',
28
+ 'YahooFinanceTool',
29
+ ]
30
+
31
+ # Optional: Add logging for import confirmation
32
+ logger.info("Finance tools module initialized successfully.")
@@ -0,0 +1,24 @@
1
+ """
2
+ Git Tools Module
3
+
4
+ This module provides tools and utilities related to Git operations.
5
+ """
6
+
7
+ from loguru import logger
8
+
9
+ # Explicit imports of all tools in the module
10
+ from .bitbucket_clone_repo_tool import BitbucketCloneTool
11
+ from .bitbucket_operations_tool import BitbucketOperationsTool
12
+ from .clone_repo_tool import CloneRepoTool
13
+ from .git_operations_tool import GitOperationsTool
14
+
15
+ # Define __all__ to control what is imported with `from ... import *`
16
+ __all__ = [
17
+ 'BitbucketCloneTool',
18
+ 'BitbucketOperationsTool',
19
+ 'CloneRepoTool',
20
+ 'GitOperationsTool',
21
+ ]
22
+
23
+ # Optional: Add logging for import confirmation
24
+ logger.info("Git tools module initialized successfully.")
@@ -0,0 +1,18 @@
1
+ """
2
+ Google Packages Tools Module
3
+
4
+ This module provides tools and utilities related to Google packages.
5
+ """
6
+
7
+ from loguru import logger
8
+
9
+ # Explicit imports of all tools in the module
10
+ from .google_news_tool import GoogleNewsTool
11
+
12
+ # Define __all__ to control what is imported with `from ... import *`
13
+ __all__ = [
14
+ 'GoogleNewsTool',
15
+ ]
16
+
17
+ # Optional: Add logging for import confirmation
18
+ logger.info("Google Packages tools module initialized successfully.")
@@ -0,0 +1,18 @@
1
+ """
2
+ Image Generation Tools Module
3
+
4
+ This module provides tools and utilities for image generation.
5
+ """
6
+
7
+ from loguru import logger
8
+
9
+ # Explicit imports of all tools in the module
10
+ from .dalle_e import LLMImageGenerationTool
11
+
12
+ # Define __all__ to control what is imported with `from ... import *`
13
+ __all__ = [
14
+ 'LLMImageGenerationTool',
15
+ ]
16
+
17
+ # Optional: Add logging for import confirmation
18
+ logger.info("Image Generation tools module initialized successfully.")
@@ -0,0 +1,20 @@
1
+ """
2
+ NASA Packages Tools Module
3
+
4
+ This module provides tools and utilities related to NASA packages.
5
+ """
6
+
7
+ from loguru import logger
8
+
9
+ # Explicit imports of all tools in the module
10
+ from .nasa_apod_tool import NasaApodTool
11
+ from .nasa_neows_tool import NasaNeoWsTool
12
+
13
+ # Define __all__ to control what is imported with `from ... import *`
14
+ __all__ = [
15
+ 'NasaApodTool',
16
+ 'NasaNeoWsTool',
17
+ ]
18
+
19
+ # Optional: Add logging for import confirmation
20
+ logger.info("NASA Packages tools module initialized successfully.")
@@ -0,0 +1,18 @@
1
+ """
2
+ Presentation Tools Module
3
+
4
+ This module provides tools and utilities for creating and managing presentations.
5
+ """
6
+
7
+ from loguru import logger
8
+
9
+ # Explicit imports of all tools in the module
10
+ from .presentation_llm_tool import PresentationLLMTool
11
+
12
+ # Define __all__ to control what is imported with `from ... import *`
13
+ __all__ = [
14
+ 'PresentationLLMTool',
15
+ ]
16
+
17
+ # Optional: Add logging for import confirmation
18
+ logger.info("Presentation tools module initialized successfully.")
@@ -0,0 +1,18 @@
1
+ """
2
+ Product Hunt Tools Module
3
+
4
+ This module provides tools and utilities related to Product Hunt.
5
+ """
6
+
7
+ from loguru import logger
8
+
9
+ # Explicit imports of all tools in the module
10
+ from .product_hunt_tool import ProductHuntTool
11
+
12
+ # Define __all__ to control what is imported with `from ... import *`
13
+ __all__ = [
14
+ 'ProductHuntTool',
15
+ ]
16
+
17
+ # Optional: Add logging for import confirmation
18
+ logger.info("Product Hunt tools module initialized successfully.")
@@ -1,48 +1,24 @@
1
- """RAG Tool and related components."""
2
-
3
- import importlib
4
- import sys
5
- from typing import Any
6
-
7
-
8
- class LazyLoader:
9
- """
10
- Lazily import a module only when its attributes are accessed.
11
- This helps reduce startup time by deferring imports until needed.
12
- """
13
- def __init__(self, module_path: str):
14
- self.module_path = module_path
15
- self._module = None
16
-
17
- def __getattr__(self, name: str) -> Any:
18
- if self._module is None:
19
- self._module = importlib.import_module(self.module_path)
20
- return getattr(self._module, name)
21
-
22
-
23
- # Map of class names to their import paths
24
- _IMPORTS = {
25
- "DocumentMetadata": ".document_metadata",
26
- "QueryResponse": ".query_response",
27
- "RagTool": ".rag_tool"
28
- }
29
-
30
- # Create lazy loaders for each module
31
- _lazy_modules = {}
32
- for cls_name, path in _IMPORTS.items():
33
- full_path = f"{__package__}{path}"
34
- if (full_path not in _lazy_modules):
35
- _lazy_modules[full_path] = LazyLoader(full_path)
36
-
37
- # Map each class to its lazy module
38
- _class_to_lazy_module = {}
39
- for cls_name, path in _IMPORTS.items():
40
- full_path = f"{__package__}{path}"
41
- _class_to_lazy_module[cls_name] = _lazy_modules[full_path]
42
-
43
- # Define __all__ so that import * works properly
44
- __all__ = list(_IMPORTS.keys())
45
-
46
- # Set up lazy loading for each class
47
- for cls_name, lazy_module in _class_to_lazy_module.items():
48
- setattr(sys.modules[__name__], cls_name, getattr(lazy_module, cls_name))
1
+ """
2
+ RAG Tool and related components.
3
+
4
+ This module provides tools and utilities for Retrieval-Augmented Generation (RAG).
5
+ """
6
+
7
+ from loguru import logger
8
+
9
+ # Explicit imports of all tools in the module
10
+ from .document_metadata import DocumentMetadata
11
+ from .query_response import QueryResponse
12
+ from .rag_tool import RagTool
13
+ from .rag_tool_beta import RagToolBeta
14
+
15
+ # Define __all__ to control what is imported with `from ... import *`
16
+ __all__ = [
17
+ 'DocumentMetadata',
18
+ 'QueryResponse',
19
+ 'RagTool',
20
+ 'RagToolBeta',
21
+ ]
22
+
23
+ # Optional: Add logging for import confirmation
24
+ logger.info("RAG tools module initialized successfully.")