Story 2.3 - content generation script nightmare alomst done - fixed (maybe) outline too big issue
parent
b6b0acfcb0
commit
3063fc4b84
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue