generate site using llm prompt

This commit is contained in:
Krrish Ghimire
2026-07-02 01:15:16 +05:45
parent 18fed113f9
commit 3ccbd2ebec
75 changed files with 2220 additions and 3173 deletions

View 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;
}