diff --git a/Gemfile b/Gemfile index 6f6bd7751..b4752c745 100644 --- a/Gemfile +++ b/Gemfile @@ -33,6 +33,8 @@ gem 'liquid' gem 'commonmarker' # Validate Data against JSON Schema gem 'json_schemer' +# used in swagger build +gem 'json_refs' # Rack middleware for blocking & throttling abusive requests gem 'rack-attack', '>= 6.7.0' # a utility tool for streaming, flexible and safe downloading of remote files @@ -196,9 +198,6 @@ group :development do gem 'scss_lint', require: false gem 'web-console', '>= 4.2.1' - # used in swagger build - gem 'json_refs' - # When we want to squash migrations gem 'squasher' diff --git a/app/builders/messages/instagram/base_message_builder.rb b/app/builders/messages/instagram/base_message_builder.rb index 767115bc6..8b40ba3c9 100644 --- a/app/builders/messages/instagram/base_message_builder.rb +++ b/app/builders/messages/instagram/base_message_builder.rb @@ -152,11 +152,13 @@ class Messages::Instagram::BaseMessageBuilder < Messages::Messenger::MessageBuil end def message_already_exists? - cw_message = conversation.messages.where( - source_id: @messaging[:message][:mid] - ).first + find_message_by_source_id(@messaging[:message][:mid]).present? + end - cw_message.present? + def find_message_by_source_id(source_id) + return unless source_id + + @message = Message.find_by(source_id: source_id) end def all_unsupported_files? diff --git a/app/controllers/api/v1/accounts/articles_controller.rb b/app/controllers/api/v1/accounts/articles_controller.rb index 9148e4386..da2be2312 100644 --- a/app/controllers/api/v1/accounts/articles_controller.rb +++ b/app/controllers/api/v1/accounts/articles_controller.rb @@ -68,7 +68,7 @@ class Api::V1::Accounts::ArticlesController < Api::V1::Accounts::BaseController def article_params params.require(:article).permit( - :title, :slug, :position, :content, :description, :position, :category_id, :author_id, :associated_article_id, :status, + :title, :slug, :position, :content, :description, :category_id, :author_id, :associated_article_id, :status, :locale, meta: [:title, :description, { tags: [] }] diff --git a/app/controllers/platform/api/v1/users_controller.rb b/app/controllers/platform/api/v1/users_controller.rb index 453e475b0..7b9284cd9 100644 --- a/app/controllers/platform/api/v1/users_controller.rb +++ b/app/controllers/platform/api/v1/users_controller.rb @@ -1,9 +1,9 @@ class Platform::Api::V1::UsersController < PlatformController # ref: https://stackoverflow.com/a/45190318/939299 # set resource is called for other actions already in platform controller - # we want to add login to that chain as well - before_action(only: [:login]) { set_resource } - before_action(only: [:login]) { validate_platform_app_permissible } + # we want to add login and token to that chain as well + before_action(only: [:login, :token]) { set_resource } + before_action(only: [:login, :token]) { validate_platform_app_permissible } def show; end @@ -18,6 +18,8 @@ class Platform::Api::V1::UsersController < PlatformController render json: { url: @resource.generate_sso_link } end + def token; end + def update @resource.assign_attributes(user_update_params) diff --git a/app/javascript/dashboard/components-next/captain/pageComponents/assistant/EditAssistantForm.vue b/app/javascript/dashboard/components-next/captain/pageComponents/assistant/EditAssistantForm.vue index 362950802..3134d7062 100644 --- a/app/javascript/dashboard/components-next/captain/pageComponents/assistant/EditAssistantForm.vue +++ b/app/javascript/dashboard/components-next/captain/pageComponents/assistant/EditAssistantForm.vue @@ -42,6 +42,7 @@ const initialState = { conversationFaqs: false, memories: false, }, + temperature: 1, }; const state = reactive({ ...initialState }); @@ -87,6 +88,7 @@ const updateStateFromAssistant = assistant => { conversationFaqs: config.feature_faq || false, memories: config.feature_memory || false, }; + state.temperature = config.temperature || 1; }; const handleBasicInfoUpdate = async () => { @@ -136,6 +138,7 @@ const handleInstructionsUpdate = async () => { const payload = { config: { ...props.assistant.config, + temperature: state.temperature || 1, instructions: state.instructions, }, }; @@ -212,7 +215,7 @@ watch( -
+
+
+ +
+ + {{ state.temperature }} +
+

+ {{ t('CAPTAIN.ASSISTANTS.FORM.TEMPERATURE.DESCRIPTION') }} +

+