Update tokenlens to canary with server side fetching (#1196)
Co-authored-by: josh <josh@afterima.ge>
This commit is contained in:
parent
445d63e620
commit
5ab695262f
10 changed files with 196 additions and 286 deletions
|
|
@ -33,7 +33,7 @@ import { generateUUID } from '../utils';
|
|||
import { generateHashedPassword } from './utils';
|
||||
import type { VisibilityType } from '@/components/visibility-selector';
|
||||
import { ChatSDKError } from '../errors';
|
||||
import type { LanguageModelV2Usage } from '@ai-sdk/provider';
|
||||
import type { AppUsage } from '../usage';
|
||||
|
||||
// Optionally, if not using email/pass login, you can
|
||||
// use the Drizzle adapter for Auth.js / NextAuth
|
||||
|
|
@ -479,8 +479,8 @@ export async function updateChatLastContextById({
|
|||
context,
|
||||
}: {
|
||||
chatId: string;
|
||||
// Store raw LanguageModelUsage to keep it simple
|
||||
context: LanguageModelV2Usage;
|
||||
// Store merged server-enriched usage object
|
||||
context: AppUsage;
|
||||
}) {
|
||||
try {
|
||||
return await db
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue