Run it
Copy the script and paste it into your executor.
TweenService = :()
UserInputService = :()
RunService = :()
HttpService = :()
MODEL_PRESETS = {
[] = {
input = ,
hidden = ,
output = ,
learning_rate = ,
description =
},
[] = {
input = ,
hidden = ,
output = ,
learning_rate = ,
description =
},
[] = {
input = ,
hidden = ,
output = ,
learning_rate = ,
description =
},
[] = {
input = ,
hidden = ,
output = ,
learning_rate = ,
description =
},
[] = {
input = ,
hidden = ,
output = ,
learning_rate = ,
description =
},
[] = {
input = ,
hidden = ,
output = ,
learning_rate = ,
description =
}
}
KNOWLEDGE_BASE = {
greetings = {
,
,
,
},
farewells = {
,
,
,
},
positive_responses = {
,
,
,
,
},
negative_responses = {
,
,
,
},
questions = {
,
,
,
,
},
topics = {
= {, , },
coding = {, , },
weather = {, , },
food = {, , },
music = {, , }
}
}
CURRENT_MODEL_NAME =
INPUT_SIZE =
HIDDEN_SIZE =
OUTPUT_SIZE =
INITIAL_LEARNING_RATE =
TARGET_PARAMETER_COUNT =
()
(INPUT_SIZE * HIDDEN_SIZE) + HIDDEN_SIZE + (HIDDEN_SIZE * OUTPUT_SIZE) + OUTPUT_SIZE
TARGET_PARAMETER_COUNT = ()
PARAMETERS = {}
current_learning_rate = INITIAL_LEARNING_RATE
last_input_features = {}
last_output_activation =
conversation_context = {}
CONVERSATIONAL_MODE =
INPUT_PARSING_PASSED =
ChatSessions = {}
CurrentSessionName =
session_counter =
lastSaveTime =
lastReturnSession =
SAVE_FILE_NAME =
W1_START =
B1_START =
W2_START =
B2_INDEX =
()
W1_START =
B1_START = (INPUT_SIZE * HIDDEN_SIZE) +
W2_START = B1_START + HIDDEN_SIZE
B2_INDEX = W2_START + HIDDEN_SIZE
()
GRAMMAR_PATTERNS = {
{, , , , , , , },
{, , , , , , },
{, , , , , },
{, , , , , , , },
{, , , , , , },
{, , , , , , , },
{, , , },
{, , },
{, },
{, }
}
(text)
t = text:()
positive_score =
negative_score =
positive_words = {, , , , , , ,
, , , , , , }
_, word (positive_words)
t:(word) positive_score = positive_score +
negative_words = {, , , , , , ,
, , , , }
_, word (negative_words)
t:(word) negative_score = negative_score +
positive_score - negative_score
(text)
t = text:()
t:() t:() t:()
t:() t:() t:()
t:() t:() t:()
t:() t:() t:()
t:() t:() t:()
(text)
t = text:()
greetings = {, , , , , , }
_, greeting (greetings)
t:( .. greeting) t:( .. greeting)
(text)
t = text:()
farewells = {, , , , , , }
_, farewell (farewells)
t:(farewell)
(text)
text:() text:():() text:():()
text:():() text:():() text:():()
text:():() text:():() text:():()
(text)
t = text:()
words = {}
word t:()
.(words, word)
features = {}
maxFeatures = .(INPUT_SIZE, )
features[] = .(#words, ) /
features[] = (text) /
features[] = (text)
features[] = (text)
features[] = (text)
features[] = (text:() )
topic = (text)
features[] = (topic == )
features[] = (topic == )
features[] = (topic == )
features[] = (topic == )
features[] = (topic == )
important_words = {, , , , , , , , , ,
, , , , , , , , , }
featureIndex =
_, word (important_words)
featureIndex > maxFeatures
features[featureIndex] = (t:( .. word .. ) )
featureIndex = featureIndex +
grammarIndex =
_, patternGroup (GRAMMAR_PATTERNS)
_, pattern (patternGroup)
featureIndex > maxFeatures
found =
_, word (words)
word == pattern
found =
features[featureIndex] = found
featureIndex = featureIndex +
featureIndex > maxFeatures
#conversation_context >
featureIndex <= maxFeatures
features[featureIndex] = #conversation_context /
featureIndex = featureIndex +
#features < INPUT_SIZE
.(features, )
features
(params)
encoded =
i = , #params
val = params[i]
compressed = .(, val)
encoded = encoded .. compressed
i < #params encoded = encoded ..
encoded
(encoded)
params = {}
index =
num_str encoded:()
params[index] = (num_str)
index = index +
params
(modelName)
config = MODEL_PRESETS[modelName]
config
.(, config.input, config.hidden, config.output, config.learning_rate)
()
export =
export = export .. CURRENT_MODEL_NAME ..
export = export .. (CURRENT_MODEL_NAME) ..
sessionName, sessionData (ChatSessions)
export = export .. .. sessionName ..
export = export .. .. (sessionData.model CURRENT_MODEL_NAME) ..
export = export .. .. (sessionData.params PARAMETERS) ..
export = export .. .. #sessionData.messages ..
_, msg (sessionData.messages)
cleanMsg = msg.text:(, ):(, )
export = export .. msg.sender .. .. cleanMsg ..
export
(importStr)
parts = importStr:()
parts[] ~=
,
ChatSessions = {}
i =
i <= #parts
parts[i]:()
sessionName = parts[i]:()
i = i +
i <= #parts parts[i]:()
sessModelName = parts[i]:()
i = i +
i <= #parts parts[i]:()
paramStr = parts[i]:()
params = (paramStr)
i = i +
i <= #parts parts[i]:()
msgCount = (parts[i]:())
i = i +
messages = {}
j = , msgCount
i <= #parts
msgParts = parts[i]:()
#msgParts >=
.(messages, {
sender = msgParts[],
text = msgParts[]:(, ):(, ),
isAI = msgParts[] ==
})
i = i +
ChatSessions[sessionName] = {
messages = messages,
params = params,
model = sessModelName
}
i = i +
,
()
saveData = ()
(SAVE_FILE_NAME, saveData)
lastSaveTime = .()
()
(SAVE_FILE_NAME)
,
saveData = (SAVE_FILE_NAME)
(saveData)
(original)
copy = {}
k, v (original)
copy[k] = v
copy
()
rand = Random.()
parameters = {}
i = , TARGET_PARAMETER_COUNT
parameters[i] = (rand:() * - ) *
parameters
(x)
/ ( + .(-.(.(x, -), )))
(x)
x * ( - x)
(input_vector)
last_input_features = input_vector
hidden_outputs = {}
j = , HIDDEN_SIZE
sum =
i = , INPUT_SIZE
idx = W1_START + (j - ) * INPUT_SIZE + (i - )
PARAMETERS[idx]
sum = sum + input_vector[i] * PARAMETERS[idx]
PARAMETERS[B1_START + j - ]
sum = sum + PARAMETERS[B1_START + j - ]
hidden_outputs[j] = (sum)
output_sum =
j = , HIDDEN_SIZE
PARAMETERS[W2_START + j - ]
output_sum = output_sum + hidden_outputs[j] * PARAMETERS[W2_START + j - ]
PARAMETERS[B2_INDEX]
output_sum = output_sum + PARAMETERS[B2_INDEX]
last_output_activation = (output_sum)
last_output_activation, hidden_outputs
(target_output, hidden_outputs)
predicted = last_output_activation
= target_output - predicted
.() <
cost = * ( ^ )
delta_output = * (predicted)
j = , HIDDEN_SIZE
w_idx = W2_START + j -
PARAMETERS[w_idx]
PARAMETERS[w_idx] = PARAMETERS[w_idx] + current_learning_rate * delta_output * hidden_outputs[j]
PARAMETERS[B2_INDEX]
PARAMETERS[B2_INDEX] = PARAMETERS[B2_INDEX] + current_learning_rate * delta_output
j = , HIDDEN_SIZE
error_at_node = (PARAMETERS[W2_START + j - ] ) * delta_output
hidden_delta = error_at_node * (hidden_outputs[j])
i = , INPUT_SIZE
w1_idx = W1_START + (j - ) * INPUT_SIZE + (i - )
PARAMETERS[w1_idx]
PARAMETERS[w1_idx] = PARAMETERS[w1_idx] + current_learning_rate * hidden_delta * last_input_features[i]
b_idx = B1_START + j -
PARAMETERS[b_idx]
PARAMETERS[b_idx] = PARAMETERS[b_idx] + current_learning_rate * hidden_delta
.(, cost)
(confidence)
confidence >=
, .(, , )
confidence >=
, .(, , )
confidence >=
, .(, , )
confidence >=
, .(, , )
, .(, , )
(text, confidence)
(text)
KNOWLEDGE_BASE.greetings[.(#KNOWLEDGE_BASE.greetings)]
(text)
KNOWLEDGE_BASE.farewells[.(#KNOWLEDGE_BASE.farewells)]
topic = (text)
topic KNOWLEDGE_BASE.topics[topic]
responses = KNOWLEDGE_BASE.topics[topic]
responses[.(#responses)]
sentiment = (text)
sentiment >
KNOWLEDGE_BASE.positive_responses[.(#KNOWLEDGE_BASE.positive_responses)]
sentiment < -
KNOWLEDGE_BASE.negative_responses[.(#KNOWLEDGE_BASE.negative_responses)]
(text)
confidence >
.. KNOWLEDGE_BASE.questions[.(#KNOWLEDGE_BASE.questions)]
confidence <
.. KNOWLEDGE_BASE.questions[.(#KNOWLEDGE_BASE.questions)]
.. KNOWLEDGE_BASE.questions[.(#KNOWLEDGE_BASE.questions)]
confidence >=
.. (.() > )
confidence >=
.. (.() > )
confidence >=
.. (.() > )
confidence >=
.. (.() > )
.. (.() > )
player = .Players.LocalPlayer
playerGui = player:()
screenGui = .(, playerGui)
screenGui.Name =
screenGui.ResetOnSpawn =
mainFrame = .()
mainFrame.Size = .(, , , )
mainFrame.Position = .(, -, , -)
mainFrame.BackgroundColor3 = .(, , )
mainFrame.BorderSizePixel =
mainFrame.ClipsDescendants =
mainFrame.Parent = screenGui
.(, mainFrame).CornerRadius = .(, )
sidebar = .()
sidebar.Size = .(, , , )
sidebar.BackgroundColor3 = .(, , )
sidebar.BorderSizePixel =
sidebar.Parent = mainFrame
sidebarHeader = .()
sidebarHeader.Size = .(, , , )
sidebarHeader.BackgroundColor3 = .(, , )
sidebarHeader.BorderSizePixel =
sidebarHeader.Parent = sidebar
logoText = .()
logoText.Text =
logoText.Size = .(, -, , )
logoText.Position = .(, , , )
logoText.BackgroundTransparency =
logoText.TextColor3 = .(, , )
logoText.Font = .Font.GothamBold
logoText.TextSize =
logoText.TextXAlignment = .TextXAlignment.Left
logoText.Parent = sidebarHeader
sessionScroll = .()
sessionScroll.Size = .(, -, , -)
sessionScroll.Position = .(, , , )
sessionScroll.BackgroundTransparency =
sessionScroll.BorderSizePixel =
sessionScroll.ScrollBarThickness =
sessionScroll.CanvasSize = .(, , , )
sessionScroll.Parent = sidebar
sessionList = .()
sessionList.Padding = .(, )
sessionList.Parent = sessionScroll
newChatBtn = .()
newChatBtn.Size = .(, -, , )
newChatBtn.Position = .(, , , -)
newChatBtn.BackgroundColor3 = .(, , )
newChatBtn.Text =
newChatBtn.TextColor3 = .(, , )
newChatBtn.Font = .Font.GothamBold
newChatBtn.TextSize =
newChatBtn.BorderSizePixel =
newChatBtn.Parent = sidebar
.(, newChatBtn).CornerRadius = .(, )
contentFrame = .()
contentFrame.Size = .(, -, , )
contentFrame.Position = .(, , , )
contentFrame.BackgroundTransparency =
contentFrame.Parent = mainFrame
topBar = .()
topBar.Size = .(, , , )
topBar.BackgroundColor3 = .(, , )
topBar.BorderSizePixel =
topBar.Parent = contentFrame
sessionTitle = .()
sessionTitle.Text =
sessionTitle.Size = .(, , , )
sessionTitle.Position = .(, , , )
sessionTitle.BackgroundTransparency =
sessionTitle.TextColor3 = .(, , )
sessionTitle.Font = .Font.GothamBold
sessionTitle.TextSize =
sessionTitle.TextXAlignment = .TextXAlignment.Left
sessionTitle.Parent = topBar
modeToggle = .()
modeToggle.Size = .(, , , )
modeToggle.Position = .(, -, , -)
modeToggle.BackgroundColor3 = .(, , )
modeToggle.Text =
modeToggle.TextColor3 = .(, , )
modeToggle.Font = .Font.GothamBold
modeToggle.TextSize =
modeToggle.Parent = topBar
.(, modeToggle).CornerRadius = .(, )
settingsBtn = .()
settingsBtn.Size = .(, , , )
settingsBtn.Position = .(, -, , -)
settingsBtn.BackgroundColor3 = .(, , )
settingsBtn.Text =
settingsBtn.TextColor3 = .(, , )
settingsBtn.Font = .Font.GothamBold
settingsBtn.TextSize =
settingsBtn.Parent = topBar
.(, settingsBtn).CornerRadius = .(, )
minimizeBtn = .()
minimizeBtn.Size = .(, , , )
minimizeBtn.Position = .(, -, , -)
minimizeBtn.BackgroundColor3 = .(, , )
minimizeBtn.Text =
minimizeBtn.TextColor3 = .(, , )
minimizeBtn.Font = .Font.GothamBold
minimizeBtn.TextSize =
minimizeBtn.Parent = topBar
.(, minimizeBtn).CornerRadius = .(, )
closeBtn = .()
closeBtn.Size = .(, , , )
closeBtn.Position = .(, -, , -)
closeBtn.BackgroundColor3 = .(, , )
closeBtn.Text =
closeBtn.TextColor3 = .(, , )
closeBtn.Font = .Font.GothamBold
closeBtn.TextSize =
closeBtn.Parent = topBar
.(, closeBtn).CornerRadius = .(, )
chatScroll = .()
chatScroll.Size = .(, -, , -)
chatScroll.Position = .(, , , )
chatScroll.BackgroundTransparency =
chatScroll.BorderSizePixel =
chatScroll.ScrollBarThickness =
chatScroll.CanvasSize = .(, , , )
chatScroll.Visible =
chatScroll.Parent = contentFrame
chatContent = .()
chatContent.Size = .(, -, , )
chatContent.BackgroundTransparency =
chatContent.TextColor3 = .(, , )
chatContent.Font = .Font.Gotham
chatContent.TextSize =
chatContent.TextWrapped =
chatContent.TextXAlignment = .TextXAlignment.Left
chatContent.TextYAlignment = .TextYAlignment.Top
chatContent.Parent = chatScroll
tutorialPanel = .()
tutorialPanel.Size = .(, -, , -)
tutorialPanel.Position = .(, , , )
tutorialPanel.BackgroundTransparency =
tutorialPanel.BorderSizePixel =
tutorialPanel.ScrollBarThickness =
tutorialPanel.CanvasSize = .(, , , )
tutorialPanel.Parent = contentFrame
tutorialText = .()
tutorialText.Text =
tutorialText.Size = .(, , , )
tutorialText.BackgroundTransparency =
tutorialText.TextColor3 = .(, , )
tutorialText.Font = .Font.Gotham
tutorialText.TextSize =
tutorialText.TextWrapped =
tutorialText.TextXAlignment = .TextXAlignment.Left
tutorialText.TextYAlignment = .TextYAlignment.Top
tutorialText.LineHeight =
tutorialText.Parent = tutorialPanel
inputContainer = .()
inputContainer.Size = .(, -, , )
inputContainer.Position = .(, , , -)
inputContainer.BackgroundColor3 = .(, , )
inputContainer.BorderSizePixel =
inputContainer.Visible =
inputContainer.Parent = contentFrame
.(, inputContainer).CornerRadius = .(, )
inputBox = .()
inputBox.Size = .(, -, , -)
inputBox.Position = .(, , , )
inputBox.BackgroundTransparency =
inputBox.PlaceholderText =
inputBox.PlaceholderColor3 = .(, , )
inputBox.TextColor3 = .(, , )
inputBox.Font = .Font.Gotham
inputBox.TextSize =
inputBox.TextXAlignment = .TextXAlignment.Left
inputBox.TextWrapped =
inputBox.ClearTextOnFocus =
inputBox.Parent = inputContainer
modelsBtn = .()
modelsBtn.Size = .(, , , )
modelsBtn.Position = .(, -, , -)
modelsBtn.BackgroundColor3 = .(, , )
modelsBtn.Text =
modelsBtn.TextColor3 = .(, , )
modelsBtn.Font = .Font.GothamBold
modelsBtn.TextSize =
modelsBtn.Parent = inputContainer
.(, modelsBtn).CornerRadius = .(, )
sendBtn = .()
sendBtn.Size = .(, , , )
sendBtn.Position = .(, -, , -)
sendBtn.BackgroundColor3 = .(, , )
sendBtn.Text =
sendBtn.TextColor3 = .(, , )
sendBtn.Font = .Font.GothamBold
sendBtn.TextSize =
sendBtn.Parent = inputContainer
.(, sendBtn).CornerRadius = .(, )
modelPanel = .()
modelPanel.Size = .(, , , )
modelPanel.Position = .(, -, , -)
modelPanel.BackgroundColor3 = .(, , )
modelPanel.BorderSizePixel =
modelPanel.Visible =
modelPanel.ZIndex =
modelPanel.Parent = screenGui
.(, modelPanel).CornerRadius = .(, )
modelHeader = .()
modelHeader.Text =
modelHeader.Size = .(, , , )
modelHeader.BackgroundColor3 = .(, , )
modelHeader.TextColor3 = .(, , )
modelHeader.Font = .Font.GothamBold
modelHeader.TextSize =
modelHeader.Parent = modelPanel
.(, modelHeader).CornerRadius = .(, )
modelScroll = .()
modelScroll.Size = .(, -, , -)
modelScroll.Position = .(, , , )
modelScroll.BackgroundTransparency =
modelScroll.BorderSizePixel =
modelScroll.ScrollBarThickness =
modelScroll.CanvasSize = .(, , , )
modelScroll.Parent = modelPanel
modelList = .()
modelList.Padding = .(, )
modelList.Parent = modelScroll
modelCloseBtn = .()
modelCloseBtn.Size = .(, , , )
modelCloseBtn.Position = .(, -, , )
modelCloseBtn.BackgroundColor3 = .(, , )
modelCloseBtn.Text =
modelCloseBtn.TextColor3 = .(, , )
modelCloseBtn.Font = .Font.GothamBold
modelCloseBtn.TextSize =
modelCloseBtn.ZIndex =
modelCloseBtn.Parent = modelPanel
.(, modelCloseBtn).CornerRadius = .(, )
settingsPanel = .()
settingsPanel.Size = .(, , , )
settingsPanel.BackgroundColor3 = .(, , )
settingsPanel.BorderSizePixel =
settingsPanel.Visible =
settingsPanel.Parent = contentFrame
settingsScroll = .()
settingsScroll.Size = .(, -, , -)
settingsScroll.Position = .(, , , )
settingsScroll.BackgroundTransparency =
settingsScroll.BorderSizePixel =
settingsScroll.ScrollBarThickness =
settingsScroll.CanvasSize = .(, , , )
settingsScroll.Parent = settingsPanel
settingsList = .()
settingsList.Padding = .(, )
settingsList.Parent = settingsScroll
(text, parent)
label = .()
label.Text = text
label.Size = .(, -, , )
label.BackgroundTransparency =
label.TextColor3 = .(, , )
label.Font = .Font.GothamBold
label.TextSize =
label.TextXAlignment = .TextXAlignment.Left
label.Parent = parent
label
lrLabel = ( .. .(, current_learning_rate), settingsScroll)
lrInput = .()
lrInput.Size = .(, -, , )
lrInput.BackgroundColor3 = .(, , )
lrInput.Text = .(, current_learning_rate)
lrInput.PlaceholderText =
lrInput.TextColor3 = .(, , )
lrInput.Font = .Font.Gotham
lrInput.TextSize =
lrInput.Parent = settingsScroll
.(, lrInput).CornerRadius = .(, )
(, settingsScroll)
createModelBtn = .()
createModelBtn.Size = .(, -, , )
createModelBtn.BackgroundColor3 = .(, , )
createModelBtn.Text =
createModelBtn.TextColor3 = .(, , )
createModelBtn.Font = .Font.GothamBold
createModelBtn.TextSize =
createModelBtn.Parent = settingsScroll
.(, createModelBtn).CornerRadius = .(, )
(, settingsScroll)
saveBtn = .()
saveBtn.Size = .(, -, , )
saveBtn.BackgroundColor3 = .(, , )
saveBtn.Text =
saveBtn.TextColor3 = .(, , )
saveBtn.Font = .Font.GothamBold
saveBtn.TextSize =
saveBtn.Parent = settingsScroll
.(, saveBtn).CornerRadius = .(, )
loadBtn = .()
loadBtn.Size = .(, -, , )
loadBtn.BackgroundColor3 = .(, , )
loadBtn.Text =
loadBtn.TextColor3 = .(, , )
loadBtn.Font = .Font.GothamBold
loadBtn.TextSize =
loadBtn.Parent = settingsScroll
.(, loadBtn).CornerRadius = .(, )
(, settingsScroll)
exportBtn = .()
exportBtn.Size = .(, -, , )
exportBtn.BackgroundColor3 = .(, , )
exportBtn.Text =
exportBtn.TextColor3 = .(, , )
exportBtn.Font = .Font.GothamBold
exportBtn.TextSize =
exportBtn.Parent = settingsScroll
.(, exportBtn).CornerRadius = .(, )
importInput = .()
importInput.Size = .(, -, , )
importInput.BackgroundColor3 = .(, , )
importInput.PlaceholderText =
importInput.TextColor3 = .(, , )
importInput.Font = .Font.Code
importInput.TextSize =
importInput.TextWrapped =
importInput.TextXAlignment = .TextXAlignment.Left
importInput.TextYAlignment = .TextYAlignment.Top
importInput.ClearTextOnFocus =
importInput.MultiLine =
importInput.Parent = settingsScroll
.(, importInput).CornerRadius = .(, )
importBtn = .()
importBtn.Size = .(, -, , )
importBtn.BackgroundColor3 = .(, , )
importBtn.Text =
importBtn.TextColor3 = .(, , )
importBtn.Font = .Font.GothamBold
importBtn.TextSize =
importBtn.Parent = settingsScroll
.(, importBtn).CornerRadius = .(, )
(, settingsScroll)
randomizeBtn = .()
randomizeBtn.Size = .(, -, , )
randomizeBtn.BackgroundColor3 = .(, , )
randomizeBtn.Text =
randomizeBtn.TextColor3 = .(, , )
randomizeBtn.Font = .Font.GothamBold
randomizeBtn.TextSize =
randomizeBtn.Parent = settingsScroll
.(, randomizeBtn).CornerRadius = .(, )
(, settingsScroll)
diagBox = .()
diagBox.Size = .(, -, , )
diagBox.BackgroundColor3 = .(, , )
diagBox.TextColor3 = .(, , )
diagBox.Font = .Font.Code
diagBox.TextSize =
diagBox.TextXAlignment = .TextXAlignment.Left
diagBox.TextYAlignment = .TextYAlignment.Top
diagBox.TextWrapped =
diagBox.Text =
diagBox.Parent = settingsScroll
.(, diagBox).CornerRadius = .(, )
creatorPanel = .()
creatorPanel.Size = .(, , , )
creatorPanel.Position = .(, -, , -)
creatorPanel.BackgroundColor3 = .(, , )
creatorPanel.BorderSizePixel =
creatorPanel.Visible =
creatorPanel.ZIndex =
creatorPanel.Parent = screenGui
.(, creatorPanel).CornerRadius = .(, )
creatorHeader = .()
creatorHeader.Text =
creatorHeader.Size = .(, , , )
creatorHeader.BackgroundColor3 = .(, , )
creatorHeader.TextColor3 = .(, , )
creatorHeader.Font = .Font.GothamBold
creatorHeader.TextSize =
creatorHeader.Parent = creatorPanel
.(, creatorHeader).CornerRadius = .(, )
creatorScroll = .()
creatorScroll.Size = .(, -, , -)
creatorScroll.Position = .(, , , )
creatorScroll.BackgroundTransparency =
creatorScroll.BorderSizePixel =
creatorScroll.ScrollBarThickness =
creatorScroll.CanvasSize = .(, , , )
creatorScroll.Parent = creatorPanel
creatorList = .()
creatorList.Padding = .(, )
creatorList.Parent = creatorScroll
(labelText, placeholder, parent)
label = (labelText, parent)
input = .()
input.Size = .(, -, , )
input.BackgroundColor3 = .(, , )
input.PlaceholderText = placeholder
input.Text =
input.TextColor3 = .(, , )
input.Font = .Font.Gotham
input.TextSize =
input.Parent = parent
.(, input).CornerRadius = .(, )
input
nameInput = (, , creatorScroll)
inputSizeInput = (, , creatorScroll)
hiddenSizeInput = (, , creatorScroll)
lrCreatorInput = (, , creatorScroll)
paramCountLabel = .()
paramCountLabel.Text =
paramCountLabel.Size = .(, -, , )
paramCountLabel.BackgroundColor3 = .(, , )
paramCountLabel.TextColor3 = .(, , )
paramCountLabel.Font = .Font.GothamBold
paramCountLabel.TextSize =
paramCountLabel.Parent = creatorScroll
.(, paramCountLabel).CornerRadius = .(, )
createFinalBtn = .()
createFinalBtn.Size = .(, -, , )
createFinalBtn.Position = .(, , , -)
createFinalBtn.BackgroundColor3 = .(, , )
createFinalBtn.Text =
createFinalBtn.TextColor3 = .(, , )
createFinalBtn.Font = .Font.GothamBold
createFinalBtn.TextSize =
createFinalBtn.ZIndex =
createFinalBtn.Parent = creatorPanel
.(, createFinalBtn).CornerRadius = .(, )
creatorCloseBtn = .()
creatorCloseBtn.Size = .(, , , )
creatorCloseBtn.Position = .(, -, , )
creatorCloseBtn.BackgroundColor3 = .(, , )
creatorCloseBtn.Text =
creatorCloseBtn.TextColor3 = .(, , )
creatorCloseBtn.Font = .Font.GothamBold
creatorCloseBtn.TextSize =
creatorCloseBtn.ZIndex =
creatorCloseBtn.Parent = creatorPanel
.(, creatorCloseBtn).CornerRadius = .(, )
floatingBtn = .()
floatingBtn.Size = .(, , , )
floatingBtn.Position = .(, -, , -)
floatingBtn.BackgroundColor3 = .(, , )
floatingBtn.Text =
floatingBtn.TextColor3 = .(, , )
floatingBtn.Font = .Font.GothamBold
floatingBtn.TextSize =
floatingBtn.Visible =
floatingBtn.Parent = screenGui
.(, floatingBtn).CornerRadius = .(, )
()
text = .. CURRENT_MODEL_NAME ..
text = text .. .. TARGET_PARAMETER_COUNT ..
text = text .. .. .(, current_learning_rate) ..
text = text .. .. (CONVERSATIONAL_MODE ) ..
text = text ..
text = text .. .. INPUT_SIZE ..
text = text .. .. HIDDEN_SIZE ..
text = text .. .. OUTPUT_SIZE ..
text = text ..
i = , .(, TARGET_PARAMETER_COUNT)
text = text .. .(, i, PARAMETERS[i] )
diagBox.Text = text
lrLabel.Text = .. .(, current_learning_rate)
(sender, text)
message = {sender = sender, text = text, isAI = (sender == )}
.(ChatSessions[CurrentSessionName].messages, message)
displayText =
_, msg (ChatSessions[CurrentSessionName].messages)
displayText = displayText .. msg.sender .. .. msg.text ..
chatContent.Text = displayText
contentHeight = chatContent.TextBounds.Y +
chatScroll.CanvasSize = .(, , , contentHeight)
chatScroll.CanvasPosition = .(, contentHeight)
(() () )
(name)
btn = .()
btn.Name = .. name
btn.Size = .(, -, , )
btn.BackgroundColor3 = (name == CurrentSessionName) .(, , ) .(, , )
btn.Text = .. name
btn.TextColor3 = (name == CurrentSessionName) .(, , ) .(, , )
btn.Font = .Font.Gotham
btn.TextSize =
btn.TextXAlignment = .TextXAlignment.Left
btn.TextTruncate = .TextTruncate.AtEnd
btn.Parent = sessionScroll
.(, btn).CornerRadius = .(, )
btn.MouseButton1Click:(()
(name)
)
btn
()
_, child (sessionScroll:())
child:()
child:()
tutBtn = .()
tutBtn.Name =
tutBtn.Size = .(, -, , )
tutBtn.BackgroundColor3 = (CurrentSessionName == ) .(, , ) .(, , )
tutBtn.Text =
tutBtn.TextColor3 = (CurrentSessionName == ) .(, , ) .(, , )
tutBtn.Font = .Font.GothamBold
tutBtn.TextSize =
tutBtn.TextXAlignment = .TextXAlignment.Left
tutBtn.Parent = sessionScroll
.(, tutBtn).CornerRadius = .(, )
tutBtn.MouseButton1Click:(()
()
)
count =
name, _ (ChatSessions)
(name)
count = count +
sessionScroll.CanvasSize = .(, , , (count * ) + (count * ))
(name)
ChatSessions[CurrentSessionName] ChatSessions[CurrentSessionName].params
ChatSessions[CurrentSessionName].params = (PARAMETERS)
CurrentSessionName = name
sessionTitle.Text = name
isChat = ChatSessions[name] ~=
chatScroll.Visible = isChat
inputContainer.Visible = isChat
tutorialPanel.Visible = isChat
settingsPanel.Visible =
isChat
session = ChatSessions[CurrentSessionName]
CURRENT_MODEL_NAME = session.model
modelConfig = MODEL_PRESETS[CURRENT_MODEL_NAME]
modelConfig
INPUT_SIZE = modelConfig.input
HIDDEN_SIZE = modelConfig.hidden
OUTPUT_SIZE = modelConfig.output
current_learning_rate = modelConfig.learning_rate
TARGET_PARAMETER_COUNT = ()
()
PARAMETERS = (session.params)
displayText =
_, msg (session.messages)
displayText = displayText .. msg.sender .. .. msg.text ..
chatContent.Text = displayText
contentHeight = chatContent.TextBounds.Y +
chatScroll.CanvasSize = .(, , , contentHeight)
chatScroll.CanvasPosition = .(, contentHeight)
()
()
(modelName)
modelConfig = MODEL_PRESETS[modelName]
modelConfig
CURRENT_MODEL_NAME = modelName
INPUT_SIZE = modelConfig.input
HIDDEN_SIZE = modelConfig.hidden
OUTPUT_SIZE = modelConfig.output
current_learning_rate = modelConfig.learning_rate
TARGET_PARAMETER_COUNT = ()
()
PARAMETERS = ()
ChatSessions[CurrentSessionName]
ChatSessions[CurrentSessionName].params = (PARAMETERS)
ChatSessions[CurrentSessionName].model = modelName
(, .. modelName .. .. TARGET_PARAMETER_COUNT .. )
()
()
_, child (modelScroll:())
child:()
child:()
count =
modelName, config (MODEL_PRESETS)
paramCount = (config.input * config.hidden) + config.hidden + (config.hidden * config.output) + config.output
btn = .()
btn.Size = .(, -, , )
btn.BackgroundColor3 = (modelName == CURRENT_MODEL_NAME) .(, , ) .(, , )
btn.BorderSizePixel =
btn.Parent = modelScroll
.(, btn).CornerRadius = .(, )
title = .()
title.Text = modelName
title.Size = .(, -, , )
title.Position = .(, , , )
title.BackgroundTransparency =
title.TextColor3 = .(, , )
title.Font = .Font.GothamBold
title.TextSize =
title.TextXAlignment = .TextXAlignment.Left
title.Parent = btn
info = .()
info.Text = .(, paramCount, config.input, config.hidden)
info.Size = .(, -, , )
info.Position = .(, , , )
info.BackgroundTransparency =
info.TextColor3 = .(, , )
info.Font = .Font.Gotham
info.TextSize =
info.TextXAlignment = .TextXAlignment.Left
info.Parent = btn
lr = .()
lr.Text = .(, config.learning_rate)
lr.Size = .(, -, , )
lr.Position = .(, , , )
lr.BackgroundTransparency =
lr.TextColor3 = .(, , )
lr.Font = .Font.Gotham
lr.TextSize =
lr.TextXAlignment = .TextXAlignment.Left
lr.Parent = btn
btn.MouseButton1Click:(()
(modelName)
modelPanel.Visible =
)
count = count +
modelScroll.CanvasSize = .(, , , (count * ) + (count * ))
(text)
CurrentSessionName == text:() ==
inputBox.Text =
target = (text)
(target == target == ) INPUT_PARSING_PASSED CONVERSATIONAL_MODE
(, .. target)
confidence, hidden = (last_input_features)
result = (target, hidden)
(, .. result)
INPUT_PARSING_PASSED =
()
(, text)
confidence, hidden = ((text))
CONVERSATIONAL_MODE
response = (text, confidence)
(, response)
response, color = (confidence)
(, .(response .. , confidence))
INPUT_PARSING_PASSED =
dragging =
dragStart, startPos
topBar.InputBegan:((input)
input.UserInputType == .UserInputType.MouseButton1 input.UserInputType == .UserInputType.Touch
dragging =
dragStart = input.Position
startPos = mainFrame.Position
)
UserInputService.InputChanged:((input)
dragging (input.UserInputType == .UserInputType.MouseMovement input.UserInputType == .UserInputType.Touch)
delta = input.Position - dragStart
mainFrame.Position = .(
startPos.X.Scale, startPos.X.Offset + delta.X,
startPos.Y.Scale, startPos.Y.Offset + delta.Y
)
)
UserInputService.InputEnded:((input)
input.UserInputType == .UserInputType.MouseButton1 input.UserInputType == .UserInputType.Touch
dragging =
)
modeToggle.MouseButton1Click:(()
CONVERSATIONAL_MODE = CONVERSATIONAL_MODE
CONVERSATIONAL_MODE
modeToggle.Text =
modeToggle.TextColor3 = .(, , )
modeToggle.BackgroundColor3 = .(, , )
modeToggle.Text =
modeToggle.TextColor3 = .(, , )
modeToggle.BackgroundColor3 = .(, , )
()
)
settingsBtn.MouseButton1Click:(()
CurrentSessionName ~=
lastReturnSession = CurrentSessionName
settingsPanel.Visible = settingsPanel.Visible
chatScroll.Visible = settingsPanel.Visible ChatSessions[CurrentSessionName] ~=
inputContainer.Visible = settingsPanel.Visible ChatSessions[CurrentSessionName] ~=
tutorialPanel.Visible = settingsPanel.Visible CurrentSessionName ==
settingsPanel.Visible
()
)
isMinimized =
originalSize = mainFrame.Size
minimizeBtn.MouseButton1Click:(()
isMinimized
TweenService:(mainFrame, TweenInfo.(), {
Size = .(, , , )
}):()
contentFrame.Visible =
sidebar.Visible =
minimizeBtn.Text =
isMinimized =
TweenService:(mainFrame, TweenInfo.(), {
Size = originalSize
}):()
()
contentFrame.Visible =
sidebar.Visible =
minimizeBtn.Text =
isMinimized =
)
closeBtn.MouseButton1Click:(()
mainFrame.Visible =
floatingBtn.Visible =
)
floatingBtn.MouseButton1Click:(()
floatingBtn.Visible =
mainFrame.Visible =
isMinimized
TweenService:(mainFrame, TweenInfo.(), {
Size = originalSize
}):()
()
contentFrame.Visible =
sidebar.Visible =
minimizeBtn.Text =
isMinimized =
)
newChatBtn.MouseButton1Click:(()
num =
ChatSessions[ .. num]
num = num +
newName = .. num
ChatSessions[newName] = {
messages = {{sender = , text = .. CURRENT_MODEL_NAME .. , isAI = }},
params = (),
model = CURRENT_MODEL_NAME
}
(newName)
)
sendBtn.MouseButton1Click:(()
(inputBox.Text)
)
inputBox.FocusLost:((enter)
enter
(inputBox.Text)
)
modelsBtn.MouseButton1Click:(()
()
modelPanel.Visible =
)
modelCloseBtn.MouseButton1Click:(()
modelPanel.Visible =
)
lrInput.FocusLost:(()
newLR = (lrInput.Text)
newLR newLR > newLR <=
current_learning_rate = newLR
()
lrInput.Text = .(, current_learning_rate)
)
createModelBtn.MouseButton1Click:(()
creatorPanel.Visible =
)
creatorCloseBtn.MouseButton1Click:(()
creatorPanel.Visible =
lastReturnSession ~= ChatSessions[lastReturnSession]
(lastReturnSession)
)
()
input = (inputSizeInput.Text)
hidden = (hiddenSizeInput.Text)
params = (input * hidden) + hidden + hidden +
paramCountLabel.Text = .. params
inputSizeInput:():(updateParamCount)
hiddenSizeInput:():(updateParamCount)
createFinalBtn.MouseButton1Click:(()
modelName = nameInput.Text
inputSize = (inputSizeInput.Text)
hiddenSize = (hiddenSizeInput.Text)
lr = (lrCreatorInput.Text)
modelName == inputSize hiddenSize lr
createFinalBtn.Text =
()
createFinalBtn.Text =
inputSize < inputSize > hiddenSize < hiddenSize >
createFinalBtn.Text =
()
createFinalBtn.Text =
MODEL_PRESETS[modelName] = {
input = inputSize,
hidden = hiddenSize,
output = ,
learning_rate = lr
}
createFinalBtn.Text =
()
creatorPanel.Visible =
createFinalBtn.Text =
nameInput.Text =
inputSizeInput.Text =
hiddenSizeInput.Text =
lrCreatorInput.Text =
lastReturnSession ~= ChatSessions[lastReturnSession]
(lastReturnSession)
)
saveBtn.MouseButton1Click:(()
success = (save_all_sessions)
success
saveBtn.Text =
()
saveBtn.Text =
saveBtn.Text =
()
saveBtn.Text =
)
loadBtn.MouseButton1Click:(()
success = (load_all_sessions)
success
loadBtn.Text =
first = (ChatSessions)
first (first)
()
loadBtn.Text =
loadBtn.Text =
()
loadBtn.Text =
)
exportBtn.MouseButton1Click:(()
exportStr = ()
(exportStr)
exportBtn.Text = "ā
Copied!"
wait(2)
exportBtn.Text = "š Copy Export String"
end)
importBtn.MouseButton1Click:Connect(function()
local importStr = importInput.Text
if importStr:len() > 0 then
local success, msg = import_from_string(importStr)
if success then
importBtn.Text = "ā
Imported!"
local first = next(ChatSessions)
if first then load_session(first) end
else
importBtn.Text = "ā " .. msg
end
wait(2)
importBtn.Text = "š„ Import String"
end
end)
randomizeBtn.MouseButton1Click:Connect(function()
PARAMETERS = initialize_parameters()
if ChatSessions[CurrentSessionName] then
ChatSessions[CurrentSessionName].params = table_clone(PARAMETERS)
end
randomizeBtn.Text = "ā
Randomized!"
update_diagnostics()
wait(1.5)
randomizeBtn.Text = "š² Randomize Current Model"
end)
-- ===================================
-- INITIALIZATION
-- ===================================
local loadSuccess = pcall(load_all_sessions)
if not loadSuccess then
PARAMETERS = initialize_parameters()
ChatSessions = {
["Session 1"] = {
messages = {{sender = "š¤ RoAI", text = "Welcome! " .. CURRENT_MODEL_NAME .. " ready. Toggle modes above!", isAI = true}},
params = table_clone(PARAMETERS),
model = CURRENT_MODEL_NAME
}
}
end
load_session(CurrentSessionName)
print("š¤ RoAI System v3.0 Loaded!")
print("š Current: " .. CURRENT_MODEL_NAME)
print("⨠Custom models supported!")
if loadSuccess then
print("š¾ Previous sessions restored!")
endRoAI 3.0: The Complete Multi-Model AI Assistant for Roblox Tired of simple API wrappers? RoAI 3.0 is a groundbreaking, custom-built Neural Network (NN) entirely coded in Roblox Lua. It is a full-featured conversational assistant with a custom training loop and multiple models built right into your game. ⨠CORE FEATURES Native Lua Neural Network: This is not a third-party API! RoAI implements a custom, single-hidden-layer Feedforward Neural Network using the Backpropagation algorithm for genuine, in-game learning. Multi-Model Architecture: Choose from 6 distinct AI models (from RoAI 1.0 Mini to RoAI 3.5 Ultra), each with a unique size and learning rate: RoAI 3.5 Ultra: Our flagship model with 128 input features and 256 hidden nodes, offering ~33,000 parameters for the most complex reasoning. RoAI 1.0 Mini: A lightweight, high-speed model for fast responses. Real-Time Training Mode (š): You can actively train the AI's weights and biases! Toggle into Training Mode and provide immediate positive (1) or negative (0) feedback after an AI response to teach it context and sentiment in real-time. Advanced Feature Engineering: The system analyzes over 120+ contextual features from you