Skip to content

FIX: Make sure strings are correctly escaped before seeding a persona for triage scripts #34082

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
FIX: Make sure strings are correctly escaped before seeding a persona…
… for triage scripts
  • Loading branch information
romanrizzi committed Aug 4, 2025
commit d0b6220e05c75bc8f428a4719a97765dbb46e796
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,21 @@ def up
model = field["model"] || "NULL"
model = model.split(":").last if model.start_with?("custom:")

row =
"'#{name}', 'Seeded Persona for an LLM Triage script', FALSE, '#{field["system_prompt"]}', #{temp}, #{model}, NOW(), NOW()"
desc = "Seeded Persona for an LLM Triage script"
prompt = field["system_prompt"]

DB.query_single(<<~SQL)&.first
DB.query_single(
<<~SQL,
INSERT INTO ai_personas (name, description, enabled, system_prompt, temperature, default_llm_id, created_at, updated_at)
VALUES (#{row})
VALUES (:name, :desc, FALSE, :prompt, :temp, :model, NOW(), NOW())
RETURNING id
SQL
name: name,
desc: desc,
prompt: prompt,
temp: temp,
model: model,
)&.first
end
end

Expand Down
Loading