MCPcopy Index your code
hub / github.com/caesarHQ/textSQL / calculate_cost

Function calculate_cost

api/app/api/utils/caesar_logging.py:91–96  ·  view source on GitHub ↗
(model, input_tokens, output_tokens)

Source from the content-addressed store, hash-verified

89}
90
91def calculate_cost(model, input_tokens, output_tokens):
92 base_model = 'turbo'
93 if model.find('gpt-4') != -1:
94 base_model = 'gpt-4'
95 cost = costs[base_model]['input'] * input_tokens + costs[base_model]['output'] * output_tokens
96 return cost
97
98
99@failsoft

Callers 1

log_apicallFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected