1 Star 0 Fork 18

readerloop/claw-code

forked from chenshiying007/claw-code 
Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
transcript.py 585 Bytes
Copy Edit Raw Blame History
from __future__ import annotations
from dataclasses import dataclass, field
@dataclass
class TranscriptStore:
entries: list[str] = field(default_factory=list)
flushed: bool = False
def append(self, entry: str) -> None:
self.entries.append(entry)
self.flushed = False
def compact(self, keep_last: int = 10) -> None:
if len(self.entries) > keep_last:
self.entries[:] = self.entries[-keep_last:]
def replay(self) -> tuple[str, ...]:
return tuple(self.entries)
def flush(self) -> None:
self.flushed = True
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/readerloop/claw-code.git
git@gitee.com:readerloop/claw-code.git
readerloop
claw-code
claw-code
main

Search