diff --git a/app/controllers/admin/prompt_sandboxes_controller.rb b/app/controllers/admin/prompt_sandboxes_controller.rb index 4a3de57a0..e4176265a 100644 --- a/app/controllers/admin/prompt_sandboxes_controller.rb +++ b/app/controllers/admin/prompt_sandboxes_controller.rb @@ -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 diff --git a/app/helpers/ai_helper.rb b/app/helpers/ai_helper.rb new file mode 100644 index 000000000..73b9d7b43 --- /dev/null +++ b/app/helpers/ai_helper.rb @@ -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 diff --git a/app/views/admin/prompt_sandboxes/show.html.erb b/app/views/admin/prompt_sandboxes/show.html.erb index 3924807c9..f5fc9a575 100644 --- a/app/views/admin/prompt_sandboxes/show.html.erb +++ b/app/views/admin/prompt_sandboxes/show.html.erb @@ -15,7 +15,7 @@
<%= 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), {} %>