Not just a bunch of ifs and say blocks - this is real AI.
----
Scratch Profile: scratch.mit.edu/users/charles...
Email: contact@donutask.com
Website: donutask.com
----
I can't publish this extension because it requires an API key. Here are the resources you need to create it yourself. The OpenAI API, ironically, requires real money to use.
Scratch mod used: sheeptester.github.io/scratch...
OpenAI Documentation: platform.openai.com/docs/api-...
Get API Key (requires account and billing details): platform.openai.com/account/a...
JavaScript Code (You need to provide an API key):
class AIBlock {
getInfo() {
//Metadata for block
return {
"id": "AI",
"name": "AI",
"blocks": [{
"opcode": "completePrompt",
"blockType": "reporter",
"text": "complete prompt [string]",
"arguments": {
"string": {
"type": "string",
"defaultValue": "Explain quantum computing in simple terms"
}
}
}],
//don't worry about it
"menus": {}
};
}
async completePrompt({ string }) {
//Remove trailing spaces, required for model to work properly
const text = string.trim();
//Request text completion using Davinci3
const url = `api.openai.com/v1/engines/tex...`;
const options = {
//Has to be post for some reason
method: "POST",
//Input prompt and a decent length
body: JSON.stringify({
prompt: text,
max_tokens: 300,
}),
//API key, and JSON content type
headers: {
Authorization: "Bearer " + API_KEY,
"Content-type": "application/json; charset=UTF-8"
},
};
console.log("REQUEST:" + url);
//Fetch and await promise.
const response = await fetch(url, options);
//Get JSON data
const jsonData = await response.json();
//The ai response will be the first (and only) choices text
const output = jsonData.choices[0].text;
return output;
}
}
//Register block with Scratch
Scratch.extensions.register(new AIBlock());
---
Sound effects from ZapSplat.com
Some images generated by DALL-E
Images and videos from Unsplash.com and Pexels.com
Music by Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 4.0 License
creativecommons.org/licenses/b...
Subscribe!
Oh, and if you want to support me financially, consider becoming a member :)
/ @donut_ask
I should've got AI to write the code! Unfortunately, I can't publish the extension because it requires an API key that costs real money. If you have the money, the code (along with extra details) is in the description. Anyways, thank you for watching :D
I loved the video!
@@ThirtyDimensionedMissile Thank you :)
@@donut_ask No problem!
THAT IS WHAT I WAS TRYING TO DO 1 WEEK AGO
Cool video btw
Donutask: "this is the super secret api key im not allowed to share with anyone" Also Donutask: *casually shows the api key to thousands of viewers*
🤪
hehehehe
@@donut_ask you changed it... right..?!?
@@RealMadhuuthere are either two options: 1. he changed it 2. he casually waits for everyone to spend his money. LMFAO
@@IlliaZhdanov I deleted it. I was stupid enough to not know how to properly sync audio and video, but not THAT stupid
“This is the super secret api key I’m not allowed to share with anyone” hmmm ok I’ll definitely keep that a secret
Ei09GOCHMYjMvt5jcfTrT3B1bkFJcbRIZP5kMhRMghUG7bdJ
I can keep it a secret. I cant vouch for the people I tell it to though...
I was just about to comment that
I've actually made one in Snap! (A different programming language) it has a URL block inside and some libraries that can do posts and send headers to the internet. It's much easier than making an entire extension from blocks instead of Javascript! Pretty impressive how you did it in Scratch though. That was awesome!
Didn't know snap could do that
@@donut_ask snap is basically scratch on steroids with slightly outdated ui
it has a more complex custom blocks system and has firstclass blocks, so you can pass blocks to blocks to, for example, map a list
man putting blocks to do stuff is harder than programming
are you my ai
ive been watching you since 1K subs! Good to see you finally get the attention you deserve.
Thank you
As a JS programmer this was painful to watch
I am very sorry for you having to use JS. (Since you understand it i want to share something stupid i did. I was trying to access object properties with obj["choices"] instead of obj.choices. I think it works the other way in python, because python.
um actually as a mf ur dick is small 🤓🤓🤓🤓
javascript is the worst programming language in the world.
@@TheRealMangoDevWould you care to try Cobol. Or maybe something like Brain fuck or whitespace. Or maybe even PHP?
Im a scratcher
What a journey! Amazing video :)
Thank you :)
"This is the super secret api key that im not allowed to share with anyone" *proceeds to show it to 80k+ peaople*
Hehe
This is honestly pretty cool!
thanks
@@donut_ask no problem!
@@donut_ask no problem
And you used ChatGPT to create ChatGPT in Scratch!
most underrated programmer in the game!!!!!!!!!!!!!!!!!!!!
Could you make a longer, more precise and step-by-step guide that explains every tiny thing. That would be awesome and absolutely deserve a sub.
I should, but maybe on a second channel. The explanation oarts are where people click off :(
@@donut_ask Yeah true. Smart.
Yes that would be great, I really want to do that but I am just to dumm to understand it, a step by step guide would be nice
@@scullycraft4776 Yeah.
how is this man so underrated
yeah, he replies to every comment.
@@rahulpanchal87 ok?
Harsh
I have no idea
Fr
First time on the channel... I love it!
👋 Hello, and thank you :)
@@donut_ask You're welcome.
Same
Ive been here since 1K! I submitted a game for playing your scratch games too i also remember i made a remix of your finding game thing you used
thanks :)
Just subscribed because like all there is right now is griffpatch this guy is so underrated
Thanks for putting me in the same sentence as the goat :)
A couple months ago, I started making my first AI in Scratch. It was a dog with 2 tricks: Sit and Come. Last week, I coded another dog AI but this time it does a random trick and it starts off with a 1 in 100 chance to get the trick right, which I did with random numbers and lists. If it chooses a number other than 1, it will choose a random trick out of 3 tricks (Sit, Speak, and Come). It doesn't choose the trick it was told to do because that wouldn't make sense if it was doing the trick wrong.
😎
The griffpatch we didn't know we needed
Looks nice! Im glad I could answer you even in Scratch!
Can you answer my question?
@@omichall Of course! Please feel free to ask me any question you have, and I'll do my best to provide a helpful answer.
You're fake goner.
@@NotOmichall are you seriously chatgpt?
Yesterday I just got my AI to work in Scratch from scratch, it uses neural networks and you can talk to it. So I guess I am quite talented. But nice video!
Link? Proof?
I probably will make a video of it on another KZhead channel, but I will not share a link yet, since I don't want it to be copied.
@@nitrous69 Hello! Here is a video of the usage with the AI: kzhead.info/sun/o9Nrd9llbKdtfqM/bejne.html
Bro worked hard on this , he deserves a like guys.
😀
@@donut_ask it dident work
@@Shadow-Silver-Reboot wat ?
This is very cool! Can you make step-by-step instructions through the process? also, can I use Google Gemini/Bard? can I publish the working ai? It would be very cool if it works and I hope you can make a longer video of this!
Woohoo! AI in scratch.
🤖
note: The AI used is not ChatGPT, it is text-davinci
Yes
This man is one of the few people who can genuinely make me laugh. You just earned a new subscriber! 😂😂😂
Thank you :D
@@donut_ask was the api key at the end real
@@kramsdell_ no
Thats so cool love it
Thanks :)
Scratch “programmer” trying javascript for the first time be like
I've used JS before on a couple websites. But JS is awful!
What Website Did You Use For The "Data: URI Generator"?
Can't remember, i think it was just the top google result for 'Data URI Generator'
That's cool and all but I once made an apple go to a random position when you click it
that's cool and all but once I made an apple move right when you pressed left
This is just using an extension that goes into ChatGPT AI. That means this isn't working AI in Scratch, especially since you had to go to a totally different website to do so with an extension. I was expecting for a neural network to be coded literally with scratch blocks.
Yeah the title and thumbnail is a bit clickbait on this video. Unfortunately it works; this is one of my top performing videos. No one would watch "I Just Used an Extension that Goes into ChatGPT AI". In the first 30 seconds, I clarify that this is an extension, so I'm not trying to waste your time. I hope you understand :) Also, you can make a basic neural network in Scratch. But the most complex you can really do is recognise numbers. Predictive text would be impossible in regular scratch.
@@donut_ask Hey, it's all good, I understand that! I tried making a neural network in Spanish before lol
5:07 Him: I can't show this code to anyone Me: ...
...
1:42 no way you just did that. I was about to warn you about you not blurring it properly. 😂
Amazing!!!🤯
You are so underrated on yt. You definitely deseeve over 500 k subs
😀
Aw. Thanks! It helps a lot!
wow great video man
Thanks
@@donut_ask also make your thumbnails more mr beast like, add suprised faces to them
😱😱😱😱😱😱
@@donut_ask negro coton picker
@@donut_ask mb bro
I feel like there is a way to make almost good working chat AI, but it's also possible to make regular Nextbot-like AI.
At 5:40 Line 34 | "method: 'post'" POST is a type to pass info to php, in that case, basically it will get the input from the Scratch and send it to the php of the AI
I could be wrong, but I think that is it
Seems about right
I used your clicker tutorial and it worked-¹!except sunshine and the water) you just earned a sub for helping scratchers
Thanks :)
Yoo, this is the most underrated extension ever! (Btw i didnt payed for this donation but google technicaly did)
This is the first super thanks I got. Thank you!!
@@donut_ask You're welcome, you deserved it because you spent cash on the video, basically its a cash back by google.
omg wait czech people?! 😱
@@lejacobofficial If you cash back from google, the person you sent the money doesn't get it. Are you only 10? How could you even think things work like that?
@@dabbopabblo I think you misunderstood him.
Will it work when shared?
The Gandi IDE already has an AI extension, you can give it a try 😊
That sounds cool
This is not coded AI in scratch, this is coded API.
Correct
@@donut_ask Implemented, false title.
what’s funny is that robot sprite in the beginning reminds me of those 60s sci-fi film with crazy cool predictions on the future, definitely a true future with advanced AI like this
i'm usually a Python programmer, but i've had some JS experience, so i can try to breakdown the thought process here, but forgive some estimation "POST" is a form of HTTP interfacing, instead of asking the server (OpenAI) "hey, can we get this resource", it's like putting a little request form in an envelope and putting it in a queue for OpenAI! JavaScript's JSON is a library(ish? i'm not sure on terminology for JavaScript) that essentially takes a few tidbits of information (like the prompt and max_tokens), similar to a dictionary in Python, or, good lord, Objects in JavaScript. a mere google search gave me shivers. other than that, the headers are just ways for the content to be delivered to OpenAI's HTTP servers. after that, the request is sent, and async/await allows JavaScript to keep working with other functions and elements without having to wait for one element to finish. then, the response is a JSON data packet, which is then accessing the choices element in the JSON, choosing the first, and giving you a string as an output! finally, the actual elements come together in a neat little package, registering the block in Scratch.
Great explanation!! If only I could of said it like this in the video
JSON is a data format
1:43 It says "Never gonna give you up" That is a creative way to deter some people looking for your personal info...
Haha some people actually thought it was my actual info
@@donut_askwait what those are hardcore hackers probably they're willing to get rickrolled if it means a possible chance for someone's information
0:13 BLUR BLUR BLUR THE API KEY NOW NOW BLUR IT BLUR IT BLUR IT BLUR IT
I actually made one in Vanilla Scratch! Using cloud variables. It was interesting. My classmates and teachers liked the little project.
Oooh, clever!
Can you give me the link? I WANT IT.
nice, i even tried it myself and it works! I kinda had to fix it by putting the api key code and use chatgpt to fix further cuz it no work and thanks to fixes it worked but i also found out u dont need money to get api key, i dont care about limits
How did you get it for free?
@@donut_ask easy generating api key requires no money i simply opened the link, clicked the button that generates the key, BOOM, key generated, just a reminder i DO have an openai account
How do I create an API key, I don't understand what you said in the description
help.openai.com/en/articles/4936850-where-do-i-find-my-secret-api-key
Could you perhaps write the code, with the api key place saying "API-KEY"
Code is in description
Underrated creator spotted 👀
:)
Amazing
Thanks :)
“In Scratch” Also I would love to run this in Snap. I can surely modify this…
I've never used snap, good luck
I have that thingy too. Why haven't I tried to alter time with it?
Be careful not to break the space time continuum!
How do I paste the code into the scratch mod?
Just wait until someone makes a working ai using only scratch blocks
Next Griffpatch project...
already did :) of course, it's not perfect in any way, nor can you call it an actual a.i, but the concept is the same as an a.i would.
I'm turning this into an extension that can be used on Turbowarp (by editing a few things)
Yay
1:51 I don't even know much about coding and making games. but this experience is too real for me.
Please how do I contact would love to discuss something on scratch Program with you
Email in description :)
Could you upload the project so we can use the chatgpt block?
No, you can't upload projects with custom extensions
@@donut_ask 😭😭😭😭😭😭😭
title: i coded working ai in scratch video: im using this random persons version of scratch
Donutask is such a stupid liar!
can you give me the link of the ai assistant
It keeps on saying TypeError and i don't understand.
Now make it entirely in Scratch lol
Don't think that's possible. Bet Griffpatch will do it though.
@@donut_ask I mean, people have already coded working neural networks that recognize drawn text, but we havent reached chatgpt level lol
Yeah, there's a big difference
This is really cool and keep up the good work.
Thanks :)
"thIS IS A SUPer SEcret API key"
bro became a dinosaur at 2:03
scratch GOAT
Yo, a few questions, one the code doesn't work, and two can i make a vid on this?
Do you have an API key? Or my code just sucks. You can make a video :)
@@donut_ask yea i got an api key
Task: become donut
🍩
Woohoo, youre so good at coding!
Thanks
now make a transistor simulator and make a whole ai out of simulated transistors
how can i make this extension?
i just got rick rolled, trying to steal someones credit card number. that makes me wonder if that card number is valid
I used a fake number generator. But you got RICK ROLLED!!!!!
please add the link to the working A.I in the description
I literally can't
WOW NICE VID!!! your literally a genius in scratch. Your channel is underrated it needs more subscribers!!! and hehe. I love how you put some jokes in your vids!
Thanks. I try to make boring videos actually fun to watch. Glad you liked it.
@@donut_ask i tried it, but i got an error :(
u are so good
Thanks :)
MY BRAIN IS IN PRAINNNNNNNNNNNN
real chads would us scratchattach.
whats the url? /
Nice video
Thank you
my brain hurts this is too smart-y🥶🥶
This is me > 🤓🤓
2:44 timing is perfect
How did I manage to mess this up!
You actually didnt built any ai , you just made scratch talk with an api...
Yeah, a lot of people have mentioned that. I might need to change the title a bit. But I don't know how to phrase it in any other interesting way :/
Hey donutask I have found a way to make custom extensions without writing Java code all your hard work was a bad thing did you know about turbowarp and penguin mod those can allow you to upload custom extensions
Yup turbowarp works. How do you make an extension without JavaScript code?
IT shall work
@@labanikhanam1055 I don't understand
Why did you show the API key you werent meant to show?
I deleted it. I left it in the video because it would be funny
ScratchGPT by DonutAI
I dare you too make the most cursed game ever
I TRIPLE DOG DARE YOU
WITH A CHARY ON TOP
Maybe
make a custom and make it then it says define (custom block name) and u connect blocks underneath and da blocks underneath define the custom block. pretty complex but its just how it works (the video is still cool)
Yes that us how custom blocks work. They can't achieve what I wanted to do so i needed an extension
I Love Keyboard-Typed Coding More Than Block Coding
Same
@@donut_ask 2 people who like the same thing as me, I guess my js and java(and lots of languages) classes definitely made me a genius
@@thekeyboardwarrior1018 Everybody Loves Text-Based Programming Languages More Than Block-Based Programming Languages
@@thekeyboardwarrior1018 Scheme Programming Language, C# Programming Language, XNA Programming Language and XML Programming Language are My Favorites
@@cyanuranus6456 yeah
🎉
real footage of a 8 year old coding and cracking jokes.
it dosent show the extension
It's not released
WOWOWOWOWOW
whats the url?
can you make video tutorial to make block is scratch please?
A lot of people have asked, I probably should actually make it now.
i know a person who made ai without an api key it cant do much though
how do i set it up with the js?
See description. Unfortunately the API will cost money
@@donut_ask It does not say how to import it.
Imagine someone wants to see in description talk Scratch OpenAI CGPT, but there is no actual link, or link on the charlesbel's games. There is no ChatGPT in here, it's just a challenge.
Hey, im wondering if you could do a more in depth video on how you made an extension in scratch.
Maybe, I'll consider making one :)