ox-ai-workers 1.0.0.1 → 1.0.1.1

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: 5bfd6987a99ebbceea76d221f6f2f1050cd17f782213286a2fab23d6bd6e178a
4
- data.tar.gz: 65cbf912d37bb96b8c9887137aa84a33c96b9cc5215c711e727054f96a7813da
3
+ metadata.gz: ba17fbce4bcdcc90ca498bd391a129f3348ce02ab349ada1f1f5bc5599a6bf53
4
+ data.tar.gz: 38c3b111273b1eb7e607f0e0ca31f836a50298b43ad2c6eb4ca0b25711244127
5
5
  SHA512:
6
- metadata.gz: 0f896f86019744c1024bb3336356284861c9c59840628337ef7c5e91d7dbb5829b2e83bdcfd34d620ee32e7aab682c864d618caefb0783e1fd43a712ee95ea6f
7
- data.tar.gz: 505544fffa56299e2f5d7c00ffdd799277808af903052e5831b87d52f99c797ad777f6fe13bcaba4434eb5abc24ae5553c90dcb8199d19aa4e42cff3c21a3b1d
6
+ metadata.gz: f1de785b9917868c32544ff2620b932ae0827cd32080785be1f0bfd7f4136c8bc1eef2ac7a0af03c9a4af95cd8bdbc6a93bbcb6f00add080a8470beebbf37fb6
7
+ data.tar.gz: 2216bf33ad62ee0a731abca6d956b35a9c1c84927c900b39c2eb359120a67ba39cf6ca0630991cab6adf9a03ff39e68371115b68bf800e229ce7af019b45090c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [1.0.1] - 2025-05-13
2
+
3
+ - Property `required` parameter is now `true` by default in `define_function`
4
+
1
5
  ## [1.0.0] - 2025-05-12
2
6
 
3
7
  - Final version for 1.0.0 release
data/README.md CHANGED
@@ -387,7 +387,8 @@ class MyTool
387
387
 
388
388
  def initialize
389
389
  define_function :hello_world, description: "Says hello to someone" do
390
- property :name, type: "string", description: "Name to greet", required: true
390
+ property :name, type: "string", description: "Name to greet" # Default required: true
391
+ property :age, type: ["integer", "null"], description: "Age of the person" # Default required: true
391
392
  end
392
393
  end
393
394
 
@@ -17,7 +17,7 @@ module OxAiWorkers
17
17
  required: true
18
18
  property :result, type: 'string', description: I18n.t('oxaiworkers.tool.pipeline.send_message.result'),
19
19
  required: true
20
- property :example, type: 'string', description: I18n.t('oxaiworkers.tool.pipeline.send_message.example'),
20
+ property :example, type: %w[string null], description: I18n.t('oxaiworkers.tool.pipeline.send_message.example'),
21
21
  required: true
22
22
  property :to_id, type: 'string', description: I18n.t('oxaiworkers.tool.pipeline.send_message.to_id'),
23
23
  required: true
@@ -27,7 +27,7 @@ module OxAiWorkers
27
27
  @on_message = on_message
28
28
  end
29
29
 
30
- def send_message(message:, result:, example:, to_id:)
30
+ def send_message(message:, result:, to_id:, example: nil)
31
31
  puts "send_message to #{to_id}: #{message}".colorize(:red)
32
32
  puts " Result: #{result}"
33
33
  puts " Example: #{example}"
@@ -36,7 +36,9 @@ module OxAiWorkers
36
36
  @assistants[to_id].add_task message
37
37
  with_locale do
38
38
  @assistants[to_id].add_task "#{I18n.t('oxaiworkers.tool.pipeline.send_message.result')}: #{result}"
39
- @assistants[to_id].add_task "#{I18n.t('oxaiworkers.tool.pipeline.send_message.example')}: #{example}"
39
+ unless example.nil?
40
+ @assistants[to_id].add_task "#{I18n.t('oxaiworkers.tool.pipeline.send_message.example')}: #{example}"
41
+ end
40
42
  end
41
43
  @assistants[to_id].execute
42
44
  nil
@@ -19,7 +19,7 @@ module OxAiWorkers
19
19
  property :prompt, type: 'string', description: I18n.t('oxaiworkers.tool.pixels.generate_image.prompt'),
20
20
  required: true
21
21
  if worker.sizes.length > 1
22
- property :size, type: 'string', description: I18n.t('oxaiworkers.tool.pixels.generate_image.size'),
22
+ property :size, type: %w[string null], description: I18n.t('oxaiworkers.tool.pixels.generate_image.size'),
23
23
  enum: worker.sizes
24
24
  end
25
25
  if current_dir.present?
@@ -28,7 +28,7 @@ module OxAiWorkers
28
28
  required: true
29
29
  end
30
30
  if worker.qualities.length > 1
31
- property :quality, type: 'string', description: I18n.t('oxaiworkers.tool.pixels.generate_image.quality'),
31
+ property :quality, type: %w[string null], description: I18n.t('oxaiworkers.tool.pixels.generate_image.quality'),
32
32
  enum: worker.qualities
33
33
  end
34
34
  end
@@ -19,7 +19,7 @@ module OxAiWorkers
19
19
  property :prompt, type: 'string', description: I18n.t('oxaiworkers.tool.wolfram_alpha.ask.prompt'),
20
20
  required: true
21
21
  if location.nil?
22
- property :location, type: 'string', description: I18n.t('oxaiworkers.tool.wolfram_alpha.ask.location'),
22
+ property :location, type: %w[string null], description: I18n.t('oxaiworkers.tool.wolfram_alpha.ask.location'),
23
23
  required: true
24
24
  end
25
25
  end
@@ -194,7 +194,7 @@ module OxAiWorkers
194
194
  # @param required [Boolean] Whether the property is required
195
195
  # @yield [Block] Block for nested properties (only for object and array types)
196
196
  # @raise [ArgumentError] If any parameter is invalid
197
- def property(name = nil, type:, description: nil, enum: nil, required: false, &)
197
+ def property(name = nil, type:, description: nil, enum: nil, required: true, &)
198
198
  validate_parameters(name:, type:, enum:, required:)
199
199
 
200
200
  prop = { type:, description:, enum: }.compact
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OxAiWorkers
4
- VERSION = '1.0.0.1'
4
+ VERSION = '1.0.1.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ox-ai-workers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.1
4
+ version: 1.0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Smolev