Last active 1746447820

Revision 173270a037b143fa8abaf7d24baf443c7dc006c9

fixgpt.log Raw
12025-05-05T12:59:43: DiscordAPIError[50035]: Invalid Form Body
22025-05-05T12:59:43: content[BASE_TYPE_MAX_LENGTH]: Must be 2000 or fewer in length.
32025-05-05T12:59:43: at handleErrors (/home/fix/fixgpt/node_modules/@discordjs/rest/dist/index.js:748:13)
42025-05-05T12:59:43: at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
52025-05-05T12:59:43: at async SequentialHandler.runRequest (/home/fix/fixgpt/node_modules/@discordjs/rest/dist/index.js:1149:23)
62025-05-05T12:59:43: at async SequentialHandler.queueRequest (/home/fix/fixgpt/node_modules/@discordjs/rest/dist/index.js:980:14)
72025-05-05T12:59:43: at async _REST.request (/home/fix/fixgpt/node_modules/@discordjs/rest/dist/index.js:1293:22)
82025-05-05T12:59:43: at async InteractionWebhook.editMessage (/home/fix/fixgpt/node_modules/discord.js/src/structures/Webhook.js:351:15)
92025-05-05T12:59:43: at async ChatInputCommandInteraction.editReply (/home/fix/fixgpt/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:248:17)
102025-05-05T12:59:43: at async Object.execute (file:///home/fix/fixgpt/commands/prompt.js:54:11)
112025-05-05T12:59:43: at async Client.<anonymous> (file:///home/fix/fixgpt/app.js:52:5) {
122025-05-05T12:59:43: requestBody: {
132025-05-05T12:59:43: files: [],
142025-05-05T12:59:43: json: {
152025-05-05T12:59:43: content: `Okay, let's break down Rust vs. C# for UI development. There's no simple "better" - it depends heavily on your priorities and project scope.\n` +
162025-05-05T12:59:43: '\n' +
172025-05-05T12:59:43: '**C# (with .NET/WPF/WinForms/MAUI):**\n' +
182025-05-05T12:59:43: '\n' +
192025-05-05T12:59:43: '* **Pros:**\n' +
202025-05-05T12:59:43: ' * **Mature Ecosystem:** .NET has a *huge* ecosystem of UI frameworks (WPF, WinForms, MAUI – cross-platform). Lots of libraries, tutorials, and support.\n' +
212025-05-05T12:59:43: ' * **Rapid Development:** C# is generally faster to develop in due to garbage collection, a rich standard library, and simpler syntax.\n' +
222025-05-05T12:59:43: ' * **Easier Learning Curve:** Easier to pick up than Rust, especially if you have prior object-oriented programming experience.\n' +
232025-05-05T12:59:43: ' * **Visual Studio:** Excellent IDE support with Visual Studio.\n' +
242025-05-05T12:59:43: ' * **Cross-Platform (MAUI):** MAUI allows you to build UIs for Windows, macOS, Android, and iOS from a single codebase.\n' +
252025-05-05T12:59:43: '\n' +
262025-05-05T12:59:43: '* **Cons:**\n' +
272025-05-05T12:59:43: ' * **Performance:** Garbage collection can introduce pauses. Generally not *as* performant as Rust.\n' +
282025-05-05T12:59:43: " * **Memory Safety (less concern):** C#'s garbage collection abstracts away memory management, reducing risk but also limiting fine-grained control.\n" +
292025-05-05T12:59:43: '\n' +
302025-05-05T12:59:43: '\n' +
312025-05-05T12:59:43: '\n' +
322025-05-05T12:59:43: '**Rust (with frameworks like Iced, Relm4, egui):**\n' +
332025-05-05T12:59:43: '\n' +
342025-05-05T12:59:43: '* **Pros:**\n' +
352025-05-05T12:59:43: ' * **Performance:** Exceptionally fast and efficient due to its zero-cost abstractions and memory safety guarantees.\n' +
362025-05-05T12:59:43: " * **Memory Safety:** Rust's compiler prevents memory-related bugs at compile time (no null pointers, data races, etc.).\n" +
372025-05-05T12:59:43: ' * **Control:** You have fine-grained control over memory allocation and resource management.\n' +
382025-05-05T12:59:43: ' * **Emerging UI Frameworks:** Frameworks like Iced and Relm4 are improving, although not as mature as .NET options. egui is a popular immediate mode GUI library.\n' +
392025-05-05T12:59:43: '\n' +
402025-05-05T12:59:43: '* **Cons:**\n' +
412025-05-05T12:59:43: " * **Steeper Learning Curve:** Rust's ownership and borrowing system can be challenging to master.\n" +
422025-05-05T12:59:43: ' * **Development Speed:** Generally slower development speed compared to C#. The compiler can be strict.\n' +
432025-05-05T12:59:43: " * **Less Mature UI Ecosystem:** Rust's UI frameworks are newer and have fewer features/libraries compared to .NET.\n" +
442025-05-05T12:59:43: ' * **Debugging:** Debugging Rust can be more difficult.\n' +
452025-05-05T12:59:43: '\n' +
462025-05-05T12:59:43: '**Summary:**\n' +
472025-05-05T12:59:43: '\n' +
482025-05-05T12:59:43: '* **Choose C# if:** You need to build a UI *quickly*, prioritize ease of development, and/or need a mature and well-supported platform (like desktop apps for Windows). MAUI is a compelling option for cross-platform development.\n' +
492025-05-05T12:59:43: "* **Choose Rust if:** Performance is *absolutely critical*, you need precise control over resources, and you're comfortable with a steeper learning curve. Consider it for embedded systems or specialized applications.\n" +
502025-05-05T12:59:43: '\n' +
512025-05-05T12:59:43: '\n' +
522025-05-05T12:59:43: '\n' +
532025-05-05T12:59:43: 'To help me tailor my advice further, could you tell me:\n' +
542025-05-05T12:59:43: '\n' +
552025-05-05T12:59:43: '* What type of UI are you planning to build (desktop, web, embedded)?\n' +
562025-05-05T12:59:43: "* What's your priority: Speed of development, performance, or something else?",
572025-05-05T12:59:43: tts: false,
582025-05-05T12:59:43: nonce: undefined,
592025-05-05T12:59:43: enforce_nonce: false,
602025-05-05T12:59:43: embeds: undefined,
612025-05-05T12:59:43: components: undefined,
622025-05-05T12:59:43: username: undefined,
632025-05-05T12:59:43: avatar_url: undefined,
642025-05-05T12:59:43: allowed_mentions: undefined,
652025-05-05T12:59:43: flags: undefined,
662025-05-05T12:59:43: message_reference: undefined,
672025-05-05T12:59:43: attachments: undefined,
682025-05-05T12:59:43: sticker_ids: undefined,
692025-05-05T12:59:43: thread_name: undefined,
702025-05-05T12:59:43: applied_tags: undefined,
712025-05-05T12:59:43: poll: undefined
722025-05-05T12:59:43: }
732025-05-05T12:59:43: },
742025-05-05T12:59:43: rawError: {
752025-05-05T12:59:43: message: 'Invalid Form Body',
762025-05-05T12:59:43: code: 50035,
772025-05-05T12:59:43: errors: { content: [Object] }
782025-05-05T12:59:43: },
792025-05-05T12:59:43: code: 50035,
802025-05-05T12:59:43: status: 400,
812025-05-05T12:59:43: method: 'PATCH',
822025-05-05T12:59:43: url: 'https://discord.com/api/v10/webhooks/1366823670730719362/aW50ZXJhY3Rpb246MTM2ODg4OTcxMTM3NTk0MTY3MjpnUmhzTG8wUGxmREpPc0ZXa254eURaWnlUUm9kR0hIUG8zalZDMzZ4TTRxU01HNWo2U2ZSRTZGVnFMT21yRm5pbVdFTk1hQ243aTduSFFBeDQ1MlFzQ2c0SlFMNnlqMUF4NXFEdnozbXZUUDFFZ0JNZXU3WG1kTHI1WU1EamtVNA/messages/%40original'
832025-05-05T12:59:43: }
prompt.js Raw
1import { SlashCommandBuilder } from 'discord.js';
2import axios from 'axios';
3
4let prompting = false;
5const num_gpu_map = {
6 'gemma3:12b': 48,
7 'gemma3:27b': 30,
8 'dolphin-mixtral:8x7b-v2.5': 9,
9 'phi4': 33
10};
11
12export default {
13 data: new SlashCommandBuilder()
14 .setName('prompt')
15 .setDescription('Prompt a model')
16 .addStringOption(option =>
17 option.setName('model')
18 .setDescription('The model to prompt, see /models for available models')
19 .setRequired(true)
20 .addChoices([
21 { name: 'gemma3:12b', value: 'gemma3:12b' },
22 { name: 'gemma3:27b', value: 'gemma3:27b' },
23 { name: 'dolphin-mixtral', value: 'dolphin-mixtral:8x7b-v2.5' },
24 { name: 'phi4', value: 'phi4' }
25 ])
26 )
27 .addStringOption(option =>
28 option.setName('prompt')
29 .setDescription('The prompt to send to the model')
30 .setRequired(true)
31 .setMaxLength(1500)
32 ),
33
34 async execute(interaction) {
35 interaction.deferReply();
36
37 if(!prompting) {
38 prompting = true;
39
40 const ollamaReply = await axios.post('http://localhost:11434/api/generate', {
41 model: interaction.options.getString('model'),
42 prompt: interaction.options.getString('prompt'),
43 system: "Feel free to reply with long responses if necessary, but not longer than 2000 characters.",
44 stream: false,
45 options: {
46 num_gpu: num_gpu_map[interaction.options.getString('model')]
47 }
48 });
49
50 console.log('[INFO] Prompted model:', interaction.options.getString('model'));
51 console.log('[INFO] Prompt:', interaction.options.getString('prompt'));
52
53 if(ollamaReply) {
54 await interaction.editReply(ollamaReply.data.response);
55 }
56 else{
57 return await interaction.editReply('Unable to prompt ollama, try again later.');
58 }
59
60 prompting = false;
61 }
62 else{
63 await interaction.editReply(`Don't make me shit myself, i am already replying to a prompt.`);
64 }
65 }
66};