iatoolkit 0.71.4__py3-none-any.whl → 0.91.1__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.
Files changed (86) hide show
  1. iatoolkit/__init__.py +15 -5
  2. iatoolkit/base_company.py +4 -58
  3. iatoolkit/cli_commands.py +6 -7
  4. iatoolkit/common/exceptions.py +1 -0
  5. iatoolkit/common/routes.py +12 -28
  6. iatoolkit/common/util.py +7 -1
  7. iatoolkit/company_registry.py +50 -14
  8. iatoolkit/{iatoolkit.py → core.py} +54 -55
  9. iatoolkit/infra/{mail_app.py → brevo_mail_app.py} +15 -37
  10. iatoolkit/infra/llm_client.py +9 -5
  11. iatoolkit/locales/en.yaml +10 -2
  12. iatoolkit/locales/es.yaml +171 -162
  13. iatoolkit/repositories/database_manager.py +59 -14
  14. iatoolkit/repositories/llm_query_repo.py +34 -22
  15. iatoolkit/repositories/models.py +16 -18
  16. iatoolkit/repositories/profile_repo.py +5 -10
  17. iatoolkit/repositories/vs_repo.py +9 -4
  18. iatoolkit/services/auth_service.py +1 -1
  19. iatoolkit/services/branding_service.py +1 -1
  20. iatoolkit/services/company_context_service.py +19 -11
  21. iatoolkit/services/configuration_service.py +219 -46
  22. iatoolkit/services/dispatcher_service.py +31 -225
  23. iatoolkit/services/document_service.py +10 -1
  24. iatoolkit/services/embedding_service.py +9 -6
  25. iatoolkit/services/excel_service.py +50 -2
  26. iatoolkit/services/history_manager_service.py +189 -0
  27. iatoolkit/services/jwt_service.py +1 -1
  28. iatoolkit/services/language_service.py +8 -2
  29. iatoolkit/services/license_service.py +82 -0
  30. iatoolkit/services/mail_service.py +171 -25
  31. iatoolkit/services/profile_service.py +37 -32
  32. iatoolkit/services/{prompt_manager_service.py → prompt_service.py} +110 -1
  33. iatoolkit/services/query_service.py +192 -191
  34. iatoolkit/services/sql_service.py +63 -12
  35. iatoolkit/services/tool_service.py +231 -0
  36. iatoolkit/services/user_feedback_service.py +18 -6
  37. iatoolkit/services/user_session_context_service.py +18 -0
  38. iatoolkit/static/images/iatoolkit_core.png +0 -0
  39. iatoolkit/static/images/iatoolkit_logo.png +0 -0
  40. iatoolkit/static/js/chat_feedback_button.js +1 -1
  41. iatoolkit/static/js/chat_help_content.js +4 -4
  42. iatoolkit/static/js/chat_main.js +17 -5
  43. iatoolkit/static/js/chat_onboarding_button.js +1 -1
  44. iatoolkit/static/styles/chat_iatoolkit.css +1 -1
  45. iatoolkit/static/styles/chat_public.css +28 -0
  46. iatoolkit/static/styles/documents.css +598 -0
  47. iatoolkit/static/styles/landing_page.css +223 -7
  48. iatoolkit/system_prompts/__init__.py +0 -0
  49. iatoolkit/system_prompts/query_main.prompt +2 -1
  50. iatoolkit/system_prompts/sql_rules.prompt +47 -12
  51. iatoolkit/templates/_company_header.html +30 -5
  52. iatoolkit/templates/_login_widget.html +3 -3
  53. iatoolkit/templates/chat.html +1 -1
  54. iatoolkit/templates/forgot_password.html +3 -2
  55. iatoolkit/templates/onboarding_shell.html +1 -1
  56. iatoolkit/templates/signup.html +3 -0
  57. iatoolkit/views/base_login_view.py +1 -1
  58. iatoolkit/views/change_password_view.py +1 -1
  59. iatoolkit/views/forgot_password_view.py +9 -4
  60. iatoolkit/views/history_api_view.py +3 -3
  61. iatoolkit/views/home_view.py +4 -2
  62. iatoolkit/views/init_context_api_view.py +1 -1
  63. iatoolkit/views/llmquery_api_view.py +4 -3
  64. iatoolkit/views/{file_store_api_view.py → load_document_api_view.py} +1 -1
  65. iatoolkit/views/login_view.py +17 -5
  66. iatoolkit/views/logout_api_view.py +10 -2
  67. iatoolkit/views/prompt_api_view.py +1 -1
  68. iatoolkit/views/root_redirect_view.py +22 -0
  69. iatoolkit/views/signup_view.py +12 -4
  70. iatoolkit/views/static_page_view.py +27 -0
  71. iatoolkit/views/verify_user_view.py +1 -1
  72. iatoolkit-0.91.1.dist-info/METADATA +268 -0
  73. iatoolkit-0.91.1.dist-info/RECORD +125 -0
  74. iatoolkit-0.91.1.dist-info/licenses/LICENSE_COMMUNITY.md +15 -0
  75. iatoolkit/services/history_service.py +0 -37
  76. iatoolkit/templates/about.html +0 -13
  77. iatoolkit/templates/index.html +0 -145
  78. iatoolkit/templates/login_simulation.html +0 -45
  79. iatoolkit/views/external_login_view.py +0 -73
  80. iatoolkit/views/index_view.py +0 -14
  81. iatoolkit/views/login_simulation_view.py +0 -93
  82. iatoolkit-0.71.4.dist-info/METADATA +0 -276
  83. iatoolkit-0.71.4.dist-info/RECORD +0 -122
  84. {iatoolkit-0.71.4.dist-info → iatoolkit-0.91.1.dist-info}/WHEEL +0 -0
  85. {iatoolkit-0.71.4.dist-info → iatoolkit-0.91.1.dist-info}/licenses/LICENSE +0 -0
  86. {iatoolkit-0.71.4.dist-info → iatoolkit-0.91.1.dist-info}/top_level.txt +0 -0
@@ -10,7 +10,7 @@ from injector import inject
10
10
  from iatoolkit.services.profile_service import ProfileService
11
11
  from iatoolkit.services.jwt_service import JWTService
12
12
  from iatoolkit.services.query_service import QueryService
13
- from iatoolkit.services.prompt_manager_service import PromptService
13
+ from iatoolkit.services.prompt_service import PromptService
14
14
  from iatoolkit.services.branding_service import BrandingService
15
15
  from iatoolkit.services.configuration_service import ConfigurationService
