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 && (
- Generating personas in parallel... + Generating personas... {Math.round(generationProgress)}%
diff --git a/src/components/ai-recruiter/AIRecruiterForm.tsx b/src/components/ai-recruiter/AIRecruiterForm.tsx index 70b89509..66ceb4fd 100644 --- a/src/components/ai-recruiter/AIRecruiterForm.tsx +++ b/src/components/ai-recruiter/AIRecruiterForm.tsx @@ -438,7 +438,7 @@ export default function AIRecruiterForm({ onSubmit, isGenerating }: AIRecruiterF {isGenerating && (
- Generating multiple personas in parallel. This may take 1-2 minutes... + Generating personas. This may take 1-2 minutes...
)}
diff --git a/src/utils/personaGenerator.ts b/src/utils/personaGenerator.ts index 21e8f25e..df6e238a 100644 --- a/src/utils/personaGenerator.ts +++ b/src/utils/personaGenerator.ts @@ -5,7 +5,7 @@ import { aiPersonasApi, personasApi, foldersApi } from "@/lib/api"; * Generate synthetic personas using the AI endpoint * Using a two-stage approach: * 1. Generate basic profiles in one call - * 2. Expand each profile into a full persona in parallel + * 2. Expand each profile into a full persona * * @param brief Audience brief to guide persona generation * @param researchObjective Optional research objective to focus persona goals and scenarios @@ -28,7 +28,7 @@ export async function generateSyntheticPersonas( console.log(`🔄 generateSyntheticPersonas using model: ${llmModel || 'gemini-2.5-pro'}`); try { - // We'll use the two-stage approach which leverages parallel processing + // We'll use the two-stage approach console.log(`Generating ${count} synthetic personas using two-stage approach...`); // First, check if the brief is too short to be useful