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

Track input/output token counts #25

Closed
simonw opened this issue Nov 20, 2024 · 1 comment
Closed

Track input/output token counts #25

simonw opened this issue Nov 20, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@simonw
Copy link
Owner

simonw commented Nov 20, 2024

With new LLM feature:

@simonw simonw added the enhancement New feature or request label Nov 20, 2024
@simonw
Copy link
Owner Author

simonw commented Nov 20, 2024

I got stuck writing a full test for this, because there's something weird about the current pytest-recording setup - look at this:

assert response.response_json == [
{
"candidates": [
{"content": {"parts": [{"text": "Percy"}], "role": "model"}}
],
"usageMetadata": {"promptTokenCount": 10, "totalTokenCount": 10},
"modelVersion": "gemini-1.5-flash-002",
}
]

Why does that have input tokens but no output tokens?

I couldn't figure that out, so I'm going to assert for input tokens only for the moment.

@simonw simonw closed this as completed in c702761 Nov 20, 2024
simonw added a commit that referenced this issue Nov 20, 2024
simonw added a commit that referenced this issue Dec 2, 2024
simonw added a commit that referenced this issue Dec 2, 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

1 participant