Calculate the cost of a list of turns.
(self, turns: list[Turn])
| 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 | """ |