miteshtrivedi10 commited on
Commit
73badda
·
verified ·
1 Parent(s): 8c5c24b

Added new tool

Browse files
Files changed (1) hide show
  1. app.py +74 -1
app.py CHANGED
@@ -33,6 +33,79 @@ def get_current_time_in_timezone(timezone: str) -> str:
33
  except Exception as e:
34
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
  final_answer = FinalAnswerTool()
38
 
@@ -41,7 +114,7 @@ final_answer = FinalAnswerTool()
41
 
42
  model = HfApiModel(
43
  max_tokens=2096,
44
- temperature=0.5,
45
  model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
46
  custom_role_conversions=None,
47
  )
 
33
  except Exception as e:
34
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
35
 
36
+ @tool
37
+ def get_installed_solar_capacity_for_indian_states(state_name: str) -> float:
38
+ """ A tool that fetches the current installed solar capacity in megawatt for different indian states.
39
+ Args:
40
+ state_name: A string representing valid indian state name (e.g., Gujarat)
41
+ """
42
+ indian_states = dict()
43
+ indian_states["Andaman and Nicobar"] = 2.69
44
+ indian_states["Andhra Pradesh"] = 143.77
45
+ indian_states["Arunachal Pradesh"] = 0.22
46
+ indian_states["Assam"] = 28.59
47
+ indian_states["Bihar"] = 18.55
48
+ indian_states["Chandigarh"] = 38.41
49
+ indian_states["Chhattisgarh"] = 36.94
50
+ indian_states["Goa"] = 22.76
51
+ indian_states["Gujarat"] = 2037.62
52
+ indian_states["Haryana"] = 358.83
53
+
54
+ return indian_states[state_name]
55
+ # return [
56
+ # {
57
+ # "sl_no_": "1",
58
+ # "states_uts": "Andaman and Nicobar",
59
+ # "rooftop_solar_capacity_installed_mw_": 2.69
60
+ # },
61
+ # {
62
+ # "sl_no_": "2",
63
+ # "states_uts": "Andhra Pradesh",
64
+ # "rooftop_solar_capacity_installed_mw_": 143.77
65
+ # },
66
+ # {
67
+ # "sl_no_": "3",
68
+ # "states_uts": "Arunachal Pradesh",
69
+ # "rooftop_solar_capacity_installed_mw_": 0.22
70
+ # },
71
+ # {
72
+ # "sl_no_": "4",
73
+ # "states_uts": "Assam",
74
+ # "rooftop_solar_capacity_installed_mw_": 28.59
75
+ # },
76
+ # {
77
+ # "sl_no_": "5",
78
+ # "states_uts": "Bihar",
79
+ # "rooftop_solar_capacity_installed_mw_": 18.55
80
+ # },
81
+ # {
82
+ # "sl_no_": "6",
83
+ # "states_uts": "Chandigarh",
84
+ # "rooftop_solar_capacity_installed_mw_": 38.41
85
+ # },
86
+ # {
87
+ # "sl_no_": "7",
88
+ # "states_uts": "Chhattisgarh",
89
+ # "rooftop_solar_capacity_installed_mw_": 36.94
90
+ # },
91
+ # {
92
+ # "sl_no_": "8",
93
+ # "states_uts": "Goa",
94
+ # "rooftop_solar_capacity_installed_mw_": 22.76
95
+ # },
96
+ # {
97
+ # "sl_no_": "9",
98
+ # "states_uts": "Gujarat",
99
+ # "rooftop_solar_capacity_installed_mw_": 2037.62
100
+ # },
101
+ # {
102
+ # "sl_no_": "10",
103
+ # "states_uts": "Haryana",
104
+ # "rooftop_solar_capacity_installed_mw_": 358.83
105
+ # }
106
+ # ]
107
+
108
+
109
 
110
  final_answer = FinalAnswerTool()
111
 
 
114
 
115
  model = HfApiModel(
116
  max_tokens=2096,
117
+ temperature=0.4,
118
  model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
119
  custom_role_conversions=None,
120
  )