Move model options to helper
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user