Feature Request: Add method to retrieve token count from LLM responses
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
調査の方向性
この issue には最初に確認すべきソースファイル、テスト、エントリポイントが記載されていないため、まずリポジトリ内で LLM のレスポンスまたは invoke の結果が処理されている場所を特定してください。ユーザーが prompt/response に対して input_token_count と output_token_count の両方を取得できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Description of the feature request:
Currently, when using the google-gemini/gemini-fullstack-langgraph-quickstart library, there isn't an apparent way to directly access the number of input or output tokens consumed by the LLM for a given prompt/response. It would be highly beneficial to expose this information.
I propose adding a method or attribute to the LLM response object, or to the invoke result, that allows users to easily retrieve the input_token_count and output_token_count.
What problem are you trying to solve with this feature?
Without access to token counts, it's difficult to:
- Monitor API costs: Users cannot accurately track or estimate their Gemini API usage expenses.
- Implement rate limiting/budget management: For applications requiring strict control over LLM consumption, token count is essential.
- Optimize prompt engineering: Understanding token usage helps in refining prompts for efficiency.
Any other information you'd like to share?
No response
- 主要言語
- Jupyter Notebook
- スター
- 18.4k
- フォーク
- 3.1k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
google-gemini/gemini-fullstack-langgraph-quickstart のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
-
The field types in the state diagram do not match対応中かも @Benny45123 が 66 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 55/100
google-gemini/gemini-fullstack-langgraph-quickstart#221 · コメント 1 件 ·
-
## Code Reviewオープン
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 55/100
google-gemini/gemini-fullstack-langgraph-quickstart の issue をすべて見る
似ている issue
-
agent-reported bug from-app needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
nightly-labs/openbot#19144 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
WingedGuardian/GENesis-AGI#5188 ·
メンテナーはふだん 1 日以内に返信
-
runPowerShell description does not warn that a nested powershell -Command can report a false exit 1オープンagent backend bug
難易度 2/5 1〜3時間 初心者へのやさしさ 92/100
fritzprix/libr-agent#3121 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
mattpocock/skills#1503 ·
メンテナーはふだん 1 日以内に返信