32 lines
738 B
TypeScript
32 lines
738 B
TypeScript
import type {GenerationSettings} from "./generation-settings";
|
|
|
|
export type ResponseMetadata = {
|
|
providerId: string;
|
|
model: string;
|
|
durationMs: number;
|
|
outputTokens: number | null;
|
|
tokensPerSecond: number | null;
|
|
};
|
|
|
|
export type StoredChatMessage = {
|
|
id: string;
|
|
role: "system" | "user" | "assistant";
|
|
parts: Array<Record<string, unknown> & {type: string}>;
|
|
metadata?: {custom?: {response?: ResponseMetadata}};
|
|
};
|
|
|
|
export type ConversationSummary = {
|
|
id: string;
|
|
title: string;
|
|
providerId: string;
|
|
model: string;
|
|
messageCount: number;
|
|
createdAt: string;
|
|
updatedAt: string;
|
|
};
|
|
|
|
export type Conversation = ConversationSummary & {
|
|
generationSettings: GenerationSettings;
|
|
messages: StoredChatMessage[];
|
|
};
|