Feature Request: Add method to retrieve token count from LLM responses

オープン
#177 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

@AbdulTawabJuly がすでに取り組んでいます。

2025年12月14日 から。

  • #181 @AbdulTawabJuly による — オープン

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
jupyter-notebook
領域
ai, api

調査の方向性

この 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 ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

google-gemini/gemini-fullstack-langgraph-quickstart のほかの issue

google-gemini/gemini-fullstack-langgraph-quickstart の issue をすべて見る

似ている issue

AI Infra & Agents の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。