Alptraum commited on
Commit
f8c5079
·
verified ·
1 Parent(s): 1be3043

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -2
app.py CHANGED
@@ -12,7 +12,16 @@ from Gradio_UI import GradioUI
12
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
13
  @tool
14
 
15
- def fetch_movie_from_omdb(genre: str):
 
 
 
 
 
 
 
 
 
16
  api_key = "59341a1e"
17
  url = f"http://www.omdbapi.com/?i=tt3896198&apikey=59341a1e"
18
 
@@ -31,6 +40,8 @@ def fetch_movie_from_omdb(genre: str):
31
  "genre": genre,
32
  "imdb_id": best_movie["imdbID"]
33
  }
 
 
34
  def get_movie_recommendation(mood: str, location: str, user_preferences: dict) -> dict:
35
  """
36
  Recommend a movie based on the user's mood, current weather at the given location,
@@ -139,7 +150,7 @@ with open("prompts.yaml", 'r') as stream:
139
 
140
  agent = CodeAgent(
141
  model=model,
142
- tools=[final_answer, get_current_time_in_timezone, image_generation_tool,get_movie_recommendation], ## add your tools here (don't remove final answer)
143
  max_steps=6,
144
  verbosity_level=1,
145
  grammar=None,
 
12
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
13
  @tool
14
 
15
+ def fetch_movie_from_omdb(genre: str) -> dict:
16
+ """
17
+ Fetches a movie recommendation from the OMDb API based on a given genre.
18
+
19
+ Parameters:
20
+ - genre (str): The movie genre (e.g., Comedy, Drama, Sci-Fi).
21
+
22
+ Returns:
23
+ - dict: A dictionary containing movie details such as title, year, and IMDb ID.
24
+ """
25
  api_key = "59341a1e"
26
  url = f"http://www.omdbapi.com/?i=tt3896198&apikey=59341a1e"
27
 
 
40
  "genre": genre,
41
  "imdb_id": best_movie["imdbID"]
42
  }
43
+ @tool
44
+
45
  def get_movie_recommendation(mood: str, location: str, user_preferences: dict) -> dict:
46
  """
47
  Recommend a movie based on the user's mood, current weather at the given location,
 
150
 
151
  agent = CodeAgent(
152
  model=model,
153
+ tools=[final_answer, get_current_time_in_timezone, image_generation_tool,get_movie_recommendation, fetch_movie_from_omdb], ## add your tools here (don't remove final answer)
154
  max_steps=6,
155
  verbosity_level=1,
156
  grammar=None,