active_harness 0.3.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84073ba470d30f01513a68c7a4d9d3a354ae5b55f8571aa28727cc67d2338745
4
- data.tar.gz: 682d2b973e49d9e308fc28932f7d5c5b0402725518b3dfa6ed59c205c7729813
3
+ metadata.gz: eaf485a5e22b0e8896fde6333964ccfb2f9739a6f366707587d4c3a9a1cbcec7
4
+ data.tar.gz: 9fe117e4d320affd189bd8ef8f601d0481c858f8087d509529bd79d04d710a1d
5
5
  SHA512:
6
- metadata.gz: 72a9260869cc75489fbea6fdf825033b212690b9c383c115cc44e7772c17bf4186ff025a77de4acdade5eb750897d0b49d0c01f2f9c4cc9061522e4f88b03eb3
7
- data.tar.gz: 9c0d6d1d61d4b449719132ed3757510389b4277000392123039420c7f968e5de7aeb0db44437642361bd48cbebf712c584fa2c9dabdf5598f00152796cd25fba
6
+ metadata.gz: e115a0659d759419465014e3a5dbdbecabb6e26b9fb6aa0f4909debd117ea0f1aca33f302170dc4d4a9ea4d3769edbc3ba64b230bf824ad2cc787ef1e384336c
7
+ data.tar.gz: f04b58a682ae1af32e56a7afb96517a376136e9990366529406706f1c6af66ae6f446185da5d775df50ad93f95ef54b95deb86d0d98981169e20acd165570094
@@ -62,7 +62,7 @@ module ActiveHarness
62
62
  opts[:temperature] = entry[:temperature] if entry[:temperature]
63
63
  opts[:stream] = @token if @token
64
64
  opts[:name] = entry[:name] if entry[:name]
65
- opts[:questions] = entry[:questions] if entry[:questions]
65
+ opts[:questions] = resolve_questions(entry[:questions]) if entry[:questions]
66
66
  provider.call(**opts)
67
67
  end
68
68
 
@@ -111,6 +111,15 @@ module ActiveHarness
111
111
  factory.call
112
112
  end
113
113
 
114
+ # `questions:` (currently used only by provider: :vercel) accepts either a
115
+ # static Hash or a Proc, resolved the same way system_prompt is: called via
116
+ # instance_exec with no arguments, so it can read @input/@context/@params.
117
+ #
118
+ # use provider: :vercel, model: "typesafe-ai/jev", questions: -> { @params[:questions] }
119
+ def resolve_questions(value)
120
+ value.is_a?(Proc) ? instance_exec(&value) : value
121
+ end
122
+
114
123
  def build_messages(system_prompt, input)
115
124
  # Memory is NOT auto-injected here.
116
125
  # To use history in LLM context, inject it manually via a hook or prompt class.
@@ -35,7 +35,7 @@ require_relative "active_harness/pipeline"
35
35
  require_relative "active_harness/railtie" if defined?(Rails::Railtie)
36
36
 
37
37
  module ActiveHarness
38
- VERSION = "0.3.2"
38
+ VERSION = "0.3.4"
39
39
 
40
40
  class << self
41
41
  # Configure ActiveHarness.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_harness
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - the-teacher