Feature Request: Add method to retrieve token count from LLM responses
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
Línea de trabajo
El issue no indica ningún archivo fuente, prueba ni punto de entrada para empezar, así que primero identifica dónde se gestionan las respuestas de LLM o los resultados de invoke en el repositorio. Se considera terminado cuando los usuarios pueden obtener tanto input_token_count como output_token_count para un prompt/respuesta.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Jupyter Notebook
- Estrellas
- 18.4k
- Forks
- 3.1k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de google-gemini/gemini-fullstack-langgraph-quickstart
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
-
The field types in the state diagram do not matchPosiblemente ocupada @Benny45123 la tomó hace 66 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 55/100
google-gemini/gemini-fullstack-langgraph-quickstart#221 · 1 comentario ·
-
## Code ReviewAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 55/100
Todos los issues de google-gemini/gemini-fullstack-langgraph-quickstart
Issues similares
-
agent-reported bug from-app needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
nightly-labs/openbot#19144 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
WingedGuardian/GENesis-AGI#5188 ·
Los mantenedores suelen responder en 1 día
-
runPowerShell description does not warn that a nested powershell -Command can report a false exit 1Abiertoagent backend bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 92/100
fritzprix/libr-agent#3121 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
mattpocock/skills#1503 ·
Los mantenedores suelen responder en 1 día