fix: `console` circular import
Browse files- app.py +0 -4
- tools/__init__.py +0 -2
- tools/driver_performance.py +3 -1
- tools/event_performance.py +3 -1
- tools/telemetry_analysis.py +3 -1
- tools/tyre_performance.py +3 -1
- tools/weather_impact.py +3 -1
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
|
|
|
|
|
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
|
|
|
|
|
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
|
|
|
|
|
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
|
|
|
|
|
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
|
|
|
|
|
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):
|