Chris4K commited on
Commit
e8ab34d
·
verified ·
1 Parent(s): e58825b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -82,10 +82,11 @@ def handle_submission():
82
  # Get the user's message and the selected tools
83
  #message = st.text_input("Enter your message:", "")
84
 
85
- # selected_tools = []
86
- # for tool, checkbox in tool_checkboxes:
87
- # if checkbox:
88
- # selected_tools.append(tool)
 
89
 
90
  #selected_tools = [tool for tool, checkbox in tool_checkboxes]
91
 
@@ -93,8 +94,8 @@ def handle_submission():
93
  agent = CustomHfAgent(url_endpoint="https://api-inference.huggingface.co/models/bigcode/starcoder", token=os.environ['HF_token'])
94
 
95
  # Run the agent with the user's message and selected tools
96
- #response = agent.run(message, tools=selected_tools)
97
- response = agent.chat(message)
98
 
99
  print(response)
100
 
 
82
  # Get the user's message and the selected tools
83
  #message = st.text_input("Enter your message:", "")
84
 
85
+ selected_tools = []
86
+ for tool, checkbox in tool_checkboxes:
87
+ if checkbox:
88
+ print("checked {tool.name}")
89
+ selected_tools.append(tool)
90
 
91
  #selected_tools = [tool for tool, checkbox in tool_checkboxes]
92
 
 
94
  agent = CustomHfAgent(url_endpoint="https://api-inference.huggingface.co/models/bigcode/starcoder", token=os.environ['HF_token'])
95
 
96
  # Run the agent with the user's message and selected tools
97
+ response = agent.run(message, tools=selected_tools)
98
+ #response = agent.chat(message)
99
 
100
  print(response)
101