AI Chat Block
- Moodle 4.4–5.2
- 更新 2026-05-20
This plugin provides a chat block powered by Moodle’s AI subsystem, with customizable AI personality.
moodle-block_ open ai_chat
Moodle AI subsystem-powered chat block for Moodle (no longer just OpenAI!)
This block allows your Moodle users to get 24/7 chat support via Moodle’s AI subsystem. The block offers multiple options for customizing the persona of the AI and the prompt it is given, in order to influence the text it outputs.
To get started, navigate to Site Administration > AI > AI Providers > and create a provider instance. The block will use this provider in order to generate chat responses.
Global block settings
The global block settings can be found by going to Site Administration > Plugins > Blocks > AI Chat Block. The options are:
Restrict chat usage to logged-in users: If this box is checked, only logged-in users will be able to use the chat box.
Assistant name: The name that the AI will use for itself in the conversation. It is also used for the UI headings in the chat window.
User name: The name that the AI will use for the user in the conversation. Both this and the above option can be used to influence the persona and responses of the AI. It is also always used for the UI headings in the chat window.
Enable logging: Checking this box will record all messages sent by users along with the AI response. When logging is enabled, a recording icon is displayed in the block to indicate to users that their messages are being saved. Interactions with the AI can be found at Site Administration > Reports > AI Chat Logs.
Persist conversations: If this box is checked, the assistant will remember the conversation between page loads. However, separate block instances will maintain separate conversations. For example, a user’s conversation will be retained between page loads within the same course, but chatting with an assistant in a different course will not carry on the same conversation.
Completion prompt: Here you can edit the text added to the top of the conversation in order to influence the AI’s persona and responses
Source of truth: Here you can add extra information or system-level instructions in order to influcence the AI’s responses or provide background context. Anything added here in the SoT at the plugin level will be applied to every block instance on the site, even if a block-level source of truth is provided. In that case, the block-level SoT will be appended to the site level.
Instance-level settings: Checking this box will allow anybody that can add a block to adjust all settings at a per-block level. Enabling this could incur extra charges.
Individual block settings
There are a few settings that can be changed on a per-block basis. You can access these settings by entering editing mode on your site and clicking the gear on the block, and then going to “Configure OpenAI Chat Block”
Block title: The title for this block
Show labels: Whether or not the names chosen for “Assistant name” and “User name” should appear in the chat UI
Source of Truth: Here you can add extra information or system-level instructions in order to influcence the AI’s responses or provide background context. Information provided here will only apply to this specific block.
- 4.0.2Moodle 4.4, 4.5, 5.0, 5.1, 5.2
- 3.0.2Moodle 4.0, 4.1, 4.2, 4.3, 4.4, 4.5