Story 2.3 - content generation script nightmare alomst done - fixed (maybe) outline too big issue

main
PeninsulaInd 2025-10-19 20:46:06 -05:00
parent b6b0acfcb0
commit 3063fc4b84
1 changed files with 6 additions and 0 deletions

View File

@ -24,6 +24,9 @@ class GenerationError(Exception):
class ContentGenerationService: class ContentGenerationService:
"""Service for AI-powered content generation with validation""" """Service for AI-powered content generation with validation"""
MAX_H2_TOTAL = 5
MAX_H3_TOTAL = 13
def __init__( def __init__(
self, self,
session: Session, session: Session,
@ -189,6 +192,9 @@ class ContentGenerationService:
h2_total = int(h2_total) h2_total = int(h2_total)
h3_total = int(h3_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( prompt = prompt_template["user_template"].format(
title=title, title=title,
main_keyword=project.main_keyword, main_keyword=project.main_keyword,