iatoolkit 0.68.0__tar.gz → 0.69.0__tar.gz
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.
Potentially problematic release.
This version of iatoolkit might be problematic. Click here for more details.
- {iatoolkit-0.68.0/src/iatoolkit.egg-info → iatoolkit-0.69.0}/PKG-INFO +1 -1
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/pyproject.toml +1 -1
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/__init__.py +0 -4
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/iatoolkit.py +2 -2
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/repositories/database_manager.py +5 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/services/branding_service.py +2 -2
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/services/company_context_service.py +37 -17
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/services/configuration_service.py +2 -2
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/services/dispatcher_service.py +2 -2
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/services/language_service.py +1 -1
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/services/search_service.py +11 -4
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/views/base_login_view.py +1 -1
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/views/help_content_api_view.py +1 -1
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/views/login_view.py +1 -1
- {iatoolkit-0.68.0 → iatoolkit-0.69.0/src/iatoolkit.egg-info}/PKG-INFO +1 -1
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/LICENSE +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/readme.md +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/requirements.txt +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/setup.cfg +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/base_company.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/cli_commands.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/common/__init__.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/common/exceptions.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/common/routes.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/common/session_manager.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/common/util.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/company_registry.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/infra/__init__.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/infra/call_service.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/infra/connectors/__init__.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/infra/connectors/file_connector.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/infra/connectors/file_connector_factory.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/infra/connectors/google_cloud_storage_connector.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/infra/connectors/google_drive_connector.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/infra/connectors/local_file_connector.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/infra/connectors/s3_connector.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/infra/gemini_adapter.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/infra/google_chat_app.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/infra/llm_client.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/infra/llm_proxy.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/infra/llm_response.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/infra/mail_app.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/infra/openai_adapter.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/infra/redis_session_manager.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/locales/en.yaml +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/locales/es.yaml +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/repositories/__init__.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/repositories/document_repo.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/repositories/llm_query_repo.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/repositories/models.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/repositories/profile_repo.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/repositories/tasks_repo.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/repositories/vs_repo.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/services/__init__.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/services/auth_service.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/services/benchmark_service.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/services/document_service.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/services/excel_service.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/services/file_processor_service.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/services/history_service.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/services/i18n_service.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/services/jwt_service.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/services/load_documents_service.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/services/mail_service.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/services/profile_service.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/services/prompt_manager_service.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/services/query_service.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/services/sql_service.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/services/tasks_service.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/services/user_feedback_service.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/services/user_session_context_service.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/static/images/fernando.jpeg +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/static/js/chat_feedback_button.js +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/static/js/chat_filepond.js +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/static/js/chat_help_content.js +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/static/js/chat_history_button.js +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/static/js/chat_logout_button.js +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/static/js/chat_main.js +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/static/js/chat_onboarding_button.js +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/static/js/chat_prompt_manager.js +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/static/js/chat_reload_button.js +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/static/styles/chat_iatoolkit.css +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/static/styles/chat_modal.css +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/static/styles/chat_public.css +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/static/styles/landing_page.css +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/static/styles/llm_output.css +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/static/styles/onboarding.css +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/system_prompts/format_styles.prompt +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/system_prompts/query_main.prompt +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/system_prompts/sql_rules.prompt +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/templates/_company_header.html +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/templates/_login_widget.html +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/templates/about.html +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/templates/base.html +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/templates/change_password.html +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/templates/chat.html +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/templates/chat_modals.html +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/templates/error.html +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/templates/forgot_password.html +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/templates/index.html +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/templates/login_simulation.html +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/templates/onboarding_shell.html +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/templates/signup.html +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/views/__init__.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/views/change_password_view.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/views/external_login_view.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/views/file_store_api_view.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/views/forgot_password_view.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/views/history_api_view.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/views/home_view.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/views/index_view.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/views/init_context_api_view.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/views/llmquery_api_view.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/views/login_simulation_view.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/views/logout_api_view.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/views/profile_api_view.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/views/prompt_api_view.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/views/signup_view.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/views/tasks_api_view.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/views/tasks_review_api_view.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/views/user_feedback_api_view.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/views/verify_user_view.py +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit.egg-info/SOURCES.txt +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit.egg-info/dependency_links.txt +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit.egg-info/requires.txt +0 -0
- {iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit.egg-info/top_level.txt +0 -0
|
@@ -10,10 +10,8 @@ from .iatoolkit import IAToolkit, current_iatoolkit, create_app
|
|
|
10
10
|
# for registering the client companies
|
|
11
11
|
from .company_registry import register_company
|
|
12
12
|
from .base_company import BaseCompany
|
|
13
|
-
from iatoolkit.repositories.database_manager import DatabaseManager
|
|
14
13
|
|
|
15
14
|
# --- Services ---
|
|
16
|
-
from iatoolkit.services.configuration_service import ConfigurationService
|
|
17
15
|
from iatoolkit.services.query_service import QueryService
|
|
18
16
|
from iatoolkit.services.sql_service import SqlService
|
|
19
17
|
from iatoolkit.services.document_service import DocumentService
|
|
@@ -28,9 +26,7 @@ __all__ = [
|
|
|
28
26
|
'current_iatoolkit',
|
|
29
27
|
'register_company',
|
|
30
28
|
'BaseCompany',
|
|
31
|
-
'DatabaseManager',
|
|
32
29
|
'QueryService',
|
|
33
|
-
'ConfigurationService',
|
|
34
30
|
'SqlService',
|
|
35
31
|
'ExcelService',
|
|
36
32
|
'DocumentService',
|
|
@@ -19,7 +19,7 @@ from werkzeug.middleware.proxy_fix import ProxyFix
|
|
|
19
19
|
from injector import Binder, Injector, singleton
|
|
20
20
|
from importlib.metadata import version as _pkg_version, PackageNotFoundError
|
|
21
21
|
|
|
22
|
-
IATOOLKIT_VERSION = "0.
|
|
22
|
+
IATOOLKIT_VERSION = "0.69.0"
|
|
23
23
|
|
|
24
24
|
# global variable for the unique instance of IAToolkit
|
|
25
25
|
_iatoolkit_instance: Optional['IAToolkit'] = None
|
|
@@ -360,7 +360,7 @@ class IAToolkit:
|
|
|
360
360
|
# instantiate all the registered companies
|
|
361
361
|
get_company_registry().instantiate_companies(self._injector)
|
|
362
362
|
|
|
363
|
-
# use the dispatcher to load the company config and prepare the execution
|
|
363
|
+
# use the dispatcher to load the company config.yaml file and prepare the execution
|
|
364
364
|
dispatcher = self._injector.get(Dispatcher)
|
|
365
365
|
dispatcher.load_company_configs()
|
|
366
366
|
|
|
@@ -70,6 +70,11 @@ class DatabaseManager:
|
|
|
70
70
|
def remove_session(self):
|
|
71
71
|
self.scoped_session.remove()
|
|
72
72
|
|
|
73
|
+
def get_all_table_names(self) -> list[str]:
|
|
74
|
+
# Returns a list of all table names in the database
|
|
75
|
+
inspector = inspect(self._engine)
|
|
76
|
+
return inspector.get_table_names()
|
|
77
|
+
|
|
73
78
|
def get_table_schema(self,
|
|
74
79
|
table_name: str,
|
|
75
80
|
schema_name: str | None = None,
|
|
@@ -75,7 +75,7 @@ class BrandingService:
|
|
|
75
75
|
fusionando los valores por defecto con los personalizados.
|
|
76
76
|
"""
|
|
77
77
|
final_branding_values = self._default_branding.copy()
|
|
78
|
-
branding_data = self.config_service.
|
|
78
|
+
branding_data = self.config_service.get_configuration(company_short_name, 'branding')
|
|
79
79
|
final_branding_values.update(branding_data)
|
|
80
80
|
|
|
81
81
|
|
|
@@ -140,7 +140,7 @@ class BrandingService:
|
|
|
140
140
|
"""
|
|
141
141
|
|
|
142
142
|
# get the company name from configuration for the branding render
|
|
143
|
-
company_name = self.config_service.
|
|
143
|
+
company_name = self.config_service.get_configuration(company_short_name, 'name')
|
|
144
144
|
|
|
145
145
|
return {
|
|
146
146
|
"name": company_name,
|
|
@@ -79,23 +79,22 @@ class CompanyContextService:
|
|
|
79
79
|
return static_context
|
|
80
80
|
|
|
81
81
|
def _get_sql_schema_context(self, company_short_name: str) -> str:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
"""
|
|
83
|
+
Generates the SQL schema context by inspecting live database connections
|
|
84
|
+
based on the flexible company.yaml configuration.
|
|
85
|
+
It supports including all tables and providing specific overrides for a subset of them.
|
|
86
|
+
"""
|
|
87
|
+
data_sources_config = self.config_service.get_configuration(company_short_name, 'data_sources')
|
|
85
88
|
if not data_sources_config or not data_sources_config.get('sql'):
|
|
86
|
-
return ''
|
|
89
|
+
return ''
|
|
87
90
|
|
|
88
91
|
sql_context = ''
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
# iterate over all SQL sources defined in the YAML configuration
|
|
92
|
-
for source in sql_sources:
|
|
92
|
+
for source in data_sources_config.get('sql', []):
|
|
93
93
|
db_name = source.get('database')
|
|
94
94
|
if not db_name:
|
|
95
95
|
continue
|
|
96
96
|
|
|
97
97
|
try:
|
|
98
|
-
# get a handle to the DB manager
|
|
99
98
|
db_manager = self.sql_service.get_database_manager(db_name)
|
|
100
99
|
except IAToolkitException as e:
|
|
101
100
|
logging.warning(f"Could not get DB manager for '{db_name}': {e}")
|
|
@@ -104,22 +103,43 @@ class CompanyContextService:
|
|
|
104
103
|
db_description = source.get('description', '')
|
|
105
104
|
sql_context += f"{db_description}\n" if db_description else ""
|
|
106
105
|
|
|
107
|
-
#
|
|
108
|
-
|
|
106
|
+
# 1. get the list of tables to process.
|
|
107
|
+
tables_to_process = []
|
|
108
|
+
if source.get('include_all_tables', False):
|
|
109
|
+
all_tables = db_manager.get_all_table_names()
|
|
110
|
+
tables_to_exclude = set(source.get('exclude_tables', []))
|
|
111
|
+
tables_to_process = [t for t in all_tables if t not in tables_to_exclude]
|
|
112
|
+
elif 'tables' in source:
|
|
113
|
+
# if not include_all_tables, use the list of tables explicitly specified in the map.
|
|
114
|
+
tables_to_process = list(source['tables'].keys())
|
|
115
|
+
|
|
116
|
+
# 2. get the global list of columns to exclude.
|
|
117
|
+
global_exclude_columns = source.get('exclude_columns', [])
|
|
118
|
+
|
|
119
|
+
# 3. get the overrides for specific tables.
|
|
120
|
+
table_overrides = source.get('tables', {})
|
|
121
|
+
|
|
122
|
+
# 3. iterate over the tables.
|
|
123
|
+
for table_name in tables_to_process:
|
|
109
124
|
try:
|
|
110
|
-
|
|
125
|
+
# 4. get the table specific configuration.
|
|
126
|
+
table_config = table_overrides.get(table_name, {})
|
|
127
|
+
|
|
128
|
+
# 5. define the schema name, using the override if it exists.
|
|
129
|
+
schema_name = table_config.get('schema_name', table_name)
|
|
111
130
|
|
|
112
|
-
#
|
|
113
|
-
|
|
131
|
+
# 6. define the list of columns to exclude, (local vs. global).
|
|
132
|
+
local_exclude_columns = table_config.get('exclude_columns')
|
|
133
|
+
final_exclude_columns = local_exclude_columns if local_exclude_columns is not None else global_exclude_columns
|
|
114
134
|
|
|
115
|
-
# get the schema definition
|
|
135
|
+
# 7. get the table schema definition.
|
|
116
136
|
table_definition = db_manager.get_table_schema(
|
|
117
137
|
table_name=table_name,
|
|
118
138
|
schema_name=schema_name,
|
|
119
|
-
exclude_columns=
|
|
139
|
+
exclude_columns=final_exclude_columns
|
|
120
140
|
)
|
|
121
141
|
sql_context += table_definition
|
|
122
142
|
except (KeyError, RuntimeError) as e:
|
|
123
|
-
logging.warning(f"Could not generate schema for table '{
|
|
143
|
+
logging.warning(f"Could not generate schema for table '{table_name}': {e}")
|
|
124
144
|
|
|
125
145
|
return sql_context
|
|
@@ -20,7 +20,7 @@ class ConfigurationService:
|
|
|
20
20
|
self.utility = utility
|
|
21
21
|
self._loaded_configs = {} # cache for store loaded configurations
|
|
22
22
|
|
|
23
|
-
def
|
|
23
|
+
def get_configuration(self, company_short_name: str, content_key: str):
|
|
24
24
|
"""
|
|
25
25
|
Public method to provide a specific section of a company's configuration.
|
|
26
26
|
It uses a cache to avoid reading files from disk on every call.
|
|
@@ -28,7 +28,7 @@ class ConfigurationService:
|
|
|
28
28
|
self._ensure_config_loaded(company_short_name)
|
|
29
29
|
return self._loaded_configs[company_short_name].get(content_key)
|
|
30
30
|
|
|
31
|
-
def
|
|
31
|
+
def load_configuration(self, company_short_name: str, company_instance):
|
|
32
32
|
"""
|
|
33
33
|
Main entry point for configuring a company instance.
|
|
34
34
|
This method is invoked by the dispatcher for each registered company.
|
|
@@ -68,7 +68,7 @@ class Dispatcher:
|
|
|
68
68
|
for company_name, company_instance in self.company_instances.items():
|
|
69
69
|
try:
|
|
70
70
|
# read company configuration from company.yaml
|
|
71
|
-
self.config_service.
|
|
71
|
+
self.config_service.load_configuration(company_name, company_instance)
|
|
72
72
|
|
|
73
73
|
# register the company databases
|
|
74
74
|
self._register_company_databases(company_name)
|
|
@@ -85,7 +85,7 @@ class Dispatcher:
|
|
|
85
85
|
database with the central SqlService.
|
|
86
86
|
"""
|
|
87
87
|
logging.info(f" -> Registering databases for '{company_name}'...")
|
|
88
|
-
data_sources_config = self.config_service.
|
|
88
|
+
data_sources_config = self.config_service.get_configuration(company_name, 'data_sources')
|
|
89
89
|
|
|
90
90
|
if not data_sources_config or not data_sources_config.get('sql'):
|
|
91
91
|
logging.info(f" -> No SQL data sources to register for '{company_name}'.")
|
|
@@ -68,7 +68,7 @@ class LanguageService:
|
|
|
68
68
|
# Priority 2: Company's default language
|
|
69
69
|
company_short_name = self._get_company_short_name()
|
|
70
70
|
if company_short_name:
|
|
71
|
-
locale = self.config_service.
|
|
71
|
+
locale = self.config_service.get_configuration(company_short_name, 'locale')
|
|
72
72
|
if locale:
|
|
73
73
|
company_language = locale.split('_')[0]
|
|
74
74
|
g.lang = company_language
|
|
@@ -5,19 +5,22 @@
|
|
|
5
5
|
|
|
6
6
|
from iatoolkit.repositories.vs_repo import VSRepo
|
|
7
7
|
from iatoolkit.repositories.document_repo import DocumentRepo
|
|
8
|
+
from iatoolkit.repositories.profile_repo import ProfileRepo
|
|
9
|
+
from iatoolkit.repositories.models import Company
|
|
8
10
|
from injector import inject
|
|
9
11
|
|
|
10
12
|
|
|
11
13
|
class SearchService:
|
|
12
14
|
@inject
|
|
13
15
|
def __init__(self,
|
|
16
|
+
profile_repo: ProfileRepo,
|
|
14
17
|
doc_repo: DocumentRepo,
|
|
15
18
|
vs_repo: VSRepo):
|
|
16
|
-
|
|
19
|
+
self.profile_repo = profile_repo
|
|
17
20
|
self.vs_repo = vs_repo
|
|
18
21
|
self.doc_repo = doc_repo
|
|
19
22
|
|
|
20
|
-
def search(self,
|
|
23
|
+
def search(self, company_short_name: str, query: str, metadata_filter: dict = None) -> str:
|
|
21
24
|
"""
|
|
22
25
|
Performs a semantic search for a given query within a company's documents.
|
|
23
26
|
|
|
@@ -26,7 +29,7 @@ class SearchService:
|
|
|
26
29
|
content of the retrieved documents, which can be used as context for an LLM.
|
|
27
30
|
|
|
28
31
|
Args:
|
|
29
|
-
|
|
32
|
+
company_short_name: The company to search within.
|
|
30
33
|
query: The text query to search for.
|
|
31
34
|
metadata_filter: An optional dictionary to filter documents by their metadata.
|
|
32
35
|
|
|
@@ -34,7 +37,11 @@ class SearchService:
|
|
|
34
37
|
A string containing the concatenated content of the found documents,
|
|
35
38
|
formatted to be used as a context.
|
|
36
39
|
"""
|
|
37
|
-
|
|
40
|
+
company = self.profile_repo.get_company_by_short_name(company_short_name)
|
|
41
|
+
if not company:
|
|
42
|
+
return f"error: company {company_short_name} not found"
|
|
43
|
+
|
|
44
|
+
document_list = self.vs_repo.query(company_id=company.id,
|
|
38
45
|
query_text=query,
|
|
39
46
|
metadata_filter=metadata_filter)
|
|
40
47
|
|
|
@@ -57,7 +57,7 @@ class BaseLoginView(MethodView):
|
|
|
57
57
|
"""
|
|
58
58
|
# --- Get the company branding and onboarding_cards
|
|
59
59
|
branding_data = self.branding_service.get_company_branding(company_short_name)
|
|
60
|
-
onboarding_cards = self.config_service.
|
|
60
|
+
onboarding_cards = self.config_service.get_configuration(company_short_name, 'onboarding_cards')
|
|
61
61
|
|
|
62
62
|
# this service decides is the context needs to be rebuilt or not
|
|
63
63
|
prep_result = self.query_service.prepare_context(
|
|
@@ -37,7 +37,7 @@ class HelpContentApiView(MethodView):
|
|
|
37
37
|
user_identifier = auth_result.get('user_identifier')
|
|
38
38
|
|
|
39
39
|
# 2. Call the config service with the unified identifier.
|
|
40
|
-
response = self.config_service.
|
|
40
|
+
response = self.config_service.get_configuration(
|
|
41
41
|
company_short_name=company_short_name,
|
|
42
42
|
content_key='help_content' # specific key for this service
|
|
43
43
|
)
|
|
@@ -129,7 +129,7 @@ class FinalizeContextView(MethodView):
|
|
|
129
129
|
|
|
130
130
|
# 3. render the chat page.
|
|
131
131
|
prompts = self.prompt_service.get_user_prompts(company_short_name)
|
|
132
|
-
onboarding_cards = self.config_service.
|
|
132
|
+
onboarding_cards = self.config_service.get_configuration(company_short_name, 'onboarding_cards')
|
|
133
133
|
|
|
134
134
|
# Get the entire 'js_messages' block in the correct language.
|
|
135
135
|
js_translations = self.i18n_service.get_translation_block('js_messages')
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/infra/connectors/file_connector_factory.py
RENAMED
|
File without changes
|
|
File without changes
|
{iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/infra/connectors/google_drive_connector.py
RENAMED
|
File without changes
|
{iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/infra/connectors/local_file_connector.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{iatoolkit-0.68.0 → iatoolkit-0.69.0}/src/iatoolkit/services/user_session_context_service.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|