iatoolkit 0.58.10__py3-none-any.whl → 0.59.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.
Potentially problematic release.
This version of iatoolkit might be problematic. Click here for more details.
- iatoolkit/iatoolkit.py +1 -2
- iatoolkit/services/auth_service.py +3 -3
- iatoolkit/static/js/chat_context_reload.js +26 -33
- iatoolkit/views/init_context_api_view.py +0 -2
- {iatoolkit-0.58.10.dist-info → iatoolkit-0.59.1.dist-info}/METADATA +1 -1
- {iatoolkit-0.58.10.dist-info → iatoolkit-0.59.1.dist-info}/RECORD +8 -8
- {iatoolkit-0.58.10.dist-info → iatoolkit-0.59.1.dist-info}/WHEEL +0 -0
- {iatoolkit-0.58.10.dist-info → iatoolkit-0.59.1.dist-info}/top_level.txt +0 -0
iatoolkit/iatoolkit.py
CHANGED
|
@@ -19,7 +19,7 @@ from werkzeug.middleware.proxy_fix import ProxyFix
|
|
|
19
19
|
from injector import Binder, singleton, Injector
|
|
20
20
|
from importlib.metadata import version as _pkg_version, PackageNotFoundError
|
|
21
21
|
|
|
22
|
-
IATOOLKIT_VERSION = "0.
|
|
22
|
+
IATOOLKIT_VERSION = "0.59.1"
|
|
23
23
|
|
|
24
24
|
# global variable for the unique instance of IAToolkit
|
|
25
25
|
_iatoolkit_instance: Optional['IAToolkit'] = None
|
|
@@ -230,7 +230,6 @@ class IAToolkit:
|
|
|
230
230
|
default_origins = [
|
|
231
231
|
"http://localhost:5001",
|
|
232
232
|
"http://127.0.0.1:5001",
|
|
233
|
-
"https://portal-interno.maxxa.cl",
|
|
234
233
|
os.getenv('IATOOLKIT_BASE_URL')
|
|
235
234
|
]
|
|
236
235
|
|
|
@@ -122,7 +122,7 @@ class AuthService:
|
|
|
122
122
|
api_key_entry = self.profile_service.get_active_api_key_entry(api_key)
|
|
123
123
|
if not api_key_entry:
|
|
124
124
|
logging.info(f"Invalid or inactive API Key {api_key}")
|
|
125
|
-
return {"success": False, "
|
|
125
|
+
return {"success": False, "error_message": "Invalid or inactive API Key", "status_code": 401}
|
|
126
126
|
|
|
127
127
|
# obtain the company from the api_key_entry
|
|
128
128
|
company = api_key_entry.company
|
|
@@ -140,8 +140,8 @@ class AuthService:
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
# --- Failure: No valid credentials found ---
|
|
143
|
-
logging.info(f"Authentication required. No session cookie or API Key provided.")
|
|
144
|
-
return {"success": False, "
|
|
143
|
+
logging.info(f"Authentication required. No session cookie or API Key provided. session: {str(session_info)}")
|
|
144
|
+
return {"success": False, "error_message": "Authentication required. No session cookie or API Key provided.",
|
|
145
145
|
"status_code": 402}
|
|
146
146
|
|
|
147
147
|
def log_access(self,
|
|
@@ -8,7 +8,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
|
8
8
|
// Configuración de Toastr para que aparezca abajo a la derecha
|
|
9
9
|
toastr.options = { "positionClass": "toast-bottom-right", "preventDuplicates": true };
|
|
10
10
|
|
|
11
|
-
reloadButton.addEventListener('click', function(event) {
|
|
11
|
+
reloadButton.addEventListener('click', async function(event) {
|
|
12
12
|
event.preventDefault();
|
|
13
13
|
|
|
14
14
|
if (reloadButton.disabled) return; // Prevenir doble clic
|
|
@@ -19,43 +19,36 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
|
19
19
|
icon.className = spinnerIconClass;
|
|
20
20
|
toastr.info('Iniciando recarga de contexto en segundo plano...');
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
throw new Error(err.error_message || `Error del servidor: ${response.status}`);
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
return response.json();
|
|
43
|
-
})
|
|
44
|
-
.then(data => {
|
|
45
|
-
if (data.status === 'OK') {
|
|
46
|
-
toastr.success(data.message || 'Contexto recargado exitosamente.');
|
|
22
|
+
try {
|
|
23
|
+
// 2. Definir los parámetros para callToolkit
|
|
24
|
+
const apiPath = '/api/init-context';
|
|
25
|
+
const payload = { 'user_identifier': window.user_identifier };
|
|
26
|
+
|
|
27
|
+
// 3. Hacer la llamada usando callToolkit
|
|
28
|
+
const data = await callToolkit(apiPath, payload, 'POST');
|
|
29
|
+
|
|
30
|
+
// 4. Procesar la respuesta
|
|
31
|
+
// callToolkit devuelve null si hubo un error que ya mostró en el chat.
|
|
32
|
+
if (data) {
|
|
33
|
+
if (data.status === 'OK') {
|
|
34
|
+
toastr.success(data.message || 'Contexto recargado exitosamente.');
|
|
35
|
+
} else {
|
|
36
|
+
// El servidor respondió 200 OK pero con un mensaje de error en el cuerpo
|
|
37
|
+
toastr.error(data.error_message || 'Ocurrió un error desconocido durante la recarga.');
|
|
38
|
+
}
|
|
47
39
|
} else {
|
|
48
|
-
|
|
40
|
+
// Si data es null, callToolkit ya manejó el error (mostrando un mensaje en el chat).
|
|
41
|
+
// Añadimos un toast para notificar al usuario que algo falló.
|
|
42
|
+
toastr.error('Falló la recarga del contexto. Revisa el chat para más detalles.');
|
|
49
43
|
}
|
|
50
|
-
})
|
|
51
|
-
|
|
44
|
+
} catch (error) {
|
|
45
|
+
// Este bloque se ejecutará para errores no controlados por callToolkit (como AbortError)
|
|
52
46
|
console.error('Error durante la recarga del contexto:', error);
|
|
53
47
|
toastr.error(error.message || 'Error de red al intentar recargar.');
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// 4. Restaurar el botón
|
|
48
|
+
} finally {
|
|
49
|
+
// 5. Restaurar el botón en cualquier caso
|
|
57
50
|
reloadButton.disabled = false;
|
|
58
51
|
icon.className = originalIconClass;
|
|
59
|
-
}
|
|
52
|
+
}
|
|
60
53
|
});
|
|
61
54
|
});
|
|
@@ -53,8 +53,6 @@ class InitContextApiView(MethodView):
|
|
|
53
53
|
user_identifier=user_identifier
|
|
54
54
|
)
|
|
55
55
|
|
|
56
|
-
# logging.info(f"Context for {company_short_name}/{user_identifier} rebuilt successfully.")
|
|
57
|
-
|
|
58
56
|
# 3. Respond with JSON, as this is an API endpoint.
|
|
59
57
|
return jsonify({'status': 'OK', 'message': 'El context se ha recargado con éxito.'}), 200
|
|
60
58
|
|
|
@@ -2,7 +2,7 @@ iatoolkit/__init__.py,sha256=4PWjMJjktixtrxF6BY405qyA50Sv967kEP2x-oil6qk,1120
|
|
|
2
2
|
iatoolkit/base_company.py,sha256=nfF-G0h63jy3Qh9kCnvx8Ozx76IjG2p7a34HpweWhOk,4608
|
|
3
3
|
iatoolkit/cli_commands.py,sha256=G5L9xQXZ0lVFXQWBaE_KEZHyfuiT6PL1nTQRoSdnBzc,2302
|
|
4
4
|
iatoolkit/company_registry.py,sha256=tduqt3oV8iDX_IB1eA7KIgvIxE4edTcy-3qZIXh3Lzw,2549
|
|
5
|
-
iatoolkit/iatoolkit.py,sha256=
|
|
5
|
+
iatoolkit/iatoolkit.py,sha256=gaO37He8WhL0K0MItvOxxIq38PIaEtaumJ294lesqbA,17583
|
|
6
6
|
iatoolkit/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
iatoolkit/common/exceptions.py,sha256=EXx40n5htp7UiOM6P1xfJ9U6NMcADqm62dlFaKz7ICU,1154
|
|
8
8
|
iatoolkit/common/routes.py,sha256=en9LNxQ3oj7wPUA19okmauGVqdA1yIB_YjPo_-CV-UQ,6195
|
|
@@ -34,7 +34,7 @@ iatoolkit/repositories/profile_repo.py,sha256=21am3GP7XCG0nq6i3pArQ7mfGsrRn8rdcW
|
|
|
34
34
|
iatoolkit/repositories/tasks_repo.py,sha256=icVO_r2oPagGnnBhwVFzznnvEEU2EAx-2dlWuWvoDC4,1745
|
|
35
35
|
iatoolkit/repositories/vs_repo.py,sha256=UkpmQQiocgM5IwRBmmWhw3HHzHP6zK1nN3J3TcQgjhc,5300
|
|
36
36
|
iatoolkit/services/__init__.py,sha256=5JqK9sZ6jBuK83zDQokUhxQ0wuJJJ9DXB8pYCLkX7X4,102
|
|
37
|
-
iatoolkit/services/auth_service.py,sha256=
|
|
37
|
+
iatoolkit/services/auth_service.py,sha256=1_YfoEflzV7UboOO9xIduwXuwb4I8XHC8mZLgYyDEyw,7171
|
|
38
38
|
iatoolkit/services/benchmark_service.py,sha256=CdbFYyS3FHFhNzWQEa9ZNjUlmON10DT1nKNbZQ1EUi8,5880
|
|
39
39
|
iatoolkit/services/branding_service.py,sha256=gXj9Lj6EIFNIHT6wAHia5lr4_2a2sD-ExMbewno5YD8,7505
|
|
40
40
|
iatoolkit/services/dispatcher_service.py,sha256=Qdn2x4cozpgpKg2448sUxkhO6tuplzb8xPWUxdTTFBE,12772
|
|
@@ -55,7 +55,7 @@ iatoolkit/services/tasks_service.py,sha256=itREO5rDnUIgsqtyCOBKDtH30QL5v1egs4qPT
|
|
|
55
55
|
iatoolkit/services/user_feedback_service.py,sha256=ooy750qWmYOeJi-IJQofu8pLG4svGjGU_JKpKMURZkw,2353
|
|
56
56
|
iatoolkit/services/user_session_context_service.py,sha256=vYF_vWM37tPB_ZyPBJ6f6WTJVjT2j-4L8JfZbqbI93k,6775
|
|
57
57
|
iatoolkit/static/images/fernando.jpeg,sha256=W68TYMuo5hZVpbP-evwH6Nu4xWFv2bc8pJzSKDoLTeQ,100612
|
|
58
|
-
iatoolkit/static/js/chat_context_reload.js,sha256=
|
|
58
|
+
iatoolkit/static/js/chat_context_reload.js,sha256=DCOGEf7-t_YLw9wuqkP-kFpiFHt3UyaesFfePp9Cs_k,2512
|
|
59
59
|
iatoolkit/static/js/chat_feedback.js,sha256=zlLEDQfEocGK7RKG2baqI-9fyQlqe6hVuAHOKTPmWek,4399
|
|
60
60
|
iatoolkit/static/js/chat_filepond.js,sha256=mzXafm7a506EpM37KATTK3zvAswO1E0KSUY1vKbwuRc,3163
|
|
61
61
|
iatoolkit/static/js/chat_history.js,sha256=4h6ldU7cDvgkW84fMKB8JReoxCX0NKSQAir_4CzAF9I,4382
|
|
@@ -95,7 +95,7 @@ iatoolkit/views/file_store_api_view.py,sha256=Uz9f6sey3_F5K8zuyQz6SwYRKAalCjD1ek
|
|
|
95
95
|
iatoolkit/views/forgot_password_view.py,sha256=-qKJeeOBqJFdvDUk7rCNg1E1cDQnJQkozPpb0T0FgwA,3159
|
|
96
96
|
iatoolkit/views/history_api_view.py,sha256=x-tZhB8UzqrD2n-WDIfmHK9iVhGZ9f0yncsGs9mxwt0,1953
|
|
97
97
|
iatoolkit/views/index_view.py,sha256=P5aVdEWxsYOZGbzcXd6WFE733qZ7YXIoeqriUMAM6V8,1527
|
|
98
|
-
iatoolkit/views/init_context_api_view.py,sha256=
|
|
98
|
+
iatoolkit/views/init_context_api_view.py,sha256=NbJdGD4BDTkmDhGO5jkrGihdkpdIvuqUsl_Qg7MDZvA,2878
|
|
99
99
|
iatoolkit/views/llmquery_api_view.py,sha256=ihRtZygDLAamz8DIJ0UEN73MG_SHzjgvQIznXvCPyxg,1816
|
|
100
100
|
iatoolkit/views/login_simulation_view.py,sha256=0Qt-puRnltI2HZxlfdyJmOf26-hQp3xjknGV_jkwV7E,3484
|
|
101
101
|
iatoolkit/views/login_view.py,sha256=ESJLKHGUKQw71STHK2AoxugQUJmxnPYlI13n7ZawLLg,5663
|
|
@@ -105,7 +105,7 @@ iatoolkit/views/tasks_review_view.py,sha256=keLsLCyOTTlcoIapnB_lbuSvLwrPVZVpBiFC
|
|
|
105
105
|
iatoolkit/views/tasks_view.py,sha256=a3anTXrJTTvbQuc6PSpOzidLKQFL4hWa7PI2Cppcz8w,4110
|
|
106
106
|
iatoolkit/views/user_feedback_api_view.py,sha256=59XB9uQLHI4Q6QA4_XhK787HzfXb-c6EY7k1Ccyr4hI,2424
|
|
107
107
|
iatoolkit/views/verify_user_view.py,sha256=7XLSaxvs8LjBr3cYOUDa9B8DqW_50IGlq0IvmOQcD0Y,2340
|
|
108
|
-
iatoolkit-0.
|
|
109
|
-
iatoolkit-0.
|
|
110
|
-
iatoolkit-0.
|
|
111
|
-
iatoolkit-0.
|
|
108
|
+
iatoolkit-0.59.1.dist-info/METADATA,sha256=0XpfjEJK6gmLoXv1_MF0E2ttfqygFrIwy9pK5PngYZM,9301
|
|
109
|
+
iatoolkit-0.59.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
110
|
+
iatoolkit-0.59.1.dist-info/top_level.txt,sha256=V_w4QvDx0b1RXiy8zTCrD1Bp7AZkFe3_O0-9fMiwogg,10
|
|
111
|
+
iatoolkit-0.59.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|