feat: add tokenlens integration for language model usage tracking (#1161)

This commit is contained in:
Nicklas Scharpff 2025-09-08 16:56:10 +02:00 committed by GitHub
parent 7327c9a18a
commit 1e539b65b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 363 additions and 6 deletions

View file

@ -3,7 +3,7 @@ import type { getWeather } from './ai/tools/get-weather';
import type { createDocument } from './ai/tools/create-document';
import type { updateDocument } from './ai/tools/update-document';
import type { requestSuggestions } from './ai/tools/request-suggestions';
import type { InferUITool, UIMessage } from 'ai';
import type { InferUITool, LanguageModelUsage, UIMessage } from 'ai';
import type { ArtifactKind } from '@/components/artifact';
import type { Suggestion } from './db/schema';
@ -42,6 +42,7 @@ export type CustomUIDataTypes = {
kind: ArtifactKind;
clear: null;
finish: null;
usage: LanguageModelUsage;
};
export type ChatMessage = UIMessage<