spdraptor commited on
Commit
ada42e4
·
verified ·
1 Parent(s): 78864c7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -7
app.py CHANGED
@@ -4,6 +4,7 @@ import requests
4
  import pytz
5
  import yaml
6
  from tools.final_answer import FinalAnswerTool
 
7
 
8
  from Gradio_UI import GradioUI
9
 
@@ -19,13 +20,23 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
19
  return "What magic will you build ?"
20
 
21
  @tool
22
- def get_fullform(arg1:str)-> str: #it's import to specify the return type
23
- #Keep this format for the description / args / args description but feel free to modify the tool
24
- """A tool gives ful form of spdraptor
25
- Args:
26
- arg1: shortform
27
  """
28
- return "full form of spdraptor is Sanket Pandurang Dhuri Raptor"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
  @tool
31
  def get_current_time_in_timezone(timezone: str) -> str:
@@ -64,7 +75,7 @@ with open("prompts.yaml", 'r') as stream:
64
 
65
  agent = CodeAgent(
66
  model=model,
67
- tools=[final_answer], ## add your tools here (don't remove final answer)
68
  max_steps=6,
69
  verbosity_level=1,
70
  grammar=None,
 
4
  import pytz
5
  import yaml
6
  from tools.final_answer import FinalAnswerTool
7
+ import inspirational_quotes
8
 
9
  from Gradio_UI import GradioUI
10
 
 
20
  return "What magic will you build ?"
21
 
22
  @tool
23
+ def get_thought_of_the_day():
 
 
 
 
24
  """
25
+ A tool that fetches the random inspirational quote
26
+ """
27
+ try:
28
+ # Fetch a random inspirational quote
29
+ quote = inspirational_quotes.get_quote()
30
+
31
+ # The package returns a dictionary with 'quote' and 'author'
32
+ text = quote.get("quote", "Stay positive and keep learning!")
33
+ author = quote.get("author", "Unknown")
34
+
35
+ return f"💡 Thought of the Day:\n\"{text}\" — {author}"
36
+
37
+ except Exception as e:
38
+ return f"Error fetching thought of the day: {e}"
39
+
40
 
41
  @tool
42
  def get_current_time_in_timezone(timezone: str) -> str:
 
75
 
76
  agent = CodeAgent(
77
  model=model,
78
+ tools=[final_answer,get_current_time_in_timezone,get_thought_of_the_day], ## add your tools here (don't remove final answer)
79
  max_steps=6,
80
  verbosity_level=1,
81
  grammar=None,