From 091dc626e82cd3269b7eefa0dbb6b09dbbbaa494 Mon Sep 17 00:00:00 2001 From: Roman Rizzi Date: Fri, 21 Jun 2024 16:35:31 -0300 Subject: [PATCH] FIX: Make sure LlmEnumerator always return value hashes using symbols (#684) --- lib/configuration/llm_enumerator.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/configuration/llm_enumerator.rb b/lib/configuration/llm_enumerator.rb index f804db9a..8b308510 100644 --- a/lib/configuration/llm_enumerator.rb +++ b/lib/configuration/llm_enumerator.rb @@ -10,12 +10,12 @@ module DiscourseAi end def self.values - values = DB.query_hash(<<~SQL) + values = DB.query_hash(<<~SQL).map(&:symbolize_keys) SELECT display_name AS name, id AS value FROM llm_models SQL - values.each { |value_h| value_h["value"] = "custom:#{value_h["value"]}" } + values.each { |value_h| value_h[:value] = "custom:#{value_h[:value]}" } values end