block-open-source / goose

Goose is a developer agent that operates from your command line to help you do the boring stuff.
https://block-open-source.github.io/goose/
Apache License 2.0
73 stars 12 forks source link

feat: track cost and token usage in log file #80

Closed lifeizhou-ap closed 1 week ago

lifeizhou-ap commented 1 week ago

Why Users can view the cost and token usage in the log file

What

michaelneale commented 1 week ago

I like this - and has been asked for a bit

codefromthecrypt commented 1 week ago

fyi since this is a common feature in Q/A or eval tools (langtrace, openlit, traceloop etc) you can have a look to validate approach vs what they are doing. Not suggesting change, just for context:

e.g. from openlit https://github.com/openlit/openlit/blob/b4d36f80fe1b2c6ea5faaddc2882f75db0a613af/sdk/python/src/openlit/__helpers.py https://github.com/openlit/openlit/blob/b4d36f80fe1b2c6ea5faaddc2882f75db0a613af/assets/pricing.json