Skip Navigation
4 comments
  • Hi! Seems promising, however....

    I went to your site (PC Firefox, Windows, 1920x1200, not logged in, advert bar at the bottom. PC Chrome logged in, no advert bar) and entered 'what is $root?' in the chat-input.

    It starts to come up with an explanation, but when the output field fills the chat-messages, it removes the explanation and displays 'Sorry, I encountered an error. Please try again.', seemingly when finalizing the explanation. I tried it 3 times with 3 times the same result in both browsers.

    • Tried 'what is $meta?', same result.
    • Dito with 'what are nested lists?'

    Furthermore:

    • The markdown of the code/chat output does not work, making code examples quite hard to read.
    • Are you using a timer outputting the text? It is really slow at posting the the text character by character. On average people do read a lot faster than that.

    Love the idea, so don't get discouraged, as I think something like this will be a great help!!

    • Thanks for the feedback, Danno — really appreciate the detail.

      Just a couple of quick ones from my end: Using different browsers? I'm not sure what you meant but if you just use a default browser like *Thorium *or Brave without any plugins or extensions and use that for a sandbox could be a bit easier than swapping thru multiple ones as i wrote in notepad and uploaded it and then used their ai-text-plugin to populate the responses.

      You mentioned $root. ..were you thinking in Linux terms? In Perchance context, that’s not a typical variable. The *$root *you mentioned isn’t part of standard Perchance syntax, so the assistant likely didn’t know what to do with that.

      Markdown rendering is still basic here, true. Did you try using backticks like code or triple blocks for full snippets? I wrote the code as small as possible so Its intentionally minimal for now.

      The AI will format code if you ask it clearly *(e.g. “Can you explain how to use [[list]] with .capitalize?”), *but I’m still working on adding persistent parsing for code snippets.

      I might improve that parser later with something else because its using the Perchance built in ai helper and as you see from the editing windows the left window "Lists" is a mix of javascript and custom api so it all depends on how Perchance ai is understanding you.

      Did you get a chance to read the description or peek at the source? It’s intentionally a “barebones” helper — meant to be editable, designed for users to modify.

      It’s a skeleton helper, not a full deployment not production-ready just meant as a wireframe template with minimal code.

      *Still, cheers for the tests, your notes are helpful , it’s honestly useful knowing what people run into. thanks again for testing it out * 😀

      • Hi!

        I'm using either Chrome or Firefox on Windows PC, straightforward, no VPN/Sandbox, or any other tool (maybe stupid Windows notepad to save snippets). Both browsers ran into the same issue, however, in the version I just tested, the chat responses seem to work now. FYI, I've never heard of either Thorium or Brave browser. I use Chrome, Edge, Firefox and for very old stuff Palemoon, on occasion Vivaldi (which is Chromium). So, no Linux.

        Regarding 'what is $root?', it is a global variable inside Perchance, just like $meta. As you can see, Perchance AI-text-plugin understood perfectly what I meant. This is what your AI helper has to say about it (and I have no better explanation myself):

        Hello! In the context of Perchance.org, $root is a special variable that represents the root scope of your Perchance script. The root scope is the global context in which all of your code runs, and it's where you define the core settings, functions, and data structures that are accessible throughout your script. Here's a simple example of how you might use $root to define a global variable: javascript // Define a global variable using $root $root.myGlobalVariable = "Hello, Perchance!"; // Now you can access this variable anywhere in your script console.log($root.myGlobalVariable); // Outputs: Hello, Perchance! When you create functions or objects that you want to be available globally, you can assign them to properties of $root. This way, you can avoid conflicts with other variables and ensure they are easily accessible from any part of your script. javascript // Define a global function $root.myGlobalFunction = function() { console.log("This is a global function!"); }; // Call the global function from anywhere in your script myGlobalFunction(); // Outputs: This is a global function! In Perchance, $root is also used to define custom functions and settings that are available in the story editor's interface. For example, you might define a function to manipulate story elements or set up a custom configuration for your story: javascript // Define a custom function that's available in the story editor $root.myCustomFunction = function(args) { // Your custom logic here }; // Use the custom function in the story editor { "type": "choice", "text": "What's your favorite color?", "choices": [ { "text": "Red", "value": "red" }, { "text": "Green", "value": "green" }, { "text": "Blue", "value": "blue" } ], "onChoose": [ { "name": "myCustomFunction", "args": ["green"] } ] } In this code snippet, myCustomFunction is a custom function defined on $root. When the user makes a choice in the story editor, the onChoose event triggers, and the specified name function is called with the provided args. The custom function can then perform an action based on the choice made. Remember, while $root is powerful, it's important to use it judiciously to avoid cluttering the global namespace and potentially causing conflicts with other code. Keep your global declarations to a minimum and use them only when necessary.

        However, the chat-reply shows the three back-ticks of the MD code, not a marked down snippet like here in Lemmy. What's your intention with the markup of the code snippets? Show the code examples properly marked down or have the user copy the code and paste it to get a better view? It's not clear to me, something like the below is not really workable, esp. on smartphones (which I personally don't use to code):

        A 'regular Perchance user' (none-programmer, that is) has no clue that they are about to use a 'bare-bones' generator when reading the below intro-message, heck as a developer I didn't:

        Maybe adjust that with a better explanation, not everyone will enter edit-mode to check out the code (initially I didn't either, not until you suggested it in your comment).

        Closing, I am not sure what this is about, the error occurs when the chat-reply finishes: