algolia 3.45.0 → 3.46.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.
Files changed (164) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/release.yml +2 -2
  3. data/AGENTS.md +0 -24
  4. data/CHANGELOG.md +30 -0
  5. data/Gemfile.lock +1 -1
  6. data/lib/algolia/api/abtesting_v3_client.rb +196 -7
  7. data/lib/algolia/api/agent_studio_client.rb +244 -6
  8. data/lib/algolia/api/recommend_client.rb +2 -2
  9. data/lib/algolia/api/search_client.rb +17 -3
  10. data/lib/algolia/configuration.rb +8 -0
  11. data/lib/algolia/defaults.rb +8 -0
  12. data/lib/algolia/models/abtesting-v3/ab_test.rb +25 -1
  13. data/lib/algolia/models/abtesting-v3/ab_test_configuration.rb +22 -4
  14. data/lib/algolia/models/abtesting-v3/ab_test_settings_response.rb +224 -0
  15. data/lib/algolia/models/abtesting-v3/add_ab_tests_request.rb +11 -1
  16. data/lib/algolia/models/abtesting-v3/analysis_method.rb +34 -0
  17. data/lib/algolia/models/abtesting-v3/bayesian_metric_result.rb +237 -0
  18. data/lib/algolia/models/abtesting-v3/evidence_status.rb +37 -0
  19. data/lib/algolia/models/abtesting-v3/feature_settings.rb +224 -0
  20. data/lib/algolia/models/abtesting-v3/metric_evidence.rb +209 -0
  21. data/lib/algolia/models/abtesting-v3/metric_metadata.rb +1 -1
  22. data/lib/algolia/models/abtesting-v3/metric_name.rb +7 -1
  23. data/lib/algolia/models/abtesting-v3/metric_result.rb +18 -8
  24. data/lib/algolia/models/abtesting-v3/minimum_detectable_effect.rb +1 -1
  25. data/lib/algolia/models/abtesting-v3/primary_metric.rb +37 -0
  26. data/lib/algolia/models/abtesting-v3/save_settings_request.rb +208 -0
  27. data/lib/algolia/models/abtesting-v3/variant_settings.rb +293 -0
  28. data/lib/algolia/models/agent-studio/agent_completion_algolia_params.rb +16 -4
  29. data/lib/algolia/models/agent-studio/agent_completion_request.rb +1 -3
  30. data/lib/algolia/models/agent-studio/agent_completion_request_union.rb +108 -0
  31. data/lib/algolia/models/agent-studio/agent_test_configuration.rb +1 -1
  32. data/lib/algolia/models/agent-studio/agent_with_version_response.rb +1 -1
  33. data/lib/algolia/models/agent-studio/agui_completion_request.rb +265 -0
  34. data/lib/algolia/models/agent-studio/agui_resume.rb +231 -0
  35. data/lib/algolia/models/agent-studio/algolia_grouped_results_compat_tool_config.rb +268 -0
  36. data/lib/algolia/models/agent-studio/{algolia_display_results_tool_config.rb → algolia_grouped_results_tool_config.rb} +30 -16
  37. data/lib/algolia/models/agent-studio/{algolia_recommend_tool_config_input.rb → algolia_recommend_tool_config.rb} +3 -3
  38. data/lib/algolia/models/agent-studio/algolia_search_tool_config.rb +22 -4
  39. data/lib/algolia/models/agent-studio/assistant_message_agui.rb +280 -0
  40. data/lib/algolia/models/agent-studio/assistant_message_v4.rb +1 -0
  41. data/lib/algolia/models/agent-studio/assistant_message_v5.rb +3 -1
  42. data/lib/algolia/models/agent-studio/assistant_part_v5.rb +2 -0
  43. data/lib/algolia/models/agent-studio/azure_open_ai_provider_input.rb +1 -1
  44. data/lib/algolia/models/agent-studio/boolean_param.rb +220 -0
  45. data/lib/algolia/models/agent-studio/client_side_tool_config.rb +14 -4
  46. data/lib/algolia/models/agent-studio/compaction_stats.rb +271 -0
  47. data/lib/algolia/models/agent-studio/compatibility_mode.rb +2 -1
  48. data/lib/algolia/models/agent-studio/context_compact_request.rb +263 -0
  49. data/lib/algolia/models/agent-studio/context_response.rb +231 -0
  50. data/lib/algolia/models/agent-studio/context_stats.rb +258 -0
  51. data/lib/algolia/models/agent-studio/context_trim_request.rb +239 -0
  52. data/lib/algolia/models/agent-studio/conversation_base_response.rb +16 -5
  53. data/lib/algolia/models/agent-studio/conversation_full_response.rb +26 -5
  54. data/lib/algolia/models/agent-studio/data_guardrail_violation_part_v5.rb +218 -0
  55. data/lib/algolia/models/agent-studio/data_part_v5.rb +220 -0
  56. data/lib/algolia/models/agent-studio/facet_filters_union_search_parameters_overrides.rb +108 -0
  57. data/lib/algolia/models/agent-studio/feedback_update_request.rb +253 -0
  58. data/lib/algolia/models/agent-studio/forwarded_props.rb +226 -0
  59. data/lib/algolia/models/agent-studio/function_call_agui.rb +219 -0
  60. data/lib/algolia/models/agent-studio/guardrail_outcome.rb +231 -0
  61. data/lib/algolia/models/agent-studio/guardrail_violation_data_v5.rb +230 -0
  62. data/lib/algolia/models/agent-studio/impact_analytics.rb +242 -0
  63. data/lib/algolia/models/agent-studio/index_search_parameters.rb +11 -1
  64. data/lib/algolia/models/agent-studio/input_union.rb +113 -0
  65. data/lib/algolia/models/agent-studio/items_union.rb +132 -0
  66. data/lib/algolia/models/agent-studio/items_union_agui_completion_request.rb +123 -0
  67. data/lib/algolia/models/agent-studio/managed_provider_response_input.rb +209 -0
  68. data/lib/algolia/models/agent-studio/mcp_server_tool_config.rb +1 -1
  69. data/lib/algolia/models/agent-studio/memory_record.rb +4 -4
  70. data/lib/algolia/models/agent-studio/message_event.rb +231 -0
  71. data/lib/algolia/models/agent-studio/message_part_assistant_message_agui.rb +123 -0
  72. data/lib/algolia/models/agent-studio/message_response.rb +87 -5
  73. data/lib/algolia/models/agent-studio/mode_enum.rb +34 -0
  74. data/lib/algolia/models/agent-studio/one_of_enum.rb +34 -0
  75. data/lib/algolia/models/agent-studio/open_ai_compatible_provider_input.rb +1 -1
  76. data/lib/algolia/models/agent-studio/paginated_conversations_response.rb +13 -4
  77. data/lib/algolia/models/agent-studio/provider_authentication_response.rb +14 -5
  78. data/lib/algolia/models/agent-studio/provider_input.rb +2 -1
  79. data/lib/algolia/models/agent-studio/provider_input_nullable.rb +2 -1
  80. data/lib/algolia/models/agent-studio/provider_name.rb +2 -1
  81. data/lib/algolia/models/agent-studio/reasoning_message_agui.rb +239 -0
  82. data/lib/algolia/models/agent-studio/reasoning_part_agui.rb +228 -0
  83. data/lib/algolia/models/agent-studio/search_parameters.rb +1 -1
  84. data/lib/algolia/models/agent-studio/search_parameters_overrides.rb +80 -5
  85. data/lib/algolia/models/agent-studio/status_enum.rb +34 -0
  86. data/lib/algolia/models/agent-studio/task_kind.rb +33 -0
  87. data/lib/algolia/models/agent-studio/task_request.rb +240 -0
  88. data/lib/algolia/models/agent-studio/task_response.rb +211 -0
  89. data/lib/algolia/models/agent-studio/text_part_agui.rb +219 -0
  90. data/lib/algolia/models/agent-studio/tool_approval_agui.rb +228 -0
  91. data/lib/algolia/models/agent-studio/tool_approval_request_part.rb +15 -5
  92. data/lib/algolia/models/agent-studio/tool_call_agui.rb +237 -0
  93. data/lib/algolia/models/agent-studio/tool_call_part.rb +13 -1
  94. data/lib/algolia/models/agent-studio/tool_call_part_agui.rb +272 -0
  95. data/lib/algolia/models/agent-studio/tool_call_result_part_agui.rb +250 -0
  96. data/lib/algolia/models/agent-studio/tool_config_input.rb +2 -5
  97. data/lib/algolia/models/agent-studio/{tool_config.rb → tool_config_or_boolean_union.rb} +1 -1
  98. data/lib/algolia/models/agent-studio/tool_config_output.rb +126 -0
  99. data/lib/algolia/models/agent-studio/tool_invocation_v4.rb +10 -2
  100. data/lib/algolia/models/agent-studio/tool_message_agui.rb +259 -0
  101. data/lib/algolia/models/agent-studio/tool_part_v5.rb +47 -2
  102. data/lib/algolia/models/agent-studio/tool_result_part.rb +57 -5
  103. data/lib/algolia/models/agent-studio/unknown_tool_config.rb +1 -1
  104. data/lib/algolia/models/agent-studio/user_message_agui.rb +261 -0
  105. data/lib/algolia/models/agent-studio/user_message_metadata_agui.rb +208 -0
  106. data/lib/algolia/models/agent-studio/user_message_metadata_v5.rb +4 -2
  107. data/lib/algolia/models/agent-studio/user_message_v4.rb +4 -1
  108. data/lib/algolia/models/agent-studio/user_message_v5.rb +4 -1
  109. data/lib/algolia/models/agent-studio/validation_error.rb +5 -25
  110. data/lib/algolia/models/agent-studio/xai_provider_input.rb +220 -0
  111. data/lib/algolia/models/analytics/catalog_entry.rb +1 -1
  112. data/lib/algolia/models/composition/base_injection_query_parameters.rb +18 -18
  113. data/lib/algolia/models/composition/distinct.rb +1 -1
  114. data/lib/algolia/models/composition/external_provider.rb +209 -0
  115. data/lib/algolia/models/composition/external_provider_ordering.rb +34 -0
  116. data/lib/algolia/models/composition/hit_metadata.rb +2 -2
  117. data/lib/algolia/models/composition/injected_item_external.rb +21 -14
  118. data/lib/algolia/models/composition/injected_item_external_provider.rb +258 -0
  119. data/lib/algolia/models/composition/injected_item_external_provider_source.rb +216 -0
  120. data/lib/algolia/models/composition/injected_item_hits_metadata.rb +1 -1
  121. data/lib/algolia/models/composition/{recommend.rb → injected_item_recommend.rb} +10 -3
  122. data/lib/algolia/models/composition/injected_item_recommend_source.rb +1 -1
  123. data/lib/algolia/models/composition/injected_item_search.rb +8 -1
  124. data/lib/algolia/models/composition/injected_item_source.rb +1 -0
  125. data/lib/algolia/models/composition/injection_main_external_provider.rb +258 -0
  126. data/lib/algolia/models/composition/injection_main_external_provider_source.rb +216 -0
  127. data/lib/algolia/models/composition/{main_recommend.rb → injection_main_recommend.rb} +10 -3
  128. data/lib/algolia/models/composition/injection_main_recommend_source.rb +1 -1
  129. data/lib/algolia/models/composition/{main_search.rb → injection_main_search.rb} +11 -4
  130. data/lib/algolia/models/composition/injection_main_search_source.rb +1 -1
  131. data/lib/algolia/models/composition/injection_main_source.rb +1 -0
  132. data/lib/algolia/models/composition/main_injection_query_parameters.rb +22 -22
  133. data/lib/algolia/models/composition/optional_words.rb +1 -1
  134. data/lib/algolia/models/composition/params.rb +6 -6
  135. data/lib/algolia/models/composition/processing_error.rb +209 -0
  136. data/lib/algolia/models/composition/request_body.rb +13 -4
  137. data/lib/algolia/models/composition/result_card.rb +208 -0
  138. data/lib/algolia/models/composition/search_response.rb +16 -4
  139. data/lib/algolia/models/composition/widgets.rb +13 -4
  140. data/lib/algolia/models/ingestion/source_update_commercetools.rb +11 -0
  141. data/lib/algolia/models/recommend/distinct.rb +1 -1
  142. data/lib/algolia/models/recommend/fallback_params.rb +26 -26
  143. data/lib/algolia/models/recommend/optional_words.rb +1 -1
  144. data/lib/algolia/models/recommend/recommend_search_params.rb +26 -26
  145. data/lib/algolia/models/recommend/result_card.rb +208 -0
  146. data/lib/algolia/models/recommend/widgets.rb +13 -4
  147. data/lib/algolia/models/search/api_key.rb +2 -2
  148. data/lib/algolia/models/search/attribute_criteria_computed_by.rb +35 -0
  149. data/lib/algolia/models/search/browse_params_object.rb +35 -25
  150. data/lib/algolia/models/search/consequence_params.rb +35 -25
  151. data/lib/algolia/models/search/distinct.rb +1 -1
  152. data/lib/algolia/models/search/get_api_key_response.rb +2 -2
  153. data/lib/algolia/models/search/index_settings.rb +28 -18
  154. data/lib/algolia/models/search/optional_words.rb +1 -1
  155. data/lib/algolia/models/search/result_card.rb +208 -0
  156. data/lib/algolia/models/search/search_for_facets.rb +35 -25
  157. data/lib/algolia/models/search/search_for_hits.rb +35 -25
  158. data/lib/algolia/models/search/search_params_object.rb +35 -25
  159. data/lib/algolia/models/search/secured_api_key_restrictions.rb +1 -1
  160. data/lib/algolia/models/search/settings_response.rb +28 -18
  161. data/lib/algolia/models/search/widgets.rb +13 -4
  162. data/lib/algolia/transport/transport.rb +82 -10
  163. data/lib/algolia/version.rb +1 -1
  164. metadata +72 -8
@@ -0,0 +1,280 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
4
+
5
+ require "date"
6
+ require "time"
7
+
8
+ module Algolia
9
+ module AgentStudio
10
+ # An official AG-UI assistant message or a TanStack ``UIMessage`` extension. Standard AG-UI represents text through ``content`` and tool calls through ``toolCalls``. TanStack sends those fields alongside its authoritative ``parts`` array. A populated ``parts`` array takes precedence during conversion, preventing the redundant fields from duplicating history. Unknown vendor fields are intentionally ignored, matching the other AG-UI message variants; TanStack, for example, attaches its own ``metadata`` object.
11
+ class AssistantMessageAGUI
12
+ attr_accessor :id
13
+
14
+ attr_accessor :role
15
+
16
+ attr_accessor :content
17
+
18
+ attr_accessor :name
19
+
20
+ attr_accessor :tool_calls
21
+
22
+ attr_accessor :encrypted_content
23
+
24
+ attr_accessor :parts
25
+
26
+ attr_accessor :created_at
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :id => :id,
32
+ :role => :role,
33
+ :content => :content,
34
+ :name => :name,
35
+ :tool_calls => :toolCalls,
36
+ :encrypted_content => :encryptedContent,
37
+ :parts => :parts,
38
+ :created_at => :createdAt
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.types_mapping
44
+ {
45
+ :id => :"String",
46
+ :role => :"String",
47
+ :content => :"String",
48
+ :name => :"String",
49
+ :tool_calls => :"Array<ToolCallAGUI>",
50
+ :encrypted_content => :"String",
51
+ :parts => :"Array<MessagePartAssistantMessageAGUI>",
52
+ :created_at => :"String"
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new(
59
+ [
60
+ :tool_calls
61
+ ]
62
+ )
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ raise(
70
+ ArgumentError,
71
+ "The input argument (attributes) must be a hash in `Algolia::AssistantMessageAGUI` initialize method"
72
+ )
73
+ end
74
+
75
+ # check to see if the attribute exists and convert string to symbol for hash key
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!self.class.attribute_map.key?(k.to_sym))
78
+ raise(
79
+ ArgumentError,
80
+ "`#{k}` is not a valid attribute in `Algolia::AssistantMessageAGUI`. Please check the name to make sure it's valid. List of attributes: " +
81
+ self.class.attribute_map.keys.inspect
82
+ )
83
+ end
84
+
85
+ h[k.to_sym] = v
86
+ }
87
+
88
+ if attributes.key?(:id)
89
+ self.id = attributes[:id]
90
+ else
91
+ self.id = nil
92
+ end
93
+
94
+ if attributes.key?(:role)
95
+ self.role = attributes[:role]
96
+ else
97
+ self.role = nil
98
+ end
99
+
100
+ if attributes.key?(:content)
101
+ self.content = attributes[:content]
102
+ end
103
+
104
+ if attributes.key?(:name)
105
+ self.name = attributes[:name]
106
+ end
107
+
108
+ if attributes.key?(:tool_calls)
109
+ if (value = attributes[:tool_calls]).is_a?(Array)
110
+ self.tool_calls = value
111
+ end
112
+ end
113
+
114
+ if attributes.key?(:encrypted_content)
115
+ self.encrypted_content = attributes[:encrypted_content]
116
+ end
117
+
118
+ if attributes.key?(:parts)
119
+ if (value = attributes[:parts]).is_a?(Array)
120
+ self.parts = value
121
+ end
122
+ end
123
+
124
+ if attributes.key?(:created_at)
125
+ self.created_at = attributes[:created_at]
126
+ end
127
+ end
128
+
129
+ # Checks equality by comparing each attribute.
130
+ # @param [Object] Object to be compared
131
+ def ==(other)
132
+ return true if self.equal?(other)
133
+ self.class == other.class &&
134
+ id == other.id &&
135
+ role == other.role &&
136
+ content == other.content &&
137
+ name == other.name &&
138
+ tool_calls == other.tool_calls &&
139
+ encrypted_content == other.encrypted_content &&
140
+ parts == other.parts &&
141
+ created_at == other.created_at
142
+ end
143
+
144
+ # @see the `==` method
145
+ # @param [Object] Object to be compared
146
+ def eql?(other)
147
+ self == other
148
+ end
149
+
150
+ # Calculates hash code according to all attributes.
151
+ # @return [Integer] Hash code
152
+ def hash
153
+ [id, role, content, name, tool_calls, encrypted_content, parts, created_at].hash
154
+ end
155
+
156
+ # Builds the object from hash
157
+ # @param [Hash] attributes Model attributes in the form of hash
158
+ # @return [Object] Returns the model itself
159
+ def self.build_from_hash(attributes)
160
+ return nil unless attributes.is_a?(Hash)
161
+ attributes = attributes.transform_keys(&:to_sym)
162
+ transformed_hash = {}
163
+ types_mapping.each_pair do |key, type|
164
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
165
+ transformed_hash[key.to_sym] = nil
166
+ elsif type =~ /\AArray<(.*)>/i
167
+ # check to ensure the input is an array given that the attribute
168
+ # is documented as an array but the input is not
169
+ if attributes[attribute_map[key]].is_a?(Array)
170
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
171
+ _deserialize(::Regexp.last_match(1), v)
172
+ }
173
+ end
174
+ elsif !attributes[attribute_map[key]].nil?
175
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
176
+ end
177
+ end
178
+
179
+ new(transformed_hash)
180
+ end
181
+
182
+ # Deserializes the data based on type
183
+ # @param string type Data type
184
+ # @param string value Value to be deserialized
185
+ # @return [Object] Deserialized data
186
+ def self._deserialize(type, value)
187
+ case type.to_sym
188
+ when :Time
189
+ Time.parse(value)
190
+ when :Date
191
+ Date.parse(value)
192
+ when :String
193
+ value.to_s
194
+ when :Integer
195
+ value.to_i
196
+ when :Float
197
+ value.to_f
198
+ when :Boolean
199
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
200
+ true
201
+ else
202
+ false
203
+ end
204
+
205
+ when :Object
206
+ # generic object (usually a Hash), return directly
207
+ value
208
+ when /\AArray<(?<inner_type>.+)>\z/
209
+ inner_type = Regexp.last_match[:inner_type]
210
+ value.map { |v| _deserialize(inner_type, v) }
211
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
212
+ k_type = Regexp.last_match[:k_type]
213
+ v_type = Regexp.last_match[:v_type]
214
+ {}.tap do |hash|
215
+ value.each do |k, v|
216
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
217
+ end
218
+ end
219
+ # model
220
+ else
221
+ # models (e.g. Pet) or oneOf
222
+ klass = Algolia::AgentStudio.const_get(type)
223
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
224
+ .build_from_hash(value)
225
+ end
226
+ end
227
+
228
+ # Returns the string representation of the object
229
+ # @return [String] String presentation of the object
230
+ def to_s
231
+ to_hash.to_s
232
+ end
233
+
234
+ # to_body is an alias to to_hash (backward compatibility)
235
+ # @return [Hash] Returns the object in the form of hash
236
+ def to_body
237
+ to_hash
238
+ end
239
+
240
+ def to_json(*_args)
241
+ to_hash.to_json
242
+ end
243
+
244
+ # Returns the object in the form of hash
245
+ # @return [Hash] Returns the object in the form of hash
246
+ def to_hash
247
+ hash = {}
248
+ self.class.attribute_map.each_pair do |attr, param|
249
+ value = send(attr)
250
+ if value.nil?
251
+ is_nullable = self.class.openapi_nullable.include?(attr)
252
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
253
+ end
254
+
255
+ hash[param] = _to_hash(value)
256
+ end
257
+
258
+ hash
259
+ end
260
+
261
+ # Outputs non-array value in the form of hash
262
+ # For object, use to_hash. Otherwise, just return the value
263
+ # @param [Object] value Any valid value
264
+ # @return [Hash] Returns the value in the form of hash
265
+ def _to_hash(value)
266
+ if value.is_a?(Array)
267
+ value.map { |v| _to_hash(v) }
268
+ elsif value.is_a?(Hash)
269
+ {}.tap do |hash|
270
+ value.each { |k, v| hash[k] = _to_hash(v) }
271
+ end
272
+ elsif value.respond_to?(:to_hash)
273
+ value.to_hash
274
+ else
275
+ value
276
+ end
277
+ end
278
+ end
279
+ end
280
+ end
@@ -44,6 +44,7 @@ module Algolia
44
44
  def self.openapi_nullable
45
45
  Set.new(
46
46
  [
47
+ :id,
47
48
  :tool_invocations
48
49
  ]
49
50
  )
@@ -35,7 +35,9 @@ module Algolia
35
35
  # List of attributes with nullable: true
36
36
  def self.openapi_nullable
37
37
  Set.new(
38
- []
38
+ [
39
+ :id
40
+ ]
39
41
  )
40
42
  end
41
43
 
@@ -12,6 +12,8 @@ module Algolia
12
12
  # List of class defined in oneOf (OpenAPI v3)
13
13
  def openapi_one_of
14
14
  [
15
+ :"DataGuardrailViolationPartV5",
16
+ :"DataPartV5",
15
17
  :"ReasoningPartV5",
16
18
  :"StepStartPartV5",
17
19
  :"TextPartV5",
@@ -13,7 +13,7 @@ module Algolia
13
13
 
14
14
  attr_accessor :azure_endpoint
15
15
 
16
- # Azure model deployment name is required.
16
+ # Azure model deployment name.
17
17
  attr_accessor :azure_deployment
18
18
 
19
19
  attr_accessor :api_version
@@ -0,0 +1,220 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
4
+
5
+ require "date"
6
+ require "time"
7
+
8
+ module Algolia
9
+ module AgentStudio
10
+ # A boolean search parameter with exposure control.
11
+ class BooleanParam
12
+ attr_accessor :exposed
13
+
14
+ attr_accessor :default
15
+
16
+ # Attribute mapping from ruby-style variable name to JSON key.
17
+ def self.attribute_map
18
+ {
19
+ :exposed => :exposed,
20
+ :default => :default
21
+ }
22
+ end
23
+
24
+ # Attribute type mapping.
25
+ def self.types_mapping
26
+ {
27
+ :exposed => :"Boolean",
28
+ :default => :"Boolean"
29
+ }
30
+ end
31
+
32
+ # List of attributes with nullable: true
33
+ def self.openapi_nullable
34
+ Set.new(
35
+ [
36
+ :default
37
+ ]
38
+ )
39
+ end
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ def initialize(attributes = {})
44
+ if (!attributes.is_a?(Hash))
45
+ raise(
46
+ ArgumentError,
47
+ "The input argument (attributes) must be a hash in `Algolia::BooleanParam` initialize method"
48
+ )
49
+ end
50
+
51
+ # check to see if the attribute exists and convert string to symbol for hash key
52
+ attributes = attributes.each_with_object({}) { |(k, v), h|
53
+ if (!self.class.attribute_map.key?(k.to_sym))
54
+ raise(
55
+ ArgumentError,
56
+ "`#{k}` is not a valid attribute in `Algolia::BooleanParam`. Please check the name to make sure it's valid. List of attributes: " +
57
+ self.class.attribute_map.keys.inspect
58
+ )
59
+ end
60
+
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:exposed)
65
+ self.exposed = attributes[:exposed]
66
+ else
67
+ self.exposed = nil
68
+ end
69
+
70
+ if attributes.key?(:default)
71
+ self.default = attributes[:default]
72
+ end
73
+ end
74
+
75
+ # Checks equality by comparing each attribute.
76
+ # @param [Object] Object to be compared
77
+ def ==(other)
78
+ return true if self.equal?(other)
79
+ self.class == other.class &&
80
+ exposed == other.exposed &&
81
+ default == other.default
82
+ end
83
+
84
+ # @see the `==` method
85
+ # @param [Object] Object to be compared
86
+ def eql?(other)
87
+ self == other
88
+ end
89
+
90
+ # Calculates hash code according to all attributes.
91
+ # @return [Integer] Hash code
92
+ def hash
93
+ [exposed, default].hash
94
+ end
95
+
96
+ # Builds the object from hash
97
+ # @param [Hash] attributes Model attributes in the form of hash
98
+ # @return [Object] Returns the model itself
99
+ def self.build_from_hash(attributes)
100
+ return nil unless attributes.is_a?(Hash)
101
+ attributes = attributes.transform_keys(&:to_sym)
102
+ transformed_hash = {}
103
+ types_mapping.each_pair do |key, type|
104
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
105
+ transformed_hash[key.to_sym] = nil
106
+ elsif type =~ /\AArray<(.*)>/i
107
+ # check to ensure the input is an array given that the attribute
108
+ # is documented as an array but the input is not
109
+ if attributes[attribute_map[key]].is_a?(Array)
110
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
111
+ _deserialize(::Regexp.last_match(1), v)
112
+ }
113
+ end
114
+ elsif !attributes[attribute_map[key]].nil?
115
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
116
+ end
117
+ end
118
+
119
+ new(transformed_hash)
120
+ end
121
+
122
+ # Deserializes the data based on type
123
+ # @param string type Data type
124
+ # @param string value Value to be deserialized
125
+ # @return [Object] Deserialized data
126
+ def self._deserialize(type, value)
127
+ case type.to_sym
128
+ when :Time
129
+ Time.parse(value)
130
+ when :Date
131
+ Date.parse(value)
132
+ when :String
133
+ value.to_s
134
+ when :Integer
135
+ value.to_i
136
+ when :Float
137
+ value.to_f
138
+ when :Boolean
139
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
140
+ true
141
+ else
142
+ false
143
+ end
144
+
145
+ when :Object
146
+ # generic object (usually a Hash), return directly
147
+ value
148
+ when /\AArray<(?<inner_type>.+)>\z/
149
+ inner_type = Regexp.last_match[:inner_type]
150
+ value.map { |v| _deserialize(inner_type, v) }
151
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
152
+ k_type = Regexp.last_match[:k_type]
153
+ v_type = Regexp.last_match[:v_type]
154
+ {}.tap do |hash|
155
+ value.each do |k, v|
156
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
157
+ end
158
+ end
159
+ # model
160
+ else
161
+ # models (e.g. Pet) or oneOf
162
+ klass = Algolia::AgentStudio.const_get(type)
163
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
164
+ .build_from_hash(value)
165
+ end
166
+ end
167
+
168
+ # Returns the string representation of the object
169
+ # @return [String] String presentation of the object
170
+ def to_s
171
+ to_hash.to_s
172
+ end
173
+
174
+ # to_body is an alias to to_hash (backward compatibility)
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_body
177
+ to_hash
178
+ end
179
+
180
+ def to_json(*_args)
181
+ to_hash.to_json
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = send(attr)
190
+ if value.nil?
191
+ is_nullable = self.class.openapi_nullable.include?(attr)
192
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
+ end
194
+
195
+ hash[param] = _to_hash(value)
196
+ end
197
+
198
+ hash
199
+ end
200
+
201
+ # Outputs non-array value in the form of hash
202
+ # For object, use to_hash. Otherwise, just return the value
203
+ # @param [Object] value Any valid value
204
+ # @return [Hash] Returns the value in the form of hash
205
+ def _to_hash(value)
206
+ if value.is_a?(Array)
207
+ value.map { |v| _to_hash(v) }
208
+ elsif value.is_a?(Hash)
209
+ {}.tap do |hash|
210
+ value.each { |k, v| hash[k] = _to_hash(v) }
211
+ end
212
+ elsif value.respond_to?(:to_hash)
213
+ value.to_hash
214
+ else
215
+ value
216
+ end
217
+ end
218
+ end
219
+ end
220
+ end
@@ -16,13 +16,17 @@ module Algolia
16
16
 
17
17
  attr_accessor :input_schema
18
18
 
19
+ # Server-side declaration that this tool is display/render-only: a resolved result ends the turn and the model is not re-invoked on it (CR-11753). The client's terminal claim on a tool result is honored only when this agrees; leave false for data tools whose result the model must reason about.
20
+ attr_accessor :is_terminal
21
+
19
22
  # Attribute mapping from ruby-style variable name to JSON key.
20
23
  def self.attribute_map
21
24
  {
22
25
  :name => :name,
23
26
  :type => :type,
24
27
  :description => :description,
25
- :input_schema => :inputSchema
28
+ :input_schema => :inputSchema,
29
+ :is_terminal => :isTerminal
26
30
  }
27
31
  end
28
32
 
@@ -32,7 +36,8 @@ module Algolia
32
36
  :name => :"String",
33
37
  :type => :"String",
34
38
  :description => :"String",
35
- :input_schema => :"ClientToolsArgsSchema"
39
+ :input_schema => :"ClientToolsArgsSchema",
40
+ :is_terminal => :"Boolean"
36
41
  }
37
42
  end
38
43
 
@@ -89,6 +94,10 @@ module Algolia
89
94
  else
90
95
  self.input_schema = nil
91
96
  end
97
+
98
+ if attributes.key?(:is_terminal)
99
+ self.is_terminal = attributes[:is_terminal]
100
+ end
92
101
  end
93
102
 
94
103
  # Checks equality by comparing each attribute.
@@ -99,7 +108,8 @@ module Algolia
99
108
  name == other.name &&
100
109
  type == other.type &&
101
110
  description == other.description &&
102
- input_schema == other.input_schema
111
+ input_schema == other.input_schema &&
112
+ is_terminal == other.is_terminal
103
113
  end
104
114
 
105
115
  # @see the `==` method
@@ -111,7 +121,7 @@ module Algolia
111
121
  # Calculates hash code according to all attributes.
112
122
  # @return [Integer] Hash code
113
123
  def hash
114
- [name, type, description, input_schema].hash
124
+ [name, type, description, input_schema, is_terminal].hash
115
125
  end
116
126
 
117
127
  # Builds the object from hash