Calculate the usage of the optimization process (either $ in case of openAI or #tokens the other cases)
(self)
| 75 | self.dataset.load_dataset(self.config.dataset.initial_dataset) |
| 76 | |
| 77 | def calc_usage(self): |
| 78 | """ |
| 79 | Calculate the usage of the optimization process (either $ in case of openAI or #tokens the other cases) |
| 80 | """ |
| 81 | total_usage = 0 |
| 82 | total_usage += self.meta_chain.calc_usage() |
| 83 | total_usage += self.annotator.calc_usage() |
| 84 | total_usage += self.predictor.calc_usage() |
| 85 | return total_usage |
| 86 | |
| 87 | def extract_best_prompt(self): |
| 88 | sorted_history = sorted( |
no outgoing calls
no test coverage detected