From a40b702142324100987ddbf66c87090bcd8d88a6 Mon Sep 17 00:00:00 2001 From: aleksei-okatiev <64004628+aleksei-okatiev@users.noreply.github.com> Date: Thu, 12 Dec 2024 14:45:23 +0100 Subject: [PATCH] fixed nested hashes with symbols keys couldnot compile --- CHANGELOG.md | 4 ++++ Gemfile.lock | 2 +- lib/llm_eval_ruby/prompt_adapters/base.rb | 2 +- lib/llm_eval_ruby/version.rb | 2 +- spec/llm_eval_ruby_spec.rb | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bc47cf..8abd79b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,3 +11,7 @@ ## [0.2.2] - 2024-12-03 - Introduced Tracer + +## [0.2.4] - 2024-12-12 + +- [Hotfix] prompts could not compile with variables having nested hashes with keys as symbols. diff --git a/Gemfile.lock b/Gemfile.lock index 47b4921..3e8d51c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - llm_eval_ruby (0.2.3) + llm_eval_ruby (0.2.4) httparty (~> 0.22.0) liquid (~> 5.5.0) diff --git a/lib/llm_eval_ruby/prompt_adapters/base.rb b/lib/llm_eval_ruby/prompt_adapters/base.rb index abf9452..c121cca 100644 --- a/lib/llm_eval_ruby/prompt_adapters/base.rb +++ b/lib/llm_eval_ruby/prompt_adapters/base.rb @@ -43,7 +43,7 @@ def wrap_response(response) def render_template(template, variables) template = Liquid::Template.parse(template) - template.render(variables.stringify_keys) + template.render(variables.deep_stringify_keys) end end end diff --git a/lib/llm_eval_ruby/version.rb b/lib/llm_eval_ruby/version.rb index 11db3be..612eb18 100644 --- a/lib/llm_eval_ruby/version.rb +++ b/lib/llm_eval_ruby/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module LlmEvalRuby - VERSION = "0.2.3" + VERSION = "0.2.4" end diff --git a/spec/llm_eval_ruby_spec.rb b/spec/llm_eval_ruby_spec.rb index 556d35d..75601f6 100644 --- a/spec/llm_eval_ruby_spec.rb +++ b/spec/llm_eval_ruby_spec.rb @@ -2,6 +2,6 @@ RSpec.describe LlmEvalRuby do it "has a version number" do - expect(LlmEvalRuby::VERSION).to be("0.2.3") + expect(LlmEvalRuby::VERSION).to be("0.2.4") end end