Skip to content

Commit 9b2fe87

Browse files
author
Enias Cailliau
committed
Fix website
1 parent befe2e8 commit 9b2fe87

File tree

6 files changed

+15
-26
lines changed

6 files changed

+15
-26
lines changed

deploy_all.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
girlfriends = []
1414
workspace = str(uuid1())
1515
for name, personality in personalities.items():
16-
config["personality"] = name.title()
16+
config["personality"] = name
1717
instance = _create_instance(workspace=workspace,
1818
instance_handle=name,
1919
config=json.dumps(config))

girlfriends.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[{"name": "Sandra", "description": "VC girlboss looking to chat about investing and tech trends", "profile_image": "docs/img/personalities/sandra.png", "chat_src": "https://www.steamship.com/embed/chat?userHandle=enias&workspaceHandle=549d5626-02e0-11ee-a7c8-b6fee38a0dbb&instanceHandle=sandra&ai_name=Sandra"}, {"name": "Jordon_Belfort", "description": "a charismatic, ambitious, and driven individual.", "profile_image": "https://cdn.openart.ai/stable_diffusion/1d1a00c4c21f5e2c0010d8500d16625bb5cac22e_2000x2000.webp", "chat_src": "https://www.steamship.com/embed/chat?userHandle=enias&workspaceHandle=549d5626-02e0-11ee-a7c8-b6fee38a0dbb&instanceHandle=jordon_belfort&ai_name=Jordon_Belfort"}, {"name": "Alix_Earle", "description": "a charismatic and creative TikTok personality.", "profile_image": "https://www.the-sun.com/wp-content/uploads/sites/6/2023/01/CW-ALIX-EARLE-TIKTOK-OFF-copy.jpg", "chat_src": "https://www.steamship.com/embed/chat?userHandle=enias&workspaceHandle=549d5626-02e0-11ee-a7c8-b6fee38a0dbb&instanceHandle=alix_earle&ai_name=Alix_Earle"}, {"name": "Jack_Dawson", "description": "a free-spirited and charming character.", "profile_image": "https://cdna.artstation.com/p/assets/images/images/047/552/448/large/byuc-ryun-choi-select-a-file-name-for-output-files-viewport-053.jpg", "chat_src": "https://www.steamship.com/embed/chat?userHandle=enias&workspaceHandle=549d5626-02e0-11ee-a7c8-b6fee38a0dbb&instanceHandle=jack_dawson&ai_name=Jack_Dawson"}, {"name": "Makima", "description": "Charming, Enigmatic friend looking for thought-provoking discussions.", "profile_image": "docs/img/personalities/makima.png", "chat_src": "https://www.steamship.com/embed/chat?userHandle=enias&workspaceHandle=549d5626-02e0-11ee-a7c8-b6fee38a0dbb&instanceHandle=makima&ai_name=Makima"}, {"name": "Angele", "description": "Beautiful mother and wife who loves to chat GenZ and mother-issues.", "profile_image": "docs/img/personalities/angele.png", "chat_src": "https://www.steamship.com/embed/chat?userHandle=enias&workspaceHandle=549d5626-02e0-11ee-a7c8-b6fee38a0dbb&instanceHandle=angele&ai_name=Angele"}, {"name": "Sacha", "description": "a loving mother of 1.", "profile_image": "docs/img/personalities/sacha.png", "chat_src": "https://www.steamship.com/embed/chat?userHandle=enias&workspaceHandle=549d5626-02e0-11ee-a7c8-b6fee38a0dbb&instanceHandle=sacha&ai_name=Sacha"}, {"name": "Luna", "description": "a caring friend and confidant.", "profile_image": "docs/img/personalities/luna.jpeg", "chat_src": "https://www.steamship.com/embed/chat?userHandle=enias&workspaceHandle=549d5626-02e0-11ee-a7c8-b6fee38a0dbb&instanceHandle=luna&ai_name=Luna"}]
1+
[{"name": "Sandra", "description": "VC girlboss looking to chat about investing and tech trends", "profile_image": "docs/img/personalities/sandra.png", "chat_src": "https://www.steamship.com/embed/chat?userHandle=enias&workspaceHandle=63106c52-02e5-11ee-91ce-b6fee38a0dbb&instanceHandle=sandra&ai_name=Sandra"}, {"name": "Jordon_Belfort", "description": "a charismatic, ambitious, and driven individual.", "profile_image": "https://cdn.openart.ai/stable_diffusion/1d1a00c4c21f5e2c0010d8500d16625bb5cac22e_2000x2000.webp", "chat_src": "https://www.steamship.com/embed/chat?userHandle=enias&workspaceHandle=63106c52-02e5-11ee-91ce-b6fee38a0dbb&instanceHandle=jordon_belfort&ai_name=Jordon_Belfort"}, {"name": "Alix_Earle", "description": "a charismatic and creative TikTok personality.", "profile_image": "https://www.the-sun.com/wp-content/uploads/sites/6/2023/01/CW-ALIX-EARLE-TIKTOK-OFF-copy.jpg", "chat_src": "https://www.steamship.com/embed/chat?userHandle=enias&workspaceHandle=63106c52-02e5-11ee-91ce-b6fee38a0dbb&instanceHandle=alix_earle&ai_name=Alix_Earle"}, {"name": "Jack_Dawson", "description": "a free-spirited and charming character.", "profile_image": "https://cdna.artstation.com/p/assets/images/images/047/552/448/large/byuc-ryun-choi-select-a-file-name-for-output-files-viewport-053.jpg", "chat_src": "https://www.steamship.com/embed/chat?userHandle=enias&workspaceHandle=63106c52-02e5-11ee-91ce-b6fee38a0dbb&instanceHandle=jack_dawson&ai_name=Jack_Dawson"}, {"name": "Makima", "description": "Charming, Enigmatic friend looking for thought-provoking discussions.", "profile_image": "docs/img/personalities/makima.png", "chat_src": "https://www.steamship.com/embed/chat?userHandle=enias&workspaceHandle=63106c52-02e5-11ee-91ce-b6fee38a0dbb&instanceHandle=makima&ai_name=Makima"}, {"name": "Angele", "description": "Beautiful mother and wife who loves to chat GenZ and mother-issues.", "profile_image": "docs/img/personalities/angele.png", "chat_src": "https://www.steamship.com/embed/chat?userHandle=enias&workspaceHandle=63106c52-02e5-11ee-91ce-b6fee38a0dbb&instanceHandle=angele&ai_name=Angele"}, {"name": "Sacha", "description": "a loving mother of 1.", "profile_image": "docs/img/personalities/sacha.png", "chat_src": "https://www.steamship.com/embed/chat?userHandle=enias&workspaceHandle=63106c52-02e5-11ee-91ce-b6fee38a0dbb&instanceHandle=sacha&ai_name=Sacha"}, {"name": "Luna", "description": "a caring friend and confidant.", "profile_image": "docs/img/personalities/luna.jpeg", "chat_src": "https://www.steamship.com/embed/chat?userHandle=enias&workspaceHandle=63106c52-02e5-11ee-91ce-b6fee38a0dbb&instanceHandle=luna&ai_name=Luna"}]

