Archived
1
0
Fork 0

Don't forget it

This commit is contained in:
Dianliang233 2023-04-14 21:30:10 +08:00
parent 72e28ebee2
commit 954811d995

View file

@ -35,6 +35,7 @@ async def _(msg: Bot.MessageSession):
with get_openai_callback() as cb:
res = await agent_executor.arun(question)
tokens = cb.total_tokens
# TODO: REMEMBER TO UNCOMMENT THIS BEFORE LAUNCH!!!!
# if not is_superuser:
# price = tokens / ONE_K * PRICE_PER_1K_TOKEN
# petal = price * USD_TO_CNY * CNY_TO_PETAL