mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-05-05 07:10:44 +00:00
Return LogOutput object and update callers
Introduce a LogOutput dataclass (items, start, end) and change Log.output to return a LogOutput instead of a bare list. Update callers to unwrap items: api_log_get now reads log_output.items, and state_snapshot builds logs and log_end from the LogOutput and uses log_end for log_version. Also re-enable the @extensible decorator on AgentContext.output. These changes expose log metadata (start/end) alongside items for consumers.
This commit is contained in:
parent
8d82979157
commit
2cf73c4b4a
4 changed files with 19 additions and 5 deletions
|
|
@ -209,6 +209,13 @@ class LogItem:
|
|||
}
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class LogOutput:
|
||||
items: list[dict[str, Any]]
|
||||
start: int
|
||||
end: int
|
||||
|
||||
|
||||
class Log:
|
||||
|
||||
def __init__(self):
|
||||
|
|
@ -400,7 +407,7 @@ class Log:
|
|||
if update not in seen and update < len(logs):
|
||||
out.append(logs[update].output())
|
||||
seen.add(update)
|
||||
return out
|
||||
return LogOutput(items=out, start=start, end=end)
|
||||
|
||||
def reset(self):
|
||||
with self._lock:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue