MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / calc_cost

Method calc_cost

utils/src/llms.py:313–321  ·  view source on GitHub ↗

Calculate the cost of a list of turns.

(self, turns: list[Turn])

Source from the content-addressed store, hash-verified

311 self.history: list[Turn] = []
312
313 def calc_cost(self, turns: list[Turn]):
314 """
315 Calculate the cost of a list of turns.
316 """
317 for turn in turns:
318 self.input_tokens += turn.input_tokens
319 self.output_tokens += turn.output_tokens
320 self.input_tokens += self.system_tokens
321 self.output_tokens += 3
322
323 def get_history(self, similar: int, recent: int, prompt: str):
324 """

Callers 1

__post_process__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected