Fixups
This commit is contained in:
parent
2355c1dfa5
commit
a6ff43af1d
@ -123,7 +123,7 @@ const GenerateCandidate = (props: BackstoryElementProps) => {
|
||||
} else {
|
||||
setTimestamp(Date.now())
|
||||
}
|
||||
if (data.message) {
|
||||
if (data.message !== '') {
|
||||
setStatus(data.message);
|
||||
}
|
||||
break;
|
||||
@ -296,7 +296,7 @@ const GenerateCandidate = (props: BackstoryElementProps) => {
|
||||
} else {
|
||||
setTimestamp(Date.now())
|
||||
}
|
||||
if (data.message) {
|
||||
if (data.message !== '') {
|
||||
setStatus(data.message);
|
||||
}
|
||||
break;
|
||||
@ -366,24 +366,26 @@ const GenerateCandidate = (props: BackstoryElementProps) => {
|
||||
}
|
||||
<Box sx={{display: "flex", flexDirection: "column"}}>
|
||||
<Box sx={{ display: "flex", flexDirection: "row", position: "relative" }}>
|
||||
<Avatar
|
||||
<Box sx={{ display: "flex", position: "relative" }}>
|
||||
<Avatar
|
||||
src={hasProfile ? `/api/u/${user.username}/profile/${sessionId}` : ''}
|
||||
alt={`${user.full_name}'s profile`}
|
||||
sx={{
|
||||
width: 80,
|
||||
height: 80,
|
||||
border: '2px solid #e0e0e0',
|
||||
}}
|
||||
/>
|
||||
{processing && <Pulse sx={{ position: "relative", left: "-80px" }} timestamp={timestamp} />}
|
||||
<Tooltip title={"Generate Profile Picture"}>
|
||||
sx={{
|
||||
width: 80,
|
||||
height: 80,
|
||||
border: '2px solid #e0e0e0',
|
||||
}}
|
||||
/>
|
||||
{processing && <Pulse sx={{ position: "relative", left: "-80px", top: "0px" }} timestamp={timestamp} />}
|
||||
</Box>
|
||||
<Tooltip title={"Generate Picture"}>
|
||||
<span style={{ display: "flex", flexGrow: 1 }}>
|
||||
<Button
|
||||
sx={{ m: 1, gap: 1, flexGrow: 1 }}
|
||||
variant="contained"
|
||||
disabled={sessionId === undefined || processing || !canGenImage}
|
||||
onClick={() => { generateProfile() }}>
|
||||
Generate Profile Picture<SendIcon />
|
||||
Generate Picture<SendIcon />
|
||||
</Button>
|
||||
</span>
|
||||
</Tooltip>
|
||||
|
@ -218,6 +218,7 @@ class PersonaGenerator(Agent):
|
||||
self.username = persona.get("username", None)
|
||||
if not self.username:
|
||||
raise ValueError("LLM did not generate a username")
|
||||
self.username = re.sub(r'\s+', '.', g)
|
||||
user_dir = os.path.join(defines.user_dir, persona["username"])
|
||||
while os.path.exists(user_dir):
|
||||
match = re.match(r"^(.*?)(\d*)$", persona["username"])
|
||||
|
Loading…
x
Reference in New Issue
Block a user