16
16
  from iatoolkit.services.i18n_service import I18nService
@@ -32,6 +32,7 @@ class LoginView(BaseLoginView):
32
32
  branding_data = self.branding_service.get_company_branding(company_short_name)
33
33
  email = request.form.get('email')
34
34
  password = request.form.get('password')
35
+ current_lang = request.form.get('lang') or request.args.get('lang') or 'en'
35
36
 
36
37
  # 1. Authenticate internal user
37
38
  auth_response = self.auth_service.login_local_user(
@@ -42,7 +43,14 @@ class LoginView(BaseLoginView):
42
43
 
43
44
  if not auth_response['success']:
44
45
  flash(auth_response["message"], 'error')
45
- home_template = self.utility.get_company_template(company_short_name, "home.html")
46
+
47
+ # Resolve the correct template name based on language (e.g., home_en.html or home_es.html)
48
+ template_name = self.utility.get_template_by_language("home")
49
+ home_template = self.utility.get_company_template(company_short_name, template_name)
50
+
51
+ if not home_template:
52
+ return render_template('error.html',
53
+ message=f'Home template ({template_name}) not found.'), 500
46
54
 
47
55
  return render_template_string(
48
56
  home_template,
@@ -57,7 +65,8 @@ class LoginView(BaseLoginView):
57
65
  # 3. define URL to call when slow path is finished
58
66
  target_url = url_for('finalize_no_token',
59
67
  company_short_name=company_short_name,
60
- _external=True)
68
+ _external=True,
69
+ lang=current_lang)
61
70
 
62
71
  # 2. Delegate the path decision to the centralized logic.
63
72
  try:
@@ -97,6 +106,9 @@ class FinalizeContextView(MethodView):
97
106
 
98
107
  def get(self, company_short_name: str, token: str = None):
99
108
  try:
109
+ # get the languaje from the query string if it exists
110
+ current_lang = request.args.get('lang') or 'en'
111
+
100
112
  session_info = self.profile_service.get_current_session_info()
101
113
  if session_info:
102
114
  # session exists, internal user
@@ -107,12 +119,12 @@ class FinalizeContextView(MethodView):
107
119
  payload = self.jwt_service.validate_chat_jwt(token)
108
120
  if not payload:
109
121
  logging.warning("Fallo crítico: No se pudo leer el auth token.")
110
- return redirect(url_for('home', company_short_name=company_short_name))
122
+ return redirect(url_for('home', company_short_name=company_short_name, lang=current_lang))
111
123
 
112
124
  user_identifier = payload.get('user_identifier')
113
125
  else:
114
126
  logging.error("missing session information or auth token")
115
- return redirect(url_for('home', company_short_name=company_short_name))
127
+ return redirect(url_for('home', company_short_name=company_short_name, lang=current_lang))
116
128
 
117
129
  company = self.profile_service.get_company_by_short_name(company_short_name)
118
130
  if not company:
@@ -4,7 +4,7 @@
4
4
  # IAToolkit is open source software.
5
5
 
6
6
  from flask.views import MethodView
7
- from flask import redirect, url_for, jsonify
7
+ from flask import redirect, url_for, jsonify, request, g
8
8
  from injector import inject
9
9
  from iatoolkit.services.auth_service import AuthService
10
10
  from iatoolkit.services.profile_service import ProfileService
@@ -33,7 +33,15 @@ class LogoutApiView(MethodView):
33
33
  # get URL for redirection
34
34
  url_for_redirect = company.parameters.get('external_urls', {}).get('logout_url')
35
35
  if not url_for_redirect:
36
- url_for_redirect = url_for('home', company_short_name=company_short_name)
36
+ current_lang = (
37
+ request.args.get('lang')
38
+ or getattr(g, 'lang', None)
39
+ or 'en'
40
+ )
41
+
42
+ url_for_redirect = url_for('home',
43
+ company_short_name=company_short_name,
44
+ lang=current_lang)
37
45
 
38
46
  # clear de session cookie
39
47
  SessionManager.clear()
@@ -5,7 +5,7 @@
5
5
 
6
6
  from flask import jsonify
7
7
  from flask.views import MethodView
8
- from iatoolkit.services.prompt_manager_service import PromptService
8
+ from iatoolkit.services.prompt_service import PromptService
9
9
  from iatoolkit.services.auth_service import AuthService
10
10
  from injector import inject
11
11
  import logging
@@ -0,0 +1,22 @@
1
+ from flask import redirect, url_for
2
+ from flask.views import MethodView
3
+ from iatoolkit.company_registry import get_company_registry
4
+
5
+
6
+ class RootRedirectView(MethodView):
7
+ """
8
+ Vista que redirige la raíz '/' al home de la primera compañía disponible.
9
+ """
10
+
11
+ def get(self):
12
+ registry = get_company_registry()
13
+ companies = registry.get_all_company_instances()
14
+
15
+ if companies:
16
+ # Obtener el short_name de la primera compañía registrada.
17
+ # En Python 3.7+, los diccionarios mantienen el orden de inserción.
18
+ first_company_short_name = next(iter(companies))
19
+ return redirect(url_for('home', company_short_name=first_company_short_name))
20
+
21
+ # Fallback: Si no hay compañías, ir al index genérico (o a un 404)
22
+ return redirect(url_for('index'))
@@ -22,7 +22,7 @@ class SignupView(MethodView):
22
22
  self.branding_service = branding_service # 3. Guardar la instancia
23
23
  self.i18n_service = i18n_service
24
24
 
25
- self.serializer = URLSafeTimedSerializer(os.getenv("USER_VERIF_KEY"))
25
+ self.serializer = URLSafeTimedSerializer(os.getenv("IATOOLKIT_SECRET_KEY"))
26
26
 
27
27
 
28
28
  def get(self, company_short_name: str):
@@ -33,9 +33,12 @@ class SignupView(MethodView):
33
33
  message=self.i18n_service.t('errors.templates.company_not_found')), 404
34
34
 
35
35
  branding_data = self.branding_service.get_company_branding(company_short_name)
36
+ current_lang = request.args.get("lang") or "en"
37
+
36
38
  return render_template('signup.html',
37
39
  company_short_name=company_short_name,
38
- branding=branding_data)
40
+ branding=branding_data,
41
+ lang=current_lang)
39
42
 
40
43
  def post(self, company_short_name: str):
41
44
  try:
@@ -52,6 +55,9 @@ class SignupView(MethodView):
52
55
  password = request.form.get('password')
