Added iteration_logger
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from aiohttp import web
|
||||
from pathlib import Path
|
||||
import asyncio
|
||||
import mimetypes
|
||||
import time
|
||||
|
||||
from .config import Config
|
||||
from .hf_llm_engine import HfLlmEngine
|
||||
from .llm_engine import LlmEngine
|
||||
from .iteration_logger import IterationLogger
|
||||
from .local_llm_engine import LocalLlmEngine
|
||||
from .mistral_llm_engine import MistralLlmEngine
|
||||
from .openai_llm_engine import OpenAILlmEngine
|
||||
@@ -40,8 +37,7 @@ class Main:
|
||||
self._llm = LocalLlmEngine(
|
||||
self._config.model,
|
||||
self._config.temperature,
|
||||
self._config.token_limit,
|
||||
self._config.api_token,
|
||||
self._config.token_limit
|
||||
)
|
||||
case "hf":
|
||||
self._llm = HfLlmEngine(
|
||||
@@ -73,7 +69,8 @@ class Main:
|
||||
metrics=SystemMetrics(),
|
||||
llm=self._llm,
|
||||
validator=XMLValidator(self._action_schema),
|
||||
parser=ResponseParser(self._io_buffer)
|
||||
parser=ResponseParser(self._io_buffer),
|
||||
iteration_logger=IterationLogger(self._config.iterations_dir, self._system_prompt, self._action_schema),
|
||||
)
|
||||
self._ws_manager = await WebSocketManager.create(
|
||||
self._agent,
|
||||
@@ -132,4 +129,4 @@ if __name__ == "__main__":
|
||||
config = Config()
|
||||
main = loop.run_until_complete(Main.create(config))
|
||||
print(f"Web server started at http://localhost:{config.port}")
|
||||
web.run_app(main.app, loop=loop, host=config.host, port=config.port)
|
||||
web.run_app(main.app, loop=loop, host=config.host, port=config.port)
|
||||
|
||||
Reference in New Issue
Block a user