fixed again
Browse files- app_agent_config.py +1 -0
- controller.py +3 -1
- view/app_sidebar.py +1 -1
app_agent_config.py
CHANGED
@@ -6,6 +6,7 @@ class AgentConfig:
|
|
6 |
def __init__(self):
|
7 |
self.url_endpoint = ""
|
8 |
self.tool_checkboxes = []
|
|
|
9 |
self.image = []
|
10 |
self.document = ""
|
11 |
self.log_enabled = False
|
|
|
6 |
def __init__(self):
|
7 |
self.url_endpoint = ""
|
8 |
self.tool_checkboxes = []
|
9 |
+
self.s_tool_checkboxes = []
|
10 |
self.image = []
|
11 |
self.document = ""
|
12 |
self.log_enabled = False
|
controller.py
CHANGED
@@ -19,7 +19,7 @@ class Controller:
|
|
19 |
image = []
|
20 |
def handle_submission(self, user_message ):
|
21 |
log_response("User input \n {}".format(user_message))
|
22 |
-
log_response("selected_tools \n {}".format(self.agent_config.
|
23 |
log_response("url_endpoint \n {}".format(self.agent_config.url_endpoint))
|
24 |
log_response("document \n {}".format(self.agent_config.document))
|
25 |
log_response("image \n {}".format(self.agent_config.image))
|
@@ -31,6 +31,8 @@ class Controller:
|
|
31 |
input_params={"max_new_tokens": 192},
|
32 |
)
|
33 |
|
|
|
|
|
34 |
angent_respone = agent.chat(user_message,document=self.agent_config.document,image=self.agent_config.image, context = self.agent_config.context)
|
35 |
|
36 |
log_response("Agent Response\n {}".format(angent_respone))
|
|
|
19 |
image = []
|
20 |
def handle_submission(self, user_message ):
|
21 |
log_response("User input \n {}".format(user_message))
|
22 |
+
log_response("selected_tools \n {}".format(self.agent_config.s_tool_checkboxes))
|
23 |
log_response("url_endpoint \n {}".format(self.agent_config.url_endpoint))
|
24 |
log_response("document \n {}".format(self.agent_config.document))
|
25 |
log_response("image \n {}".format(self.agent_config.image))
|
|
|
31 |
input_params={"max_new_tokens": 192},
|
32 |
)
|
33 |
|
34 |
+
selected_tools = [self.agent_config.tool_loader.tools[idx] for idx, checkbox in enumerate(self.agent_config.s_tool_checkboxe) if checkbox]
|
35 |
+
|
36 |
angent_respone = agent.chat(user_message,document=self.agent_config.document,image=self.agent_config.image, context = self.agent_config.context)
|
37 |
|
38 |
log_response("Agent Response\n {}".format(angent_respone))
|
view/app_sidebar.py
CHANGED
@@ -20,7 +20,7 @@ def configure(agent_config):
|
|
20 |
|
21 |
agent_config.log_enabled = st.checkbox("Enable Logging")
|
22 |
|
23 |
-
agent_config.
|
24 |
|
25 |
def content_and_context(agent_config):
|
26 |
agent_config.context = st.text_area("Context")
|
|
|
20 |
|
21 |
agent_config.log_enabled = st.checkbox("Enable Logging")
|
22 |
|
23 |
+
agent_config.s_tool_checkboxes = [st.checkbox(f"{tool.name} --- {tool.description} ") for tool in agent_config.tool_loader.tools]
|
24 |
|
25 |
def content_and_context(agent_config):
|
26 |
agent_config.context = st.text_area("Context")
|