Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Component from "@glimmer/component";
import { action } from "@ember/object";
import didInsert from "@ember/render-modifiers/modifiers/did-insert";
import { scheduleOnce } from "@ember/runloop";
import { service } from "@ember/service";

export default class ComposerRaiserCompopnent extends Component {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,58 @@ import ChatbotLaunch from "../components/chatbot-launch";
export default apiInitializer("1.8.0", (api) => {
const siteSettings = api.container.lookup("service:site-settings");

api.modifyClass("component:chat-channel", {
pluginId: "discourse-chatbot",
async fetchMessages(findArgs = {}) {
if (this.messagesLoader.loading) {
return;
}
api.modifyClass(
"component:chat-channel",
(Superclass) =>
class extends Superclass {
async fetchMessages(findArgs = {}) {
if (this.messagesLoader.loading) {
return;
}

this.messagesManager.clear();
this.messagesManager.clear();

const result = await this.messagesLoader.load(findArgs);
this.messagesManager.messages = this.processMessages(
this.args.channel,
result
);
if (findArgs.target_message_id) {
this.scrollToMessageId(findArgs.target_message_id, {
highlight: true,
position: findArgs.position,
});
} else if (findArgs.fetch_from_last_read) {
const lastReadMessageId = this.currentUserMembership?.lastReadMessageId;
if (
this.args.channel.chatable.type === "DirectMessage" &&
this.args.channel.unicodeTitle === this.siteSettings.chatbot_bot_user
) {
this.scrollToMessageId(
this.messagesManager.messages[
this.messagesManager.messages.length - 1
].id
const result = await this.messagesLoader.load(findArgs);
this.messagesManager.messages = this.processMessages(
this.args.channel,
result
);
} else {
this.scrollToMessageId(lastReadMessageId);
if (findArgs.target_message_id) {
this.scrollToMessageId(findArgs.target_message_id, {
highlight: true,
position: findArgs.position,
});
} else if (findArgs.fetch_from_last_read) {
const lastReadMessageId =
this.currentUserMembership?.lastReadMessageId;
if (
this.args.channel.chatable.type === "DirectMessage" &&
this.args.channel.unicodeTitle ===
this.siteSettings.chatbot_bot_user
) {
this.scrollToMessageId(
this.messagesManager.messages[
this.messagesManager.messages.length - 1
].id
);
} else {
this.scrollToMessageId(lastReadMessageId);
}
} else if (findArgs.target_date) {
this.scrollToMessageId(result.meta.target_message_id, {
highlight: true,
position: "center",
});
} else {
this._ignoreNextScroll = true;
this.scrollToBottom();
}

this.debounceFillPaneAttempt();
this.debouncedUpdateLastReadMessage();
}
} else if (findArgs.target_date) {
this.scrollToMessageId(result.meta.target_message_id, {
highlight: true,
position: "center",
});
} else {
this._ignoreNextScroll = true;
this.scrollToBottom();
}

this.debounceFillPaneAttempt();
this.debouncedUpdateLastReadMessage();
},
});
);

if (siteSettings.chatbot_quick_access_bot_post_kicks_off) {
api.registerValueTransformer(
Expand Down
8 changes: 8 additions & 0 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ plugins:
- gpt-5
- gpt-5-mini
- gpt-5-nano
- gpt-5.1
- o4-mini
- o3
- o3-mini
Expand Down Expand Up @@ -85,6 +86,7 @@ plugins:
- gpt-5
- gpt-5-mini
- gpt-5-nano
- gpt-5.1
- o4-mini
- o3
- o3-mini
Expand Down Expand Up @@ -120,6 +122,7 @@ plugins:
- gpt-5
- gpt-5-mini
- gpt-5-nano
- gpt-5.1
- o4-mini
- o3
- o3-mini
Expand All @@ -139,6 +142,7 @@ plugins:
type: enum
default: medium
choices:
- none
- minimal
- low
- medium
Expand Down Expand Up @@ -282,6 +286,10 @@ plugins:
type: enum
default: gpt-4o
choices:
- gpt-5.1
- gpt-5-mini
- gpt-5-nano
- gpt-5
- gpt-4.1
- gpt-4.1-mini
- gpt-4.1-nano
Expand Down
4 changes: 2 additions & 2 deletions plugin.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true
# name: discourse-chatbot
# about: a plugin that allows you to have a conversation with a configurable chatbot in Chat, Topics and Private Messages
# version: 1.5.19
# version: 1.5.20
# authors: merefield
# url: https://github.com/merefield/discourse-chatbot

Expand Down Expand Up @@ -41,7 +41,7 @@ module ::DiscourseChatbot
POST_URL_REGEX = %r{\/t/[^/]+/(\d+)/(\d+)(?!\d|\/)}
NON_POST_URL_REGEX = %r{\bhttps?:\/\/[^\s\/$.?#].[^\s)]*}

REASONING_MODELS = ["o1", "o1-mini", "o3", "o3-mini", "o4-mini", "gpt-5", "gpt-5-mini", "gpt-5-nano"]
REASONING_MODELS = ["o1", "o1-mini", "o3", "o3-mini", "o4-mini", "gpt-5", "gpt-5-mini", "gpt-5-nano", "gpt-5.1"]

def progress_debug_message(message)
puts "Chatbot: #{message}" if SiteSetting.chatbot_enable_verbose_console_logging
Expand Down
Loading