This commit is contained in:
2024-12-04 17:19:46 +01:00
parent af390dd779
commit da8583ab28
36 changed files with 712 additions and 69 deletions

View File

@@ -1,3 +1,4 @@
from pathlib import Path
from aiohttp import web
import json
import asyncio
@@ -13,12 +14,14 @@ from ..working_memory import WorkingMemory
class Api:
def __init__(
self,
work_dir: Path,
app: web.Application,
agent: WebAgent,
io_buffer: WebIOBuffer,
working_memory: WorkingMemory,
auto_approver: AutoApprover
):
self._work_dir = work_dir
self._app = app
self._agent = agent
self._working_memory = working_memory
@@ -275,7 +278,7 @@ class Api:
if not content:
return web.Response(status=400, text="Missing content in request body")
entries = IterationParser.parse_iteration(content, self._io_buffer)
entries = IterationParser.parse_iteration(content, self._work_dir, self._io_buffer)
for entry in entries:
self._working_memory.add_entry(entry)