53
56
  confirm_password = request.form.get('confirm_password')
54
57
 
58
+ # get the language from the form, then query
59
+ current_lang = request.form.get("lang") or request.args.get("lang")
60
+
55
61
  # create verification token and url for verification
56
62
  token = self.serializer.dumps(email, salt='email-confirm')
57
63
  verification_url = url_for('verify_account',
@@ -71,6 +77,7 @@ class SignupView(MethodView):
71
77
  'signup.html',
72
78
  company_short_name=company_short_name,
73
79
  branding=branding_data,
80
+ lang=current_lang,
74
81
  form_data={
75
82
  "first_name": first_name,
76
83
  "last_name": last_name,
@@ -80,7 +87,7 @@ class SignupView(MethodView):
80
87
  }), 400
81
88
 
82
89
  flash(response["message"], 'success')
83
- return redirect(url_for('home', company_short_name=company_short_name))
90
+ return redirect(url_for('home', company_short_name=company_short_name, lang=current_lang))
84
91
 
85
92
  except Exception as e:
86
93
  message = self.i18n_service.t('errors.templates.processing_error', error=str(e))
@@ -88,5 +95,6 @@ class SignupView(MethodView):
88
95
  "error.html",
89
96
  company_short_name=company_short_name,
90
97
  branding=branding_data,
91
- message=message
98
+ message=message,
99
+ lang=current_lang
92
100
  ), 500
@@ -0,0 +1,27 @@
1
+ from flask import render_template
2
+ from flask.views import MethodView
3
+ from injector import inject
4
+
5
+
6
+ class StaticPageView(MethodView):
7
+ """
8
+ View genérica para servir páginas estáticas simples (sin lógica de negocio compleja).
9
+ """
10
+
11
+ @inject
12
+ def __init__(self):
13
+ pass
14
+
15
+ def get(self, page_name: str):
16
+ # Mapeo seguro de nombres de página a plantillas
17
+ # Esto evita que se intente cargar cualquier archivo arbitrario
18
+ valid_pages = {
19
+ 'foundation': 'docs/foundation.html',
20
+ 'mini_project': 'docs/mini_project.html'
21
+ }
22
+
23
+ if page_name not in valid_pages:
24
+ # Si la página no existe, podríamos retornar un 404 o redirigir al index
25
+ return render_template('error.html', message=f"Página no encontrada: {page_name}"), 404
26
+
27
+ return render_template(valid_pages[page_name])
@@ -22,7 +22,7 @@ class VerifyAccountView(MethodView):
22
22
  self.profile_service = profile_service
23
23
  self.branding_service = branding_service
24
24
  self.i18n_service = i18n_service
25
- self.serializer = URLSafeTimedSerializer(os.getenv("USER_VERIF_KEY"))
25
+ self.serializer = URLSafeTimedSerializer(os.getenv("IATOOLKIT_SECRET_KEY"))
26
26
 
27
27
  def get(self, company_short_name: str, token: str):
28
28
  try:
