Added support to get usage for ChatGoogleGenerativeAI
This PR has been raised to add support to track ChatGoogleGenerativeAI's langchain call usage.
A simple check for usage_metadata attribute and then parsing using the _parse_usage_model
@NeerajG03 did you test this locally? Thanks a lot for the contribution!
@maxdeichmann I'm sorry i'm very new to contributing for projects.
If you are asking if i have run this test poetry run pytest -s -v --log-cli-level=INFO, then thats a yes. 👍
I ran it for test_langchain.py and test_langchain_integration.py
Here is the screenshot of the run summary
This also worked for me for ChatVertexAI.
It appears to fix my issues which appear to be those mentioned in https://github.com/langfuse/langfuse/issues/5468
Thanks again for raising this! Closing this as stale / no longer relevant in Python SDK v3. If you continue to see issues, please open a Github issue 👍🏾