Files
indie/frontend/src/app/core/models/llm.ts
2026-07-12 00:10:15 +05:45

117 lines
2.1 KiB
TypeScript

export interface LLMGenerateRequest {
prompt: string;
siteId: string;
provider: string;
apiKey?: string;
baseUrl?: string;
model?: string;
references?: Reference[];
}
export interface LLMRefineRequest {
prompt: string;
siteId: string;
provider: string;
currentStructure: SiteStructure;
apiKey?: string;
baseUrl?: string;
model?: string;
references?: Reference[];
}
export interface Reference {
type: 'URL' | 'IMAGE';
url: string;
altText: string;
}
export interface SiteStructure {
theme: ThemeConfig;
pages: PageStructure[];
}
export interface ThemeConfig {
colors: Record<string, string>;
fonts: Record<string, string>;
spacing: Record<string, string>;
}
export interface PageStructure {
id?: string;
title: string;
slug: string;
seoTitle?: string;
seoDescription?: string;
orderIndex: number;
rawHtml?: string;
}
export interface TokenUsage {
prompt: number;
completion: number;
total: number;
}
export interface LLMSession {
id?: string;
siteId: string;
prompt: string;
generatedStructure: SiteStructure | null;
refinedPrompt: string | null;
acceptedAt: string | null;
createdAt: string;
}
export interface GenerationVersion {
id: string;
siteId: string;
userId: string;
versionNumber: number;
prompt: string;
references: Reference[];
fullStructure: string;
createdAt: string;
}
export interface PatternSuggestion {
title: string;
description: string;
}
export interface SectionSuggestion {
title: string;
description: string;
slug: string;
patterns: PatternSuggestion[];
}
export interface SuggestSectionsRequest {
briefDescription: string;
provider: string;
apiKey?: string;
baseUrl?: string;
model?: string;
}
export interface SuggestSectionsResponse {
sections: SectionSuggestion[];
}
export interface SelectedSection {
title: string;
description: string;
slug: string;
selected: boolean;
customNotes: string;
selectedPattern: string | null;
customPatternDesc: string;
}
export interface LLMKeyEntry {
configured: boolean;
baseUrl?: string;
model?: string;
}
export type LLMKeyStatus = Record<string, LLMKeyEntry>;