Add total token cost to variant stats (#13)
* Add total token cost to variant stats * Copy over token counts for new variants * Update invalidate call
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import { isObject } from "lodash";
|
||||
import { type JSONSerializable, type SupportedModel } from "../types";
|
||||
import { type Prisma } from "@prisma/client";
|
||||
|
||||
export function getModelName(config: JSONSerializable): SupportedModel | null {
|
||||
export function getModelName(config: JSONSerializable | Prisma.JsonValue): SupportedModel | null {
|
||||
if (!isObject(config)) return null;
|
||||
if ("model" in config && typeof config.model === "string") return config.model as SupportedModel;
|
||||
return null
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user