Spaces:
Sleeping
Sleeping
update gemini api key
Browse files- geminiAgent.py +3 -3
- requirements.txt +3 -1
geminiAgent.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
|
|
| 1 |
import time
|
| 2 |
import operator
|
| 3 |
-
from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel, load_tool, tool, WikipediaSearchTool, LiteLLMModel
|
| 4 |
import datetime
|
| 5 |
import requests
|
| 6 |
import pytz
|
|
@@ -8,7 +9,6 @@ import yaml
|
|
| 8 |
from tools.final_answer import FinalAnswerTool
|
| 9 |
from tools.web_search import DuckDuckGoSearchTool
|
| 10 |
from tools.visit_webpage import VisitWebpageTool
|
| 11 |
-
import utils
|
| 12 |
import pandas as pd
|
| 13 |
import pytesseract
|
| 14 |
import openpyxl
|
|
@@ -16,7 +16,7 @@ from PIL import Image
|
|
| 16 |
|
| 17 |
def create_agent():
|
| 18 |
return CodeAgent(
|
| 19 |
-
model=LiteLLMModel(model_id="
|
| 20 |
tools=[DuckDuckGoSearchTool(), WikipediaSearchTool(), VisitWebpageTool(), DownloadTaskAttachmentTool()],
|
| 21 |
add_base_tools=True,
|
| 22 |
additional_authorized_imports=['pandas','numpy','csv','subprocess', 'exec']
|
|
|
|
| 1 |
+
import os
|
| 2 |
import time
|
| 3 |
import operator
|
| 4 |
+
from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel, load_tool, tool, WikipediaSearchTool, LiteLLMModel, DownloadTaskAttachmentTool
|
| 5 |
import datetime
|
| 6 |
import requests
|
| 7 |
import pytz
|
|
|
|
| 9 |
from tools.final_answer import FinalAnswerTool
|
| 10 |
from tools.web_search import DuckDuckGoSearchTool
|
| 11 |
from tools.visit_webpage import VisitWebpageTool
|
|
|
|
| 12 |
import pandas as pd
|
| 13 |
import pytesseract
|
| 14 |
import openpyxl
|
|
|
|
| 16 |
|
| 17 |
def create_agent():
|
| 18 |
return CodeAgent(
|
| 19 |
+
model=LiteLLMModel(model_id="gemini/gemini-2.0-flash-lite-001", api_key=os.getenv("GEMINI_KEY")),
|
| 20 |
tools=[DuckDuckGoSearchTool(), WikipediaSearchTool(), VisitWebpageTool(), DownloadTaskAttachmentTool()],
|
| 21 |
add_base_tools=True,
|
| 22 |
additional_authorized_imports=['pandas','numpy','csv','subprocess', 'exec']
|
requirements.txt
CHANGED
|
@@ -1,4 +1,6 @@
|
|
| 1 |
gradio
|
| 2 |
requests
|
| 3 |
pytesseract
|
| 4 |
-
PIL
|
|
|
|
|
|
|
|
|
| 1 |
gradio
|
| 2 |
requests
|
| 3 |
pytesseract
|
| 4 |
+
PIL
|
| 5 |
+
openpyxl
|
| 6 |
+
pytz
|