From a48c15cd17f974b1ecf31ee7eb17068b28df1bdf Mon Sep 17 00:00:00 2001 From: merefield Date: Sun, 29 Nov 2026 12:26:16 +0000 Subject: [PATCH] Refresh current model choices across supported providers --- config/settings.yml | 20 ++++++++-- lib/discourse_chatbot/llm_client.rb | 2 +- plugin.rb | 5 ++- spec/lib/llm_client_spec.rb | 34 +++++++++++++++-- spec/lib/site_setting_dependencies_spec.rb | 43 ++++++++++++++++++++-- 5 files changed, 91 insertions(+), 13 deletions(-) diff --git a/config/settings.yml b/config/settings.yml index 52351db..6c779e0 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -150,6 +150,9 @@ plugins: type: enum default: gpt-4.1-mini choices: &chatbot_open_ai_models + - gpt-6.2-astra + - gpt-6.2-sol + - gpt-6.1-terra - gpt-6-astra - gpt-6.1-sol - gpt-6-sol @@ -173,7 +176,6 @@ plugins: - gpt-5-nano - gpt-4.1 - gpt-4.1-mini - - gpt-4.1-nano depends_on: - chatbot_llm_provider depends_on_values: @@ -185,12 +187,14 @@ plugins: type: enum default: claude-sonnet-5 choices: &chatbot_anthropic_models + - claude-fable-5-2 - claude-fable-5-1 - claude-fable-5 - claude-opus-5-5 - claude-opus-5 - claude-sonnet-5-5 - claude-sonnet-5 + - claude-haiku-5-5 - claude-haiku-4-5 depends_on: - chatbot_llm_provider @@ -203,6 +207,10 @@ plugins: type: enum default: gemini-3.8-flash choices: &chatbot_google_gemini_models + - gemini-4-carbon + - gemini-4-neon + - gemini-4-hydrogen + - gemini-4-argon - gemini-3.8-flash - gemini-3.7-flash - gemini-3.6-flash @@ -225,10 +233,10 @@ plugins: type: enum default: grok-4.6 choices: &chatbot_x_ai_models + - grok-4.7 - grok-4.6 - grok-4.5 - grok-4.3 - - grok-build-0.1 - grok-4.20-reasoning - grok-4.20-non-reasoning depends_on: @@ -936,6 +944,9 @@ plugins: type: enum default: gpt-4.1 choices: + - gpt-6.2-astra + - gpt-6.2-sol + - gpt-6.1-terra - gpt-6-astra - gpt-6.1-sol - gpt-6-sol @@ -959,7 +970,6 @@ plugins: - gpt-5-nano - gpt-4.1 - gpt-4.1-mini - - gpt-4.1-nano depends_on: - chatbot_vision_provider depends_on_values: @@ -1023,6 +1033,8 @@ plugins: type: enum default: gpt-image-2 choices: + - gpt-image-2.6-sunburst + - gpt-image-2.6-flare - gpt-image-2.5-sunburst - gpt-image-2.5-flare - gpt-image-2 @@ -1039,6 +1051,7 @@ plugins: type: enum default: gemini-3.1-flash-image choices: + - gemini-nano-banana-2.1 - gemini-3.1-flash-image - gemini-3.1-flash-lite-image - gemini-3-pro-image @@ -1054,7 +1067,6 @@ plugins: default: grok-imagine-image-2.0 choices: - grok-imagine-image-2.0 - - grok-imagine-image-quality depends_on: - chatbot_image_provider depends_on_values: diff --git a/lib/discourse_chatbot/llm_client.rb b/lib/discourse_chatbot/llm_client.rb index 2afe94e..7d5d837 100644 --- a/lib/discourse_chatbot/llm_client.rb +++ b/lib/discourse_chatbot/llm_client.rb @@ -147,7 +147,7 @@ def chat_completions_generation_parameters end def explicit_prompt_caching? - @official_openai_endpoint && @model_name.match?(/\Agpt-(?:5\.6|6|6\.1)(?:-|\z)/) + @official_openai_endpoint && @model_name.match?(/\Agpt-(?:5\.6|6|6\.1|6\.2)(?:-|\z)/) end def chat_completions_messages(messages) diff --git a/plugin.rb b/plugin.rb index 3520cc2..b2f7588 100644 --- a/plugin.rb +++ b/plugin.rb @@ -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: 3.2.0 +# version: 3.2.1 # authors: merefield # url: https://github.com/merefield/discourse-chatbot @@ -43,6 +43,9 @@ module ::DiscourseChatbot NON_POST_URL_REGEX = %r{\bhttps?:\/\/[^\s\/$.?#].[^\s)]*} REASONING_MODELS = %w[ + gpt-6.2-astra + gpt-6.2-sol + gpt-6.1-terra gpt-6-astra gpt-6.1-sol gpt-6-sol diff --git a/spec/lib/llm_client_spec.rb b/spec/lib/llm_client_spec.rb index 3886ef8..3bc900b 100644 --- a/spec/lib/llm_client_spec.rb +++ b/spec/lib/llm_client_spec.rb @@ -30,7 +30,15 @@ end it "uses the reasoning-model request path for GPT-6 models" do - %w[gpt-6-astra gpt-6.1-sol gpt-6-sol gpt-6-luna].each do |model| + %w[ + gpt-6.2-astra + gpt-6.2-sol + gpt-6.1-terra + gpt-6-astra + gpt-6.1-sol + gpt-6-sol + gpt-6-luna + ].each do |model| SiteSetting.chatbot_open_ai_model_low_trust = model expect(described_class.new(trust_level: "low")).to be_reasoning_model @@ -38,7 +46,17 @@ end it "supports allowed_tools only for official OpenAI Responses configurations" do - %w[gpt-5.4-mini gpt-5.6 gpt-6-astra gpt-6.1-sol gpt-6-sol gpt-6-luna].each do |model| + %w[ + gpt-5.4-mini + gpt-5.6 + gpt-6.2-astra + gpt-6.2-sol + gpt-6.1-terra + gpt-6-astra + gpt-6.1-sol + gpt-6-sol + gpt-6-luna + ].each do |model| SiteSetting.chatbot_open_ai_model_low_trust = model expect(described_class.new(trust_level: "low")).to be_supports_allowed_tools end @@ -65,7 +83,17 @@ messages = [ { role: "developer", content: "Stable instructions", prompt_cache_breakpoint: true }, ] - %w[gpt-5.6 gpt-5.6-sol gpt-6-astra gpt-6.1-sol gpt-6-sol gpt-6-luna].each do |model| + %w[ + gpt-5.6 + gpt-5.6-sol + gpt-6.2-astra + gpt-6.2-sol + gpt-6.1-terra + gpt-6-astra + gpt-6.1-sol + gpt-6-sol + gpt-6-luna + ].each do |model| SiteSetting.chatbot_open_ai_model_low_trust = model parameters = described_class.new(trust_level: "low").responses_parameters(messages) diff --git a/spec/lib/site_setting_dependencies_spec.rb b/spec/lib/site_setting_dependencies_spec.rb index f375156..973ed64 100644 --- a/spec/lib/site_setting_dependencies_spec.rb +++ b/spec/lib/site_setting_dependencies_spec.rb @@ -198,6 +198,9 @@ expect(model_choices.call(:chatbot_open_ai_model_high_trust)).to eq( %w[ + gpt-6.2-astra + gpt-6.2-sol + gpt-6.1-terra gpt-6-astra gpt-6.1-sol gpt-6-sol @@ -221,28 +224,41 @@ gpt-5-nano gpt-4.1 gpt-4.1-mini - gpt-4.1-nano ], ) expect(model_choices.call(:chatbot_open_ai_embeddings_model)).to eq( %w[text-embedding-ada-002 text-embedding-3-small text-embedding-3-large], ) expect(model_choices.call(:chatbot_support_picture_creation_model)).to eq( - %w[gpt-image-2.5-sunburst gpt-image-2.5-flare gpt-image-2 gpt-image-1.5 gpt-image-1-mini], + %w[ + gpt-image-2.6-sunburst + gpt-image-2.6-flare + gpt-image-2.5-sunburst + gpt-image-2.5-flare + gpt-image-2 + gpt-image-1.5 + gpt-image-1-mini + ], ) expect(model_choices.call(:chatbot_anthropic_model_high_trust)).to eq( %w[ + claude-fable-5-2 claude-fable-5-1 claude-fable-5 claude-opus-5-5 claude-opus-5 claude-sonnet-5-5 claude-sonnet-5 + claude-haiku-5-5 claude-haiku-4-5 ], ) expect(model_choices.call(:chatbot_google_gemini_model_high_trust)).to eq( %w[ + gemini-4-carbon + gemini-4-neon + gemini-4-hydrogen + gemini-4-argon gemini-3.8-flash gemini-3.7-flash gemini-3.6-flash @@ -260,13 +276,32 @@ %w[gemini-embedding-2 gemini-embedding-001], ) expect(model_choices.call(:chatbot_google_gemini_image_model)).to eq( - %w[gemini-3.1-flash-image gemini-3.1-flash-lite-image gemini-3-pro-image], + %w[ + gemini-nano-banana-2.1 + gemini-3.1-flash-image + gemini-3.1-flash-lite-image + gemini-3-pro-image + ], ) expect(model_choices.call(:chatbot_x_ai_model_high_trust)).to eq( - %w[grok-4.6 grok-4.5 grok-4.3 grok-build-0.1 grok-4.20-reasoning grok-4.20-non-reasoning], + %w[grok-4.7 grok-4.6 grok-4.5 grok-4.3 grok-4.20-reasoning grok-4.20-non-reasoning], ) end + it "offers the same provider models across trust levels and vision" do + %w[open_ai anthropic google_gemini x_ai].each do |provider| + choices = settings.fetch("chatbot_#{provider}_model_high_trust".to_sym)[:valid_values] + %w[medium low].each do |trust_level| + expect( + settings.fetch("chatbot_#{provider}_model_#{trust_level}_trust".to_sym)[:valid_values], + ).to eq(choices) + end + expect(settings.fetch("chatbot_#{provider}_vision_model".to_sym)[:valid_values]).to eq( + choices, + ) + end + end + it "uses current provider model defaults" do defaults = %i[