同步了utils里对content_generator的超时时间设置

This commit is contained in:
jinye_huang 2025-04-25 15:48:43 +08:00
parent 44916eedd1
commit f2daf01f83
2 changed files with 6 additions and 4 deletions

View File

@ -193,7 +193,8 @@ def generate_content_and_posters_step(config, run_id, topics_list, output_handle
output_poster_subdir=poster_subdir, output_poster_subdir=poster_subdir,
output_poster_filename=poster_filename, output_poster_filename=poster_filename,
system_prompt=poster_content_system_prompt, system_prompt=poster_content_system_prompt,
collage_style=collage_style collage_style=collage_style,
timeout=request_timeout
) )
if posters_attempted: if posters_attempted:
logging.info(f"Poster generation process completed for Topic {topic_index}.") logging.info(f"Poster generation process completed for Topic {topic_index}.")

View File

@ -455,7 +455,8 @@ def generate_posters_for_topic(topic_item: dict,
output_poster_subdir: str, output_poster_subdir: str,
output_poster_filename: str, output_poster_filename: str,
system_prompt: str, system_prompt: str,
collage_style: str collage_style: str,
timeout: int
): ):
"""Generates all posters for a single topic item, handling image data via OutputHandler. """Generates all posters for a single topic item, handling image data via OutputHandler.
@ -477,7 +478,7 @@ def generate_posters_for_topic(topic_item: dict,
output_poster_filename: Filename for the final poster. output_poster_filename: Filename for the final poster.
system_prompt: System prompt for content generation. system_prompt: System prompt for content generation.
output_handler: An instance of OutputHandler to process results. output_handler: An instance of OutputHandler to process results.
timeout: Timeout for content generation.
Returns: Returns:
True if poster generation was attempted (regardless of individual variant success), True if poster generation was attempted (regardless of individual variant success),
False if setup failed before attempting variants. False if setup failed before attempting variants.
@ -572,7 +573,7 @@ def generate_posters_for_topic(topic_item: dict,
# Generate Text Configurations for All Variants # Generate Text Configurations for All Variants
try: try:
poster_text_configs_raw = content_gen_instance.run(info_directory, variants, loaded_content_list, system_prompt) poster_text_configs_raw = content_gen_instance.run(info_directory, variants, loaded_content_list, system_prompt, timeout=timeout)
if not poster_text_configs_raw: if not poster_text_configs_raw:
logging.warning("Warning: ContentGenerator returned empty configuration data. Skipping posters.") logging.warning("Warning: ContentGenerator returned empty configuration data. Skipping posters.")
return False return False