feat: add tokenlens integration for language model usage tracking (#1161)
This commit is contained in:
parent
7327c9a18a
commit
1e539b65b3
8 changed files with 363 additions and 6 deletions
|
|
@ -25,7 +25,7 @@ export const myProvider = isTestEnvironment
|
|||
languageModels: {
|
||||
'chat-model': gateway.languageModel('xai/grok-2-vision-1212'),
|
||||
'chat-model-reasoning': wrapLanguageModel({
|
||||
model: gateway.languageModel('xai/grok-3-mini-beta'),
|
||||
model: gateway.languageModel('xai/grok-3-mini'),
|
||||
middleware: extractReasoningMiddleware({ tagName: 'think' }),
|
||||
}),
|
||||
'title-model': gateway.languageModel('xai/grok-2-1212'),
|
||||
|
|
|
|||
|
|
@ -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<
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue