cloud93n commited on
Commit
0b95bdf
·
verified ·
1 Parent(s): b5d7e28

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -4,14 +4,16 @@ import gradio as gr
4
  import requests
5
  import inspect
6
  import pandas as pd
7
- from smolagents import CodeAgent, DuckDuckGoSearchTool, PythonInterpreterTool, HfApiModel
8
  from huggingface_hub import login
9
 
10
  # (Keep Constants as is)
11
  # --- Constants ---
12
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
13
- HF_TOKEN = os.getenv("HF_TOKEN")
14
- login(HF_TOKEN)
 
 
15
 
16
  # --- Basic Agent Definition ---
17
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
@@ -19,7 +21,7 @@ class BasicAgent:
19
  def __init__(self):
20
  print("BasicAgent initialized.")
21
  # Set up model
22
- self.model = HfApiModel()
23
 
24
  # Initialize custom tools
25
  self.tools = [
 
4
  import requests
5
  import inspect
6
  import pandas as pd
7
+ from smolagents import CodeAgent, DuckDuckGoSearchTool, PythonInterpreterTool, HfApiModel, LiteLLMModel
8
  from huggingface_hub import login
9
 
10
  # (Keep Constants as is)
11
  # --- Constants ---
12
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
13
+ #HF_TOKEN = os.getenv("HF_TOKEN")
14
+ #login(HF_TOKEN)
15
+ model = LiteLLMModel(model_id="models/gemini-2.0-flash-lite",
16
+ api_key=os.getenv("GEMINI_API_KEY"))
17
 
18
  # --- Basic Agent Definition ---
19
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
 
21
  def __init__(self):
22
  print("BasicAgent initialized.")
23
  # Set up model
24
+ self.model = model
25
 
26
  # Initialize custom tools
27
  self.tools = [