From 2d5255e1486f377507208b628b44a2054d150f91 Mon Sep 17 00:00:00 2001 From: William Jeynes Date: Thu, 9 Apr 2026 14:44:47 +0100 Subject: [PATCH] remove title: --- graphviz/processing/process_clusters.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/graphviz/processing/process_clusters.py b/graphviz/processing/process_clusters.py index f67b80e..d62d7e6 100644 --- a/graphviz/processing/process_clusters.py +++ b/graphviz/processing/process_clusters.py @@ -89,7 +89,7 @@ def extract_texts_for_cluster(cluster_id): # ------------------------------- def generate_title(texts): prompt = ( - "Summarize the following texts into a concise 2 - 4 word title that captures the main theme:\n\n" + "Summarize the following texts into a concise 3 - 6 word title that captures the main theme:\n\n" + "\n".join(f"- {t}" for t in texts) + "\n\nTitle:" ) @@ -100,7 +100,9 @@ def generate_title(texts): {"role": "user", "content": prompt} ]) title = response.choices[0].message.content.strip() - print(title) + + if title.lower().startswith("title:"): + title = title[6:].strip() return title except Exception as e: print("Error generating title:", e)