Skip to content

Commit

Permalink
fix: console circular import
Browse files Browse the repository at this point in the history
  • Loading branch information
Draichi committed Oct 31, 2024
1 parent b8fe862 commit e33c819
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 11 deletions.
4 changes: 0 additions & 4 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,8 @@ async def interact_with_agent(message, history):
role="assistant", content=msg.content, metadata={"title": f"🛠️ Used tool {msg.name}"}))
yield history

console.print(f"\nchunk:")
console.print(chunk)
if "agent" in chunk:
messages = chunk["agent"]["messages"]
console.print(f"\nmessages:")
console.print(messages)
for msg in messages:
if isinstance(msg, AIMessage):
if msg.content:
Expand Down
2 changes: 0 additions & 2 deletions tools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
from rich.console import Console
from .driver_performance import GetDriverPerformance
from .event_performance import GetEventPerformance
from .telemetry_analysis import GetTelemetry
from .tyre_performance import GetTyrePerformance
from .weather_impact import GetWeatherImpact

console = Console(style="chartreuse1 on grey7")

__all__ = [
"GetDriverPerformance",
Expand Down
4 changes: 3 additions & 1 deletion tools/driver_performance.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from pydantic import BaseModel, Field
from langchain_core.tools import BaseTool
from db.connection import db
from . import console
from rich.console import Console

console = Console(style="chartreuse1 on grey7")


class GetDriverPerformanceOutput(BaseModel):
Expand Down
4 changes: 3 additions & 1 deletion tools/event_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
from typing import Type
from langchain_core.tools import BaseTool
from db.connection import db
from . import console
from rich.console import Console

console = Console(style="chartreuse1 on grey7")


class GetEventPerformanceOutput(BaseModel):
Expand Down
4 changes: 3 additions & 1 deletion tools/telemetry_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
from typing import Type
from langchain_core.tools import BaseTool
from db.connection import db
from . import console
from rich.console import Console

console = Console(style="chartreuse1 on grey7")


class GetTelemetryAndWeatherInput(BaseModel):
Expand Down
4 changes: 3 additions & 1 deletion tools/tyre_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
from typing import Type
from langchain_core.tools import BaseTool
from db.connection import db
from . import console
from rich.console import Console

console = Console(style="chartreuse1 on grey7")


class GetTyrePerformanceInput(BaseModel):
Expand Down
4 changes: 3 additions & 1 deletion tools/weather_impact.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
from typing import Type
from langchain_core.tools import BaseTool
from db.connection import db
from . import console
from rich.console import Console

console = Console(style="chartreuse1 on grey7")


class GetWeatherImpactInput(BaseModel):
Expand Down

0 comments on commit e33c819

Please sign in to comment.