AI agent
Create the new XLQP AI agent with planning, workspace tools, permission modes, model effort, callbacks, and task controls.
AI agent
The updated AI textbox combines chat, activity steps, permission prompts, live client-visible context, and tools. Create it with Tab:AddTextbox({Ai = true}) or the CreateTextbox alias. AddXLQPGen1AI mounts the same chat implementation and also supports optional companion settings.
local Library = loadstring(game:HttpGet("https://raw.githubusercontent.com/josediaz765/XLQP-UIS/main/xlqp%20gen1"))()
local Window = Library:MakeWindow({Branding = {Name = "My Hub"}})
local Tab = Window:MakeTab({Name = "AI", Icon = "sparkles"})
local Agent = Tab:AddTextbox({
Name = "XLQP Agent",
Ai = true,
Gui = true,
Height = 620,
PermissionMode = "Ask first",
Effort = "Balanced",
AgentPlanner = true,
WorkspaceTools = true,
})Options
| Option | Accepted value and behavior |
|---|---|
Name, Placeholder, LayoutOrder | Title, input hint, and element order. |
Ai | true selects the agent instead of a normal textbox. |
Gui | Enables the GUI presentation. |
Height | Default 520; clamped from 360 to 760 pixels. |
PermissionMode | Read only, Ask first, Auto (ask for dangerous), or Allow everything. Defaults to saved service configuration, then Ask first. |
Effort | Instant, Balanced, or Deep. Defaults to saved configuration, then Balanced. |
AgentPlanner | Enabled unless explicitly false. |
WorkspaceTools | Controls automatic workspace-context collection. The current initialization also inherits the shared service setting. |
ShowContextDetails | Shows context details; inherited shared preferences may also enable it. |
MultilineInput | Enables multiline input; inherited shared preferences may also enable it. Use SetMultiline(false) to explicitly turn it off at runtime. |
PromptTransform(prompt, textbox) | May return a transformed prompt before sending. |
OnResponse(response, provider, prompt, textbox) | Called with the visible response after completion. |
Permission modes
| Mode | Tool behavior |
|---|---|
| Read only | Read tools run; write, remote, delete, and execute actions are blocked. |
| Ask first | Every non-read tool asks for approval. |
| Auto (ask for dangerous) | Ordinary writes run automatically; remote, deletion, and execution actions ask first. |
| Allow everything | Non-read tools run without an approval prompt. |
Approval offers Allow once, Allow everything this session, or Deny. These controls govern the client agent's tool calls; they do not grant access to server-only objects or unavailable script source.
Model, effort, and activity
The model menu exposes the providers bundled with the source, including its configured default Smart DevToolBox, public fallback choices, and custom-provider settings. Instant uses less planning and context; Balanced is the default; Deep collects more context and retains a longer conversation window.
Provider availability, quotas, authentication, and response quality depend on the selected service. A provider appearing in the UI does not guarantee unlimited free access.
The agent displays activity and tool status, plans, context information, usage estimates, and permission decisions. The interface also includes cancellation, questions, menus, and conversation controls. These are task summaries and results, not a transcript of hidden model reasoning.
Built-in tools
| Tool | Risk | Purpose |
|---|---|---|
instance_tree | read | Reads a bounded instance tree under a path. |
find_instances | read | Searches client-visible instances by name or class. |
inspect_instance | read | Inspects a path or previously registered instance ID. |
list_remotes | read | Lists client-visible RemoteEvents and RemoteFunctions. |
read_script_source | read | Reads LocalScript or ModuleScript source only when the runtime exposes it. |
set_property | write | Changes one writable property. |
fire_remote | remote | Invokes a visible remote with explicit arguments. |
destroy_instance | delete | Destroys one client-visible instance. |
Agent:SetPermissionMode("Read only")
print(Agent:CallTool("instance_tree", {path = "Workspace", depth = 2}))
print(Agent:CallTool("list_remotes", {limit = 20}))Use these tools in your own experience and inspect the returned result. The agent cannot infer hidden server state from a client tree.
Controller methods
| Method | Result |
|---|---|
Send(prompt) | Starts a request; returns the controller. |
GetLastResponse() | Returns the latest stored response. |
GetTools() | Returns registered tool specifications. |
CallTool(name, args) | Runs a registered tool through the permission policy. |
SetPermissionMode(mode) | Updates and saves the selected mode. |
SetEffort(mode) | Updates and saves model effort. |
SetMultiline(enabled) | Updates the input and saves that preference. |
SetAgentPlanner(enabled) | Toggles planning for this controller. |
GetCurrentTask() | Returns task name, plan, and last blocked action. |
AskQuestion(spec) | Displays a question with title, description, options, and optional typed input. |
Companion chat
AddXLQPGen1AI forces Ai = true, defaults to Gui = true, and supports UltraAI / ultraai, CompanionEnabled, FollowEnabled, UsePlayerAnimations, BubbleResponses, ChatPromptsOnly, WorldToolsEnabled, ThemeToolsEnabled, FollowDistance, WalkSpeed, and CompanionName. Those companion preferences are shared through the AI service.
See AddXLQPGen1AI, Textbox, and the full example.