mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-24 02:57:13 +00:00
perf: 更加精细的费用记录
This commit is contained in:
@@ -64,7 +64,7 @@ class DatabaseManager:
|
|||||||
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
|
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
`key_md5` varchar(255) not null,
|
`key_md5` varchar(255) not null,
|
||||||
`timestamp` bigint not null,
|
`timestamp` bigint not null,
|
||||||
`fee` DECIMAL(9,3) not null
|
`fee` DECIMAL(12,6) not null
|
||||||
)
|
)
|
||||||
""")
|
""")
|
||||||
print('Database initialized.')
|
print('Database initialized.')
|
||||||
|
|||||||
@@ -118,8 +118,8 @@ def process_message(launcher_type: str, launcher_id: int, text_message: str) ->
|
|||||||
using_key_name = ""
|
using_key_name = ""
|
||||||
for api_key in api_keys:
|
for api_key in api_keys:
|
||||||
reply_str += "{}:\n - {}元 {}%\n".format(api_key,
|
reply_str += "{}:\n - {}元 {}%\n".format(api_key,
|
||||||
pkg.openai.manager.get_inst().key_mgr.get_fee(
|
round(pkg.openai.manager.get_inst().key_mgr.get_fee(
|
||||||
api_keys[api_key]),
|
api_keys[api_key]), 6),
|
||||||
round(
|
round(
|
||||||
pkg.openai.manager.get_inst().key_mgr.get_fee(
|
pkg.openai.manager.get_inst().key_mgr.get_fee(
|
||||||
api_keys[
|
api_keys[
|
||||||
|
|||||||
Reference in New Issue
Block a user