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

Revisit - Embeddings Tokens In, Out, Total and Cost - Critical for hosting and using this library #98

Closed
converseKarl opened this issue Jul 30, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@converseKarl
Copy link

converseKarl commented Jul 30, 2024

I'm seeing this on Langchain in the API, and we definitely need this information

Query results should return the tokens in, out and total and if possible cost but this could be done aside by the developer if necessary using the in/out tokens applying the model cost

People are telling me out there, if the tokens cannot be quantified for cost any libraries are just a non-starter.

Thanks so much for your amazing work, your doing a fantastic job!

@adhityan
Copy link
Collaborator

I have published a new version today that includes this information. Now the query method will return an additional parameter tokenUse. This is the type -

tokenUse: {
    inputTokens: number | 'UNKNOWN';
    outputTokens: number | 'UNKNOWN';
};

The Unknown is sent back when the token use information is not available from the model. Hope this helps.

@adhityan adhityan added the enhancement New feature or request label Jul 31, 2024
@converseKarl
Copy link
Author

this is really useful. thank you!

@adhityan adhityan closed this as completed Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants