AI functins complete
This commit is contained in:
@@ -175,10 +175,18 @@ class GenerateContentFunction(BaseAIFunction):
|
||||
# JSON response with structured fields
|
||||
content_html = parsed.get('content', '')
|
||||
title = parsed.get('title') or task.title
|
||||
meta_title = parsed.get('meta_title') or parsed.get('seo_title') or title
|
||||
meta_description = parsed.get('meta_description') or parsed.get('seo_description')
|
||||
primary_keyword = parsed.get('primary_keyword') or parsed.get('focus_keyword')
|
||||
secondary_keywords = parsed.get('secondary_keywords') or parsed.get('keywords', [])
|
||||
else:
|
||||
# Plain text response
|
||||
content_html = str(parsed)
|
||||
title = task.title
|
||||
meta_title = title
|
||||
meta_description = None
|
||||
primary_keyword = None
|
||||
secondary_keywords = []
|
||||
|
||||
# Calculate word count
|
||||
word_count = 0
|
||||
@@ -192,6 +200,12 @@ class GenerateContentFunction(BaseAIFunction):
|
||||
title=title,
|
||||
content_html=content_html or '',
|
||||
word_count=word_count,
|
||||
# SEO fields
|
||||
meta_title=meta_title,
|
||||
meta_description=meta_description,
|
||||
primary_keyword=primary_keyword,
|
||||
secondary_keywords=secondary_keywords if isinstance(secondary_keywords, list) else [],
|
||||
# Structure
|
||||
cluster=task.cluster,
|
||||
content_type=task.content_type,
|
||||
content_structure=task.content_structure,
|
||||
|
||||
Reference in New Issue
Block a user