Skip to content

Commit

Permalink
One more ai error =)
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaUrsa committed Dec 20, 2023
1 parent 3ec250a commit d04fb50
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/discord/commands/global/d.ai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,21 +145,23 @@ async function help(
async function makePersonaEmbed(
persona: ai_personas,
) {
log.debug(F, `makePersonaEmbed started with persona: ${JSON.stringify(persona, null, 2)}`);
const createdBy = await db.users.findUniqueOrThrow({ where: { id: persona.created_by } });
const guild = await discordClient.guilds.fetch(env.DISCORD_GUILD_ID);
const createdByMember = await guild.members.fetch(createdBy.discord_id as string);

const totalCost = (persona.total_tokens / 1000) * aiCosts[persona.ai_model].output;

return embedTemplate()
.setTitle(`Interaction with '${persona.name}' persona:`)
.setTitle(`Info on '${persona.name}' persona:`)
.setColor(Colors.Blurple)
.setDescription(persona.prompt)
.setFields([
{
name: 'Prompt',
value: persona.prompt,
inline: false,
},
// {
// name: 'Prompt',
// value: persona.prompt,
// inline: false,
// },
{
name: 'Model',
value: persona.ai_model,
Expand Down Expand Up @@ -245,7 +247,7 @@ async function get(
});
if (aiPersona) {
// eslint-disable-next-line max-len
description = `Channel ${(channel as TextChannel).name} is linked with the **"${aiPersona.name ?? aiPersona}"** persona:`;
description = `Channel ${(channel as TextChannel).name} is linked with the **"${aiPersona.name ?? aiPersona}"** persona: ${aiPersona.prompt.slice(0, 4000)}`;
}
}

Expand Down

0 comments on commit d04fb50

Please sign in to comment.