llamasrock commited on
Commit
0d43e7d
·
verified ·
1 Parent(s): b70ceef

Update app.py

Browse files

moved get_file definition to utilities

Files changed (1) hide show
  1. app.py +2 -15
app.py CHANGED
@@ -4,13 +4,14 @@ import requests
4
  import inspect
5
  import pandas as pd
6
  import os
7
- from smolagents import LiteLLMModel, CodeAgent, tool, GoogleSearchTool
8
  from google import genai
9
  from google.genai import types
10
  import asyncio
11
  import requests
12
  import typing
13
  from typing import IO
 
14
 
15
  # (Keep Constants as is)
16
  # --- Constants ---
@@ -22,20 +23,6 @@ GEMINI_API_KEY = os.getenv("Gemini_API_key")
22
  # Agent capabilities required: Search the web, listen to audio recordings, watch YouTube videos (process the footage, not the transcript), work with Excel spreadsheets
23
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
24
 
25
- @tool
26
- def get_file(task_id: str) -> IO:
27
- '''
28
- Downloads the file associated with the given task_id, if one exists and is mapped.
29
- If the question mentions an attachment, use this function.
30
- Args:
31
- task_id: Id of the question.
32
- Returns:
33
- The file associated with the question.
34
- '''
35
- file_request = requests.get(url=f'https://agents-course-unit4-scoring.hf.space/files/{task_id}')
36
- file_request.raise_for_status()
37
-
38
- return file_request
39
 
40
  class BasicAgent:
41
  def __init__(self):
 
4
  import inspect
5
  import pandas as pd
6
  import os
7
+ from smolagents import LiteLLMModel, CodeAgent, GoogleSearchTool
8
  from google import genai
9
  from google.genai import types
10
  import asyncio
11
  import requests
12
  import typing
13
  from typing import IO
14
+ from utilities import get_file
15
 
16
  # (Keep Constants as is)
17
  # --- Constants ---
 
23
  # Agent capabilities required: Search the web, listen to audio recordings, watch YouTube videos (process the footage, not the transcript), work with Excel spreadsheets
24
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
 
27
  class BasicAgent:
28
  def __init__(self):