diff --git a/backend/app/routes/ai_personas.py b/backend/app/routes/ai_personas.py index ed084828..c01cbf9a 100644 --- a/backend/app/routes/ai_personas.py +++ b/backend/app/routes/ai_personas.py @@ -466,13 +466,13 @@ def batch_generate_personas(): audience_brief=custom_data.get('audience_brief') ) - # Add to the list of tasks to be executed in parallel + # Add to the list of tasks to be executed generation_tasks.append({ 'prompt_customization': custom_prompt, 'temperature': temperature }) - # Generate personas in parallel + # Generate personas personas = [] with concurrent.futures.ThreadPoolExecutor(max_workers=min(count, 4)) as executor: # Start the generation tasks @@ -495,7 +495,7 @@ def batch_generate_personas(): raise PersonaGenerationError(f"Failed to generate one of the personas: {str(exc)}") return jsonify({ - "message": f"Successfully generated {len(personas)} personas in parallel", + "message": f"Successfully generated {len(personas)} personas", "personas": personas }), 200 @@ -547,13 +547,13 @@ def batch_generate_and_save_personas(): audience_brief=custom_data.get('audience_brief') ) - # Add to the list of tasks to be executed in parallel + # Add to the list of tasks to be executed generation_tasks.append({ 'prompt_customization': custom_prompt, 'temperature': temperature }) - # Generate personas in parallel + # Generate personas generated_personas = [] with concurrent.futures.ThreadPoolExecutor(max_workers=min(count, 4)) as executor: # Start the generation tasks @@ -611,7 +611,7 @@ def batch_generate_and_save_personas(): persona_ids.append(str(persona_id)) return jsonify({ - "message": f"Successfully generated and saved {len(personas)} personas in parallel", + "message": f"Successfully generated and saved {len(personas)} personas", "personas": personas, "persona_ids": persona_ids }), 201 @@ -760,7 +760,7 @@ def batch_generate_summaries(): Generate comprehensive markdown summaries for multiple personas for download/client review. This endpoint takes a list of persona IDs, fetches their complete data, and generates - detailed summaries using LLM processing. Personas are processed in parallel batches of 10 + detailed summaries using LLM processing. Personas are processed in batches of 10 to optimize performance while staying within API limits. No upper limit on persona count. Request body: @@ -852,7 +852,7 @@ def batch_generate_summaries(): batch = personas_data[i:i + batch_size] current_app.logger.info(f"Processing batch {i//batch_size + 1}: {len(batch)} personas") - # Process this batch in parallel + # Process this batch with concurrent.futures.ThreadPoolExecutor(max_workers=batch_size) as executor: # Submit all tasks for this batch future_to_persona = { diff --git a/src/components/AIRecruiter.tsx b/src/components/AIRecruiter.tsx index 31d52f3b..722e59a9 100644 --- a/src/components/AIRecruiter.tsx +++ b/src/components/AIRecruiter.tsx @@ -89,7 +89,7 @@ export default function AIRecruiter({ targetFolderId, targetFolderName }: AIRecr }); } - toast.info("Generating AI personas in parallel", { + toast.info("Generating AI personas", { description: `Creating ${count} synthetic personas based on your brief. This may take ${estimatedTime}. Please be patient.`, duration: 10000 }); @@ -320,7 +320,7 @@ export default function AIRecruiter({ targetFolderId, targetFolderName }: AIRecr {isGenerating && (