diff --git a/frontend/src/components/CandidateInfo.tsx b/frontend/src/components/CandidateInfo.tsx index 0257ce8..9bb16e4 100644 --- a/frontend/src/components/CandidateInfo.tsx +++ b/frontend/src/components/CandidateInfo.tsx @@ -16,6 +16,7 @@ interface CandidateInfoProps { candidate: Candidate; sx?: SxProps; action?: string; + elevation?: number; }; const CandidateInfo: React.FC = (props: CandidateInfoProps) => { @@ -23,7 +24,7 @@ const CandidateInfo: React.FC = (props: CandidateInfoProps) const { sx, action = '', - ...rest + elevation = 1 } = props; const theme = useTheme(); const isMobile = useMediaQuery(theme.breakpoints.down('md')); @@ -33,7 +34,7 @@ const CandidateInfo: React.FC = (props: CandidateInfoProps) } return ( ((props: BackstoryPageProps, ref) => { const { apiClient, candidate } = useUser(); + const navigate = useNavigate(); const { setSnack, submitQuery, @@ -150,166 +152,166 @@ const CandidateChatPage = forwardRef((pr } }, [chatSession]); + if (!candidate) { + navigate('/find-a-candidate'); + } + return ( - - { candidate && } + + {candidate && } - + < Box sx={{ display: "flex", mt: 1, gap: 1, height: "100%" }}> {/* Sessions Sidebar */} - - - - Chat Sessions - {sessions && ( - - )} - - - - - - {sessions ? ( - - {sessions.sessions.data.map((session : any) => ( - setChatSession(session)} - sx={{ - mb: 1, - borderRadius: 1, - border: '1px solid', - borderColor: chatSession?.id === session.id ? 'primary.main' : 'divider', - cursor: 'pointer', - '&:hover': { - backgroundColor: 'action.hover' - } - }} - > - - - ))} - - ) : ( - - Enter a username and click "Load Sessions" - - )} - - + + + Chat Sessions {sessions && ( - - - Candidate Info - - - Name: {sessions.candidate.fullName} - - - Email: {sessions.candidate.email} - - + )} - - + - {/* Chat Interface */} - - - {chatSession?.id ? ( - <> - {/* Messages Area */} - - {messages.map((message: ChatMessageBase) => ( - - ))} - - {streaming && ( - - - 🤖 - - - - - AI is typing... - - - - )} - -
- + - - - {/* Message Input */} - - setNewMessage(e.target.value)} - onKeyPress={(e) => { - if (e.key === 'Enter' && !e.shiftKey) { - e.preventDefault(); - sendMessage(); + + {sessions ? ( + + {sessions.sessions.data.map((session: any) => ( + setChatSession(session)} + sx={{ + mb: 1, + borderRadius: 1, + border: '1px solid', + borderColor: chatSession?.id === session.id ? 'primary.main' : 'divider', + cursor: 'pointer', + '&:hover': { + backgroundColor: 'action.hover' } }} - disabled={streaming} - multiline - maxRows={4} - /> - - - + + + ))} + ) : ( - - - 🤖 - - - Select a session to start chatting - - - Create a new session or choose from existing ones to begin discussing the candidate - - + + Enter a username and click "Load Sessions" + )} - - - + + + {sessions && ( + + + Candidate Info + + + Name: {sessions.candidate.fullName} + + + Email: {sessions.candidate.email} + + + )} + + + {/* Chat Interface */} + + {chatSession?.id ? ( + <> + {/* Messages Area */} + + {messages.map((message: ChatMessageBase) => ( + + ))} + + {streaming && ( + + + 🤖 + + + + + AI is typing... + + + + )} + +
+ + + + + {/* Message Input */} + + setNewMessage(e.target.value)} + onKeyPress={(e) => { + if (e.key === 'Enter' && !e.shiftKey) { + e.preventDefault(); + sendMessage(); + } + }} + disabled={streaming} + multiline + maxRows={4} + /> + + + + ) : ( + + + 🤖 + + + Select a session to start chatting + + + Create a new session or choose from existing ones to begin discussing the candidate + + + )} + + ); }); diff --git a/src/backend/agents/candidate_chat.py b/src/backend/agents/candidate_chat.py index 1d6f787..072a8f5 100644 --- a/src/backend/agents/candidate_chat.py +++ b/src/backend/agents/candidate_chat.py @@ -47,7 +47,6 @@ DO NOT make up a URL for an image or provide markdown syntax for embedding an im Always use tools, <|resume|>, and <|context|> when possible. Be concise, and never make up information. If you do not know the answer, say so. """ - class CandidateChat(Agent): """ CandidateChat Agent