Run it
Copy the script and paste it into your executor.
HttpService = :()
TweenService = :()
UserInputService = :()
RunService = :()
CoreGui = :()
Players = :()
().GeminiChatLoaded
().GeminiChatUnload
().()
().GeminiChatLoaded =
IsGenerating =
StopGeneration =
Config = {
ApiKey = ,
Model = ,
History = {}
}
()
Theme = {
Background = .(, , ),
Sidebar = .(, , ),
InputBG = .(, , ),
UserBubble = .(, , ),
AIBubble = .(, , ),
TextPrimary = .(, , ),
TextSecondary = .(, , ),
Accent = .(, , ),
CodeBlock = .black,
Scrollbar = .(, , ),
Radius = .(, )
}
(text)
text = text:(, ):(, ):(, ):(, ):(, )
text = text:(, )
text = text:(, )
text = text:(, )
text = text:(, )
text = text:(, )
text = text:(, )
text = text:(, )
text = text:(, )
text = text:(, )
text
(label, text, speed)
label.Text =
displayed =
_, code utf8.(text)
StopGeneration
displayed = displayed .. utf8.(code)
label.Text = displayed
ChatScroll
ChatScroll.CanvasPosition = .(, ChatScroll.AbsoluteCanvasSize.Y)
speed speed >
.(speed)
.()
label.Text = text
(className, properties, children)
instance = .(className)
k, v (properties {})
instance[k] = v
children
_, child (children)
child.Parent = instance
instance
(instance, info, goals)
tween = TweenService:(instance, info, goals)
tween:()
tween
(text, font, fontSize, maxWidth)
:():(text, fontSize, font, .(maxWidth, ))
ScreenGui = (, {
Name = ,
Parent = (RunService:() Players.LocalPlayer:()) CoreGui,
ResetOnSpawn = ,
ZIndexBehavior = .ZIndexBehavior.Sibling
})
MainFrame = (, {
Name = ,
Parent = ScreenGui,
BackgroundColor3 = Theme.Background,
Size = .(, ),
Position = .(, , , -),
AnchorPoint = .(, ),
BorderSizePixel = ,
ClipsDescendants =
}, {
(, { CornerRadius = Theme.Radius }),
(, { Color = .(, , ), Thickness = , Transparency = })
})
Dragging, DragInput, DragStart, StartPos
ChatScroll, InputContainer
MainFrame.InputBegan:((input)
input.UserInputType == .UserInputType.MouseButton1
Dragging =
DragStart = input.Position
StartPos = MainFrame.Position
input.Changed:(()
input.UserInputState == .UserInputState.End
Dragging =
)
)
MainFrame.InputChanged:((input)
input.UserInputType == .UserInputType.MouseMovement
DragInput = input
)
UserInputService.InputChanged:((input)
input == DragInput Dragging
delta = input.Position - DragStart
(MainFrame, TweenInfo.(), {
Position = .(StartPos.X.Scale, StartPos.X.Offset + delta.X, StartPos.Y.Scale, StartPos.Y.Offset + delta.Y)
})
)
Header = (, {
Name = ,
Parent = MainFrame,
Size = .(, , , ),
BackgroundColor3 = Theme.Sidebar,
BorderSizePixel =
}, {
(, {
Text = ,
TextColor3 = Theme.TextPrimary,
Font = .Font.GothamBold,
TextSize = ,
Size = .(, ),
BackgroundTransparency = ,
Position = .(, ),
TextXAlignment = .TextXAlignment.Left
}),
(, { CornerRadius = .(, ) }),
(, {
Size = .(, , , ),
Position = .(, , , -),
BackgroundColor3 = Theme.Sidebar,
BorderSizePixel =
})
})
CloseBtn = (, {
Parent = Header,
Text = ,
TextColor3 = Theme.TextSecondary,
Font = .Font.Gotham,
TextSize = ,
BackgroundTransparency = ,
Size = .(, ),
Position = .(, -, , -),
AutoButtonColor =
})
CloseBtn.MouseEnter:(() (CloseBtn, TweenInfo.(), {TextColor3 = .(, , )}) )
CloseBtn.MouseLeave:(() (CloseBtn, TweenInfo.(), {TextColor3 = Theme.TextSecondary}) )
CloseBtn.MouseButton1Click:(()
().()
)
Minimized =
MinimizeBtn = (, {
Parent = Header,
Text = ,
TextColor3 = Theme.TextSecondary,
Font = .Font.Gotham,
TextSize = ,
BackgroundTransparency = ,
Size = .(, ),
Position = .(, -, , -),
AutoButtonColor =
})
MinimizeBtn.MouseEnter:(() (MinimizeBtn, TweenInfo.(), {TextColor3 = Theme.Accent}) )
MinimizeBtn.MouseLeave:(() (MinimizeBtn, TweenInfo.(), {TextColor3 = Theme.TextSecondary}) )
MinimizeBtn.MouseButton1Click:(()
Minimized = Minimized
targetSize = Minimized .(, ) .(, )
(MainFrame, TweenInfo.(, .EasingStyle.Quart, .EasingDirection.Out), {Size = targetSize})
Minimized
ChatScroll.Visible =
InputContainer.Visible =
MinimizeBtn.Text =
MinimizeBtn.Text =
.(, ()
Minimized
ChatScroll.Visible =
InputContainer.Visible =
)
)
Hidden =
UserInputService.InputBegan:((input, gpe)
gpe
input.KeyCode == .KeyCode.LeftControl
Hidden = Hidden
ScreenGui.Enabled = Hidden
)
ChatScroll = (, {
Parent = MainFrame,
Size = .(, , , -),
Position = .(, , , ),
BackgroundTransparency = ,
ScrollBarThickness = ,
ScrollBarImageColor3 = Theme.Scrollbar,
CanvasSize = .(, , , ),
AutomaticCanvasSize = .AutomaticSize.Y
}, {
(, {
SortOrder = .SortOrder.LayoutOrder,
Padding = .(, ),
HorizontalAlignment = .HorizontalAlignment.Center
}),
(, {
PaddingTop = .(, ),
PaddingBottom = .(, ),
PaddingLeft = .(, ),
PaddingRight = .(, )
})
})
InputContainer = (, {
Parent = MainFrame,
Size = .(, , , ),
Position = .(, , , -),
BackgroundTransparency = ,
BorderSizePixel =
})
Pill = (, {
Parent = InputContainer,
Size = .(, -, , ),
Position = .(, , , ),
AnchorPoint = .(, ),
BackgroundColor3 = Theme.InputBG,
BackgroundTransparency = ,
BorderSizePixel =
}, {
(, { CornerRadius = .(, ) }),
(, { Color = .(, , ), Transparency = , Thickness = })
})
InputBox = (, {
Parent = Pill,
Size = .(, -, , ),
Position = .(, , , ),
BackgroundTransparency = ,
TextColor3 = Theme.TextPrimary,
PlaceholderText = ,
PlaceholderColor3 = Theme.TextSecondary,
Font = .Font.Gotham,
TextSize = ,
TextWrapped = ,
ClearTextOnFocus = ,
TextXAlignment = .TextXAlignment.Left,
TextYAlignment = .TextYAlignment.Center,
Text =
})
SendBtn = (, {
Parent = Pill,
Size = .(, ),
Position = .(, -, , ),
AnchorPoint = .(, ),
BackgroundTransparency = ,
Image = ,
ImageColor3 = .(, , ),
ScaleType = .ScaleType.Fit,
AutoButtonColor =
})
(state)
IsGenerating = state
state
SendBtn.Image =
StopGeneration =
SendBtn.Image =
(text)
parts = {}
pattern =
lastPos =
startPos, endPos, code = text:(pattern, lastPos)
startPos
preText = text:(lastPos, startPos - )
#preText >
.(parts, {Type = , Content = preText})
cleanCode = code:(, ):(, ):(, )
.(parts, {Type = , Content = cleanCode})
lastPos = endPos +
startPos, endPos, code = text:(pattern, lastPos)
remain = text:(lastPos)
#remain >
.(parts, {Type = , Content = remain})
#parts == .(parts, {Type = , Content = text})
_, part (parts)
part.Type ==
part.Content = (part.Content)
parts
(role, text)
isUser = (role == )
bubbleColor = isUser Theme.UserBubble Theme.AIBubble
Row = (, {
Parent = ChatScroll,
Size = .(, , , ),
BackgroundTransparency = ,
AutomaticSize = .AutomaticSize.Y
})
isUser
(, {
Parent = Row,
Text = ,
TextColor3 = Theme.TextSecondary,
Font = .Font.GothamBold,
TextSize = ,
Size = .(, -, , ),
Position = .(, , , ),
BackgroundTransparency = ,
TextXAlignment = .TextXAlignment.Right
})
(, {
Parent = Row,
Size = .(, ),
BackgroundTransparency = ,
Position = .(, , , ),
Image = ,
}, { (, { CornerRadius = .(, ) }) })
ContentWidth =
Bubble = (, {
Parent = Row,
BackgroundColor3 = bubbleColor,
Size = .(, ContentWidth, , ),
Position = isUser .(, -, , ) .(, , , ),
AnchorPoint = isUser .(, ) .(, ),
AutomaticSize = .AutomaticSize.Y,
BackgroundTransparency =
}, {
(, { CornerRadius = .(, ) }),
(, {
SortOrder = .SortOrder.LayoutOrder,
Padding = .(, )
}),
(, {
PaddingTop = .(, ),
PaddingBottom = .(, ),
PaddingLeft = .(, ),
PaddingRight = .(, )
})
})
.(()
parts = (text)
_, part (parts)
StopGeneration
part.Type ==
label = (, {
Parent = Bubble,
Text = ,
TextColor3 = Theme.TextPrimary,
Font = .Font.Gotham,
TextSize = ,
TextWrapped = ,
BackgroundTransparency = ,
Size = .(, , , ),
AutomaticSize = .AutomaticSize.Y,
TextXAlignment = .TextXAlignment.Left,
RichText =
})
isUser
label.Text = part.Content
(label, part.Content)
part.Type ==
codeBox
rawContent = part.Content
codeContainer = (, {
Parent = Bubble,
BackgroundColor3 = .(, , ),
BackgroundTransparency = ,
Size = .(, , , ),
AutomaticSize = .AutomaticSize.Y,
BorderSizePixel =
}, {
(, { CornerRadius = .(, ) }),
(, {
PaddingTop = .(, ),
PaddingBottom = .(, ),
PaddingLeft = .(, ),
PaddingRight = .(, )
}),
(, {
SortOrder = .SortOrder.LayoutOrder,
Padding = .(, )
})
})
codeHeader = (, {
Parent = codeContainer,
Size = .(, , , ),
BackgroundTransparency =
})
(, {
Parent = codeHeader,
Text = ,
TextColor3 = Theme.TextSecondary,
Font = .Font.GothamBold,
TextSize = ,
Size = .(, , , ),
BackgroundTransparency = ,
TextXAlignment = .TextXAlignment.Left
})
copyBtn = (, {
Parent = codeHeader,
Text = ,
TextColor3 = Theme.TextSecondary,
Font = .Font.Gotham,
TextSize = ,
Size = .(, , , ),
Position = .(, -, , ),
BackgroundTransparency =
})
copyBtn.MouseButton1Click:(()
clipboardFunc = setclipboard toclipboard (Synapse Synapse.write_clipboard)
clipboardFunc
(rawContent)
copyBtn.Text =
.()
copyBtn.Text =
)
codeBox = (, {
Parent = codeContainer,
Text = isUser rawContent ,
TextColor3 = .(, , ),
Font = .Font.Code,
TextSize = ,
TextWrapped = ,
BackgroundTransparency = ,
Size = .(, , , ),
AutomaticSize = .AutomaticSize.Y,
TextXAlignment = .TextXAlignment.Left,
TextYAlignment = .TextYAlignment.Top,
ClearTextOnFocus = ,
TextEditable = ,
MultiLine =
})
isUser
(codeBox, rawContent)
ChatScroll
ChatScroll.CanvasPosition = .(, ChatScroll.AbsoluteCanvasSize.Y)
)
.(()
.()
ChatScroll.CanvasPosition = .(, ChatScroll.AbsoluteCanvasSize.Y)
)
()
IsGenerating
StopGeneration =
()
text = InputBox.Text
text:(, ) ==
InputBox.Text =
()
(, text)
.(Config.History, {
role = ,
parts = {{text = text}}
})
loadingMsg = (, {
Parent = ChatScroll,
Text = ,
TextColor3 = Theme.TextSecondary,
Font = .Font.Gotham,
TextSize = ,
Size = .(, , , ),
BackgroundTransparency =
})
.(()
httpRequest = ( .request) (Fluxus Fluxus.request)
url = .(, Config.Model, Config.ApiKey)
body = { contents = Config.History }
success, res
httpRequest
success, res = (()
({
Url = url,
Method = ,
Headers = { [] = },
Body = HttpService:(body)
})
)
success, res = (()
{
Body = HttpService:(url, HttpService:(body), .HttpContentType.ApplicationJson),
StatusCode =
}
)
loadingMsg:()
success res
data = HttpService:(res.Body )
data data.candidates data.candidates[]
responseText = data.candidates[].content.parts[].text
(, responseText)
.(Config.History, {
role = ,
parts = {{text = responseText}}
})
(, .. (data.error data.error.message ))
(, )
()
)
SendBtn.MouseButton1Click:(SendMessage)
InputBox.FocusLost:((enter)
enter ()
)
().GeminiChatUnload = ()
(() ScreenGui:() )
().GeminiChatLoaded =
(, )
()
ssspiem

Universal