bf8ad0d1ff
Session history was silently clipped to the first 4000 characters of the last 12 messages, so follow-ups could not see timing or audit tables. Keep an append-only tail plus a checkpoint summary, retry overflow in the same request, and expose cache hit rate in admin usage. Co-authored-by: Cursor <cursoragent@cursor.com>
35 lines
1.0 KiB
TypeScript
35 lines
1.0 KiB
TypeScript
import type { MastraModelConfig } from "@mastra/core/llm";
|
|
|
|
export type LanguageModelMode = "openai" | "compatible" | "anthropic";
|
|
|
|
export type PublicLanguageModel = {
|
|
readonly id: string;
|
|
readonly label: string;
|
|
readonly description: string;
|
|
readonly creditCost: number;
|
|
readonly isDefault: boolean;
|
|
};
|
|
|
|
export type ResolvedLanguageModel = PublicLanguageModel & {
|
|
readonly mode: LanguageModelMode;
|
|
readonly model: MastraModelConfig;
|
|
readonly configVersion?: number;
|
|
readonly inputCostMicrousdPerMillion?: number;
|
|
readonly outputCostMicrousdPerMillion?: number;
|
|
readonly contextWindow?: number | null;
|
|
};
|
|
|
|
export type LanguageModelCatalog = {
|
|
readonly models: readonly ResolvedLanguageModel[];
|
|
readonly publicModels: readonly PublicLanguageModel[];
|
|
readonly defaultModelId: string | null;
|
|
readonly issues: readonly string[];
|
|
};
|
|
|
|
export const languageModelCatalog: LanguageModelCatalog = {
|
|
models: [],
|
|
publicModels: [],
|
|
defaultModelId: null,
|
|
issues: ["database_model_catalog_required"],
|
|
};
|