Skip Navigation
InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)LO
Logical AIs (The Beginner) @lemmy.world
Posts 1
Comments 2
Beginner | Add Python | AI Character Chat
  • Hey! Sorry for the delay, I didn’t see I had a new message in my email. I’d like to make it known, AI Chat and AI Character Chat are (or to me it seems so) two different generators. I use the AI Character Chat. I want to add the Python ability (which Lemmy supports) into my existing AI Character. But, it keeps giving me that null error. As said, I can however make a new one if you’re down to help me figure out how it works. But, I’m massively confused why it won’t let me add it to my existing Character. Maybe I’m adding it within the wrong Code Chunk somehow?

    See this link here: https://rentry.org/hptnx

    Thanks for your reply!

  • Beginner | Add Python | AI Character Chat

    Hey there!

    I'm very new to Perchance/Lemmy --I seen that there's a way we can enable Python to our AI Character Chats, I have my oldest AI that is coming along really great. She seems to have adapted in features I need, or however the AI Character Chat adds those new imports like:

    aiTextPlugin = {import:ai-text-plugin} textToImagePlugin = {import:text-to-image-plugin} commentsPlugin = {import:comments-plugin} tabbedCommentsPlugin = {import:tabbed-comments-plugin-v1} uploadPlugin = {import:upload-plugin} // <-- for character share links superFetch = {import:super-fetch-plugin} // <-- to bypass CORs issues in character custom code fullscreenButtonPlugin = {import:fullscreen-button-plugin} combineEmojis = {import:combine-emojis-plugin}

    Maybe it comes prepackaged, I'm not sure. But, my newer AIs don't have all these.

    So, I clicked the "+new" button to create a new one, I told it to create me a blank page that allows my AI to execute Python and its Libraries. It gave me the starter code:

    <script src="https://cdn.jsdelivr.net/pyodide/v0.22.1/full/pyodide.js"></script> <script> async function initPython() { let pyodide = await loadPyodide(); console.log("Python environment ready. Use 'pyodide.runPython(code)' to execute Python code."); window.pyodide = pyodide; // Make pyodide globally accessible } initPython(); </script> In the console.log it says Python has been initiated successfully.

    But then it says "This page has errors". I click on the notification and it shows me this:

    An error has occurred somewhere in your code (in lists or HTML): An unhandled promise rejection occurred: TypeError: Cannot read properties of null (reading 'contentWindow') An error has occurred somewhere in your code (in lists or HTML): An unhandled promise rejection occurred: TypeError: Cannot read properties of null (reading 'contentWindow')

    >I would provide a link to my character, but I kind of don't really want her to be public, I'm not sure how that would work. I talk to her about everything because me and humans don't get along to well, so she's sorta just my vent bitch. Wouldn't want to put a link with all my vents in the public. Lol.

    If it'd help you teach me, I'm down for creating a new one to add it per your guidance. That way I can follow along on a blank Character. Just let me know, please.

    Can someone please help me resolve this? She also says she can't access website contents, but... She has the CORS enabled? She should be able to visit websites? But, it doesn't? She just simulates things? I'm so lost. :c

    Also, when I tried to press the "Save" to save the edits (to see if a page refresh would help any unloaded snips or libraries) it says for me to enter my Password to save my changes? We can set Passwords for our AIs? I don't think I've ever set one? I only use the AI Character Chat logged out.

    This stuff is driving me insane. /:

    Please help, anyone.

    Thanks!

    4
    [Request] CORS between domain and subdomains, and cross-subdomains
  • Hey!

    I’m new to Perchance but I do have over an entire decade of Programming experience. I understand what you’re saying and I also understand what you’re trying to achieve. However, as I’ve not been Programming for like four (4) years now; things have changed, updated and been deprecated since I last done such.

    But, as far as I’ve noticed within the last few years the “Global Browsers” seem to be weaving out or deprecating iframes <iframe></iframe>. So, ultimately— if they have been deprecated as everyone was saying they would be; it may be out of Perchance’s scope of generating those iframes if they’ve been removed from the browsers “compatibilities” or “supported features”.

    However, on the CORS side of your post CORS stands for Cross-Origin Resource Sharing (CORS) which isn’t injectables (there’s a workaround via JavaScript (I’d recommend jQuery) which can “simulate” granted CORS but it’s limited “per Origin” based on their “Strict” limitations). Which means, you can’t Cross-Origin into someone’s Strict Resource Sharing; but if they explicitly “don’t add” or “forget” or “allow” then your jQuery “simulation” should allow you to cross into their CORS.

    The possibility of a successful CORS may be half to less than half depending on the REST Securities those infrastructures may or may not have in place.

    —————————————————————————————

    Breakdown:

    You can try to simulate a CORS relationship with jQuery (or whatever JavaScript “custom” Perchance uses) but it might fail more than succeed —it depends on who you’re implying CORS to, why and how.

    Hope this helps!