chore: remove tokenlens and token usage tracking (#1357)
This commit is contained in:
parent
5f9e231788
commit
7942e97095
17 changed files with 60 additions and 773 deletions
|
|
@ -17,7 +17,6 @@ import postgres from "postgres";
|
|||
import type { ArtifactKind } from "@/components/artifact";
|
||||
import type { VisibilityType } from "@/components/visibility-selector";
|
||||
import { ChatSDKError } from "../errors";
|
||||
import type { AppUsage } from "../usage";
|
||||
import { generateUUID } from "../utils";
|
||||
import {
|
||||
type Chat,
|
||||
|
|
@ -502,21 +501,17 @@ export async function updateChatVisibilityById({
|
|||
}
|
||||
}
|
||||
|
||||
export async function updateChatLastContextById({
|
||||
export async function updateChatTitleById({
|
||||
chatId,
|
||||
context,
|
||||
title,
|
||||
}: {
|
||||
chatId: string;
|
||||
// Store merged server-enriched usage object
|
||||
context: AppUsage;
|
||||
title: string;
|
||||
}) {
|
||||
try {
|
||||
return await db
|
||||
.update(chat)
|
||||
.set({ lastContext: context })
|
||||
.where(eq(chat.id, chatId));
|
||||
return await db.update(chat).set({ title }).where(eq(chat.id, chatId));
|
||||
} catch (error) {
|
||||
console.warn("Failed to update lastContext for chat", chatId, error);
|
||||
console.warn("Failed to update title for chat", chatId, error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue