Structured outputs for regular replies; streaming can be enabled/disabled

This commit is contained in:
2026-03-01 19:25:15 -08:00
parent 15cffb3b66
commit 907a7caec6
7 changed files with 218 additions and 18 deletions

View File

@@ -10,6 +10,7 @@ const config: LLMConfig = {
msg_context: 8,
frequency_penalty: 0.0,
presence_penalty: 0.0,
streaming: false,
};
async function configCommand(interaction: ChatInputCommandInteraction) {
@@ -29,6 +30,7 @@ async function configCommand(interaction: ChatInputCommandInteraction) {
interaction.options.getNumber('frequency_penalty') ?? config.frequency_penalty;
config.presence_penalty =
interaction.options.getNumber('presence_penalty') ?? config.presence_penalty;
config.streaming = interaction.options.getBoolean('streaming') ?? config.streaming;
await interaction.reply(`
\`\`\`
max_new_tokens = ${config.max_new_tokens}
@@ -38,6 +40,7 @@ temperature = ${config.temperature}
top_p = ${config.top_p}
frequency_penalty = ${config.frequency_penalty}
presence_penalty = ${config.presence_penalty}
streaming = ${config.streaming}
\`\`\`
`);
}
@@ -80,6 +83,11 @@ export = {
)
.addIntegerOption((opt) =>
opt.setName('msg_context').setDescription('Num. messages in context (default: 8)')
)
.addBooleanOption((opt) =>
opt
.setName('streaming')
.setDescription('Enable/disable streaming responses (default: true)')
),
execute: configCommand,
state: () => config,

View File

@@ -6,4 +6,5 @@ export interface LLMConfig {
frequency_penalty: number;
presence_penalty: number;
msg_context: number;
streaming: boolean;
}