omniai 3.0.0 → 3.0.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: 498fab4d1dc0776ca9b28f970145e9184dd503b7d3032fc45617c0459a442dee
4
- data.tar.gz: b0ba0873060444dc59ceb5fe946eaa7b087eb0709a0bd47b80f22bfcc1d5a30c
3
+ metadata.gz: d531aa6fb65bf379e80e1ee381a9e0bcdc593ff50368023284516b1d63c12d2e
4
+ data.tar.gz: cfb766bb5a41be87fa2a24766f1a14ce03fb48bda3aeb5bf747f6f6d23cecc55
5
5
  SHA512:
6
- metadata.gz: 820e63cbc2a5e4f2cc5d6729ae2d3a0fff1950a16bd22d80eab5fec420975ab79992a6cba1fb332dc0643f4ace515ed389d45be225774b7ae59f5ca911b77b12
7
- data.tar.gz: 965a88b9114ee0b215d25a98bcdf4354ac60931154fe2d87859cf423b8d953fc679bdcdb3cb51d82a0118fab926553dffb19eb140cb43ff973e946b76f294549
6
+ metadata.gz: 4128c986161424706af7cdd57ef1d2a23541761cebd94e798e15fcd5959d8e55b79c7c7bac3aa7a69efe6c65ebb24b47154f37077a28cc233f22e0ec7c7af1f9
7
+ data.tar.gz: e4d043eb1ca554d3da937b0a72b45ef659125f7d7e52adc855ffa4ee446f2735a3981f00e361fc75c55573bfc72e46c98403d459acc7b732579fe06f2bdaa658
@@ -71,12 +71,14 @@ module OmniAI
71
71
  # @example
72
72
  # array.serialize # => { type: "array", items: { type: "string" } }
73
73
  #
74
+ # @param options [Hash] optional
75
+ #
74
76
  # @return [Hash]
75
- def serialize
77
+ def serialize(additional_properties: false)
76
78
  {
77
79
  type: TYPE,
78
80
  description: @description,
79
- items: @items.serialize,
81
+ items: @items.serialize(additional_properties:),
80
82
  maxItems: @max_items,
81
83
  minItems: @min_items,
82
84
  }.compact
@@ -51,11 +51,13 @@ module OmniAI
51
51
  # @example
52
52
  # format.serialize # => { name: "...", schema: { ... } }
53
53
  #
54
+ # @param options [Hash] optional (e.g. `{ additional_properties: nil }``)
55
+ #
54
56
  # @return [Hash]
55
- def serialize
57
+ def serialize(additional_properties: false)
56
58
  {
57
59
  name:,
58
- schema: schema.serialize,
60
+ schema: schema.serialize(additional_properties:),
59
61
  }
60
62
  end
61
63
 
@@ -74,15 +74,17 @@ module OmniAI
74
74
  )
75
75
  end
76
76
 
77
+ # @param options [Hash] optional
78
+ #
77
79
  # @return [Hash]
78
- def serialize
80
+ def serialize(additional_properties: false)
79
81
  {
80
82
  type: TYPE,
81
83
  title: @title,
82
84
  description: @description,
83
- properties: @properties.transform_values(&:serialize),
85
+ properties: @properties.transform_values { |value| value.serialize(additional_properties:) },
84
86
  required: @required,
85
- additionalProperties: false,
87
+ additionalProperties: additional_properties,
86
88
  }.compact
87
89
  end
88
90
 
@@ -91,7 +91,7 @@ module OmniAI
91
91
  # property.serialize #=> { type: "string" }
92
92
  #
93
93
  # @return [Hash]
94
- def serialize
94
+ def serialize(*)
95
95
  {
96
96
  type: @type,
97
97
  description: @description,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OmniAI
4
- VERSION = "3.0.0"
4
+ VERSION = "3.0.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniai
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre