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.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +2 -2
- data/AGENTS.md +0 -24
- data/CHANGELOG.md +30 -0
- data/Gemfile.lock +1 -1
- data/lib/algolia/api/abtesting_v3_client.rb +196 -7
- data/lib/algolia/api/agent_studio_client.rb +244 -6
- data/lib/algolia/api/recommend_client.rb +2 -2
- data/lib/algolia/api/search_client.rb +17 -3
- data/lib/algolia/configuration.rb +8 -0
- data/lib/algolia/defaults.rb +8 -0
- data/lib/algolia/models/abtesting-v3/ab_test.rb +25 -1
- data/lib/algolia/models/abtesting-v3/ab_test_configuration.rb +22 -4
- data/lib/algolia/models/abtesting-v3/ab_test_settings_response.rb +224 -0
- data/lib/algolia/models/abtesting-v3/add_ab_tests_request.rb +11 -1
- data/lib/algolia/models/abtesting-v3/analysis_method.rb +34 -0
- data/lib/algolia/models/abtesting-v3/bayesian_metric_result.rb +237 -0
- data/lib/algolia/models/abtesting-v3/evidence_status.rb +37 -0
- data/lib/algolia/models/abtesting-v3/feature_settings.rb +224 -0
- data/lib/algolia/models/abtesting-v3/metric_evidence.rb +209 -0
- data/lib/algolia/models/abtesting-v3/metric_metadata.rb +1 -1
- data/lib/algolia/models/abtesting-v3/metric_name.rb +7 -1
- data/lib/algolia/models/abtesting-v3/metric_result.rb +18 -8
- data/lib/algolia/models/abtesting-v3/minimum_detectable_effect.rb +1 -1
- data/lib/algolia/models/abtesting-v3/primary_metric.rb +37 -0
- data/lib/algolia/models/abtesting-v3/save_settings_request.rb +208 -0
- data/lib/algolia/models/abtesting-v3/variant_settings.rb +293 -0
- data/lib/algolia/models/agent-studio/agent_completion_algolia_params.rb +16 -4
- data/lib/algolia/models/agent-studio/agent_completion_request.rb +1 -3
- data/lib/algolia/models/agent-studio/agent_completion_request_union.rb +108 -0
- data/lib/algolia/models/agent-studio/agent_test_configuration.rb +1 -1
- data/lib/algolia/models/agent-studio/agent_with_version_response.rb +1 -1
- data/lib/algolia/models/agent-studio/agui_completion_request.rb +265 -0
- data/lib/algolia/models/agent-studio/agui_resume.rb +231 -0
- data/lib/algolia/models/agent-studio/algolia_grouped_results_compat_tool_config.rb +268 -0
- data/lib/algolia/models/agent-studio/{algolia_display_results_tool_config.rb → algolia_grouped_results_tool_config.rb} +30 -16
- data/lib/algolia/models/agent-studio/{algolia_recommend_tool_config_input.rb → algolia_recommend_tool_config.rb} +3 -3
- data/lib/algolia/models/agent-studio/algolia_search_tool_config.rb +22 -4
- data/lib/algolia/models/agent-studio/assistant_message_agui.rb +280 -0
- data/lib/algolia/models/agent-studio/assistant_message_v4.rb +1 -0
- data/lib/algolia/models/agent-studio/assistant_message_v5.rb +3 -1
- data/lib/algolia/models/agent-studio/assistant_part_v5.rb +2 -0
- data/lib/algolia/models/agent-studio/azure_open_ai_provider_input.rb +1 -1
- data/lib/algolia/models/agent-studio/boolean_param.rb +220 -0
- data/lib/algolia/models/agent-studio/client_side_tool_config.rb +14 -4
- data/lib/algolia/models/agent-studio/compaction_stats.rb +271 -0
- data/lib/algolia/models/agent-studio/compatibility_mode.rb +2 -1
- data/lib/algolia/models/agent-studio/context_compact_request.rb +263 -0
- data/lib/algolia/models/agent-studio/context_response.rb +231 -0
- data/lib/algolia/models/agent-studio/context_stats.rb +258 -0
- data/lib/algolia/models/agent-studio/context_trim_request.rb +239 -0
- data/lib/algolia/models/agent-studio/conversation_base_response.rb +16 -5
- data/lib/algolia/models/agent-studio/conversation_full_response.rb +26 -5
- data/lib/algolia/models/agent-studio/data_guardrail_violation_part_v5.rb +218 -0
- data/lib/algolia/models/agent-studio/data_part_v5.rb +220 -0
- data/lib/algolia/models/agent-studio/facet_filters_union_search_parameters_overrides.rb +108 -0
- data/lib/algolia/models/agent-studio/feedback_update_request.rb +253 -0
- data/lib/algolia/models/agent-studio/forwarded_props.rb +226 -0
- data/lib/algolia/models/agent-studio/function_call_agui.rb +219 -0
- data/lib/algolia/models/agent-studio/guardrail_outcome.rb +231 -0
- data/lib/algolia/models/agent-studio/guardrail_violation_data_v5.rb +230 -0
- data/lib/algolia/models/agent-studio/impact_analytics.rb +242 -0
- data/lib/algolia/models/agent-studio/index_search_parameters.rb +11 -1
- data/lib/algolia/models/agent-studio/input_union.rb +113 -0
- data/lib/algolia/models/agent-studio/items_union.rb +132 -0
- data/lib/algolia/models/agent-studio/items_union_agui_completion_request.rb +123 -0
- data/lib/algolia/models/agent-studio/managed_provider_response_input.rb +209 -0
- data/lib/algolia/models/agent-studio/mcp_server_tool_config.rb +1 -1
- data/lib/algolia/models/agent-studio/memory_record.rb +4 -4
- data/lib/algolia/models/agent-studio/message_event.rb +231 -0
- data/lib/algolia/models/agent-studio/message_part_assistant_message_agui.rb +123 -0
- data/lib/algolia/models/agent-studio/message_response.rb +87 -5
- data/lib/algolia/models/agent-studio/mode_enum.rb +34 -0
- data/lib/algolia/models/agent-studio/one_of_enum.rb +34 -0
- data/lib/algolia/models/agent-studio/open_ai_compatible_provider_input.rb +1 -1
- data/lib/algolia/models/agent-studio/paginated_conversations_response.rb +13 -4
- data/lib/algolia/models/agent-studio/provider_authentication_response.rb +14 -5
- data/lib/algolia/models/agent-studio/provider_input.rb +2 -1
- data/lib/algolia/models/agent-studio/provider_input_nullable.rb +2 -1
- data/lib/algolia/models/agent-studio/provider_name.rb +2 -1
- data/lib/algolia/models/agent-studio/reasoning_message_agui.rb +239 -0
- data/lib/algolia/models/agent-studio/reasoning_part_agui.rb +228 -0
- data/lib/algolia/models/agent-studio/search_parameters.rb +1 -1
- data/lib/algolia/models/agent-studio/search_parameters_overrides.rb +80 -5
- data/lib/algolia/models/agent-studio/status_enum.rb +34 -0
- data/lib/algolia/models/agent-studio/task_kind.rb +33 -0
- data/lib/algolia/models/agent-studio/task_request.rb +240 -0
- data/lib/algolia/models/agent-studio/task_response.rb +211 -0
- data/lib/algolia/models/agent-studio/text_part_agui.rb +219 -0
- data/lib/algolia/models/agent-studio/tool_approval_agui.rb +228 -0
- data/lib/algolia/models/agent-studio/tool_approval_request_part.rb +15 -5
- data/lib/algolia/models/agent-studio/tool_call_agui.rb +237 -0
- data/lib/algolia/models/agent-studio/tool_call_part.rb +13 -1
- data/lib/algolia/models/agent-studio/tool_call_part_agui.rb +272 -0
- data/lib/algolia/models/agent-studio/tool_call_result_part_agui.rb +250 -0
- data/lib/algolia/models/agent-studio/tool_config_input.rb +2 -5
- data/lib/algolia/models/agent-studio/{tool_config.rb → tool_config_or_boolean_union.rb} +1 -1
- data/lib/algolia/models/agent-studio/tool_config_output.rb +126 -0
- data/lib/algolia/models/agent-studio/tool_invocation_v4.rb +10 -2
- data/lib/algolia/models/agent-studio/tool_message_agui.rb +259 -0
- data/lib/algolia/models/agent-studio/tool_part_v5.rb +47 -2
- data/lib/algolia/models/agent-studio/tool_result_part.rb +57 -5
- data/lib/algolia/models/agent-studio/unknown_tool_config.rb +1 -1
- data/lib/algolia/models/agent-studio/user_message_agui.rb +261 -0
- data/lib/algolia/models/agent-studio/user_message_metadata_agui.rb +208 -0
- data/lib/algolia/models/agent-studio/user_message_metadata_v5.rb +4 -2
- data/lib/algolia/models/agent-studio/user_message_v4.rb +4 -1
- data/lib/algolia/models/agent-studio/user_message_v5.rb +4 -1
- data/lib/algolia/models/agent-studio/validation_error.rb +5 -25
- data/lib/algolia/models/agent-studio/xai_provider_input.rb +220 -0
- data/lib/algolia/models/analytics/catalog_entry.rb +1 -1
- data/lib/algolia/models/composition/base_injection_query_parameters.rb +18 -18
- data/lib/algolia/models/composition/distinct.rb +1 -1
- data/lib/algolia/models/composition/external_provider.rb +209 -0
- data/lib/algolia/models/composition/external_provider_ordering.rb +34 -0
- data/lib/algolia/models/composition/hit_metadata.rb +2 -2
- data/lib/algolia/models/composition/injected_item_external.rb +21 -14
- data/lib/algolia/models/composition/injected_item_external_provider.rb +258 -0
- data/lib/algolia/models/composition/injected_item_external_provider_source.rb +216 -0
- data/lib/algolia/models/composition/injected_item_hits_metadata.rb +1 -1
- data/lib/algolia/models/composition/{recommend.rb → injected_item_recommend.rb} +10 -3
- data/lib/algolia/models/composition/injected_item_recommend_source.rb +1 -1
- data/lib/algolia/models/composition/injected_item_search.rb +8 -1
- data/lib/algolia/models/composition/injected_item_source.rb +1 -0
- data/lib/algolia/models/composition/injection_main_external_provider.rb +258 -0
- data/lib/algolia/models/composition/injection_main_external_provider_source.rb +216 -0
- data/lib/algolia/models/composition/{main_recommend.rb → injection_main_recommend.rb} +10 -3
- data/lib/algolia/models/composition/injection_main_recommend_source.rb +1 -1
- data/lib/algolia/models/composition/{main_search.rb → injection_main_search.rb} +11 -4
- data/lib/algolia/models/composition/injection_main_search_source.rb +1 -1
- data/lib/algolia/models/composition/injection_main_source.rb +1 -0
- data/lib/algolia/models/composition/main_injection_query_parameters.rb +22 -22
- data/lib/algolia/models/composition/optional_words.rb +1 -1
- data/lib/algolia/models/composition/params.rb +6 -6
- data/lib/algolia/models/composition/processing_error.rb +209 -0
- data/lib/algolia/models/composition/request_body.rb +13 -4
- data/lib/algolia/models/composition/result_card.rb +208 -0
- data/lib/algolia/models/composition/search_response.rb +16 -4
- data/lib/algolia/models/composition/widgets.rb +13 -4
- data/lib/algolia/models/ingestion/source_update_commercetools.rb +11 -0
- data/lib/algolia/models/recommend/distinct.rb +1 -1
- data/lib/algolia/models/recommend/fallback_params.rb +26 -26
- data/lib/algolia/models/recommend/optional_words.rb +1 -1
- data/lib/algolia/models/recommend/recommend_search_params.rb +26 -26
- data/lib/algolia/models/recommend/result_card.rb +208 -0
- data/lib/algolia/models/recommend/widgets.rb +13 -4
- data/lib/algolia/models/search/api_key.rb +2 -2
- data/lib/algolia/models/search/attribute_criteria_computed_by.rb +35 -0
- data/lib/algolia/models/search/browse_params_object.rb +35 -25
- data/lib/algolia/models/search/consequence_params.rb +35 -25
- data/lib/algolia/models/search/distinct.rb +1 -1
- data/lib/algolia/models/search/get_api_key_response.rb +2 -2
- data/lib/algolia/models/search/index_settings.rb +28 -18
- data/lib/algolia/models/search/optional_words.rb +1 -1
- data/lib/algolia/models/search/result_card.rb +208 -0
- data/lib/algolia/models/search/search_for_facets.rb +35 -25
- data/lib/algolia/models/search/search_for_hits.rb +35 -25
- data/lib/algolia/models/search/search_params_object.rb +35 -25
- data/lib/algolia/models/search/secured_api_key_restrictions.rb +1 -1
- data/lib/algolia/models/search/settings_response.rb +28 -18
- data/lib/algolia/models/search/widgets.rb +13 -4
- data/lib/algolia/transport/transport.rb +82 -10
- data/lib/algolia/version.rb +1 -1
- metadata +72 -8
|
@@ -0,0 +1,268 @@
|
|
|
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
|
+
# Use `algolia_grouped_results`.
|
|
11
|
+
class AlgoliaGroupedResultsCompatToolConfig
|
|
12
|
+
attr_accessor :name
|
|
13
|
+
|
|
14
|
+
# When true, a successful tool invocation ends the agent graph (no further LLM turn). Use for chat experiences where the tool payload IS the final response. Leave false to let the main LLM produce a concluding assistant message after the tool runs.
|
|
15
|
+
attr_accessor :is_terminal
|
|
16
|
+
|
|
17
|
+
# Minimum number of result groups.
|
|
18
|
+
attr_accessor :min_groups
|
|
19
|
+
|
|
20
|
+
# Maximum number of result groups.
|
|
21
|
+
attr_accessor :max_groups
|
|
22
|
+
|
|
23
|
+
# Minimum hits per group.
|
|
24
|
+
attr_accessor :min_results_per_group
|
|
25
|
+
|
|
26
|
+
# Maximum hits per group.
|
|
27
|
+
attr_accessor :max_results_per_group
|
|
28
|
+
|
|
29
|
+
attr_accessor :type
|
|
30
|
+
|
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
32
|
+
def self.attribute_map
|
|
33
|
+
{
|
|
34
|
+
:name => :name,
|
|
35
|
+
:is_terminal => :isTerminal,
|
|
36
|
+
:min_groups => :minGroups,
|
|
37
|
+
:max_groups => :maxGroups,
|
|
38
|
+
:min_results_per_group => :minResultsPerGroup,
|
|
39
|
+
:max_results_per_group => :maxResultsPerGroup,
|
|
40
|
+
:type => :type
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Attribute type mapping.
|
|
45
|
+
def self.types_mapping
|
|
46
|
+
{
|
|
47
|
+
:name => :"String",
|
|
48
|
+
:is_terminal => :"Boolean",
|
|
49
|
+
:min_groups => :"Integer",
|
|
50
|
+
:max_groups => :"Integer",
|
|
51
|
+
:min_results_per_group => :"Integer",
|
|
52
|
+
:max_results_per_group => :"Integer",
|
|
53
|
+
:type => :"String"
|
|
54
|
+
}
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# List of attributes with nullable: true
|
|
58
|
+
def self.openapi_nullable
|
|
59
|
+
Set.new(
|
|
60
|
+
[]
|
|
61
|
+
)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Initializes the object
|
|
65
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
66
|
+
def initialize(attributes = {})
|
|
67
|
+
if (!attributes.is_a?(Hash))
|
|
68
|
+
raise(
|
|
69
|
+
ArgumentError,
|
|
70
|
+
"The input argument (attributes) must be a hash in `Algolia::AlgoliaGroupedResultsCompatToolConfig` initialize method"
|
|
71
|
+
)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
75
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
76
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
77
|
+
raise(
|
|
78
|
+
ArgumentError,
|
|
79
|
+
"`#{k}` is not a valid attribute in `Algolia::AlgoliaGroupedResultsCompatToolConfig`. Please check the name to make sure it's valid. List of attributes: " +
|
|
80
|
+
self.class.attribute_map.keys.inspect
|
|
81
|
+
)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
h[k.to_sym] = v
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if attributes.key?(:name)
|
|
88
|
+
self.name = attributes[:name]
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
if attributes.key?(:is_terminal)
|
|
92
|
+
self.is_terminal = attributes[:is_terminal]
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:min_groups)
|
|
96
|
+
self.min_groups = attributes[:min_groups]
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if attributes.key?(:max_groups)
|
|
100
|
+
self.max_groups = attributes[:max_groups]
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
if attributes.key?(:min_results_per_group)
|
|
104
|
+
self.min_results_per_group = attributes[:min_results_per_group]
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
if attributes.key?(:max_results_per_group)
|
|
108
|
+
self.max_results_per_group = attributes[:max_results_per_group]
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:type)
|
|
112
|
+
self.type = attributes[:type]
|
|
113
|
+
else
|
|
114
|
+
self.type = nil
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Checks equality by comparing each attribute.
|
|
119
|
+
# @param [Object] Object to be compared
|
|
120
|
+
def ==(other)
|
|
121
|
+
return true if self.equal?(other)
|
|
122
|
+
self.class == other.class &&
|
|
123
|
+
name == other.name &&
|
|
124
|
+
is_terminal == other.is_terminal &&
|
|
125
|
+
min_groups == other.min_groups &&
|
|
126
|
+
max_groups == other.max_groups &&
|
|
127
|
+
min_results_per_group == other.min_results_per_group &&
|
|
128
|
+
max_results_per_group == other.max_results_per_group &&
|
|
129
|
+
type == other.type
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# @see the `==` method
|
|
133
|
+
# @param [Object] Object to be compared
|
|
134
|
+
def eql?(other)
|
|
135
|
+
self == other
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Calculates hash code according to all attributes.
|
|
139
|
+
# @return [Integer] Hash code
|
|
140
|
+
def hash
|
|
141
|
+
[name, is_terminal, min_groups, max_groups, min_results_per_group, max_results_per_group, type].hash
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Builds the object from hash
|
|
145
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
146
|
+
# @return [Object] Returns the model itself
|
|
147
|
+
def self.build_from_hash(attributes)
|
|
148
|
+
return nil unless attributes.is_a?(Hash)
|
|
149
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
150
|
+
transformed_hash = {}
|
|
151
|
+
types_mapping.each_pair do |key, type|
|
|
152
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
153
|
+
transformed_hash[key.to_sym] = nil
|
|
154
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
155
|
+
# check to ensure the input is an array given that the attribute
|
|
156
|
+
# is documented as an array but the input is not
|
|
157
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
158
|
+
transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
|
|
159
|
+
_deserialize(::Regexp.last_match(1), v)
|
|
160
|
+
}
|
|
161
|
+
end
|
|
162
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
163
|
+
transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
|
|
164
|
+
end
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
new(transformed_hash)
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Deserializes the data based on type
|
|
171
|
+
# @param string type Data type
|
|
172
|
+
# @param string value Value to be deserialized
|
|
173
|
+
# @return [Object] Deserialized data
|
|
174
|
+
def self._deserialize(type, value)
|
|
175
|
+
case type.to_sym
|
|
176
|
+
when :Time
|
|
177
|
+
Time.parse(value)
|
|
178
|
+
when :Date
|
|
179
|
+
Date.parse(value)
|
|
180
|
+
when :String
|
|
181
|
+
value.to_s
|
|
182
|
+
when :Integer
|
|
183
|
+
value.to_i
|
|
184
|
+
when :Float
|
|
185
|
+
value.to_f
|
|
186
|
+
when :Boolean
|
|
187
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
188
|
+
true
|
|
189
|
+
else
|
|
190
|
+
false
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
when :Object
|
|
194
|
+
# generic object (usually a Hash), return directly
|
|
195
|
+
value
|
|
196
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
197
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
198
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
199
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
200
|
+
k_type = Regexp.last_match[:k_type]
|
|
201
|
+
v_type = Regexp.last_match[:v_type]
|
|
202
|
+
{}.tap do |hash|
|
|
203
|
+
value.each do |k, v|
|
|
204
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
205
|
+
end
|
|
206
|
+
end
|
|
207
|
+
# model
|
|
208
|
+
else
|
|
209
|
+
# models (e.g. Pet) or oneOf
|
|
210
|
+
klass = Algolia::AgentStudio.const_get(type)
|
|
211
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
|
|
212
|
+
.build_from_hash(value)
|
|
213
|
+
end
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# Returns the string representation of the object
|
|
217
|
+
# @return [String] String presentation of the object
|
|
218
|
+
def to_s
|
|
219
|
+
to_hash.to_s
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
223
|
+
# @return [Hash] Returns the object in the form of hash
|
|
224
|
+
def to_body
|
|
225
|
+
to_hash
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
def to_json(*_args)
|
|
229
|
+
to_hash.to_json
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# Returns the object in the form of hash
|
|
233
|
+
# @return [Hash] Returns the object in the form of hash
|
|
234
|
+
def to_hash
|
|
235
|
+
hash = {}
|
|
236
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
237
|
+
value = send(attr)
|
|
238
|
+
if value.nil?
|
|
239
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
240
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
hash[param] = _to_hash(value)
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
hash
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
# Outputs non-array value in the form of hash
|
|
250
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
251
|
+
# @param [Object] value Any valid value
|
|
252
|
+
# @return [Hash] Returns the value in the form of hash
|
|
253
|
+
def _to_hash(value)
|
|
254
|
+
if value.is_a?(Array)
|
|
255
|
+
value.map { |v| _to_hash(v) }
|
|
256
|
+
elsif value.is_a?(Hash)
|
|
257
|
+
{}.tap do |hash|
|
|
258
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
259
|
+
end
|
|
260
|
+
elsif value.respond_to?(:to_hash)
|
|
261
|
+
value.to_hash
|
|
262
|
+
else
|
|
263
|
+
value
|
|
264
|
+
end
|
|
265
|
+
end
|
|
266
|
+
end
|
|
267
|
+
end
|
|
268
|
+
end
|
|
@@ -7,29 +7,37 @@ require "time"
|
|
|
7
7
|
|
|
8
8
|
module Algolia
|
|
9
9
|
module AgentStudio
|
|
10
|
-
# Configuration for the
|
|
11
|
-
class
|
|
10
|
+
# Configuration for the algolia_grouped_results tool.
|
|
11
|
+
class AlgoliaGroupedResultsToolConfig
|
|
12
12
|
attr_accessor :name
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
# When true, a successful tool invocation ends the agent graph (no further LLM turn). Use for chat experiences where the tool payload IS the final response. Leave false to let the main LLM produce a concluding assistant message after the tool runs.
|
|
15
|
+
attr_accessor :is_terminal
|
|
15
16
|
|
|
17
|
+
# Minimum number of result groups.
|
|
16
18
|
attr_accessor :min_groups
|
|
17
19
|
|
|
20
|
+
# Maximum number of result groups.
|
|
18
21
|
attr_accessor :max_groups
|
|
19
22
|
|
|
23
|
+
# Minimum hits per group.
|
|
20
24
|
attr_accessor :min_results_per_group
|
|
21
25
|
|
|
26
|
+
# Maximum hits per group.
|
|
22
27
|
attr_accessor :max_results_per_group
|
|
23
28
|
|
|
29
|
+
attr_accessor :type
|
|
30
|
+
|
|
24
31
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
32
|
def self.attribute_map
|
|
26
33
|
{
|
|
27
34
|
:name => :name,
|
|
28
|
-
:
|
|
35
|
+
:is_terminal => :isTerminal,
|
|
29
36
|
:min_groups => :minGroups,
|
|
30
37
|
:max_groups => :maxGroups,
|
|
31
38
|
:min_results_per_group => :minResultsPerGroup,
|
|
32
|
-
:max_results_per_group => :maxResultsPerGroup
|
|
39
|
+
:max_results_per_group => :maxResultsPerGroup,
|
|
40
|
+
:type => :type
|
|
33
41
|
}
|
|
34
42
|
end
|
|
35
43
|
|
|
@@ -37,11 +45,12 @@ module Algolia
|
|
|
37
45
|
def self.types_mapping
|
|
38
46
|
{
|
|
39
47
|
:name => :"String",
|
|
40
|
-
:
|
|
48
|
+
:is_terminal => :"Boolean",
|
|
41
49
|
:min_groups => :"Integer",
|
|
42
50
|
:max_groups => :"Integer",
|
|
43
51
|
:min_results_per_group => :"Integer",
|
|
44
|
-
:max_results_per_group => :"Integer"
|
|
52
|
+
:max_results_per_group => :"Integer",
|
|
53
|
+
:type => :"String"
|
|
45
54
|
}
|
|
46
55
|
end
|
|
47
56
|
|
|
@@ -58,7 +67,7 @@ module Algolia
|
|
|
58
67
|
if (!attributes.is_a?(Hash))
|
|
59
68
|
raise(
|
|
60
69
|
ArgumentError,
|
|
61
|
-
"The input argument (attributes) must be a hash in `Algolia::
|
|
70
|
+
"The input argument (attributes) must be a hash in `Algolia::AlgoliaGroupedResultsToolConfig` initialize method"
|
|
62
71
|
)
|
|
63
72
|
end
|
|
64
73
|
|
|
@@ -67,7 +76,7 @@ module Algolia
|
|
|
67
76
|
if (!self.class.attribute_map.key?(k.to_sym))
|
|
68
77
|
raise(
|
|
69
78
|
ArgumentError,
|
|
70
|
-
"`#{k}` is not a valid attribute in `Algolia::
|
|
79
|
+
"`#{k}` is not a valid attribute in `Algolia::AlgoliaGroupedResultsToolConfig`. Please check the name to make sure it's valid. List of attributes: " +
|
|
71
80
|
self.class.attribute_map.keys.inspect
|
|
72
81
|
)
|
|
73
82
|
end
|
|
@@ -79,10 +88,8 @@ module Algolia
|
|
|
79
88
|
self.name = attributes[:name]
|
|
80
89
|
end
|
|
81
90
|
|
|
82
|
-
if attributes.key?(:
|
|
83
|
-
self.
|
|
84
|
-
else
|
|
85
|
-
self.type = nil
|
|
91
|
+
if attributes.key?(:is_terminal)
|
|
92
|
+
self.is_terminal = attributes[:is_terminal]
|
|
86
93
|
end
|
|
87
94
|
|
|
88
95
|
if attributes.key?(:min_groups)
|
|
@@ -100,6 +107,12 @@ module Algolia
|
|
|
100
107
|
if attributes.key?(:max_results_per_group)
|
|
101
108
|
self.max_results_per_group = attributes[:max_results_per_group]
|
|
102
109
|
end
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:type)
|
|
112
|
+
self.type = attributes[:type]
|
|
113
|
+
else
|
|
114
|
+
self.type = nil
|
|
115
|
+
end
|
|
103
116
|
end
|
|
104
117
|
|
|
105
118
|
# Checks equality by comparing each attribute.
|
|
@@ -108,11 +121,12 @@ module Algolia
|
|
|
108
121
|
return true if self.equal?(other)
|
|
109
122
|
self.class == other.class &&
|
|
110
123
|
name == other.name &&
|
|
111
|
-
|
|
124
|
+
is_terminal == other.is_terminal &&
|
|
112
125
|
min_groups == other.min_groups &&
|
|
113
126
|
max_groups == other.max_groups &&
|
|
114
127
|
min_results_per_group == other.min_results_per_group &&
|
|
115
|
-
max_results_per_group == other.max_results_per_group
|
|
128
|
+
max_results_per_group == other.max_results_per_group &&
|
|
129
|
+
type == other.type
|
|
116
130
|
end
|
|
117
131
|
|
|
118
132
|
# @see the `==` method
|
|
@@ -124,7 +138,7 @@ module Algolia
|
|
|
124
138
|
# Calculates hash code according to all attributes.
|
|
125
139
|
# @return [Integer] Hash code
|
|
126
140
|
def hash
|
|
127
|
-
[name,
|
|
141
|
+
[name, is_terminal, min_groups, max_groups, min_results_per_group, max_results_per_group, type].hash
|
|
128
142
|
end
|
|
129
143
|
|
|
130
144
|
# Builds the object from hash
|
|
@@ -8,7 +8,7 @@ require "time"
|
|
|
8
8
|
module Algolia
|
|
9
9
|
module AgentStudio
|
|
10
10
|
# Configuration for the Algolia Recommend tool. Allows specifying recommend models and related parameters.
|
|
11
|
-
class
|
|
11
|
+
class AlgoliaRecommendToolConfig
|
|
12
12
|
attr_accessor :name
|
|
13
13
|
|
|
14
14
|
attr_accessor :type
|
|
@@ -50,7 +50,7 @@ module Algolia
|
|
|
50
50
|
if (!attributes.is_a?(Hash))
|
|
51
51
|
raise(
|
|
52
52
|
ArgumentError,
|
|
53
|
-
"The input argument (attributes) must be a hash in `Algolia::
|
|
53
|
+
"The input argument (attributes) must be a hash in `Algolia::AlgoliaRecommendToolConfig` initialize method"
|
|
54
54
|
)
|
|
55
55
|
end
|
|
56
56
|
|
|
@@ -59,7 +59,7 @@ module Algolia
|
|
|
59
59
|
if (!self.class.attribute_map.key?(k.to_sym))
|
|
60
60
|
raise(
|
|
61
61
|
ArgumentError,
|
|
62
|
-
"`#{k}` is not a valid attribute in `Algolia::
|
|
62
|
+
"`#{k}` is not a valid attribute in `Algolia::AlgoliaRecommendToolConfig`. Please check the name to make sure it's valid. List of attributes: " +
|
|
63
63
|
self.class.attribute_map.keys.inspect
|
|
64
64
|
)
|
|
65
65
|
end
|
|
@@ -14,12 +14,18 @@ module Algolia
|
|
|
14
14
|
|
|
15
15
|
attr_accessor :indices
|
|
16
16
|
|
|
17
|
+
attr_accessor :mode
|
|
18
|
+
|
|
19
|
+
attr_accessor :allow_unlisted_indices
|
|
20
|
+
|
|
17
21
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
18
22
|
def self.attribute_map
|
|
19
23
|
{
|
|
20
24
|
:name => :name,
|
|
21
25
|
:type => :type,
|
|
22
|
-
:indices => :indices
|
|
26
|
+
:indices => :indices,
|
|
27
|
+
:mode => :mode,
|
|
28
|
+
:allow_unlisted_indices => :allowUnlistedIndices
|
|
23
29
|
}
|
|
24
30
|
end
|
|
25
31
|
|
|
@@ -28,7 +34,9 @@ module Algolia
|
|
|
28
34
|
{
|
|
29
35
|
:name => :"String",
|
|
30
36
|
:type => :"String",
|
|
31
|
-
:indices => :"Array<AlgoliaSearchToolIndexConfig>"
|
|
37
|
+
:indices => :"Array<AlgoliaSearchToolIndexConfig>",
|
|
38
|
+
:mode => :"ModeEnum",
|
|
39
|
+
:allow_unlisted_indices => :"Boolean"
|
|
32
40
|
}
|
|
33
41
|
end
|
|
34
42
|
|
|
@@ -81,6 +89,14 @@ module Algolia
|
|
|
81
89
|
else
|
|
82
90
|
self.indices = nil
|
|
83
91
|
end
|
|
92
|
+
|
|
93
|
+
if attributes.key?(:mode)
|
|
94
|
+
self.mode = attributes[:mode]
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
if attributes.key?(:allow_unlisted_indices)
|
|
98
|
+
self.allow_unlisted_indices = attributes[:allow_unlisted_indices]
|
|
99
|
+
end
|
|
84
100
|
end
|
|
85
101
|
|
|
86
102
|
# Checks equality by comparing each attribute.
|
|
@@ -90,7 +106,9 @@ module Algolia
|
|
|
90
106
|
self.class == other.class &&
|
|
91
107
|
name == other.name &&
|
|
92
108
|
type == other.type &&
|
|
93
|
-
indices == other.indices
|
|
109
|
+
indices == other.indices &&
|
|
110
|
+
mode == other.mode &&
|
|
111
|
+
allow_unlisted_indices == other.allow_unlisted_indices
|
|
94
112
|
end
|
|
95
113
|
|
|
96
114
|
# @see the `==` method
|
|
@@ -102,7 +120,7 @@ module Algolia
|
|
|
102
120
|
# Calculates hash code according to all attributes.
|
|
103
121
|
# @return [Integer] Hash code
|
|
104
122
|
def hash
|
|
105
|
-
[name, type, indices].hash
|
|
123
|
+
[name, type, indices, mode, allow_unlisted_indices].hash
|
|
106
124
|
end
|
|
107
125
|
|
|
108
126
|
# Builds the object from hash
|