pbesa 4.0.12__tar.gz → 4.0.14__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.
- {pbesa-4.0.12 → pbesa-4.0.14}/PKG-INFO +1 -1
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/celulas/celula_casos.py +2 -2
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/celulas/celula_consultas.py +2 -2
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/celulas/celula_datos_identificables.py +2 -2
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/celulas/celula_generar_documento.py +2 -2
- pbesa-4.0.14/pbesa/celulas/celula_preguntas.py +41 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/celulas/celula_saludos.py +2 -2
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/cognitive.py +194 -100
- pbesa-4.0.14/pbesa/models.py +349 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/social/dispatcher_team.py +156 -7
- pbesa-4.0.14/pbesa/social/prompts.py +213 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/social/worker.py +4 -2
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa.egg-info/PKG-INFO +1 -1
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa.egg-info/SOURCES.txt +1 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/setup.py +1 -1
- pbesa-4.0.12/pbesa/models.py +0 -149
- pbesa-4.0.12/pbesa/social/prompts.py +0 -90
- {pbesa-4.0.12 → pbesa-4.0.14}/.gitignore +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/LICENSE +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/LICENSE.txt +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/MANIFEST +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/README.md +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/db.sqlite3 +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/helloworld/__init__.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/helloworld/__pycache__/__init__.cpython-36.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/helloworld/__pycache__/pbesa.cpython-36.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/helloworld/__pycache__/settings.cpython-36.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/helloworld/__pycache__/urls.cpython-36.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/helloworld/__pycache__/wsgi.cpython-36.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/helloworld/asgi.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/helloworld/pbesa.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/helloworld/settings.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/helloworld/urls.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/helloworld/wsgi.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/manage.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/translate/__init__.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/translate/__pycache__/__init__.cpython-36.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/translate/__pycache__/admin.cpython-36.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/translate/__pycache__/apps.cpython-36.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/translate/__pycache__/models.cpython-36.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/translate/__pycache__/urls.cpython-36.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/translate/__pycache__/views.cpython-36.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/translate/admin.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/translate/apps.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/translate/mas/controller/__pycache__/translatecontroller.cpython-36.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/translate/mas/controller/__pycache__/translatedelegate.cpython-36.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/translate/mas/controller/__pycache__/translateresponse.cpython-36.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/translate/mas/controller/translatecontroller.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/translate/mas/controller/translatedelegate.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/translate/mas/controller/translateresponse.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/translate/mas/worker/__pycache__/translatetask.cpython-36.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/translate/mas/worker/__pycache__/workeragent.cpython-36.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/translate/mas/worker/translatetask.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/translate/mas/worker/workeragent.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/translate/migrations/__init__.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/translate/migrations/__pycache__/__init__.cpython-36.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/translate/models.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/translate/tests.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/translate/urls.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/django/helloworld/translate/views.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/remote/mas/controller/__pycache__/countercontroller.cpython-36.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/remote/mas/controller/__pycache__/counterdelegate.cpython-36.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/remote/mas/controller/__pycache__/counterresponse.cpython-36.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/remote/mas/controller/__pycache__/translatecontroller.cpython-36.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/remote/mas/controller/__pycache__/translatedelegate.cpython-36.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/remote/mas/controller/__pycache__/translateresponse.cpython-36.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/remote/mas/controller/countercontroller.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/remote/mas/controller/counterdelegate.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/remote/mas/controller/counterresponse.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/remote/mas/worker/__pycache__/counteragent.cpython-36.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/remote/mas/worker/__pycache__/countertask.cpython-36.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/remote/mas/worker/__pycache__/translatetask.cpython-36.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/remote/mas/worker/__pycache__/workeragent.cpython-36.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/remote/mas/worker/counteragent.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/remote/mas/worker/countertask.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/remote/remote_a.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/remote/remote_b.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/examples/remote/remote_c.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/__init__.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/celulas/__init__.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/celulas/web.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/kernel/__init__.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/kernel/adapter.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/kernel/agent.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/kernel/io/__init__.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/kernel/io/system_file.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/kernel/io/tcp_server.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/kernel/res/__init__.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/kernel/res/__pycache__/__init__.cpython-36.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/kernel/res/__pycache__/__init__.cpython-37.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/kernel/res/__pycache__/__init__.cpython-38.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/kernel/res/__pycache__/__init__.cpython-39.pyc +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/kernel/res/conf.json +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/kernel/util.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/kernel/world.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/mas.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/remote/__init__.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/remote/adm_listener.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/remote/adm_listener_handler.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/remote/exceptions.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/remote/remote_adm.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/remote/remote_adm_handler.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/social/__init__.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/social/collaborative_team.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/social/delegator.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/social/delegator_team.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/social/dialog.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/social/selected_dispatcher_team.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa/social/templates.py +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa.egg-info/dependency_links.txt +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa.egg-info/requires.txt +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/pbesa.egg-info/top_level.txt +0 -0
- {pbesa-4.0.12 → pbesa-4.0.14}/setup.cfg +0 -0
@@ -42,13 +42,13 @@ Clasificación:
|
|
42
42
|
"""
|
43
43
|
|
44
44
|
# Efectua la inferencia del modelo.
|
45
|
-
def derive(service, text) -> any:
|
45
|
+
def derive(service, text, max_tkns=4096) -> any:
|
46
46
|
try:
|
47
47
|
logging.info(f"Procesando: {text}")
|
48
48
|
tmp_work_memory = []
|
49
49
|
prompt = PROMPT % text
|
50
50
|
tmp_work_memory.append({"role": "user", "content": prompt})
|
51
|
-
res = service.generate(tmp_work_memory)
|
51
|
+
res = service.generate(tmp_work_memory, max_tokens=max_tkns)
|
52
52
|
logging.info(f"Respuesta: {res}")
|
53
53
|
if not res or res == "":
|
54
54
|
res = text
|
@@ -27,13 +27,13 @@ Clasificación:
|
|
27
27
|
"""
|
28
28
|
|
29
29
|
# Efectua la inferencia del modelo.
|
30
|
-
def derive(service, text) -> any:
|
30
|
+
def derive(service, text, max_tkns=4096) -> any:
|
31
31
|
try:
|
32
32
|
logging.info(f"Procesando: {text}")
|
33
33
|
tmp_work_memory = []
|
34
34
|
prompt = PROMPT % text
|
35
35
|
tmp_work_memory.append({"role": "user", "content": prompt})
|
36
|
-
res = service.generate(tmp_work_memory)
|
36
|
+
res = service.generate(tmp_work_memory, max_tokens=max_tkns)
|
37
37
|
logging.info(f"Respuesta: {res}")
|
38
38
|
if not res or res == "":
|
39
39
|
res = text
|
@@ -35,12 +35,12 @@ Clasificación:
|
|
35
35
|
"""
|
36
36
|
|
37
37
|
# Efectua la inferencia del modelo.
|
38
|
-
def derive(service, text) -> any:
|
38
|
+
def derive(service, text, max_tkns=4096) -> any:
|
39
39
|
try:
|
40
40
|
tmp_work_memory = []
|
41
41
|
prompt = PROMPT % text
|
42
42
|
tmp_work_memory.append({"role": "user", "content": prompt})
|
43
|
-
res = service.generate(tmp_work_memory)
|
43
|
+
res = service.generate(tmp_work_memory, max_tokens=max_tkns)
|
44
44
|
logging.info(f"Procesando: {text}")
|
45
45
|
logging.info(f"Respuesta: {res}")
|
46
46
|
if not res or res == "":
|
@@ -26,13 +26,13 @@ DEMANDA FORMATEADA:
|
|
26
26
|
"""
|
27
27
|
|
28
28
|
# Efectua la inferencia del modelo.
|
29
|
-
def derive(service, formato, text) -> any:
|
29
|
+
def derive(service, formato, text, max_tkns=4096) -> any:
|
30
30
|
try:
|
31
31
|
logging.info(f"Procesando: {text}")
|
32
32
|
tmp_work_memory = []
|
33
33
|
prompt = PROMPT % (formato, text)
|
34
34
|
tmp_work_memory.append({"role": "user", "content": prompt})
|
35
|
-
res = service.generate(tmp_work_memory)
|
35
|
+
res = service.generate(tmp_work_memory, max_tokens=max_tkns)
|
36
36
|
logging.info(f"Respuesta: {res}")
|
37
37
|
if not res or res == "":
|
38
38
|
res = text
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import logging
|
2
|
+
|
3
|
+
PROMPT = """
|
4
|
+
Eres un clasificador de preguntas. Tu tarea es analizar el siguiente texto y determinar si contiene preguntas.
|
5
|
+
|
6
|
+
Responde únicamente con una de estas opciones:
|
7
|
+
- CONTIENE
|
8
|
+
- NO_CONTIENE
|
9
|
+
|
10
|
+
**Definición de pregunta**: Una pregunta es una expresión que busca obtener información o aclaración sobre un tema específico. Esto incluye preguntas directas, indirectas y retóricas. No se consideran preguntas las afirmaciones o comentarios que no buscan respuesta.
|
11
|
+
|
12
|
+
Ejemplos:
|
13
|
+
- "Hola, ¿cómo estás?" → CONTIENE
|
14
|
+
- "Buenos días, equipo" → NO_CONTIENE
|
15
|
+
- "¿Cómo se hace este análisis?" → CONTIENE
|
16
|
+
- "Ey, qué más" → NO_CONTIENE
|
17
|
+
- "Necesito ayuda con el código" → NO_CONTIENE
|
18
|
+
- "Saludos" → NO_CONTIENE
|
19
|
+
|
20
|
+
Texto: "%s"
|
21
|
+
|
22
|
+
Clasificación:
|
23
|
+
"""
|
24
|
+
|
25
|
+
# Efectua la inferencia del modelo.
|
26
|
+
def derive(service, text, max_tkns=4096) -> any:
|
27
|
+
try:
|
28
|
+
logging.info(f"Procesando: {text}")
|
29
|
+
tmp_work_memory = []
|
30
|
+
prompt = PROMPT % text
|
31
|
+
tmp_work_memory.append({"role": "user", "content": prompt})
|
32
|
+
res = service.generate(tmp_work_memory, max_tokens=max_tkns)
|
33
|
+
logging.info(f"Respuesta: {res}")
|
34
|
+
if not res or res == "":
|
35
|
+
res = text
|
36
|
+
logging.warning(f"No obtener una respuesta.")
|
37
|
+
return res
|
38
|
+
except Exception as e:
|
39
|
+
logging.error(f"Error al procesar: {text}")
|
40
|
+
logging.error(e)
|
41
|
+
return None
|
@@ -23,13 +23,13 @@ Clasificación:
|
|
23
23
|
"""
|
24
24
|
|
25
25
|
# Efectua la inferencia del modelo.
|
26
|
-
def derive(service, text) -> any:
|
26
|
+
def derive(service, text, max_tkns=4096) -> any:
|
27
27
|
try:
|
28
28
|
logging.info(f"Procesando: {text}")
|
29
29
|
tmp_work_memory = []
|
30
30
|
prompt = PROMPT % text
|
31
31
|
tmp_work_memory.append({"role": "user", "content": prompt})
|
32
|
-
res = service.generate(tmp_work_memory)
|
32
|
+
res = service.generate(tmp_work_memory, max_tokens=max_tkns)
|
33
33
|
logging.info(f"Respuesta: {res}")
|
34
34
|
if not res or res == "":
|
35
35
|
res = text
|