diff --git a/.rubocop.yml b/.rubocop.yml index 6fad3fd6..c60afbe8 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -9,7 +9,7 @@ require: - rubocop-performance AllCops: - TargetRubyVersion: 3.0 + TargetRubyVersion: 3.3 # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop # to ignore them, so only the ones explicitly set in this file are enabled. DisabledByDefault: true diff --git a/app/models/message.rb b/app/models/message.rb index 36148bed..a89a01e1 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -50,7 +50,7 @@ def not_finished? private def create_conversation - self.conversation = Conversation.create!(user: Current.user, assistant: assistant) + self.conversation = Conversation.create!(user: Current.user, assistant:) end def validate_conversation @@ -62,12 +62,12 @@ def validate_assistant end def start_assistant_reply - m = conversation.messages.create!( - assistant: assistant, + conversation.messages.create!( + assistant:, role: :assistant, content_text: nil, - version: version, - index: index+1 + version:, + index: index + 1 ) end @@ -77,7 +77,7 @@ def set_last_assistant_message def update_assistant_on_conversation return if conversation.assistant == assistant - conversation.update!(assistant: assistant) + conversation.update!(assistant:) end def update_input_token_cost diff --git a/app/models/user/registerable.rb b/app/models/user/registerable.rb index 0ddfcb32..3b12714f 100644 --- a/app/models/user/registerable.rb +++ b/app/models/user/registerable.rb @@ -54,13 +54,13 @@ def create_initial_assistants_etc output_token_cost_cents = output_token_cost_per_million/million language_models.create!( - api_name: api_name, - api_service: api_service, - name: name, + api_name:, + api_service:, + name:, supports_tools: true, - supports_images: supports_images, - input_token_cost_cents: input_token_cost_cents, - output_token_cost_cents: output_token_cost_cents, + supports_images:, + input_token_cost_cents:, + output_token_cost_cents:, ) end @@ -73,7 +73,7 @@ def create_initial_assistants_etc input_token_cost_cents = input_token_cost_per_million/million output_token_cost_cents = output_token_cost_per_million/million - language_models.create!(api_name: api_name, api_service: api_service, name: name, supports_tools: false, supports_images: supports_images, input_token_cost_cents: input_token_cost_cents, output_token_cost_cents: output_token_cost_cents) + language_models.create!(api_name:, api_service:, name:, supports_tools: false, supports_images:, input_token_cost_cents:, output_token_cost_cents:) end assistants.create! name: "GPT-4o", language_model: language_models.find_by(api_name: LanguageModel::BEST_GPT)