melihuzunoglu commited on
Commit
d06d3e7
·
verified ·
1 Parent(s): e9592a4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -10
app.py CHANGED
@@ -8,16 +8,23 @@ from tools.visit_webpage import VisitWebpageTool
8
 
9
  from Gradio_UI import GradioUI
10
 
11
- # Below is an example of a tool that does nothing. Amaze us with your creativity !
12
  @tool
13
- def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
14
- #Keep this format for the description / args / args description but feel free to modify the tool
15
- """A tool that does nothing yet
16
- Args:
17
- arg1: the first argument
18
- arg2: the second argument
19
- """
20
- return "What magic will you build ?"
 
 
 
 
 
 
 
21
 
22
  @tool
23
  def get_current_time_in_timezone(timezone: str) -> str:
@@ -59,7 +66,8 @@ agent = CodeAgent(
59
  model=model,
60
  tools=[
61
  final_answer,
62
- visit_webpage
 
63
  ],
64
  max_steps=6,
65
  verbosity_level=1,
 
8
 
9
  from Gradio_UI import GradioUI
10
 
11
+
12
  @tool
13
+ def GetElectricityCutInfo(cityName: str) -> str:
14
+ city = cityName.lower().strip()
15
+
16
+ if city == "istanbul":
17
+ return "İstanbul: Kadıköy ve Beşiktaş bölgelerinde planlı bakım çalışması nedeniyle 2 saat kesinti var."
18
+ elif city == "ankara":
19
+ return "Ankara: Şu an için şehir genelinde herhangi bir elektrik kesintisi bulunmamaktadır."
20
+ elif city == "izmir":
21
+ return "İzmir: Bornova bölgesinde arıza kaynaklı bir kesinti yaşanıyor, ekipler müdahale ediyor."
22
+ elif city == "bursa":
23
+ return "Bursa: Bugün için planlanmış bir elektrik kesintisi bulunmuyor."
24
+ elif city == "antalya":
25
+ return "Antalya: Muratpaşa ilçesinde akşam 18:00 ile 20:00 arasında kesinti bekleniyor."
26
+ else:
27
+ return f"{cityName} şehri için sistemde bir kayıt bulunamadı."
28
 
29
  @tool
30
  def get_current_time_in_timezone(timezone: str) -> str:
 
66
  model=model,
67
  tools=[
68
  final_answer,
69
+ visit_webpage,
70
+ GetElectricityCutInfo
71
  ],
72
  max_steps=6,
73
  verbosity_level=1,