Draichi commited on
Commit
f90f9bb
1 Parent(s): 285b21b

chore: removes print statements from tools

Browse files
tools/driver_performance.py CHANGED
@@ -1,9 +1,6 @@
1
  from pydantic import BaseModel, Field
2
  from langchain_core.tools import BaseTool
3
  from db.connection import db
4
- from rich.console import Console
5
-
6
- console = Console(style="chartreuse1 on grey7")
7
 
8
 
9
  class GetDriverPerformanceOutput(BaseModel):
@@ -44,7 +41,6 @@ class GetDriverPerformance(BaseTool):
44
  sql_query = sql_file.read()
45
  sql_file.close()
46
 
47
- console.print("getting driver performance data")
48
  response = db.run(sql_query)
49
 
50
  if not isinstance(response, str):
 
1
  from pydantic import BaseModel, Field
2
  from langchain_core.tools import BaseTool
3
  from db.connection import db
 
 
 
4
 
5
 
6
  class GetDriverPerformanceOutput(BaseModel):
 
41
  sql_query = sql_file.read()
42
  sql_file.close()
43
 
 
44
  response = db.run(sql_query)
45
 
46
  if not isinstance(response, str):
tools/event_performance.py CHANGED
@@ -2,9 +2,6 @@ from pydantic import BaseModel, Field
2
  from typing import Type
3
  from langchain_core.tools import BaseTool
4
  from db.connection import db
5
- from rich.console import Console
6
-
7
- console = Console(style="chartreuse1 on grey7")
8
 
9
 
10
  class GetEventPerformanceOutput(BaseModel):
@@ -38,7 +35,6 @@ class GetEventPerformance(BaseTool):
38
  sql_query = sql_file.read()
39
  sql_file.close()
40
 
41
- console.print("getting event performance data")
42
  response = db.run(sql_query)
43
 
44
  if not isinstance(response, str):
 
2
  from typing import Type
3
  from langchain_core.tools import BaseTool
4
  from db.connection import db
 
 
 
5
 
6
 
7
  class GetEventPerformanceOutput(BaseModel):
 
35
  sql_query = sql_file.read()
36
  sql_file.close()
37
 
 
38
  response = db.run(sql_query)
39
 
40
  if not isinstance(response, str):
tools/telemetry_analysis.py CHANGED
@@ -2,9 +2,6 @@ from pydantic import BaseModel, Field
2
  from typing import Type
3
  from langchain_core.tools import BaseTool
4
  from db.connection import db
5
- from rich.console import Console
6
-
7
- console = Console(style="chartreuse1 on grey7")
8
 
9
 
10
  class GetTelemetryAndWeatherInput(BaseModel):
@@ -44,11 +41,9 @@ class GetTelemetry(BaseTool):
44
  def _run(
45
  self, driver_name: str, lap_number: int
46
  ) -> GetTelemetryAndWeatherOutput:
47
- # """Use the tool."""
48
  sql_file = open("tools/sql/telemetry_analysis.query.sql", "r")
49
  sql_query = sql_file.read()
50
  sql_file.close()
51
- console.print("getting telemetry")
52
  response = db.run(sql_query, parameters={
53
  "driver_name": driver_name,
54
  "lap_number": lap_number})
 
2
  from typing import Type
3
  from langchain_core.tools import BaseTool
4
  from db.connection import db
 
 
 
5
 
6
 
7
  class GetTelemetryAndWeatherInput(BaseModel):
 
41
  def _run(
42
  self, driver_name: str, lap_number: int
43
  ) -> GetTelemetryAndWeatherOutput:
 
44
  sql_file = open("tools/sql/telemetry_analysis.query.sql", "r")
45
  sql_query = sql_file.read()
46
  sql_file.close()
 
47
  response = db.run(sql_query, parameters={
48
  "driver_name": driver_name,
49
  "lap_number": lap_number})
tools/tyre_performance.py CHANGED
@@ -2,9 +2,6 @@ from pydantic import BaseModel, Field
2
  from typing import Type
3
  from langchain_core.tools import BaseTool
4
  from db.connection import db
5
- from rich.console import Console
6
-
7
- console = Console(style="chartreuse1 on grey7")
8
 
9
 
10
  class GetTyrePerformanceInput(BaseModel):
@@ -44,7 +41,6 @@ class GetTyrePerformance(BaseTool):
44
  sql_query = sql_file.read()
45
  sql_file.close()
46
 
47
- console.print("getting tyre performance data")
48
  response = db.run(sql_query, parameters={
49
  "driver_name": driver_name
50
  })
 
2
  from typing import Type
3
  from langchain_core.tools import BaseTool
4
  from db.connection import db
 
 
 
5
 
6
 
7
  class GetTyrePerformanceInput(BaseModel):
 
41
  sql_query = sql_file.read()
42
  sql_file.close()
43
 
 
44
  response = db.run(sql_query, parameters={
45
  "driver_name": driver_name
46
  })
tools/weather_impact.py CHANGED
@@ -2,9 +2,6 @@ from pydantic import BaseModel, Field
2
  from typing import Type
3
  from langchain_core.tools import BaseTool
4
  from db.connection import db
5
- from rich.console import Console
6
-
7
- console = Console(style="chartreuse1 on grey7")
8
 
9
 
10
  class GetWeatherImpactInput(BaseModel):
@@ -45,7 +42,6 @@ class GetWeatherImpact(BaseTool):
45
  sql_query = sql_file.read()
46
  sql_file.close()
47
 
48
- console.print("getting weather impact data")
49
  response = db.run(sql_query)
50
 
51
  if not isinstance(response, str):
 
2
  from typing import Type
3
  from langchain_core.tools import BaseTool
4
  from db.connection import db
 
 
 
5
 
6
 
7
  class GetWeatherImpactInput(BaseModel):
 
42
  sql_query = sql_file.read()
43
  sql_file.close()
44
 
 
45
  response = db.run(sql_query)
46
 
47
  if not isinstance(response, str):