Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add context tokens from api response to cost calculation #78

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

CornHusker89
Copy link
Contributor

also changed the formatting of the cost display...the scientific notation was a little too funny

@CornHusker89
Copy link
Contributor Author

hollup lemme fix the issue then you can review it

@@ -153,7 +155,7 @@ await message.ReplyAsync("""
// NOTE: These numbers are hardcoded and not necessarily representative of the actual costs, as the model can change
if (questionTokens != 0 && responseTokens != 0)
answerMessage.AppendLine(
$"Cost: ${Math.Round(questionTokens * 0.00000015 + responseTokens * 0.0000006, 10)}");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really see why we remove the dollar sign. Does this somehow get rid of the scientific notation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made it round to like 6 places or something and i put it in terms of cents, not dollars so theres less 0s. also multiplied every constant there by 100 to keep the value the same

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh nice. can you get rid of the "cents" and use ¢

Copy link
Contributor Author

@CornHusker89 CornHusker89 Oct 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was considering that, but idk if c# likes the cent symbol in strings or if I have to do some u/ bs so I went safe lol if that breaks it thats your fault L

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nah you'll be fine. c# string interpolation works like python's rather than js's

@smallketchup82
Copy link
Member

hollup lemme fix the issue then you can review it

L

@CornHusker89
Copy link
Contributor Author

hold off on this for now, i wanna add a prompt token thing too

@CornHusker89
Copy link
Contributor Author

k we good now

@smallketchup82
Copy link
Member

hold off on this for now, i wanna add a prompt token thing too

if possible can we start using horizontal space more. the more we add vertically, the harder it is to read the message

@CornHusker89
Copy link
Contributor Author

if possible can we start using horizontal space more. the more we add vertically, the harder it is to read the message

k ill put 2 token counts on each line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants