mirror of
https://github.com/severian-dev/sucker.severian.dev.git
synced 2025-10-28 04:35:43 +00:00
chore: 1.5
This commit is contained in:
@@ -4,6 +4,7 @@ Check package.json for commands, I can't be bothered.
|
|||||||
|
|
||||||
### Changelog
|
### Changelog
|
||||||
|
|
||||||
|
- 1.5: {{user}} substitution for user persona name
|
||||||
- 1.4: Mooth just keeps finding bugs, damn.
|
- 1.4: Mooth just keeps finding bugs, damn.
|
||||||
- 1.3: Mooth found a bug, fixed it.
|
- 1.3: Mooth found a bug, fixed it.
|
||||||
- 1.2: Fix for Janitor having changed their prompt system
|
- 1.2: Fix for Janitor having changed their prompt system
|
||||||
|
|||||||
@@ -96,8 +96,11 @@ function extractCardData(messages: Message[]): CardData {
|
|||||||
|
|
||||||
// Find all persona tags between system and the first optional tag (scenario or example_dialogs)
|
// Find all persona tags between system and the first optional tag (scenario or example_dialogs)
|
||||||
const personas = findTagsBetween(content0, "system");
|
const personas = findTagsBetween(content0, "system");
|
||||||
|
|
||||||
|
const userPersona = personas[personas.length - 2];
|
||||||
const charPersona = personas[personas.length - 1];
|
const charPersona = personas[personas.length - 1];
|
||||||
const charName = charPersona?.tag || "";
|
const charName = charPersona?.tag || "";
|
||||||
|
const userName = userPersona?.tag || "";
|
||||||
|
|
||||||
// Initialize card data with the character name
|
// Initialize card data with the character name
|
||||||
let cardData: CardData = {
|
let cardData: CardData = {
|
||||||
@@ -109,6 +112,16 @@ function extractCardData(messages: Message[]): CardData {
|
|||||||
first_mes: content1,
|
first_mes: content1,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Replace user name with placeholder in all fields
|
||||||
|
for (const field in cardData) {
|
||||||
|
if (field !== "name") {
|
||||||
|
const val = cardData[field as keyof CardData];
|
||||||
|
if (typeof val === "string") {
|
||||||
|
cardData[field as keyof CardData] = safeReplace(val, userName, "{{user}}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Replace character name with placeholder in all fields
|
// Replace character name with placeholder in all fields
|
||||||
for (const field in cardData) {
|
for (const field in cardData) {
|
||||||
if (field !== "name") {
|
if (field !== "name") {
|
||||||
|
|||||||
@@ -187,9 +187,9 @@ export default function Home() {
|
|||||||
<div className="container mx-auto px-4 py-8">
|
<div className="container mx-auto px-4 py-8">
|
||||||
<div className="flex justify-between items-center mb-4">
|
<div className="flex justify-between items-center mb-4">
|
||||||
<div>
|
<div>
|
||||||
<h1 className="text-3xl font-bold">Sucker v1.4</h1>
|
<h1 className="text-3xl font-bold">Sucker v1.5</h1>
|
||||||
<p className="text-sm text-muted-foreground">
|
<p className="text-sm text-muted-foreground">
|
||||||
Mooth's on a bug hunting spree for some reason.👌
|
User persona name substitution fixed, let me know how it goes.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
Reference in New Issue
Block a user