Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -32,7 +32,14 @@ def get_current_time_in_timezone(timezone: str) -> str:
32
  return f"The current local time in {timezone} is: {local_time}"
33
  except Exception as e:
34
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
35
-
 
 
 
 
 
 
 
36
 
37
  final_answer = FinalAnswerTool()
38
 
@@ -55,7 +62,7 @@ with open("prompts.yaml", 'r') as stream:
55
 
56
  agent = CodeAgent(
57
  model=model,
58
- tools=[final_answer], ## add your tools here (don't remove final answer)
59
  max_steps=6,
60
  verbosity_level=1,
61
  grammar=None,
 
32
  return f"The current local time in {timezone} is: {local_time}"
33
  except Exception as e:
34
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
35
+ @tool
36
+ def sql_engine(query: str) -> str:
37
+ """
38
+ Allows you to perform SQL queries on the table. Beware that this tool's output is a string representation of the execution output.\nIt can use the following tables:\n\nTable 'ekh_dvou_tax_values':\nColumns:\n - taxdate: VARCHAR(250)\n - sumtax: NUMBER\n - employeeisn: VARCHAR(250)\n - inn: VARCHAR(250)\n - employeefio: VARCHAR(4000)\n\nTable 'ekh_employeeabsencesdata':\nColumns:\n - load_date: DATE\n - dateto: DATE\n - datefrom: DATE\n - absencetype: VARCHAR(225)\n - employeeisn: NUMBER\n - employeeuid: VARCHAR(225)\n - personuid: VARCHAR(225)\n\nTable 'ekh_employeedismissal':\nColumns:\n - groupofactivities: VARCHAR(1000)\n - student: VARCHAR(10)\n - offerfromanothercompany: VARCHAR(1000)\n - supervisordismissalreason: VARCHAR(1000)\n - employeedismissalreason: VARCHAR(1000)\n - realdismissalreason: VARCHAR(1000)\n - votchetepotekuchestikadrov: VARCHAR(1000)\n - labourcode: VARCHAR(1000)\n - dismissaldate: VARCHAR(1000)\n - employeeid: VARCHAR(1000)\n - uid1: VARCHAR(1000)\n - personuid: VARCHAR(1000)
39
+ Args:
40
+ query: запрос для выполнения
41
+ """
42
+ return "sql code"
43
 
44
  final_answer = FinalAnswerTool()
45
 
 
62
 
63
  agent = CodeAgent(
64
  model=model,
65
+ tools=[final_answer, sql_engine], ## add your tools here (don't remove final answer)
66
  max_steps=6,
67
  verbosity_level=1,
68
  grammar=None,