davidmigloz / langchain_dart

Build LLM-powered Dart/Flutter applications.
https://langchaindart.dev
MIT License
426 stars 75 forks source link

feat: Add support for usage metadata in ChatFirebaseVertexAI #457

Closed davidmigloz closed 5 months ago

davidmigloz commented 5 months ago
final chatModel = ChatFirebaseVertexAI();
final res = chatModel.invoke(...);
final usage = res.usage;
print(usage.promptTokens);
print(usage.candidatesTokenCount);
print(usage.totalTokenCount);