OpenAI API System
Greetings! As Robots start to expand, and coming out with more creative and innovative ways to work, I’ve decided to make a nifty module simply for the API.
- Easy Setup
- Rate Limitation
- Anti API Exhaustion
- Conversation Message History!
To Be Added
- Any cool ideas you want added?
I want to use it!
You can find the download below
OpenAIv1.1.rbxm (2.9 KB)
- Place the file into ServerScriptService
- Obtain a Api Key from Open AI
- On the modulescript, edit the ApiKey as shown
:createChatCompletion(message, temperature, topP)
message - The message you want to send, with a configurable array to have your AI do exactly what you please! (found in the module, line 40 roleTbl)
temperature - Effectively tune how random responses are, default 0
topP - Effectively tune responses, alter temperature or top_p not both
player - Instance of the player
message - Message to send to the AI
-- Require the correct path
local OpenAIChat = require(script.Parent["OpenAIChat v1.1"]);
local chat = OpenAIChat.new()
-- Asking what's 2+2?
warn(chat:createChatCompletion("What is 2+2?"))
-- Having a conversation with the AI
Have any questions or inquiries? Feel free to join the Development Support Server
You would need to show line seven of
ServerScriptService.OpenAI.Script for further debugging.
I think you called it as a function rather as a method
OpenAIChat.conversate(player, message) -- incorrect (whats going on in your script)
OpenAIChat.conversate(self, player, message) -- correct (what it should be)
OpenAIChat:conversate(player, message) -- syntatic sugar (the correct way)
I didn’t call any functions. I imported the system with no changes.
I checked the server script in the file provided and it looks like that they forgot to replace the
you could easily fix this by replacing the
Thanks for keeping them occupied as I was occupied.
Just wrapped up an update for DTR, will now be prioritizing this System today.
Can you show line seven of
You could have just looked for it yourself…
You would need to call
OpenAIChat.new() and assign that to a variable prior to using any of the methods.
I’m sorry but isn’t this the same 6th resource that uses openai api? I’ve seen too many of them laterly and they’re all the same.
I’d like to answer this properly.
Of course there’s millions of resources for it, however my goal is to be better than others. Not to mention I released this same day GPT-3.5 was available to the public.
Now if you’re seeing the resources and seeing almost the same function names, it’s because we’re utilizing the documentation. There’s no problem with users contributing an asset as long as they enjoy it and optionally is better than others.
Sounds cool, I could use
conversate in a textlabel maybe to create a chatting ai.
You are correct.
Currently working on a remake of the site colors/buttons/UI as a plugin with optional features, these include but are not limited to:
- Conversation History
- Close/Reopen Chats + History (:GetSetting)
- Custom Prompts to load into a chat
- More to be discussed.
Currently in the process of being rewritten/updated.
You can receive an optional notification when I update the system here
When I set the model to be ‘gpt-4’, I receive a ‘Error sending request to OpenAI API: HTTP 404 (Not Found)’ error, how can I solve this?