Move model options to helper

This commit is contained in:
Jorge Manrubia
2025-07-23 11:57:22 +02:00
parent c0b385b19b
commit dcb0e5077d
3 changed files with 17 additions and 11 deletions
@@ -1,17 +1,7 @@
class Admin::PromptSandboxesController < AdminController
include DayTimelinesScoped
MODELS = %w[
chatgpt-4o-latest
gpt-4.1
gpt-3.5-turbo
gpt-4.1-mini
gpt-4.1-nano
gpt-4o-mini
]
def show
@llm_models = MODELS.map { |model| [ model, model ] }
@llm_model = params[:llm_model] || Event::Summarizer::LLM_MODEL
if @prompt = cookies[:prompt].presence
+16
View File
@@ -0,0 +1,16 @@
require "zlib"
module AiHelper
LLM_MODELS = %w[
chatgpt-4o-latest
gpt-4.1
gpt-3.5-turbo
gpt-4.1-mini
gpt-4.1-nano
gpt-4o-mini
]
def llm_model_options
LLM_MODELS.map { |model| [ model, model ] }
end
end
@@ -15,7 +15,7 @@
<div class="field">
<%= form.label :llm_model, "LLM Model:" %>
<%= form.select :llm_model,
options_for_select(@llm_models, @llm_model),
options_for_select(llm_model_options, @llm_model),
{} %>
</div>