notsakeeb commited on
Commit
7709462
·
verified ·
1 Parent(s): 02ac450

Update ToolSet.py

Browse files
Files changed (1) hide show
  1. ToolSet.py +17 -0
ToolSet.py CHANGED
@@ -72,6 +72,22 @@ def power(a: float, b: float) -> float:
72
  """
73
  return a**b
74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
 
76
  @tool
77
  def get_web_search_result(query: str) -> str:
@@ -363,6 +379,7 @@ toolset = [
363
  divide,
364
  modulus,
365
  power,
 
366
  max_object_counter_tool(),
367
  transcription_generation_tool()
368
  ]
 
72
  """
73
  return a**b
74
 
75
+ @tool
76
+ def excel_reader(path: str):
77
+ """
78
+ Reads the specified Excel file into a pandas DataFrame,
79
+ converts it to CSV-style text, and asks the LLM to answer the question
80
+ based on that data.
81
+
82
+ Args:
83
+ path: path indicating the excel file
84
+ """
85
+ print("reading_excel_file")
86
+ df = pd.read_excel(path)
87
+ data_context = df.to_csv(df)
88
+
89
+ return data_context
90
+
91
 
92
  @tool
93
  def get_web_search_result(query: str) -> str:
 
379
  divide,
380
  modulus,
381
  power,
382
+ excel_reader,
383
  max_object_counter_tool(),
384
  transcription_generation_tool()
385
  ]