Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: basic mode was calling gpt 4 turbo even if vision was off #90

Merged
merged 4 commits into from
Apr 29, 2024
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
2 changes: 1 addition & 1 deletion config/locales/server.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ en:
chatbot_open_ai_model_custom_api_type: "Fill in 'azure' if you use Azure OpenAI, otherwise will use Open AI"
chatbot_open_ai_model: "(UNLESS CUSTOM) The model to be accessed. More on supported models at <a target='_blank' rel='noopener' href='https://platform.openai.com/docs/models/overview'>OpenAI: Model overview</a>"
chatbot_support_vision: "(EXPERIMENTAL) Bot 'Vision': support sharing of images with bot so you can ask it to describe them. Images must be uploaded to forum and not hotlinked and in RAG mode bot can only see images in current Post it's responding to. Requires compatible model to be selected. 'false' switches vision off, 'directly' will share images potentially on every call, 'via_function' will only share images when requested by a function which might turn out to be cheaper if main model is older generation"
chatbot_open_ai_vision_model: "(EXPERIMENTAL) Open AI Vision model used when 'via_function' option is selected"
chatbot_open_ai_vision_model: "(EXPERIMENTAL) Open AI Vision model used when 'via_function' or 'directly' options are selected. Used for all interaction if 'directly' is set, overriding all other model settings - caution: this will be expensive!"
chatbot_reply_job_time_delay: 'Number of seconds before reply job is run. This helps prevent rate limits being hit and discourages spamming.'
chatbot_include_whispers_in_post_history: "Include content of whispers in Post history bot sees (careful!)"
chatbot_max_look_behind: "Maximum number of Posts or Chat Messages bot will consider as prompt for completion, the more the more impressive may be its response, but the more costly the interaction will be."
Expand Down
2 changes: 1 addition & 1 deletion lib/discourse_chatbot/bots/open_ai_bot_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def initialize(opts)
end

@model_name =
opts[:chatbot_bot_type] != "RAG" && SiteSetting.chatbot_support_vision ? SiteSetting.chatbot_open_ai_vision_model :
SiteSetting.chatbot_support_vision == "directly" ? SiteSetting.chatbot_open_ai_vision_model :
case opts[:trust_level]
when TRUST_LEVELS[0], TRUST_LEVELS[1], TRUST_LEVELS[2]
SiteSetting.send("chatbot_open_ai_model_custom_" + opts[:trust_level] + "_trust") ?
Expand Down
2 changes: 1 addition & 1 deletion 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 Discourse Chat, Topics and Private Messages
# version: 0.9.17
# version: 0.9.18
# authors: merefield
# url: https://github.com/merefield/discourse-chatbot

Expand Down
Loading