[0.2] AI_Playground | Use AI inside Roblox Studio

Many people are misunderstanding the difference between ChatGPT and GPT-3. OP uses GPT-3 along with the Davinci language model, the latest one yet.

ChatGPT being down (for example when too many people are using), has completely nothing to do with the downtime of the API.

I’ve dropped down a snippet on how you can make API requests to OpenAI’s API and receive responses based of a prompt.

local http = game:GetService('HttpService')
local promptmsg = 'Hello!'
  
local request = http:RequestAsync({
    Url = 'https://api.openai.com/v1/completions',
    Method = 'POST',
    Headers = {
        ['Content-Type'] = 'application/json',
        ['Authorization'] = 'Bearer APIKEY', -- replace APIKEY with your own api key
    },
    Body = http:JSONEncode({
        prompt = promptmsg,
        model = "text-davinci-003",
        max_tokens = 500,
        temperature = 0,
    })
})
  
local response = http:JSONDecode(request.Body)
  
promptmsg ..= response.choices[1].text..'\n\n' -- allows gpt to remember previous prompts
  
local promptresponses = response.choices[1].text:split('\n\n')
local promptmsg = promptresponses[#promptresponses] -- returns what gpt said

Hello!

I’m working on a way to give excerpts of Roblox documentation to the AI-model when making a request, but it’s something pretty difficult to make so it may take some time.

In the meantime, the limits of untrained AIs can be played around with and you’ll sometimes see the model give interesting results.

Thanks for your answer, have a great day!

1 Like

for some reason, my monitor keeps cutting off the first word, and it’s very annoying.
image

Hello @ezz_mady,

I’ve looked into your problem and successfully found where it went wrong. The problem should be fixed as soon as you update the plugin.

Contact me if you run into any other issue!

I want this plugin, but ChatGBT is not available in my country. Is there any way I could use it without an API key?

There is unfortunately no way to use AI_Playground without an API Key.

Sorry that I may sound stupid, but is this able to create like 3D objects in studio and not just 100% scripting?

Hi @HistoricalPooPantsz,

Yes, AI_Playground is able to create 3D objects in studio from a text prompt.

To achieve this result, click on the “Do” icon on the left and enter the desired build inside the TextBox. Finally, click “Send prompt”. Any erros will be displayed on the black console window.

Here’s a quoted example of what it looks like:

1 Like

I tried using the prompt you gave “Make a Realistic Airplane Script” and got an error
image

also got this
image

There is no allow script injection option

Those errors seem to be caused by the language model itself. Since it was not meant to be used for programming, much less for Luau programming, there are high chances of it generating wrong answer.
If you want more accurate code, I suggest you type in more direct instructions like “Create a part that’s x” or “Create x parts that makes an y”. More general prompts tend to lead to errors, but it’s fun to test the model’s limits, too.


That’s strange, I see it on my end. Does the “Do” feature still work?

Sorry if this hasn’t have to do anything with this plugin, but all I’m getting is an error saying “HTTP 429 (Too Many Requests)” even though I made the API key 2 minutes ago and never even used the API in the first place. Do you perhaps have any solution you can think of because I can’t even use this plugin now.

The HTTP 429 error is caused by the API being rate-limited. It means your account (or organisation if your account is under an organisation) has sent too many requests in a too short amount of time.

API rate-limits could also be because too many people from the same endpoint (Roblox Studio) had sent too many requests. However, I can’t confirm this is true.

In both case, the only solution is to wait and try again later. Contact me if the issue persists.
Here are some links to get more information about OpenAI’s rate-limits.

1 Like

i bought it i pasted my API key in and it doesnt work at all i spent 100 robux on it and it just gives out the error HTTP 404 NOT FOUND any fix?

uhmm :skull: you spent 100r$ on a plugin even if on the post it says its going to be discontinued like rn lol
I guess wait until @HumainAbsurde looks your reply :person_shrugging:

You have to pay for OpenAI API credit (which this post conveniently doesn’t mention).

As a PSA to everyone: don’t buy this, you will be billed by OpenAI per token for your usage. This post make it sound like there is no charge involved, but as a heads up you do have to pay for any API calls through OpenAI’s API.

OpenAI’s API has a 5$ free trial (18$ when I originaly posted AI_Playground) which lets you make ~ 750 API calls for free (~2700 when I originaly posted AI_Playground). I personally used the plugin a lot during the development phase for obvious testing purposes, and I never spent one dollar on OpenAI.

So please, I would like you to avoid spreading misinformation and implying that I’ve hidden charges to the community for some reason as it’s plain wrong. Adding to that, I would remind you that the plugin is litterally free to download and published under the free CC BY-SA 4.0 license. With the paid alternative only there for support and convenience.

Hey StingyDenizo, as of today, AI_Playground is no longer maintained. I’ll try to patch the issue you came across but I can’t assure you 100% it’s going to be fixed.

As an alternative, I recommend you try out Roblox’s native Code Assist feature which works pretty well.

Have a great day!

Plugins can’t work in scripts. All they can do is fill autocomplete suggestions for code.