Update app.py to invoke Agent answer
Browse files
app.py
CHANGED
|
@@ -36,7 +36,24 @@ class BasicAgent:
|
|
| 36 |
|
| 37 |
with open("prompts.yaml", 'r') as stream:
|
| 38 |
prompt_templates = yaml.safe_load(stream)
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
return fixed_answer
|
| 41 |
|
| 42 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
|
|
| 36 |
|
| 37 |
with open("prompts.yaml", 'r') as stream:
|
| 38 |
prompt_templates = yaml.safe_load(stream)
|
| 39 |
+
|
| 40 |
+
agent = CodeAgent(
|
| 41 |
+
model=model,
|
| 42 |
+
# tools=[DuckDuckGoSearchTool()],
|
| 43 |
+
tools=[],
|
| 44 |
+
max_steps=5,
|
| 45 |
+
verbosity_level=1,
|
| 46 |
+
grammar=None,
|
| 47 |
+
planning_interval=None,
|
| 48 |
+
name=None,
|
| 49 |
+
description=None,
|
| 50 |
+
prompt_templates=prompt_templates
|
| 51 |
+
)
|
| 52 |
+
|
| 53 |
+
agent_answer = agent.invoke(question)
|
| 54 |
+
|
| 55 |
+
print(f"Agent Answer: {agent_answer})
|
| 56 |
+
|
| 57 |
return fixed_answer
|
| 58 |
|
| 59 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|