activeagent 0.4.2 → 0.4.3

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: 47bdf9e37e7297013da9b708a3dde24829cff913ef1ec74abc273768af85f4b9
4
- data.tar.gz: ad71eb99a02c3d527b9c43b9728be6f861a4f7b230eb3258709135d6268b88ce
3
+ metadata.gz: bf7ac1240fa119582c4b5891b96fb38c99bb519b925c5f79e22e8a8193aba6ba
4
+ data.tar.gz: 843c5e2e9e7344cca72f695b21569024ab50b83716a3929959e0fa124441261d
5
5
  SHA512:
6
- metadata.gz: b796e122648f92d27f8bb7b8ae2f7933cddc47bf7d4af682086375b6b775b54d50e8d05d94e5e70bb5dbd28b15cd17a24639d2ecde1d69dd2ef57a6bf1f29c23
7
- data.tar.gz: 58e8fddc983ca61e142e7710ff6c7315bff8215ecc007dee903ab499602ba323958fe84ec756f7932290cab2dcac214664e760d37588aada9368aacbe7492720
6
+ metadata.gz: 4a721e85af2201e488adde2cfb686702dcffd494b1c748e8dc1444b5b540d7e58d9dc16cf9f6aea0603d77132a9da72d1c002e5809dd0ad87fcaefd84515bd6a
7
+ data.tar.gz: f47df425e66e53237cfe26498160b2c030f3baaccd15615616f857be9013b0795a9c9d2bcb3427068deef90d517df2dd26481aea8f270ede07b388f6482856f5
@@ -239,9 +239,7 @@ module ActiveAgent
239
239
  def initialize
240
240
  super
241
241
  @_prompt_was_called = false
242
- @_context = ActiveAgent::ActionPrompt::Prompt.new(
243
- instructions: prepare_instructions(options[:instructions]), options: options
244
- )
242
+ @_context = ActiveAgent::ActionPrompt::Prompt.new(options: options)
245
243
  end
246
244
 
247
245
  def process(method_name, *args) # :nodoc:
@@ -296,7 +294,8 @@ module ActiveAgent
296
294
  def prompt(headers = {}, &block)
297
295
  return context if @_prompt_was_called && headers.blank? && !block
298
296
 
299
- context.instructions = prepare_instructions(headers[:instructions]) if headers.has_key?(:instructions)
297
+ raw_instructions = headers.has_key?(:instructions) ? headers[:instructions] : context.options[:instructions]
298
+ context.instructions = prepare_instructions(raw_instructions)
300
299
  context.options.merge!(options)
301
300
  content_type = headers[:content_type]
302
301
  headers = apply_defaults(headers)
@@ -338,7 +337,11 @@ module ActiveAgent
338
337
  end
339
338
 
340
339
  def action_schemas
340
+ prefixes = lookup_context.prefixes | [ self.class.agent_name ]
341
+
341
342
  action_methods.map do |action|
343
+ next unless lookup_context.template_exists?(action, prefixes, false, formats: [ :json ])
344
+
342
345
  JSON.parse render_to_string(locals: { action_name: action }, action: action, formats: :json)
343
346
  end.compact
344
347
  end
@@ -34,6 +34,8 @@ module ActiveAgent
34
34
  end
35
35
 
36
36
  def instructions=(instructions)
37
+ return if instructions.blank?
38
+
37
39
  @instructions = instructions
38
40
  if @messages[0].present? && @messages[0].role == :system
39
41
  @messages[0] = instructions_message
@@ -1,3 +1,3 @@
1
1
  module ActiveAgent
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeagent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Bowen
@@ -227,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
227
  - !ruby/object:Gem::Version
228
228
  version: '0'
229
229
  requirements: []
230
- rubygems_version: 3.6.9
230
+ rubygems_version: 3.7.0
231
231
  specification_version: 4
232
232
  summary: Rails AI Agents Framework
233
233
  test_files: []