From 878f275e680ea21cffc268b8b86b8d851f8d2c56 Mon Sep 17 00:00:00 2001 From: James Ketrenos Date: Sat, 24 May 2025 16:09:26 -0700 Subject: [PATCH] Lots of changes --- Dockerfile | 3 + .../src/NewApp/Components/CandidateInfo.tsx | 12 +- frontend/src/NewApp/Components/Quote.tsx | 116 ++++++++++++++++++ .../src/NewApp/Pages/GenerateCandidate.tsx | 10 +- src/utils/profile_image.py | 2 +- 5 files changed, 130 insertions(+), 13 deletions(-) create mode 100644 frontend/src/NewApp/Components/Quote.tsx diff --git a/Dockerfile b/Dockerfile index 90eab49..c18fbb7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -172,6 +172,9 @@ RUN pip install yfinance pyzt geopy # Install packages needed for vector operations RUN pip install umap-learn +# Needed for random name generation +RUN pip install names-dataset + FROM llm-base AS backstory #COPY /src/requirements.txt /opt/backstory/src/requirements.txt diff --git a/frontend/src/NewApp/Components/CandidateInfo.tsx b/frontend/src/NewApp/Components/CandidateInfo.tsx index a9d7d82..4a5956d 100644 --- a/frontend/src/NewApp/Components/CandidateInfo.tsx +++ b/frontend/src/NewApp/Components/CandidateInfo.tsx @@ -130,15 +130,15 @@ const CandidateInfo: React.FC = (props: CandidateInfoProps) - + { candidate.location && Location: {candidate.location} - - + } + { candidate.email && Email: {candidate.email} - - + } + { candidate.phone && Phone: {candidate.phone} - + } diff --git a/frontend/src/NewApp/Components/Quote.tsx b/frontend/src/NewApp/Components/Quote.tsx new file mode 100644 index 0000000..9be6dca --- /dev/null +++ b/frontend/src/NewApp/Components/Quote.tsx @@ -0,0 +1,116 @@ + + + + +import React from 'react'; +import { Box, Typography, Paper } from '@mui/material'; +import { styled } from '@mui/material/styles'; + +const QuoteContainer = styled(Paper)(({ theme }) => ({ + position: 'relative', + padding: theme.spacing(4), + margin: theme.spacing(2), + background: 'linear-gradient(135deg, #FFFFFF 0%, #D3CDBF 100%)', // White to Warm Gray + borderRadius: theme.spacing(2), + boxShadow: '0 8px 32px rgba(26, 37, 54, 0.15)', // Midnight Blue shadow + overflow: 'hidden', + border: '1px solid rgba(74, 122, 125, 0.2)', // Subtle Dusty Teal border + '&::before': { + content: '""', + position: 'absolute', + top: 0, + left: 0, + right: 0, + height: '4px', + background: 'linear-gradient(90deg, #4A7A7D 0%, #D4A017 100%)', // Dusty Teal to Golden Ochre + } +})); + +const QuoteText = styled(Typography)(({ theme }) => ({ + fontSize: '1.2rem', + lineHeight: 1.6, + fontStyle: 'italic', + color: '#2E2E2E', // Charcoal Black + position: 'relative', + zIndex: 2, + textAlign: 'center', + fontFamily: '"Georgia", "Times New Roman", serif', + fontWeight: 400, +})); + +const QuoteMark = styled(Typography)(({ theme }) => ({ + fontSize: '4rem', + fontFamily: '"Georgia", "Times New Roman", serif', + fontWeight: 'bold', + opacity: 0.15, + position: 'absolute', + zIndex: 1, + color: '#4A7A7D', // Dusty Teal + userSelect: 'none', +})); + +const OpeningQuote = styled(QuoteMark)({ + top: '10px', + left: '15px', +}); + +const ClosingQuote = styled(QuoteMark)({ + bottom: '10px', + right: '15px', + transform: 'rotate(180deg)', +}); + +const AuthorText = styled(Typography)(({ theme }) => ({ + marginTop: theme.spacing(2), + textAlign: 'right', + fontStyle: 'normal', + fontWeight: 500, + color: '#1A2536', // Midnight Blue + fontSize: '0.95rem', + '&::before': { + content: '"— "', + color: '#D4A017', // Golden Ochre dash + } +})); + +const AccentLine = styled(Box)({ + width: '60px', + height: '2px', + background: 'linear-gradient(90deg, #D4A017 0%, #4A7A7D 100%)', // Golden Ochre to Dusty Teal + margin: '1rem auto', + borderRadius: '1px', +}); + + +interface QuoteProps { + quote?: string, + author?: string +}; + +const Quote = (props : QuoteProps) => { + const { quote, author } = props; + return ( + + " + " + + + + {quote} + + + + + {author && ( + + {author} + + )} + + + ); +}; + +export { + Quote +}; \ No newline at end of file diff --git a/frontend/src/NewApp/Pages/GenerateCandidate.tsx b/frontend/src/NewApp/Pages/GenerateCandidate.tsx index 60792cf..de94705 100644 --- a/frontend/src/NewApp/Pages/GenerateCandidate.tsx +++ b/frontend/src/NewApp/Pages/GenerateCandidate.tsx @@ -61,7 +61,8 @@ const GenerateCandidate = (props: BackstoryElementProps) => { return; } setPrompt(query.prompt); - setState(0); + setState(0); + setStatus("Generating persona..."); setUser(emptyUser); setStreaming(''); setResume(''); @@ -170,7 +171,7 @@ const GenerateCandidate = (props: BackstoryElementProps) => { } const imagePrompt = `A photorealistic profile picture of a ${user?.age} year old ${user?.gender?.toLocaleLowerCase()} ${user?.ethnicity?.toLocaleLowerCase()} person. ${prompt}` - setStatus('Staring image generation...'); + setStatus('Starting image generation...'); setProcessing(true); setCanGenImage(false); setState(3); @@ -279,10 +280,7 @@ const GenerateCandidate = (props: BackstoryElementProps) => { sx={{flexShrink: 1}}/> } { prompt && - - Persona prompt - - + } {processing && AsyncGenera model_type = "flux" device = "cpu" - yield status(message, f"Starting image generation for prompt: {prompt} {request.width}x{request.height} as {filename} using {device}") + yield status(message, f"Starting image generation...") # Get initial time estimate, scaled by resolution estimates = TIME_ESTIMATES[model_type][device]