Added fix to prompt and profile passing
Browse files
app.py
CHANGED
|
@@ -45,7 +45,7 @@ class BasicAgent:
|
|
| 45 |
def __call__(self, question: str) -> str:
|
| 46 |
print(f"\nAgent (smolagents) received question (first 100 chars): {question[:100]}...")
|
| 47 |
try:
|
| 48 |
-
prompt = f"Answer the following question without
|
| 49 |
response = self.agent_executor.run(question)
|
| 50 |
|
| 51 |
print(f"Agent (smolagents) returning answer (first 50 chars): {str(response)[:50]}...")
|
|
@@ -65,6 +65,10 @@ async def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
| 65 |
questions_url = f"{api_url}/questions"
|
| 66 |
submit_url = f"{api_url}/submit"
|
| 67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
| 69 |
try:
|
| 70 |
agent = BasicAgent()
|
|
|
|
| 45 |
def __call__(self, question: str) -> str:
|
| 46 |
print(f"\nAgent (smolagents) received question (first 100 chars): {question[:100]}...")
|
| 47 |
try:
|
| 48 |
+
prompt = f"Answer the following question without formatting, reasoning or explanation. ${question}"
|
| 49 |
response = self.agent_executor.run(question)
|
| 50 |
|
| 51 |
print(f"Agent (smolagents) returning answer (first 50 chars): {str(response)[:50]}...")
|
|
|
|
| 65 |
questions_url = f"{api_url}/questions"
|
| 66 |
submit_url = f"{api_url}/submit"
|
| 67 |
|
| 68 |
+
if profile:
|
| 69 |
+
username= f"{profile.username}"
|
| 70 |
+
print(f"User logged in: {username}")
|
| 71 |
+
|
| 72 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
| 73 |
try:
|
| 74 |
agent = BasicAgent()
|