From 3063fc4b84a2ffde4de08b2ce5b1e4873c632dc2 Mon Sep 17 00:00:00 2001 From: PeninsulaInd Date: Sun, 19 Oct 2025 20:46:06 -0500 Subject: [PATCH] Story 2.3 - content generation script nightmare alomst done - fixed (maybe) outline too big issue --- src/generation/service.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/generation/service.py b/src/generation/service.py index cd23032..c5bf6ab 100644 --- a/src/generation/service.py +++ b/src/generation/service.py @@ -24,6 +24,9 @@ class GenerationError(Exception): class ContentGenerationService: """Service for AI-powered content generation with validation""" + MAX_H2_TOTAL = 5 + MAX_H3_TOTAL = 13 + def __init__( self, session: Session, @@ -189,6 +192,9 @@ class ContentGenerationService: h2_total = int(h2_total) h3_total = int(h3_total) + h2_total = min(h2_total, self.MAX_H2_TOTAL) + h3_total = min(h3_total, self.MAX_H3_TOTAL) + prompt = prompt_template["user_template"].format( title=title, main_keyword=project.main_keyword,