@@ -0,0 +1,268 @@
1
+ Metadata-Version: 2.4
2
+ Name: iatoolkit
3
+ Version: 0.91.1
4
+ Summary: IAToolkit
5
+ Author: Fernando Libedinsky
6
+ License-Expression: MIT
7
+ Requires-Python: >=3.12
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ License-File: LICENSE_COMMUNITY.md
11
+ Requires-Dist: bcrypt==4.2.1
12
+ Requires-Dist: boto3==1.36.22
13
+ Requires-Dist: botocore==1.36.22
14
+ Requires-Dist: build==1.2.2.post1
15
+ Requires-Dist: click==8.1.8
16
+ Requires-Dist: cryptography==44.0.3
17
+ Requires-Dist: Flask==3.1.0
18
+ Requires-Dist: Flask-Bcrypt==1.0.1
19
+ Requires-Dist: flask-cors==6.0.0
20
+ Requires-Dist: Flask-Injector==0.15.0
21
+ Requires-Dist: Flask-Session==0.8.0
22
+ Requires-Dist: flatbuffers==24.3.25
23
+ Requires-Dist: google-ai-generativelanguage==0.6.15
24
+ Requires-Dist: google-api-core==2.24.1
25
+ Requires-Dist: google-api-python-client==2.161.0
26
+ Requires-Dist: google-auth==2.37.0
27
+ Requires-Dist: google-auth-httplib2==0.2.0
28
+ Requires-Dist: google-auth-oauthlib==1.2.1
29
+ Requires-Dist: google-cloud-core==2.4.1
30
+ Requires-Dist: google-cloud-storage==3.0.0
31
+ Requires-Dist: google-crc32c==1.6.0
32
+ Requires-Dist: google-generativeai==0.8.5
33
+ Requires-Dist: google-resumable-media==2.7.2
34
+ Requires-Dist: googleapis-common-protos==1.66.0
35
+ Requires-Dist: gunicorn==23.0.0
36
+ Requires-Dist: h11==0.14.0
37
+ Requires-Dist: httpcore==1.0.7
38
+ Requires-Dist: httplib2==0.22.0
39
+ Requires-Dist: httptools==0.6.4
40
+ Requires-Dist: httpx==0.28.0
41
+ Requires-Dist: httpx-sse==0.4.0
42
+ Requires-Dist: huggingface-hub==0.31.4
43
+ Requires-Dist: humanfriendly==10.0
44
+ Requires-Dist: idna==3.10
45
+ Requires-Dist: injector==0.22.0
46
+ Requires-Dist: Jinja2==3.1.5
47
+ Requires-Dist: langchain==0.3.19
48
+ Requires-Dist: langchain-core==0.3.35
49
+ Requires-Dist: langchain-text-splitters==0.3.6
50
+ Requires-Dist: markdown2==2.5.3
51
+ Requires-Dist: openai==2.8.1
52
+ Requires-Dist: openpyxl==3.1.5
53
+ Requires-Dist: pandas==2.3.1
54
+ Requires-Dist: pgvector==0.3.6
55
+ Requires-Dist: pillow==11.0.0
56
+ Requires-Dist: psutil==7.0.0
57
+ Requires-Dist: psycopg2-binary==2.9.10
58
+ Requires-Dist: PyJWT==2.10.1
59
+ Requires-Dist: PyMuPDF==1.25.0
60
+ Requires-Dist: python-dotenv==1.0.1
61
+ Requires-Dist: pytest==8.3.4
62
+ Requires-Dist: pytest-cov==5.0.0
63
+ Requires-Dist: pytest-mock==3.14.0
64
+ Requires-Dist: python-dateutil==2.9.0.post0
65
+ Requires-Dist: python-docx==1.1.2
66
+ Requires-Dist: pytesseract==0.3.13
67
+ Requires-Dist: pytz==2025.2
68
+ Requires-Dist: PyYAML==6.0.2
69
+ Requires-Dist: redis==5.2.1
70
+ Requires-Dist: regex==2024.11.6
71
+ Requires-Dist: requests==2.32.3
72
+ Requires-Dist: requests-oauthlib==2.0.0
73
+ Requires-Dist: requests-toolbelt==1.0.0
74
+ Requires-Dist: s3transfer==0.11.2
75
+ Requires-Dist: sib-api-v3-sdk==7.6.0
76
+ Requires-Dist: SQLAlchemy==2.0.36
77
+ Requires-Dist: tiktoken==0.8.0
78
+ Requires-Dist: tokenizers==0.21.0
79
+ Requires-Dist: websocket-client==1.8.0
80
+ Requires-Dist: websockets==14.1
81
+ Requires-Dist: Werkzeug==3.1.3
82
+ Requires-Dist: pyjwt[crypto]>=2.8.0
83
+ Dynamic: license-file
84
+
85
+ # 🧠 IAToolkit — Open-Source Framework for Real-World AI Assistants
86
+
87
+ Build private, production-grade AI assistants that run entirely inside your environment and speak the language of your business.
88
+
89
+ IAToolkit is not a demo wrapper or a prompt playground — it is a **full architecture** for implementing intelligent systems that combine LLMs, SQL data, internal documents, tools, workflows, and multi-tenant business logic.
90
+
91
+ ---
92
+
93
+ ## 🚀 Why IAToolkit?
94
+
95
+ Modern AI development is fragmented: LangChain handles chains, LlamaIndex handles documents,
96
+ your backend handles SQL, your frontend handles chats, and your devs glue everything together.
97
+
98
+ **IAToolkit brings all of this into one unified, production-ready framework.**
99
+
100
+ It focuses on:
101
+
102
+ - **real-world data** (SQL + documents)
103
+ - **real workflows** (LLM tools + python services)
104
+ - **real multi-tenant architecture** (1 company → many companies)
105
+ - **real constraints** (security, reproducibility, governance)
106
+ - **real deployment** (your servers, your infrastructure)
107
+
108
+ IAToolkit lets you build the assistant that *your* organization needs — not a generic chatbot.
109
+
110
+ ---
111
+
112
+ ## 🧩 Architecture in a Nutshell
113
+
114
+ IAToolkit is a structured, layered framework:
115
+
116
+ Interfaces (Web & API)
117
+
118
+ Intelligence Layer (prompts, tools, SQL orchestration, RAG)
119
+
120
+ Execution Layer (services, workflows, validation)
121
+
122
+ Data Access (SQLAlchemy, connectors)
123
+
124
+ Company Modules (company.yaml + custom tools)
125
+
126
+ ### ✔ Interfaces
127
+ Chat UI, REST API, auth, sessions, JSON/HTML responses.
128
+
129
+ ### ✔ Intelligence Layer
130
+ Core logic: prompt rendering, SQL orchestration, RAG, LLM tool dispatching.
131
+
132
+ ### ✔ Execution Layer
133
+ Python services that implement real workflows: querying data, generating reports, retrieving documents, executing business logic.
134
+
135
+ ### ✔ Data Access
136
+ A clean repository pattern using SQLAlchemy.
137
+
138
+ ### ✔ Company Modules
139
+ Each company has:
140
+
141
+ - its own `company.yaml`
142
+ - its own prompts
143
+ - its own tools
144
+ - its own services
145
+ - its own vector store & SQL context
146
+
147
+ This modularity allows **true multi-tenancy**.
148
+
149
+ ---
150
+
151
+ ## 🔌 Connect to Anything
152
+
153
+ IAToolkit integrates naturally with:
154
+
155
+ - **SQL databases** (PostgreSQL, MySQL, SQL Server, etc.)
156
+ - **Document retrieval** (PDF, text, embeddings)
157
+ - **External APIs**
158
+ - **Internal microservices**
159
+ - **Custom Python tools**
160
+
161
+ It also includes a **production-grade RAG pipeline**, combining:
162
+
163
+ - embeddings
164
+ - chunking
165
+ - hybrid search
166
+ - SQL queries + document retrieval
167
+ - tool execution
168
+
169
+ Everything orchestrated through the Intelligence Layer.
170
+
171
+ ---
172
+
173
+ ## 🏢 Multi-Tenant Architecture
174
+
175
+ A single installation of IAToolkit can power assistants for multiple companies, departments, or customers.
176
+ ```text
177
+ companies/
178
+ company_a
179
+ company_b
180
+ company_c
181
+ ```
182
+ Each Company is fully isolated:
183
+
184
+ - prompts
185
+ - tools
186
+ - credentials
187
+ - documents
188
+ - SQL contexts
189
+ - business rules
190
+
191
+ This makes IAToolkit ideal for SaaS products, agencies, consultancies, and organizations with multiple business units.
192
+
193
+ ---
194
+
195
+ ## 🆓 Community Edition vs Enterprise Edition
196
+
197
+ IAToolkit follows a modern **open-core** model:
198
+
199
+ ### 🟦 Community Edition (MIT License)
200
+ - Full Open-Source Core
201
+ - SQL + Basic RAG
202
+ - One Company
203
+ - Custom Python tools
204
+ - Self-managed deployment
205
+
206
+ Perfect for developers, small teams, single-business use cases, and experimentation.
207
+
208
+ ### 🟥 Enterprise Edition (Commercial License)
209
+ - Unlimited Companies (multi-tenant)
210
+ - Advanced RAG pipelines
211
+ - External connectors (S3, APIs, email)
212
+ - SSO, auditing, access controls
213
+ - Priority support & continuous updates
214
+ - Activation via **License Key**
215
+
216
+ 👉 Licensing information:
217
+ - [Community Edition (MIT)](LICENSE_COMMUNITY.md)
218
+ - [Enterprise License](ENTERPRISE_LICENSE.md)
219
+
220
+ ---
221
+
222
+ ## 🧩 Who Is IAToolkit For?
223
+
224
+ - Companies building internal “ChatGPT for the business”
225
+ - SaaS products adding AI assistants for multiple customers
226
+ - AI teams that need reproducible prompts and controlled tools
227
+ - Developers who want real workflows, not toy demos
228
+ - Organizations requiring privacy, security, and self-hosting
229
+ - Teams working with SQL-heavy business logic
230
+ - Consultancies deploying AI for multiple clients
231
+
232
+ ---
233
+
234
+ ## ⭐ Key Differentiators
235
+
236
+ - prioritizes **architecture-first design**, not chains or wrappers
237
+ - supports **multi-company** out of the box
238
+ - integrates **SQL, RAG, and tools** into a single intelligence layer
239
+ - keeps **business logic isolated** inside Company modules
240
+ - runs entirely **on your own infrastructure**
241
+ - ships with a **full web chat**, and API.
242
+ - is built for **production**, not prototypes
243
+
244
+ ---
245
+
246
+ ## 📚 Documentation
247
+
248
+ - 🚀 **[Quickstart](docs/quickstart.md)** – Set up your environment and run the project
249
+ - ☁️ **[Deployment Guide](docs/deployment_guide.md)** – Production deployment instructions
250
+ - 🏗️ **[Companies & Components](docs/companies_and_components.md)** – how Company modules work
251
+ - 🧠 **[Programming Guide](docs/programming_guide.md)** – services, intelligence layer, dispatching
252
+ - 🗃️ **[Database Guide](docs/database_guide.md)** – internal schema overview
253
+ - 🌱 **[Foundation Article](https://iatoolkit.com/pages/foundation)** – the “Why” behind the architecture
254
+ - 📘 **[Mini-Project (3 months)](https://iatoolkit.com/pages/mini_project)** – how to deploy a corporate AI assistant
255
+
256
+
257
+ ---
258
+
259
+ ## 🤝 Contributing
260
+
261
+ IAToolkit is open-source and community-friendly.
262
+ PRs, issues, ideas, and feedback are always welcome.
263
+
264
+ ---
265
+
266
+ ## ⭐ Support the Project
267
+
268
+ If you find IAToolkit useful, please **star the GitHub repo** — it helps visibility and adoption.
@@ -0,0 +1,125 @@
1
+ iatoolkit/__init__.py,sha256=U1z2Ra1_zh3nri1jxmA3UnM7X89FNXUv9aovMHxTikc,1337
2
+ iatoolkit/base_company.py,sha256=t3h4oFye9NQMpa4GwEQwHEz6Wd0TF31Vux0xY8-q6Bg,1334
3
+ iatoolkit/cli_commands.py,sha256=1lSDE_6K3p_psGnHrgaGT6MWaz27aRDn10dzb2wf9_E,2271
4
+ iatoolkit/company_registry.py,sha256=rZxuAMO-5ehdaYltRANLhBk7tp7H_Tfxs--XKiY_PE4,4015
5
+ iatoolkit/core.py,sha256=EcwRiKyn5oCRCBMbvOVCNOjgOXeT55vP613pwIjoXbg,19433
6
+ iatoolkit/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ iatoolkit/common/exceptions.py,sha256=kZyyTL9P72SlwljddmrFFvARRVdzWv7uQW3H2bM4GmU,1183
8
+ iatoolkit/common/routes.py,sha256=uAFwVt_hmirDQbi-scZA3ZFmHOsYWxLh-vXJE-4tK0c,5888
9
+ iatoolkit/common/session_manager.py,sha256=OUYMzT8hN1U-NCUidR5tUAXB1drd8nYTOpo60rUNYeY,532
10
+ iatoolkit/common/util.py,sha256=38G_7TUm_d1pIcJNNV-poZZjlvFVSXnuBPgagSi-9LM,15299
11
+ iatoolkit/infra/__init__.py,sha256=5JqK9sZ6jBuK83zDQokUhxQ0wuJJJ9DXB8pYCLkX7X4,102
12
+ iatoolkit/infra/brevo_mail_app.py,sha256=xvy3KxEEgjFpHlIAogP6SU5KXmg3w7lC16nnNmOYU8Y,5323
13
+ iatoolkit/infra/call_service.py,sha256=iRk9VxbXaAwlLIl8fUzGDWIAdzwfsbs1MtP84YeENxg,4929
14
+ iatoolkit/infra/gemini_adapter.py,sha256=kXV-t5i9GmWBafUPX2kAyiqvcT7GPoxHylcCUWG_c_U,15051
15
+ iatoolkit/infra/google_chat_app.py,sha256=_uKWxeacHH6C5a4FVx0YZjBn1tL-x_MIQV9gqgWGAjo,1937
16
+ iatoolkit/infra/llm_client.py,sha256=bVrPYooJbkKYZsZKZ8VeyeC7ewLnKAVBTkvJtfRpbgE,18522
17
+ iatoolkit/infra/llm_proxy.py,sha256=TJti_mkdeFfsl4oGd5gTB7gaxF6bNG_rwqchkDiubw0,6933
18
+ iatoolkit/infra/llm_response.py,sha256=YUUQPBHzmP3Ce6-t0kKMRIpowvh7de1odSoefEByIvI,904
19
+ iatoolkit/infra/openai_adapter.py,sha256=tbzd8aPAH5cQOJT-sD4ypqq2fWB6WiEIGuGesUDnQNk,3550
20
+ iatoolkit/infra/redis_session_manager.py,sha256=EPr3E_g7LHxn6U4SV5lT_L8WQsAwg8VzA_WIEZ3TwOw,3667
21
+ iatoolkit/infra/connectors/__init__.py,sha256=5JqK9sZ6jBuK83zDQokUhxQ0wuJJJ9DXB8pYCLkX7X4,102
22
+ iatoolkit/infra/connectors/file_connector.py,sha256=HOjRTFd-WfDOcFyvHncAhnGNZuFgChIwC-P6osPo9ZM,352
23
+ iatoolkit/infra/connectors/file_connector_factory.py,sha256=3qvyfH4ZHKuiMxJFkawOxhW2-TGKKtsBYHgoPpZMuKU,2118
24
+ iatoolkit/infra/connectors/google_cloud_storage_connector.py,sha256=IXpL3HTo7Ft4EQsYiQq5wXRRQK854jzOEB7ZdWjLa4U,2050
25
+ iatoolkit/infra/connectors/google_drive_connector.py,sha256=WR1AlO5-Bl3W89opdja0kKgHTJzVOjTsy3H4SlIvwVg,2537
26
+ iatoolkit/infra/connectors/local_file_connector.py,sha256=hrzIgpMJOTuwTqzlQeTIU_50ZbZ6yl8lcWPv6hMnoqI,1739
27
+ iatoolkit/infra/connectors/s3_connector.py,sha256=Nj4_YaLobjfcnbZewJf21_K2EXohgcc3mJll1Pzn4zg,1123
28
+ iatoolkit/locales/en.yaml,sha256=e8tTV8k4qk0ESSj3OlFqX7iz0pq8Bii-io_q6kw3Aeg,7989
29
+ iatoolkit/locales/es.yaml,sha256=xqryHAeRSGBhhrdt0FnK-OxOtfWYsbVU2sEuxsrnjTw,8459
30
+ iatoolkit/repositories/__init__.py,sha256=5JqK9sZ6jBuK83zDQokUhxQ0wuJJJ9DXB8pYCLkX7X4,102
31
+ iatoolkit/repositories/database_manager.py,sha256=bpVSLAE-ltDB4vAfNlf7q6QfAWWJmRthmzscrv1q3K8,5832
32
+ iatoolkit/repositories/document_repo.py,sha256=vhFc0hu9GK6yoKJHs2dLaAoQ9ZJaf9GEOsD2yWuVuNw,1130
33
+ iatoolkit/repositories/llm_query_repo.py,sha256=AuelF-LfMoJScgwVEYIN1JoOLk9UKANoRsnzNtKA7CI,3839
34
+ iatoolkit/repositories/models.py,sha256=78oHVVxt6xQlizth0GDmEcMCMuvCOi6mFM2dRaPuoLE,14343
35
+ iatoolkit/repositories/profile_repo.py,sha256=ETSnEwDVni5w-5hSHFxnf-zJq5QUqP6DoR7qfJeqfBA,3845
36
+ iatoolkit/repositories/tasks_repo.py,sha256=icVO_r2oPagGnnBhwVFzznnvEEU2EAx-2dlWuWvoDC4,1745
37
+ iatoolkit/repositories/vs_repo.py,sha256=jVyzcK4l7T4n7O0KVLDIfOiZkPEA-rV1OtgYCD2M_G4,6110
38
+ iatoolkit/services/__init__.py,sha256=5JqK9sZ6jBuK83zDQokUhxQ0wuJJJ9DXB8pYCLkX7X4,102
39
+ iatoolkit/services/auth_service.py,sha256=B0gTUHDf56WiTnA5viBEvbmf2A6y_6bkAoFlMvu0IWY,7756
40
+ iatoolkit/services/benchmark_service.py,sha256=CdbFYyS3FHFhNzWQEa9ZNjUlmON10DT1nKNbZQ1EUi8,5880
41
+ iatoolkit/services/branding_service.py,sha256=Fsjcos7hGLx2qhoZ9hTaFCgb7x5eYHMDGvXg4mXx8D0,8120
42
+ iatoolkit/services/company_context_service.py,sha256=LhscfhcB1w6ycjNkd075cZSknIAJQQB_Aty5CWM5hfY,7381
43
+ iatoolkit/services/configuration_service.py,sha256=1HPTrfsqF1VyDS1zZc5tI9bo22OMeZwuD1BGVDnXsD8,13764
44
+ iatoolkit/services/dispatcher_service.py,sha256=e-y8T5Zvy1_XUc1uDttImnhwbtI3pblEFGOxIb9vnOQ,4516
45
+ iatoolkit/services/document_service.py,sha256=XrAwbNPyhmP94bGdDwHy76Mg_PCg6O2QyZwii1T6kZ8,6469
46
+ iatoolkit/services/embedding_service.py,sha256=ngRnFXEpko-rqpicqbJbVdr91IjSe1jXSYVWprOVlE0,6296
47
+ iatoolkit/services/excel_service.py,sha256=de4fj3klWFWSTdgej8yk0FBuNr1lunyy9cuOyZwl0rI,6221
48
+ iatoolkit/services/file_processor_service.py,sha256=h8Tg2Xwvjv_HOIUo51Rnu5H4tUmkJ8W9tKvmFfgKPms,3792
49
+ iatoolkit/services/history_manager_service.py,sha256=PMDj35XR96IbwLl0VnD6QE-1mSpl_eouTlf6MdkLXQs,8502
50
+ iatoolkit/services/i18n_service.py,sha256=mR4pS0z56NgZLeSnEvDXiMvVBeOCl5CkUWdYBTVEhyM,3941
51
+ iatoolkit/services/jwt_service.py,sha256=pVoH1rzRwWixpvT3AhFdiE1BDmdbo4KQMyOF0P7tz-Y,2939
52
+ iatoolkit/services/language_service.py,sha256=ktNzj0hrCPm_VMIpWTxFEpEHKQ1lOHOfuhzCbZud2Dc,3428
53
+ iatoolkit/services/license_service.py,sha256=pdl9szSEPbIu2ISl6g-WIR1p4HQu2gSGdAjViKxY6Hg,2751
54
+ iatoolkit/services/load_documents_service.py,sha256=04XZmn6AWOK0wiRU7QDu2VYRekOK7fD19H-mC4FiMjA,7908
55
+ iatoolkit/services/mail_service.py,sha256=6Kx1CIbXzAr_ucoqwqTlhhwE6y2Jw64eNDjXysaZP-c,8297
56
+ iatoolkit/services/profile_service.py,sha256=6MxFfaQeDf-VXcs8ijQNsiYfDXfN_YyEWETHlrdYuUQ,22581
57
+ iatoolkit/services/prompt_service.py,sha256=HFCAhhtrdhOZmf5f-DjUoYlFQob3MHTPrGGJQ48u_4o,13005
58
+ iatoolkit/services/query_service.py,sha256=eR2YrDX5-fJE3IuUFSwqvc_UfEtHwmH3wi2QWEEQKR8,19423
59
+ iatoolkit/services/search_service.py,sha256=Omx7tXit5V9o_HdIEFs24Hmaz382CxuphfFzvige4Uo,2188
60
+ iatoolkit/services/sql_service.py,sha256=JMDCCn43e2woYsGPhMfFvAc-c-XuBQ6_oGlxWSVZtyE,5522
61
+ iatoolkit/services/tasks_service.py,sha256=itREO5rDnUIgsqtyCOBKDtH30QL5v1egs4qPTiBK8xU,6865
62
+ iatoolkit/services/tool_service.py,sha256=K1CesxoovZT9wGqaE6QQoVPtMU4bNno4Dc0uXpHDcIc,9458
63
+ iatoolkit/services/user_feedback_service.py,sha256=KbjMjl0CDF7WpPHioJ3sqQVwocjfq_cisrpeqYUqtas,5361
64
+ iatoolkit/services/user_session_context_service.py,sha256=O9yX2i9B2OEo0pzMvkRKRrb9EV7kdlpYkX4GXUCKTpM,7670
65
+ iatoolkit/static/images/fernando.jpeg,sha256=W68TYMuo5hZVpbP-evwH6Nu4xWFv2bc8pJzSKDoLTeQ,100612
66
+ iatoolkit/static/images/iatoolkit_core.png,sha256=EsmhI8ucevGtzWUPtRDUBfoU-1jqXK7ZmQtrZ-cbJO8,42358
67
+ iatoolkit/static/images/iatoolkit_logo.png,sha256=cGSO-06Y8hCwxsnEGbUBjqFmlSA4pm-OOnNypOEAZVs,7563
68
+ iatoolkit/static/js/chat_feedback_button.js,sha256=P0ANiY5tbaEegi7fYg5Y4xFFWd3Ldf86rDu3zwwZd3A,2425
69
+ iatoolkit/static/js/chat_filepond.js,sha256=mzXafm7a506EpM37KATTK3zvAswO1E0KSUY1vKbwuRc,3163
70
+ iatoolkit/static/js/chat_help_content.js,sha256=VwJ4esnrQ2xCP09IhObJyg-sRIJYMGGiAIRF8fX_lE0,5201
71
+ iatoolkit/static/js/chat_history_button.js,sha256=i9EBAWWW2XyQnAuj1b-c8102EG_gDkQ2ElbA8_Nu0yo,3491
72
+ iatoolkit/static/js/chat_logout_button.js,sha256=Of9H6IbAboSBmeqRaurEVW6_dL752L0UeDcDLNBD5Z0,1335
73
+ iatoolkit/static/js/chat_main.js,sha256=DllrDCL1bwR3gA6mHHckGSzttmJw0K8li2f5atL6Pro,12960
74
+ iatoolkit/static/js/chat_onboarding_button.js,sha256=nlm7dmMs-KTq3f2Ve5LhAkCbn-wx_3zDReivX8Ch7DU,3364
75
+ iatoolkit/static/js/chat_prompt_manager.js,sha256=QYki28CpyM2Chn82dnOP2eH6FObxH8eChGFyUxukv1M,3319
76
+ iatoolkit/static/js/chat_reload_button.js,sha256=FHMm5sLdn2HuWDq66wphNuRcltjLG-aADp0yTwEbnQw,1256
77
+ iatoolkit/static/styles/chat_iatoolkit.css,sha256=_3tqIydkfbLBoo_mASdSD-jmjIsvh5wePhGgMwPFWS4,13808
78
+ iatoolkit/static/styles/chat_modal.css,sha256=9rwWrzL4Vq7AsdiGb3qczyOUf2PJEgLjSLCkSns8dQA,3031
79
+ iatoolkit/static/styles/chat_public.css,sha256=2SDz0gGyTnTn3BUwD--QX-0qEc3eYKXeTTC6h730UCU,4486
80
+ iatoolkit/static/styles/documents.css,sha256=6Yoprc9JHlKdtqUBEGr4r-JCQsK3Bg1ivoxfJyGuKvg,11893
81
+ iatoolkit/static/styles/landing_page.css,sha256=HVYbo9ZqbqsImvMhGBq2dDFkRiRWOtVaZ0IP9QqDquA,8914
82
+ iatoolkit/static/styles/llm_output.css,sha256=AlxgRSOleeCk2dLAqFWVaQ-jwZiJjcpC5rHuUv3T6VU,2312
83
+ iatoolkit/static/styles/onboarding.css,sha256=fNiqT_MMJ6gGhNzfbSZhJwvcCZ_8gibL-MWZwxyAgAs,3749
84
+ iatoolkit/system_prompts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
85
+ iatoolkit/system_prompts/format_styles.prompt,sha256=MSMe1qvR3cF_0IbFshn8R0z6Wx6VCHQq1p37rpu5wwk,3576
86
+ iatoolkit/system_prompts/query_main.prompt,sha256=FXYjE4ICiEHiu7oTgK7lAEytUlk30WVacIf5P_yRm2c,2155
87
+ iatoolkit/system_prompts/sql_rules.prompt,sha256=U1Z5BObI-fgkMatcYfx89q2-YmuRNK6OV6q69p-wAFI,60585
88
+ iatoolkit/templates/_company_header.html,sha256=L1QtrMpqYXALqtinCa3WhG4CrgHKLObl_d-jfQYNjhg,1903
89
+ iatoolkit/templates/_login_widget.html,sha256=qziV70-n7SwC11rL4cU1LenJM83jYvuyw2xSz6OORJA,2063
90
+ iatoolkit/templates/base.html,sha256=xOox6JJEd6dHBlw6DBrFDJTXtAKCaXZc3Ffrufa-GDk,3042
91
+ iatoolkit/templates/change_password.html,sha256=p0GWZ9gldluYQM8OPSz2Q4CYhU8UJmb-72iz_Sl_6Ho,3485
92
+ iatoolkit/templates/chat.html,sha256=Ey4iJkyYpNkOnOrwx7Qngy7UDwk8GOq3eB4HyYaC9tA,13300
93
+ iatoolkit/templates/chat_modals.html,sha256=x0Do7I7X9cfgZFHSAwWreIN55nYPCpZK7PTBxGXjrYY,8501
94
+ iatoolkit/templates/error.html,sha256=4aT6cIYQUILciekAceHEiUuZxcAqkmNPUMnB9CD4BNA,1778
95
+ iatoolkit/templates/forgot_password.html,sha256=XLVMmLJK5SAXmPqIH_OyTlSbu5QTAdekO6ggzfcNup0,2376
96
+ iatoolkit/templates/onboarding_shell.html,sha256=fKNT3aIhXcO95Q8C092axRxSGYGKOTD00vetM-sMSt0,4648
97
+ iatoolkit/templates/signup.html,sha256=kvV9B8M99zMDj4y9up-K5ChzOznSxzZTX4jPShGRBvI,4316
98
+ iatoolkit/views/__init__.py,sha256=5JqK9sZ6jBuK83zDQokUhxQ0wuJJJ9DXB8pYCLkX7X4,102
99
+ iatoolkit/views/base_login_view.py,sha256=S53PSIoML1yMCfP2kr8-csNGe0Ig-wNaBilzpdjjMyo,3683
100
+ iatoolkit/views/change_password_view.py,sha256=TXFvvtNrR37yrNAHYzcMSSIkV4-MIzmIpwbPffaJJyE,4957
101
+ iatoolkit/views/embedding_api_view.py,sha256=9n5utihq8zHiG0V2sVCOYQ72wOKa4denqE951gqaJWo,2371
102
+ iatoolkit/views/forgot_password_view.py,sha256=C4eJe9GmGrl6M3bTt_anwuPQib9ouXZtKYp6kB2xBeU,3380
103
+ iatoolkit/views/help_content_api_view.py,sha256=8EUw2iSE6X-Lm2dGlYZxSp-29HzaAGwD3CpL4Otqp5k,2011
104
+ iatoolkit/views/history_api_view.py,sha256=oNYfo-fZbz4sY6VpE_goaCFQyH2k9IX85VhPotqQtGc,2015
105
+ iatoolkit/views/home_view.py,sha256=GaU2-qyTnE8jE1ejdNjHW3azo72X_Awhp1y1Zx9BXRg,2662
106
+ iatoolkit/views/init_context_api_view.py,sha256=axfNno8E1v4dCNuXNkdV1XpDZtypICj48hW3cRyl_eA,2961
107
+ iatoolkit/views/llmquery_api_view.py,sha256=ohlYmFcvhvZL2BTMeCzd7ZPeTBzIPcIZbC9CRWqQM70,2290
108
+ iatoolkit/views/load_document_api_view.py,sha256=RFkVrzOy6eG_aoQYdxb3EpInTnomZpyDaHRW3_n4dro,2310
109
+ iatoolkit/views/login_view.py,sha256=9EilnksI6M46FsqVAaiADVrtekZDtJyBpQgoRQQqTgE,7099
110
+ iatoolkit/views/logout_api_view.py,sha256=7c0rL5sLTuoRPqQs73wlH_7eb3--S6GLcr7Yu4hNOYU,2035
111
+ iatoolkit/views/profile_api_view.py,sha256=qhlmhyygIs5h-OyNDwq1uGUS8S-GxB2zOYY51Hs5prY,1645
112
+ iatoolkit/views/prompt_api_view.py,sha256=WAv4I6WmGfT1TTZ-lml9LaR2wDsSx9mshYcxFAV_wtk,1255
113
+ iatoolkit/views/root_redirect_view.py,sha256=t7tqiyJAPffzIuQVwnfgIw3Bo51qkegyMmBTfChsrJk,833
114
+ iatoolkit/views/signup_view.py,sha256=83jgbAuOAETID88TC8h-wCszkkEaFygCH6tTj7XyZYI,4261
115
+ iatoolkit/views/static_page_view.py,sha256=V0oTybQ5lFo3hp5xOKau-yMO8vK8NCM6zWiwVI8lpBQ,881
116
+ iatoolkit/views/tasks_api_view.py,sha256=wGnuwuuL83ByQ1Yre6ytRVztA0OGQjGrwMjB1_G830U,2630
117
+ iatoolkit/views/tasks_review_api_view.py,sha256=wsCpzqyRyUdCXWAhyGlBe3eNZZ6A1DQG7TblN_GZNfM,1894
118
+ iatoolkit/views/user_feedback_api_view.py,sha256=QOTBtpNqYAmewXDgVAoaIprnVjvf1xM0ExWxSFp3ICI,2098
119
+ iatoolkit/views/verify_user_view.py,sha256=Uc9P2wiRjZ7pMRTjWUn8Y-p0DFqw_AwNYQsdbAwhbg8,2659
120
+ iatoolkit-0.91.1.dist-info/licenses/LICENSE,sha256=5tOLQdjoCvSXEx_7Lr4bSab3ha4NSwzamvua0fwCXi8,1075
121
+ iatoolkit-0.91.1.dist-info/licenses/LICENSE_COMMUNITY.md,sha256=9lVNcggPNUnleMF3_h3zu9PbNTeaRqB1tHAbiBLQJZU,566
122
+ iatoolkit-0.91.1.dist-info/METADATA,sha256=no3mDlRTL0FwdP007a2cmmvwJIbgeeFQRAcB3TTPoCc,8421
123
+ iatoolkit-0.91.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
124
+ iatoolkit-0.91.1.dist-info/top_level.txt,sha256=V_w4QvDx0b1RXiy8zTCrD1Bp7AZkFe3_O0-9fMiwogg,10
125
+ iatoolkit-0.91.1.dist-info/RECORD,,
@@ -0,0 +1,15 @@
1
+ # IAToolkit Community Edition License
2
+
3
+ The IAToolkit Community Edition is licensed under the MIT License.
4
+
5
+ This edition includes the full open-source IAToolkit Core, with the following usage scope:
6
+
7
+ - Support for **one (1) Company**
8
+ - Unlimited Tools within that Company
9
+ - SQL integration
10
+ - Basic RAG (standard retrieval & embeddings)
11
+ - All Components of the open-source Intelligence Layer and Interfaces
12
+
13
+ No additional technical limits apply beyond the single-Company constraint.
14
+
15
+ This edition is designed for learning, prototyping, and single-business deployments.
@@ -1,37 +0,0 @@
1
- # Copyright (c) 2024 Fernando Libedinsky
2
- # Product: IAToolkit
3
- #
4
- # IAToolkit is open source software.
5
-
6
- from injector import inject
7
- from iatoolkit.repositories.llm_query_repo import LLMQueryRepo
8
- from iatoolkit.repositories.profile_repo import ProfileRepo
9
- from iatoolkit.services.i18n_service import I18nService
10
-
11
-
12
- class HistoryService:
13
- @inject
14
- def __init__(self, llm_query_repo: LLMQueryRepo,
15
- profile_repo: ProfileRepo,
16
- i18n_service: I18nService):
17
- self.llm_query_repo = llm_query_repo
18
- self.profile_repo = profile_repo
19
- self.i18n_service = i18n_service
20
-
21
- def get_history(self,
22
- company_short_name: str,
23
- user_identifier: str) -> dict:
24
- try:
25
- company = self.profile_repo.get_company_by_short_name(company_short_name)
26
- if not company:
27
- return {"error": self.i18n_service.t('errors.company_not_found', company_short_name=company_short_name)}
28
-
29
- history = self.llm_query_repo.get_history(company, user_identifier)
30
- if not history:
31
- return {'message': 'empty history', 'history': []}
32
-
33
- history_list = [query.to_dict() for query in history]
34
- return {'message': 'history loaded ok', 'history': history_list}
35
-
36
- except Exception as e:
37
- return {'error': str(e)}