Spaces:
Sleeping
Sleeping
Pycrolis
commited on
Commit
·
a8fbc0f
1
Parent(s):
281ee36
feat: use ShrewdAgent instead of BasicAgent for better answers
Browse files
app.py
CHANGED
@@ -1,8 +1,10 @@
|
|
1 |
import os
|
|
|
2 |
import gradio as gr
|
3 |
-
import requests
|
4 |
-
import inspect
|
5 |
import pandas as pd
|
|
|
|
|
|
|
6 |
|
7 |
# (Keep Constants as is)
|
8 |
# --- Constants ---
|
@@ -38,13 +40,13 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
38 |
questions_url = f"{api_url}/questions"
|
39 |
submit_url = f"{api_url}/submit"
|
40 |
|
41 |
-
# 1. Instantiate Agent (
|
42 |
try:
|
43 |
-
agent =
|
44 |
except Exception as e:
|
45 |
print(f"Error instantiating agent: {e}")
|
46 |
return f"Error initializing agent: {e}", None
|
47 |
-
# In the case of an app running as a hugging Face space, this link points toward your codebase (
|
48 |
agent_code = f"https://huggingface.co/spaces/{space_id}/tree/main"
|
49 |
print(agent_code)
|
50 |
|
|
|
1 |
import os
|
2 |
+
|
3 |
import gradio as gr
|
|
|
|
|
4 |
import pandas as pd
|
5 |
+
import requests
|
6 |
+
|
7 |
+
from ShrewdAgent import ShrewdAgent
|
8 |
|
9 |
# (Keep Constants as is)
|
10 |
# --- Constants ---
|
|
|
40 |
questions_url = f"{api_url}/questions"
|
41 |
submit_url = f"{api_url}/submit"
|
42 |
|
43 |
+
# 1. Instantiate Agent (modify this part to create your agent)
|
44 |
try:
|
45 |
+
agent = ShrewdAgent()
|
46 |
except Exception as e:
|
47 |
print(f"Error instantiating agent: {e}")
|
48 |
return f"Error initializing agent: {e}", None
|
49 |
+
# In the case of an app running as a hugging Face space, this link points toward your codebase (usefull for others so please keep it public)
|
50 |
agent_code = f"https://huggingface.co/spaces/{space_id}/tree/main"
|
51 |
print(agent_code)
|
52 |
|