Really snazzy
This commit is contained in:
parent
142c2baac4
commit
8dc77dd8f7
@ -2,6 +2,7 @@ import React from 'react';
|
|||||||
import { Box, Typography, Avatar, Paper, Grid, Chip } from '@mui/material';
|
import { Box, Typography, Avatar, Paper, Grid, Chip } from '@mui/material';
|
||||||
import { styled } from '@mui/material/styles';
|
import { styled } from '@mui/material/styles';
|
||||||
import { Tunables } from '../../Components/ChatQuery';
|
import { Tunables } from '../../Components/ChatQuery';
|
||||||
|
import { Route, Routes, useLocation, useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
// Define the UserInfo interface for type safety
|
// Define the UserInfo interface for type safety
|
||||||
interface UserInfo {
|
interface UserInfo {
|
||||||
@ -33,6 +34,7 @@ const StyledPaper = styled(Paper)(({ theme }) => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
const CandidateInfo: React.FC<CandidateInfoProps> = ({ userInfo }) => {
|
const CandidateInfo: React.FC<CandidateInfoProps> = ({ userInfo }) => {
|
||||||
|
const navigate = useNavigate();
|
||||||
// Format RAG content size (e.g., if it's in bytes, convert to KB/MB)
|
// Format RAG content size (e.g., if it's in bytes, convert to KB/MB)
|
||||||
const formatRagSize = (size: number): string => {
|
const formatRagSize = (size: number): string => {
|
||||||
if (size < 1000) return `${size} RAG elements`;
|
if (size < 1000) return `${size} RAG elements`;
|
||||||
@ -61,6 +63,7 @@ const CandidateInfo: React.FC<CandidateInfoProps> = ({ userInfo }) => {
|
|||||||
{userInfo.full_name}
|
{userInfo.full_name}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Chip
|
<Chip
|
||||||
|
onClick={() => navigate('/rag-visualizer')}
|
||||||
label={formatRagSize(userInfo.rag_content_size)}
|
label={formatRagSize(userInfo.rag_content_size)}
|
||||||
color="primary"
|
color="primary"
|
||||||
size="small"
|
size="small"
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
|
import { Route, Routes, useLocation, useNavigate } from 'react-router-dom';
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
Container,
|
Container,
|
||||||
@ -13,6 +14,7 @@ import {
|
|||||||
import { useTheme } from '@mui/material/styles';
|
import { useTheme } from '@mui/material/styles';
|
||||||
import ConstructionIcon from '@mui/icons-material/Construction';
|
import ConstructionIcon from '@mui/icons-material/Construction';
|
||||||
import RocketLaunchIcon from '@mui/icons-material/RocketLaunch';
|
import RocketLaunchIcon from '@mui/icons-material/RocketLaunch';
|
||||||
|
import { Navigate } from 'react-router-dom';
|
||||||
|
|
||||||
interface BetaPageProps {
|
interface BetaPageProps {
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
@ -28,12 +30,13 @@ export const BetaPage: React.FC<BetaPageProps> = ({
|
|||||||
title = "Coming Soon",
|
title = "Coming Soon",
|
||||||
subtitle = "This page is currently in development",
|
subtitle = "This page is currently in development",
|
||||||
returnPath = "/",
|
returnPath = "/",
|
||||||
returnLabel = "Return to Dashboard",
|
returnLabel = "Return to Backstory",
|
||||||
onReturn,
|
onReturn,
|
||||||
}) => {
|
}) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
|
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
|
||||||
const [showSparkle, setShowSparkle] = useState<boolean>(false);
|
const [showSparkle, setShowSparkle] = useState<boolean>(false);
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
// Enhanced sparkle effect for background elements
|
// Enhanced sparkle effect for background elements
|
||||||
const [sparkles, setSparkles] = useState<Array<{
|
const [sparkles, setSparkles] = useState<Array<{
|
||||||
@ -72,7 +75,7 @@ export const BetaPage: React.FC<BetaPageProps> = ({
|
|||||||
if (onReturn) {
|
if (onReturn) {
|
||||||
onReturn();
|
onReturn();
|
||||||
} else if (returnPath) {
|
} else if (returnPath) {
|
||||||
window.location.href = returnPath;
|
navigate(returnPath);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -72,16 +72,18 @@ What would you like to know about ${user.first_name}?
|
|||||||
}, [setSnack, sessionId]);
|
}, [setSnack, sessionId]);
|
||||||
|
|
||||||
if (sessionId === undefined || user === undefined) {
|
if (sessionId === undefined || user === undefined) {
|
||||||
return <LoadingComponent
|
return (<Box>
|
||||||
|
<LoadingComponent
|
||||||
loadingText="Fetching user information..."
|
loadingText="Fetching user information..."
|
||||||
loaderType="linear"
|
loaderType="linear"
|
||||||
withFade={true}
|
withFade={true}
|
||||||
fadeDuration={1200} />;
|
fadeDuration={1200} />
|
||||||
|
</Box>);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<CandidateInfo userInfo={user}/>
|
<CandidateInfo userInfo={user} />
|
||||||
<Conversation
|
<Conversation
|
||||||
ref={ref}
|
ref={ref}
|
||||||
{...{
|
{...{
|
||||||
@ -94,7 +96,7 @@ What would you like to know about ${user.first_name}?
|
|||||||
// preamble: preamble,
|
// preamble: preamble,
|
||||||
defaultPrompts: questions,
|
defaultPrompts: questions,
|
||||||
submitQuery,
|
submitQuery,
|
||||||
}}/>
|
}} />
|
||||||
</Box>);
|
</Box>);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -575,6 +575,7 @@ class WebServer:
|
|||||||
"first_name": user.first_name,
|
"first_name": user.first_name,
|
||||||
"last_name": user.last_name,
|
"last_name": user.last_name,
|
||||||
"full_name": user.full_name,
|
"full_name": user.full_name,
|
||||||
|
"description": user.description,
|
||||||
"contact_info": user.contact_info,
|
"contact_info": user.contact_info,
|
||||||
"rag_content_size": user.rag_content_size,
|
"rag_content_size": user.rag_content_size,
|
||||||
"profile_url": user.profile_url,
|
"profile_url": user.profile_url,
|
||||||
|
@ -42,7 +42,7 @@ logging_level = os.getenv("LOGGING_LEVEL", "INFO").upper()
|
|||||||
chunk_buffer = 5 # Number of lines before and after chunk beyond the portion used in embedding (to return to callers)
|
chunk_buffer = 5 # Number of lines before and after chunk beyond the portion used in embedding (to return to callers)
|
||||||
|
|
||||||
# Maximum number of entries for ChromaDB to find
|
# Maximum number of entries for ChromaDB to find
|
||||||
default_rag_top_k = 80
|
default_rag_top_k = 50
|
||||||
|
|
||||||
# Cosine Distance Equivalent Similarity Retrieval Characteristics
|
# Cosine Distance Equivalent Similarity Retrieval Characteristics
|
||||||
# 0.2 - 0.3 0.85 - 0.90 Very strict, highly precise results only
|
# 0.2 - 0.3 0.85 - 0.90 Very strict, highly precise results only
|
||||||
|
@ -200,7 +200,7 @@ class User(BaseModel):
|
|||||||
self.first_name = info.get("first_name", self.username)
|
self.first_name = info.get("first_name", self.username)
|
||||||
self.last_name = info.get("last_name", "")
|
self.last_name = info.get("last_name", "")
|
||||||
self.full_name = info.get("full_name", f"{self.first_name} {self.last_name}")
|
self.full_name = info.get("full_name", f"{self.first_name} {self.last_name}")
|
||||||
self.description = info.get("first_name", self.description)
|
self.description = info.get("description", self.description)
|
||||||
self.profile_url = info.get("profile_url", self.description)
|
self.profile_url = info.get("profile_url", self.description)
|
||||||
self.contact_info = info.get("contact_info", {})
|
self.contact_info = info.get("contact_info", {})
|
||||||
questions = info.get("questions", [ f"Tell me about {self.first_name}.", f"What are {self.first_name}'s professional strengths?"])
|
questions = info.get("questions", [ f"Tell me about {self.first_name}.", f"What are {self.first_name}'s professional strengths?"])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user