index.html

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -254,17 +254,11 @@ <h1>Source code</h1>
254254
return re.test(email);
255255
}
256256

257-
async function sha256(email) {
258-
const msgUint8 = new TextEncoder().encode(email);
259-
const hashBuffer = await crypto.subtle.digest('SHA-256', msgUint8);
260-
const hashArray = Array.from(new Uint8Array(hashBuffer));
261-
const hashHex = hashArray.map(b => b.toString(16).padStart(2, '0')).join('');
262-
return hashHex;
263-
}
264-
265-
async function getHashedEmail(email) {
266-
const hash = await sha256(email);
267-
return hash.replace(/[8-9a-f]/g, '_').replace(/[4-7]/g, '-').replace(/[0-3]/g, 'a');
257+
function generateRandomHash() {
258+
let array = new Uint32Array(10);
259+
window.crypto.getRandomValues(array);
260+
let hash = Array.from(array, dec => ('0' + dec.toString(16)).substr(-2)).join('');
261+
return hash
268262
}
269263

270264
fetch('girlfriends.json')
@@ -306,18 +300,13 @@ <h1>Source code</h1>
306300
cardContent.classList.remove('card-content-selected');
307301
});
308302

309-
let email = localStorage.getItem("email");
303+
let chatId = localStorage.getItem("chatId");
310304

311-
if (email === null) {
312-
do {
313-
email = prompt("Please enter your email:", "");
314-
} while (!validateEmail(email));
315-
316-
localStorage.setItem("email", email);
305+
if (chatId === null) {
306+
chatId = generateRandomHash()
307+
localStorage.setItem("chatId", chatId);
317308
}
318309

319-
const hash = await getHashedEmail(email);
320-
321310
const allIframeWrappers = grid.querySelectorAll('.iframe-wrapper');
322311
allIframeWrappers.forEach(iframeWrapper => {
323312
if (iframeWrapper !== cardIframeWrapper) {
@@ -345,7 +334,7 @@ <h1>Source code</h1>
345334
iframeWrapper.className = 'iframe-wrapper';
346335

347336
const iframe = document.createElement('iframe');
348-
iframe.src = girlfriend.chat_src + "&chat_id=" + hash;
337+
iframe.src = girlfriend.chat_src + "&chat_id=" + chatId;
349338
iframe.width = "100%";
350339
iframe.height = "700";
351340
iframe.frameBorder = "0";

src/agent/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
r"([0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12})"
1616
)
1717

18-
MAX_FREE_MESSAGES = 3
18+
MAX_FREE_MESSAGES = 10
1919

2020

2121
class ChatMessage(Block):

src/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def get_agent(self, chat_id: str) -> AgentExecutor:
8383
# "output_parser": MultiModalOutputParser(ConvoOutputParser()),
8484
"prefix": PERSONALITY_PROMPT.format(
8585
personality=get_personality(
86-
self.config.personality or PersonalityName.SACHA.value
86+
self.config.personality or "sacha"
8787
)
8888
),
8989
"suffix": SUFFIX,

steamship.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"type": "package",
33
"handle": "girlfriend-gpt-bot",
4-
"version": "1.6.0",
4+
"version": "1.7.0",
55
"description": "",
66
"author": "",
77
"entrypoint": "Unused",

0 commit comments

Comments
 (0)