Commit ·
f6d3502
1
Parent(s): f5bf6b6
switch back to flash and add sleep
Browse files
app.py
CHANGED
|
@@ -5,6 +5,7 @@ import inspect
|
|
| 5 |
import pandas as pd
|
| 6 |
import asyncio
|
| 7 |
import sys
|
|
|
|
| 8 |
from llama_index.llms.google_genai import GoogleGenAI
|
| 9 |
from llama_index.tools.duckduckgo import DuckDuckGoSearchToolSpec
|
| 10 |
from llama_index.core.agent.workflow import AgentWorkflow
|
|
@@ -27,7 +28,7 @@ class BasicAgent:
|
|
| 27 |
raise ValueError("GEMINI_API_KEY not set in environment variables.")
|
| 28 |
|
| 29 |
self.model = GoogleGenAI(
|
| 30 |
-
model="gemini-2.0-flash
|
| 31 |
api_key=gemini_api_key
|
| 32 |
)
|
| 33 |
|
|
@@ -121,6 +122,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 121 |
answers_payload = []
|
| 122 |
print(f"Running agent on {len(questions_data)} questions...")
|
| 123 |
for item in questions_data:
|
|
|
|
| 124 |
task_id = item.get("task_id")
|
| 125 |
question_text = item.get("question")
|
| 126 |
file_name = item.get("file_name")
|
|
|
|
| 5 |
import pandas as pd
|
| 6 |
import asyncio
|
| 7 |
import sys
|
| 8 |
+
import time
|
| 9 |
from llama_index.llms.google_genai import GoogleGenAI
|
| 10 |
from llama_index.tools.duckduckgo import DuckDuckGoSearchToolSpec
|
| 11 |
from llama_index.core.agent.workflow import AgentWorkflow
|
|
|
|
| 28 |
raise ValueError("GEMINI_API_KEY not set in environment variables.")
|
| 29 |
|
| 30 |
self.model = GoogleGenAI(
|
| 31 |
+
model="gemini-2.0-flash",
|
| 32 |
api_key=gemini_api_key
|
| 33 |
)
|
| 34 |
|
|
|
|
| 122 |
answers_payload = []
|
| 123 |
print(f"Running agent on {len(questions_data)} questions...")
|
| 124 |
for item in questions_data:
|
| 125 |
+
time.sleep(5) # To avoid rate limiting issues, you can adjust this delay as needed
|
| 126 |
task_id = item.get("task_id")
|
| 127 |
question_text = item.get("question")
|
| 128 |
file_name = item.get("file_name")
|