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,