Merged
Conversation
lifeizhou-ap
approved these changes
Dec 16, 2024
zakiali
reviewed
Dec 16, 2024
| use super::base::{Pricing, Usage}; | ||
|
|
||
| lazy_static::lazy_static! { | ||
| static ref MODEL_PRICING: HashMap<String, Pricing> = { |
Collaborator
There was a problem hiding this comment.
this overlaps with ModelConfig in the #466 a bit. Might be worthwhile to merge them
Contributor
Author
There was a problem hiding this comment.
Will get them both merged and look for opportunities.
zakiali
approved these changes
Dec 16, 2024
* v1.0: chore: don't require UV to download tokenizers (#473)
lifeizhou-ap
added a commit
that referenced
this pull request
Dec 17, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds cost to session.log. We can update the format later just getting the data piped through.
{"session_file":"~/.config/goose/sessions/yoyqaq3e.jsonl","usage":[{"model":"claude-3-5-sonnet-20241022-v2:0","usage":{"input_tokens":2067,"output_tokens":204,"total_tokens":2271},"cost":"0.009261"}]} {"session_file":"~/.config/goose/sessions/hao4empo.jsonl","usage":[{"model":"gpt-4o-2024-08-06","usage":{"input_tokens":2749,"output_tokens":41,"total_tokens":2790},"cost":"0.0072825"}]}Changes
Adds costs for models.
Instead of providers collecting usage and the agent asking for it, the provider returns usage (as it already did) to the agent along with the cost on each 'complete' call. The agent collects all usages (which now includes cost). This keeps providers with less state and also makes it trivial for the agent to collect usage from different providers/models if we ever head back down that path.