Draichi commited on
Commit
e33c819
1 Parent(s): b8fe862

fix: `console` circular import

Browse files
app.py CHANGED
@@ -63,12 +63,8 @@ async def interact_with_agent(message, history):
63
  role="assistant", content=msg.content, metadata={"title": f"🛠️ Used tool {msg.name}"}))
64
  yield history
65
 
66
- console.print(f"\nchunk:")
67
- console.print(chunk)
68
  if "agent" in chunk:
69
  messages = chunk["agent"]["messages"]
70
- console.print(f"\nmessages:")
71
- console.print(messages)
72
  for msg in messages:
73
  if isinstance(msg, AIMessage):
74
  if msg.content:
 
63
  role="assistant", content=msg.content, metadata={"title": f"🛠️ Used tool {msg.name}"}))
64
  yield history
65
 
 
 
66
  if "agent" in chunk:
67
  messages = chunk["agent"]["messages"]
 
 
68
  for msg in messages:
69
  if isinstance(msg, AIMessage):
70
  if msg.content:
tools/__init__.py CHANGED
@@ -1,11 +1,9 @@
1
- from rich.console import Console
2
  from .driver_performance import GetDriverPerformance
3
  from .event_performance import GetEventPerformance
4
  from .telemetry_analysis import GetTelemetry
5
  from .tyre_performance import GetTyrePerformance
6
  from .weather_impact import GetWeatherImpact
7
 
8
- console = Console(style="chartreuse1 on grey7")
9
 
10
  __all__ = [
11
  "GetDriverPerformance",
 
 
1
  from .driver_performance import GetDriverPerformance
2
  from .event_performance import GetEventPerformance
3
  from .telemetry_analysis import GetTelemetry
4
  from .tyre_performance import GetTyrePerformance
5
  from .weather_impact import GetWeatherImpact
6
 
 
7
 
8
  __all__ = [
9
  "GetDriverPerformance",
tools/driver_performance.py CHANGED
@@ -1,7 +1,9 @@
1
  from pydantic import BaseModel, Field
2
  from langchain_core.tools import BaseTool
3
  from db.connection import db
4
- from . import console
 
 
5
 
6
 
7
  class GetDriverPerformanceOutput(BaseModel):
 
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):
tools/event_performance.py CHANGED
@@ -2,7 +2,9 @@ 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 . import console
 
 
6
 
7
 
8
  class GetEventPerformanceOutput(BaseModel):
 
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):
tools/telemetry_analysis.py CHANGED
@@ -2,7 +2,9 @@ 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 . import console
 
 
6
 
7
 
8
  class GetTelemetryAndWeatherInput(BaseModel):
 
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):
tools/tyre_performance.py CHANGED
@@ -2,7 +2,9 @@ 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 . import console
 
 
6
 
7
 
8
  class GetTyrePerformanceInput(BaseModel):
 
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):
tools/weather_impact.py CHANGED
@@ -2,7 +2,9 @@ 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 . import console
 
 
6
 
7
 
8
  class GetWeatherImpactInput(BaseModel):
 
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):