quick table print utlity

This commit is contained in:
reibs
2024-04-23 00:03:44 -07:00
parent 650d328f4e
commit 933f1c9e17

7
table.py Normal file
View File

@@ -0,0 +1,7 @@
import pandas as pd
import tokencost
df = pd.DataFrame(tokencost.TOKEN_COSTS).T
df[['input_cost_per_token', 'output_cost_per_token']] = df[[
'input_cost_per_token', 'output_cost_per_token']].applymap(lambda x: '$'+f'{x:.8f}')
print(df[['max_tokens', 'max_input_tokens', 'input_cost_per_token', 'output_cost_per_token']].to_markdown())