generate site using llm prompt
This commit is contained in:
76
frontend/src/app/core/models/llm.ts
Normal file
76
frontend/src/app/core/models/llm.ts
Normal file
@@ -0,0 +1,76 @@
|
||||
import { ComponentType } from './component';
|
||||
|
||||
export interface LLMGenerateRequest {
|
||||
prompt: string;
|
||||
siteId: string;
|
||||
references?: Reference[];
|
||||
}
|
||||
|
||||
export interface LLMRefineRequest {
|
||||
prompt: string;
|
||||
siteId: string;
|
||||
currentStructure: SiteStructure;
|
||||
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;
|
||||
components: ComponentStructure[];
|
||||
}
|
||||
|
||||
export interface ComponentStructure {
|
||||
id?: string;
|
||||
type: ComponentType;
|
||||
orderIndex: number;
|
||||
config: Record<string, unknown>;
|
||||
styles: Record<string, unknown>;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user