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