When using the JS SDK and creating a chat stream, is there any way to get the usage metadata? As the response is being chunked back, rather than returned as an object, it’s just a pure text stream. Is the metadata still stored somewhere internally we can get at?
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
UsageMetadata is nil in GenerateContentStream final response for gemini-2.5-pro-preview, works for gemini-2.0-flash | 0 | 41 | April 13, 2025 | |
How do I get the chat history with the new SDK Javascript | 3 | 105 | April 30, 2025 | |
Maintaining Session for a Chat Conversation in Gemini API (Multi-turn conversations) | 1 | 119 | March 31, 2025 | |
Problems with Live API Audio Streaming and Function Responses | 0 | 133 | March 30, 2025 | |
Gemini api 400 max payload 20kb | 0 | 24 | March 30, 2025 |