Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -126,7 +126,7 @@ def handle_input(user_prompt, image=None, audio=None, websearch=False, document=
|
|
126 |
tools = [
|
127 |
Tool(
|
128 |
name="Image",
|
129 |
-
func=ImageGeneration(),
|
130 |
description="Useful for generating images based on text descriptions"
|
131 |
),
|
132 |
]
|
@@ -134,7 +134,7 @@ def handle_input(user_prompt, image=None, audio=None, websearch=False, document=
|
|
134 |
# Add the numpy tool, but with a more specific description
|
135 |
tools.append(Tool(
|
136 |
name="Calculator",
|
137 |
-
func=NumpyCodeCalculator(),
|
138 |
description="Useful only for performing numerical computations, not for general searches"
|
139 |
))
|
140 |
|
@@ -142,7 +142,7 @@ def handle_input(user_prompt, image=None, audio=None, websearch=False, document=
|
|
142 |
if websearch:
|
143 |
tools.append(Tool(
|
144 |
name="Web",
|
145 |
-
func=WebSearch(),
|
146 |
description="Useful for advanced web searching beyond general information"
|
147 |
))
|
148 |
|
@@ -150,7 +150,7 @@ def handle_input(user_prompt, image=None, audio=None, websearch=False, document=
|
|
150 |
if document:
|
151 |
tools.append(Tool(
|
152 |
name="Document",
|
153 |
-
func=DocumentQuestionAnswering(document),
|
154 |
description="Useful for answering questions about a specific document"
|
155 |
))
|
156 |
|
|
|
126 |
tools = [
|
127 |
Tool(
|
128 |
name="Image",
|
129 |
+
func=ImageGeneration(), # Pass the class instance, not ImageGeneration()._run
|
130 |
description="Useful for generating images based on text descriptions"
|
131 |
),
|
132 |
]
|
|
|
134 |
# Add the numpy tool, but with a more specific description
|
135 |
tools.append(Tool(
|
136 |
name="Calculator",
|
137 |
+
func=NumpyCodeCalculator(), # Pass the class instance, not NumpyCodeCalculator()._run
|
138 |
description="Useful only for performing numerical computations, not for general searches"
|
139 |
))
|
140 |
|
|
|
142 |
if websearch:
|
143 |
tools.append(Tool(
|
144 |
name="Web",
|
145 |
+
func=WebSearch(), # Pass the class instance, not WebSearch()._run
|
146 |
description="Useful for advanced web searching beyond general information"
|
147 |
))
|
148 |
|
|
|
150 |
if document:
|
151 |
tools.append(Tool(
|
152 |
name="Document",
|
153 |
+
func=DocumentQuestionAnswering(document), # This is already correct
|
154 |
description="Useful for answering questions about a specific document"
|
155 |
))
|
156 |
|