MCPcopy Create free account
hub / github.com/Eladlev/AutoPrompt / calc_usage

Method calc_usage

optimization_pipeline.py:77–85  ·  view source on GitHub ↗

Calculate the usage of the optimization process (either $ in case of openAI or #tokens the other cases)

(self)

Source from the content-addressed store, hash-verified

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(

Callers 2

stop_criteriaMethod · 0.95
stepMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected