mirror of
https://github.com/AgentOps-AI/tokencost.git
synced 2024-06-22 04:30:40 +03:00
add table
This commit is contained in:
8
table.py
8
table.py
@@ -1,7 +1 @@
|
||||
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())
|
||||
|
||||
Reference in New Issue
Block a user