1818from starlette .templating import Jinja2Templates
1919
2020from hackingBuddyGPT .usecases .base import UseCase , use_case
21+ from hackingBuddyGPT .utils .configurable import parameter
2122from hackingBuddyGPT .utils .db_storage import DbStorage
2223from hackingBuddyGPT .utils .db_storage .db_storage import (
2324 Message ,
@@ -205,8 +206,8 @@ class Viewer(UseCase):
205206 TODOs:
206207 - [ ] This server needs to be as async as possible to allow good performance, but the database accesses are not yet, might be an issue?
207208 """
208- log : GlobalLocalLogger
209- log_db : DbStorage
209+ log : GlobalLocalLogger = None
210+ log_db : DbStorage = None
210211 log_server_address : str = "127.0.0.1:4444"
211212 save_playback_dir : str = ""
212213
@@ -231,7 +232,7 @@ async def save_message(self, message: ControlMessage):
231232 with open (file_path , "a" ) as f :
232233 f .write (ReplayMessage (datetime .datetime .now (), message ).to_json () + "\n " )
233234
234- def run (self ):
235+ def run (self , config ):
235236 @asynccontextmanager
236237 async def lifespan (app : FastAPI ):
237238 app .state .db = self .log_db
@@ -358,8 +359,8 @@ def get_name(self) -> str:
358359
359360@use_case ("Tool to replay the .jsonl logs generated by the Viewer (not well tested)" )
360361class Replayer (UseCase ):
361- log : GlobalRemoteLogger
362- replay_file : str
362+ log : GlobalRemoteLogger = None
363+ replay_file : str = None
363364 pause_on_message : bool = False
364365 pause_on_tool_calls : bool = False
365366 playback_speed : float = 1.0
0 commit comments