Spaces:
Sleeping
Sleeping
Initial commit with full functionality extend app req tools
Browse files- app.py +1 -2
- tools/final_answer.py +5 -0
app.py
CHANGED
@@ -6,8 +6,7 @@ from Gradio_UI import GradioUI
|
|
6 |
|
7 |
def create_agent():
|
8 |
# Initialize the final answer tool
|
9 |
-
final_answer = FinalAnswerTool(
|
10 |
-
|
11 |
# Load prompt templates
|
12 |
with open("prompts.yaml", 'r') as stream:
|
13 |
prompt_templates = yaml.safe_load(stream)
|
|
|
6 |
|
7 |
def create_agent():
|
8 |
# Initialize the final answer tool
|
9 |
+
final_answer = FinalAnswerTool()
|
|
|
10 |
# Load prompt templates
|
11 |
with open("prompts.yaml", 'r') as stream:
|
12 |
prompt_templates = yaml.safe_load(stream)
|
tools/final_answer.py
CHANGED
@@ -6,6 +6,11 @@ class FinalAnswerTool(Tool):
|
|
6 |
"""Tool for providing final answers to user queries."""
|
7 |
|
8 |
name = "final_answer"
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
def __call__(self, answer: str) -> str:
|
11 |
"""Process and return the final answer.
|
|
|
6 |
"""Tool for providing final answers to user queries."""
|
7 |
|
8 |
name = "final_answer"
|
9 |
+
description = "Tool for providing the final answer to the agent's task"
|
10 |
+
|
11 |
+
def __init__(self, description: Optional[str] = None):
|
12 |
+
super().__init__()
|
13 |
+
self.description = description or self.description
|
14 |
|
15 |
def __call__(self, answer: str) -> str:
|
16 |
"""Process and return the final answer.
|