pbesa 4.0.3__tar.gz → 4.0.4__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.3 → pbesa-4.0.4}/PKG-INFO +1 -1
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/cognitive.py +17 -1
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/social/collaborative_team.py +32 -3
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa.egg-info/PKG-INFO +1 -1
- {pbesa-4.0.3 → pbesa-4.0.4}/setup.py +1 -1
- {pbesa-4.0.3 → pbesa-4.0.4}/.gitignore +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/LICENSE +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/LICENSE.txt +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/MANIFEST +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/README.md +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/db.sqlite3 +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/helloworld/__init__.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/helloworld/__pycache__/__init__.cpython-36.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/helloworld/__pycache__/pbesa.cpython-36.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/helloworld/__pycache__/settings.cpython-36.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/helloworld/__pycache__/urls.cpython-36.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/helloworld/__pycache__/wsgi.cpython-36.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/helloworld/asgi.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/helloworld/pbesa.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/helloworld/settings.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/helloworld/urls.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/helloworld/wsgi.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/manage.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/__init__.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/__pycache__/__init__.cpython-36.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/__pycache__/admin.cpython-36.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/__pycache__/apps.cpython-36.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/__pycache__/models.cpython-36.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/__pycache__/urls.cpython-36.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/__pycache__/views.cpython-36.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/admin.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/apps.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/mas/controller/__pycache__/translatecontroller.cpython-36.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/mas/controller/__pycache__/translatedelegate.cpython-36.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/mas/controller/__pycache__/translateresponse.cpython-36.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/mas/controller/translatecontroller.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/mas/controller/translatedelegate.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/mas/controller/translateresponse.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/mas/worker/__pycache__/translatetask.cpython-36.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/mas/worker/__pycache__/workeragent.cpython-36.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/mas/worker/translatetask.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/mas/worker/workeragent.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/migrations/__init__.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/migrations/__pycache__/__init__.cpython-36.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/models.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/tests.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/urls.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/views.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/remote/mas/controller/__pycache__/countercontroller.cpython-36.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/remote/mas/controller/__pycache__/counterdelegate.cpython-36.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/remote/mas/controller/__pycache__/counterresponse.cpython-36.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/remote/mas/controller/__pycache__/translatecontroller.cpython-36.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/remote/mas/controller/__pycache__/translatedelegate.cpython-36.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/remote/mas/controller/__pycache__/translateresponse.cpython-36.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/remote/mas/controller/countercontroller.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/remote/mas/controller/counterdelegate.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/remote/mas/controller/counterresponse.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/remote/mas/worker/__pycache__/counteragent.cpython-36.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/remote/mas/worker/__pycache__/countertask.cpython-36.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/remote/mas/worker/__pycache__/translatetask.cpython-36.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/remote/mas/worker/__pycache__/workeragent.cpython-36.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/remote/mas/worker/counteragent.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/remote/mas/worker/countertask.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/remote/remote_a.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/remote/remote_b.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/examples/remote/remote_c.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/__init__.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/kernel/__init__.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/kernel/adapter.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/kernel/agent.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/kernel/io/__init__.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/kernel/io/system_file.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/kernel/io/tcp_server.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/kernel/res/__init__.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/kernel/res/__pycache__/__init__.cpython-36.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/kernel/res/__pycache__/__init__.cpython-37.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/kernel/res/__pycache__/__init__.cpython-38.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/kernel/res/__pycache__/__init__.cpython-39.pyc +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/kernel/res/conf.json +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/kernel/util.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/kernel/world.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/mas.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/models.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/remote/__init__.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/remote/adm_listener.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/remote/adm_listener_handler.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/remote/exceptions.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/remote/remote_adm.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/remote/remote_adm_handler.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/social/__init__.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/social/delegator.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/social/delegator_team.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/social/dialog.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/social/dispatcher_team.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/social/prompts.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/social/selected_dispatcher_team.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/social/templates.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa/social/worker.py +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa.egg-info/SOURCES.txt +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa.egg-info/dependency_links.txt +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa.egg-info/requires.txt +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/pbesa.egg-info/top_level.txt +0 -0
- {pbesa-4.0.3 → pbesa-4.0.4}/setup.cfg +0 -0
@@ -466,6 +466,8 @@ class Dialog(ABC):
|
|
466
466
|
# Define deep
|
467
467
|
self.__deep_count = 0
|
468
468
|
self.__deep_limit = 3
|
469
|
+
# Define knowledge
|
470
|
+
self.knowledge = None
|
469
471
|
|
470
472
|
def setup_world(self):
|
471
473
|
""" Set up model method """
|
@@ -473,10 +475,14 @@ class Dialog(ABC):
|
|
473
475
|
instrucciones = f"Instrucciones:\n{self.__role.description}\n Tu tarea: {self.__role.objective}\n"
|
474
476
|
requisitos = f"Requisitos:\n{self.__role.arquetype}\n"
|
475
477
|
ejemplo = f"Ejemplo:\n{self.__role.example}\n"
|
478
|
+
if self.knowledge:
|
479
|
+
conocimiento = f"Conocimiento:\n{self.knowledge}\n"
|
476
480
|
continuar = "Ahora, evalúa el siguiente caso:\n"
|
477
481
|
self.__work_memory.append({"role": "user", "content": instrucciones})
|
478
482
|
self.__work_memory.append({"role": "user", "content": requisitos})
|
479
483
|
self.__work_memory.append({"role": "user", "content": ejemplo})
|
484
|
+
if self.knowledge:
|
485
|
+
self.__work_memory.append({"role": "user", "content": conocimiento})
|
480
486
|
self.__work_memory.append({"role": "user", "content": continuar})
|
481
487
|
|
482
488
|
def get_model(self) -> any:
|
@@ -721,7 +727,10 @@ class Dialog(ABC):
|
|
721
727
|
self.__work_memory.append({"role": "user", "content": node.text})
|
722
728
|
logging.info(f"-> node team -> envia: {query}")
|
723
729
|
text = self.team_inquiry(node.team, query, node.tool, False)
|
724
|
-
|
730
|
+
logging.info(f"-> node team -> text: {text}")
|
731
|
+
if text:
|
732
|
+
logging.info(f"-> Adicion WM node team -> text: {text}")
|
733
|
+
self.__work_memory.append({"role": "system", "content": text})
|
725
734
|
self.__deep_count += 1
|
726
735
|
if self.__deep_count < self.__deep_limit:
|
727
736
|
return self.transition(owner, node.performative, text, True)
|
@@ -765,3 +774,10 @@ class Dialog(ABC):
|
|
765
774
|
|
766
775
|
logging.info(f"$$$> new_owner: {owner} new_dialog_state: {new_dialog_state}")
|
767
776
|
return owner, new_dialog_state, res, owner
|
777
|
+
|
778
|
+
def set_knowledge(self, knowledge) -> str:
|
779
|
+
""" Set knowledge method
|
780
|
+
:param query: query
|
781
|
+
:return: str
|
782
|
+
"""
|
783
|
+
self.knowledge = knowledge
|
@@ -33,6 +33,7 @@ clear and unified results.
|
|
33
33
|
# Define resources
|
34
34
|
# --------------------------------------------------------
|
35
35
|
|
36
|
+
import logging
|
36
37
|
from threading import Timer
|
37
38
|
from abc import abstractmethod
|
38
39
|
from ..kernel.agent import Agent
|
@@ -94,7 +95,7 @@ class DelegateAction(Action):
|
|
94
95
|
self.agent.reset()
|
95
96
|
self.delegate(data['dto'])
|
96
97
|
|
97
|
-
def
|
98
|
+
def active_timeout(self, time:int) -> None:
|
98
99
|
""" Active timeout
|
99
100
|
@param time: Time
|
100
101
|
"""
|
@@ -109,6 +110,27 @@ class DelegateAction(Action):
|
|
109
110
|
self.adm.send_event(ag, 'task', data)
|
110
111
|
else:
|
111
112
|
raise CollaborativeException('[Warn, toAssign]: The number of data packets exceeds the number of agents')
|
113
|
+
|
114
|
+
def get_list_agents(self) -> list:
|
115
|
+
""" Get list of agents
|
116
|
+
@return: List of agents
|
117
|
+
"""
|
118
|
+
return self.agent.get_free_list()
|
119
|
+
|
120
|
+
def to_individual_assign(self, ag_id, data:any) -> bool:
|
121
|
+
""" Assign data to an agent
|
122
|
+
@param data: Data
|
123
|
+
"""
|
124
|
+
if len(self.agent.get_free_list()) > 0:
|
125
|
+
index = self.agent.get_free_list().index(ag_id)
|
126
|
+
if index >= 0:
|
127
|
+
self.agent.get_free_list().pop(index)
|
128
|
+
self.adm.send_event(ag_id, 'task', data)
|
129
|
+
else:
|
130
|
+
return False
|
131
|
+
else:
|
132
|
+
raise CollaborativeException('[Warn, toAssign]: The number of data packets exceeds the number of agents')
|
133
|
+
return True
|
112
134
|
|
113
135
|
@abstractmethod
|
114
136
|
def delegate(self, data:any) -> None:
|
@@ -129,17 +151,24 @@ class ResponseAction(Action):
|
|
129
151
|
@param data: Event data
|
130
152
|
"""
|
131
153
|
if 'timeout' == data:
|
154
|
+
logging.info('Stopping timeout')
|
132
155
|
results = {}
|
133
156
|
for key, res in self.agent.get_check_dict().items():
|
134
157
|
results[key] = res
|
135
158
|
self.end_of_process(results, True)
|
136
159
|
else:
|
160
|
+
logging.info("Response received")
|
161
|
+
logging.info(data)
|
137
162
|
result = 'None'
|
138
163
|
agentID = data['source']
|
139
|
-
if data['result']:
|
164
|
+
if 'result' in data and data['result']:
|
140
165
|
result = data['result']
|
141
|
-
|
166
|
+
self.agent.get_check_dict()[agentID] = result
|
167
|
+
else:
|
168
|
+
logging.warning(f"No result received for agent {agentID}")
|
169
|
+
self.agent.get_check_dict()[agentID] = "None"
|
142
170
|
if self.check():
|
171
|
+
logging.info("All agents have responded")
|
143
172
|
results = {}
|
144
173
|
for key, res in self.agent.get_check_dict().items():
|
145
174
|
results[key] = res
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/helloworld/__pycache__/pbesa.cpython-36.pyc
RENAMED
File without changes
|
File without changes
|
{pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/helloworld/__pycache__/urls.cpython-36.pyc
RENAMED
File without changes
|
{pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/helloworld/__pycache__/wsgi.cpython-36.pyc
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
|
{pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/__pycache__/__init__.cpython-36.pyc
RENAMED
File without changes
|
{pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/__pycache__/admin.cpython-36.pyc
RENAMED
File without changes
|
{pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/__pycache__/apps.cpython-36.pyc
RENAMED
File without changes
|
{pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/__pycache__/models.cpython-36.pyc
RENAMED
File without changes
|
{pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/__pycache__/urls.cpython-36.pyc
RENAMED
File without changes
|
{pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/__pycache__/views.cpython-36.pyc
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/mas/controller/translatedelegate.py
RENAMED
File without changes
|
{pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/mas/controller/translateresponse.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{pbesa-4.0.3 → pbesa-4.0.4}/examples/django/helloworld/translate/mas/worker/translatetask.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
|
{pbesa-4.0.3 → pbesa-4.0.4}/examples/remote/mas/worker/__pycache__/counteragent.cpython-36.pyc
RENAMED
File without changes
|
{pbesa-4.0.3 → pbesa-4.0.4}/examples/remote/mas/worker/__pycache__/countertask.cpython-36.pyc
RENAMED
File without changes
|
{pbesa-4.0.3 → pbesa-4.0.4}/examples/remote/mas/worker/__pycache__/translatetask.cpython-36.pyc
RENAMED
File without changes
|
{pbesa-4.0.3 → pbesa-4.0.4}/examples/remote/mas/worker/__pycache__/workeragent.cpython-36.pyc
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
|