Update app.py
Browse files
app.py
CHANGED
|
@@ -18,9 +18,10 @@ class BasicAgent:
|
|
| 18 |
def __init__(self):
|
| 19 |
print("BasicAgent initialized.")
|
| 20 |
self.model = LiteLLMModel(
|
| 21 |
-
"llama-3.
|
| 22 |
api_base="https://api.groq.com/openai/v1",
|
| 23 |
api_key=GROQ_KEY,
|
|
|
|
| 24 |
)
|
| 25 |
self.model.flatten_messages_as_text = True
|
| 26 |
|
|
@@ -31,8 +32,7 @@ class BasicAgent:
|
|
| 31 |
|
| 32 |
def __call__(self, question: str) -> str:
|
| 33 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
| 34 |
-
response = self.agent.run(question)
|
| 35 |
-
print(response)
|
| 36 |
return response
|
| 37 |
|
| 38 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
@@ -92,7 +92,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 92 |
for item in questions_data:
|
| 93 |
task_id = item.get("task_id")
|
| 94 |
question_text = item.get("question")
|
| 95 |
-
time.sleep(
|
| 96 |
if not task_id or question_text is None:
|
| 97 |
print(f"Skipping item with missing task_id or question: {item}")
|
| 98 |
continue
|
|
|
|
| 18 |
def __init__(self):
|
| 19 |
print("BasicAgent initialized.")
|
| 20 |
self.model = LiteLLMModel(
|
| 21 |
+
"llama-3.3-70b-versatile",
|
| 22 |
api_base="https://api.groq.com/openai/v1",
|
| 23 |
api_key=GROQ_KEY,
|
| 24 |
+
verbosity_level=1
|
| 25 |
)
|
| 26 |
self.model.flatten_messages_as_text = True
|
| 27 |
|
|
|
|
| 32 |
|
| 33 |
def __call__(self, question: str) -> str:
|
| 34 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
| 35 |
+
response = self.agent.run(question, max_steps=3)
|
|
|
|
| 36 |
return response
|
| 37 |
|
| 38 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
|
|
| 92 |
for item in questions_data:
|
| 93 |
task_id = item.get("task_id")
|
| 94 |
question_text = item.get("question")
|
| 95 |
+
time.sleep(30)
|
| 96 |
if not task_id or question_text is None:
|
| 97 |
print(f"Skipping item with missing task_id or question: {item}")
|
| 98 |
continue
|