diff --git a/main.py b/main.py index 4f1b72a..4fe57db 100644 --- a/main.py +++ b/main.py @@ -193,7 +193,8 @@ def generate_content_and_posters_step(config, run_id, topics_list, output_handle output_poster_subdir=poster_subdir, output_poster_filename=poster_filename, system_prompt=poster_content_system_prompt, - collage_style=collage_style + collage_style=collage_style, + timeout=request_timeout ) if posters_attempted: logging.info(f"Poster generation process completed for Topic {topic_index}.") diff --git a/utils/tweet_generator.py b/utils/tweet_generator.py index 1458a85..44a6302 100644 --- a/utils/tweet_generator.py +++ b/utils/tweet_generator.py @@ -455,7 +455,8 @@ def generate_posters_for_topic(topic_item: dict, output_poster_subdir: str, output_poster_filename: 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. @@ -477,7 +478,7 @@ def generate_posters_for_topic(topic_item: dict, output_poster_filename: Filename for the final poster. system_prompt: System prompt for content generation. output_handler: An instance of OutputHandler to process results. - + timeout: Timeout for content generation. Returns: True if poster generation was attempted (regardless of individual variant success), 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 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: logging.warning("Warning: ContentGenerator returned empty configuration data. Skipping posters.") return False