Compact a waiting worker's session shortly before its prompt cache expires
CI / tests (pull_request) Failing after 3m16s
CI / tests (pull_request) Failing after 3m16s
This commit is contained in:
@@ -13,6 +13,10 @@ class Tokens:
|
||||
read: int = 0
|
||||
output: int = 0
|
||||
|
||||
def context(self) -> int:
|
||||
"""The tokens of the prompt the message answered: its context."""
|
||||
return self.input + self.write_5m + self.write_1h + self.read
|
||||
|
||||
def plus(self, other: "Tokens") -> "Tokens":
|
||||
return Tokens(*(mine + theirs for mine, theirs in zip(dataclasses.astuple(self), dataclasses.astuple(other))))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user