recombee_api_client 6.0.0 → 6.1.0

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: 88fa1bd148ace9bb4ddfa4c75037c4242bf693a96e7395de3b0c23dafb325d03
4
- data.tar.gz: c4bbc5474baf87cfaabc58f07b0c4e5161190473e1816e2b6f6ab61b90d32347
3
+ metadata.gz: 251fbc7719eb5f880e85cbc68996c563e893c0bc30b304ee75c5b34c19ac6b99
4
+ data.tar.gz: 753e1a9f4bf897a7e15a6ddc2127f7ca062193a1c2fce6674815167eed87ce84
5
5
  SHA512:
6
- metadata.gz: ba77e029c00f29e3e4ec1d8b7790620d205e13bb4cbcc16b06061f0ce3045b74b39b815706bf0cde69d88964460a6149d8012f976e2563c9f2188464833ebc2b
7
- data.tar.gz: 3a6abbe8a347b15d2fec1ec457a23870c4321839c18f75e344adaf607dcb95b2e379b20057af1d90a3edb023eb97643d2788a35088c853588cfe368e7a9a7abe
6
+ metadata.gz: 5a83df05802119f4c100a2f63dfd1efa216db575a6c6547fe93c0611a0a0bd509b603d9a20facb57ba829d944b750ae73d061dbce3fa14de11d5a0d2d7381d51
7
+ data.tar.gz: 85e6cd1960ebab74f7de00ca4dbf0da42ba001bd9d3f7685d0f43609ebef8323836b04b4cb386aff2519a46c4fd79e39abacaa1bb641704d21d315c6d30d8c89
@@ -24,7 +24,7 @@ module RecombeeApiClient
24
24
  #
25
25
  class RecommendItemSegmentsToItem < ApiRequest
26
26
  attr_reader :item_id, :target_user_id, :count, :scenario, :cascade_create, :filter, :booster, :logic,
27
- :expert_settings, :return_ab_group
27
+ :expert_settings, :return_ab_group, :reql_expressions
28
28
  attr_accessor :timeout, :ensure_https
29
29
 
30
30
  ##
@@ -75,6 +75,43 @@ module RecombeeApiClient
75
75
  #
76
76
  # - +returnAbGroup+ -> If there is a custom AB-testing running, return the name of the group to which the request belongs.
77
77
  #
78
+ # - +reqlExpressions+ -> A dictionary of [ReQL](https://docs.recombee.com/reql) expressions that will be executed for each recommended Item Segment.
79
+ # This can be used to compute additional properties of the recommended Item Segments.
80
+ #
81
+ # The keys are the names of the expressions, and the values are the actual ReQL expressions.
82
+ #
83
+ # Example request:
84
+ # ```json
85
+ # {
86
+ # "reqlExpressions": {
87
+ # "countItems": "size(segment_items(\"categories\", 'segmentId'))"
88
+ # }
89
+ # }
90
+ # ```
91
+ #
92
+ # Example response:
93
+ # ```json
94
+ # {
95
+ # "recommId": "a7ac55a4-8d6e-4f19-addc-abac4164d8a8",
96
+ # "recomms":
97
+ # [
98
+ # {
99
+ # "id": "category-fantasy-books",
100
+ # "reqlEvaluations": {
101
+ # "countItems": 486
102
+ # }
103
+ # },
104
+ # {
105
+ # "id": "category-sci-fi-costumes",
106
+ # "reqlEvaluations": {
107
+ # "countItems": 19
108
+ # }
109
+ # }
110
+ # ],
111
+ # "numberNextRecommsCalls": 0
112
+ # }
113
+ # ```
114
+ #
78
115
  #
79
116
  def initialize(item_id, target_user_id, count, optional = {})
80
117
  @item_id = item_id
@@ -88,12 +125,13 @@ module RecombeeApiClient
88
125
  @logic = optional['logic']
89
126
  @expert_settings = optional['expertSettings']
90
127
  @return_ab_group = optional['returnAbGroup']
128
+ @reql_expressions = optional['reqlExpressions']
91
129
  @optional = optional
92
130
  @timeout = 3000
93
131
  @ensure_https = false
94
132
  @optional.each do |par, _|
95
133
  raise UnknownOptionalParameter.new(par) unless %w[scenario cascadeCreate filter booster logic
96
- expertSettings returnAbGroup].include? par
134
+ expertSettings returnAbGroup reqlExpressions].include? par
97
135
  end
98
136
  end
99
137
 
@@ -114,6 +152,7 @@ module RecombeeApiClient
114
152
  p['logic'] = @optional['logic'] if @optional.include? 'logic'
115
153
  p['expertSettings'] = @optional['expertSettings'] if @optional.include? 'expertSettings'
116
154
  p['returnAbGroup'] = @optional['returnAbGroup'] if @optional.include? 'returnAbGroup'
155
+ p['reqlExpressions'] = @optional['reqlExpressions'] if @optional.include? 'reqlExpressions'
117
156
 
118
157
  p
119
158
  end
@@ -23,7 +23,7 @@ module RecombeeApiClient
23
23
  #
24
24
  class RecommendItemSegmentsToItemSegment < ApiRequest
25
25
  attr_reader :context_segment_id, :target_user_id, :count, :scenario, :cascade_create, :filter, :booster, :logic,
26
- :expert_settings, :return_ab_group
26
+ :expert_settings, :return_ab_group, :reql_expressions
27
27
  attr_accessor :timeout, :ensure_https
28
28
 
29
29
  ##
@@ -74,6 +74,43 @@ module RecombeeApiClient
74
74
  #
75
75
  # - +returnAbGroup+ -> If there is a custom AB-testing running, return the name of the group to which the request belongs.
76
76
  #
77
+ # - +reqlExpressions+ -> A dictionary of [ReQL](https://docs.recombee.com/reql) expressions that will be executed for each recommended Item Segment.
78
+ # This can be used to compute additional properties of the recommended Item Segments.
79
+ #
80
+ # The keys are the names of the expressions, and the values are the actual ReQL expressions.
81
+ #
82
+ # Example request:
83
+ # ```json
84
+ # {
85
+ # "reqlExpressions": {
86
+ # "countItems": "size(segment_items(\"categories\", 'segmentId'))"
87
+ # }
88
+ # }
89
+ # ```
90
+ #
91
+ # Example response:
92
+ # ```json
93
+ # {
94
+ # "recommId": "a7ac55a4-8d6e-4f19-addc-abac4164d8a8",
95
+ # "recomms":
96
+ # [
97
+ # {
98
+ # "id": "category-fantasy-books",
99
+ # "reqlEvaluations": {
100
+ # "countItems": 486
101
+ # }
102
+ # },
103
+ # {
104
+ # "id": "category-sci-fi-costumes",
105
+ # "reqlEvaluations": {
106
+ # "countItems": 19
107
+ # }
108
+ # }
109
+ # ],
110
+ # "numberNextRecommsCalls": 0
111
+ # }
112
+ # ```
113
+ #
77
114
  #
78
115
  def initialize(context_segment_id, target_user_id, count, optional = {})
79
116
  @context_segment_id = context_segment_id
@@ -87,12 +124,13 @@ module RecombeeApiClient
87
124
  @logic = optional['logic']
88
125
  @expert_settings = optional['expertSettings']
89
126
  @return_ab_group = optional['returnAbGroup']
127
+ @reql_expressions = optional['reqlExpressions']
90
128
  @optional = optional
91
129
  @timeout = 3000
92
130
  @ensure_https = false
93
131
  @optional.each do |par, _|
94
132
  raise UnknownOptionalParameter.new(par) unless %w[scenario cascadeCreate filter booster logic
95
- expertSettings returnAbGroup].include? par
133
+ expertSettings returnAbGroup reqlExpressions].include? par
96
134
  end
97
135
  end
98
136
 
@@ -114,6 +152,7 @@ module RecombeeApiClient
114
152
  p['logic'] = @optional['logic'] if @optional.include? 'logic'
115
153
  p['expertSettings'] = @optional['expertSettings'] if @optional.include? 'expertSettings'
116
154
  p['returnAbGroup'] = @optional['returnAbGroup'] if @optional.include? 'returnAbGroup'
155
+ p['reqlExpressions'] = @optional['reqlExpressions'] if @optional.include? 'reqlExpressions'
117
156
 
118
157
  p
119
158
  end
@@ -24,7 +24,7 @@ module RecombeeApiClient
24
24
  #
25
25
  class RecommendItemSegmentsToUser < ApiRequest
26
26
  attr_reader :user_id, :count, :scenario, :cascade_create, :filter, :booster, :logic, :expert_settings,
27
- :return_ab_group
27
+ :return_ab_group, :reql_expressions
28
28
  attr_accessor :timeout, :ensure_https
29
29
 
30
30
  ##
@@ -57,6 +57,43 @@ module RecombeeApiClient
57
57
  #
58
58
  # - +returnAbGroup+ -> If there is a custom AB-testing running, return the name of the group to which the request belongs.
59
59
  #
60
+ # - +reqlExpressions+ -> A dictionary of [ReQL](https://docs.recombee.com/reql) expressions that will be executed for each recommended Item Segment.
61
+ # This can be used to compute additional properties of the recommended Item Segments.
62
+ #
63
+ # The keys are the names of the expressions, and the values are the actual ReQL expressions.
64
+ #
65
+ # Example request:
66
+ # ```json
67
+ # {
68
+ # "reqlExpressions": {
69
+ # "countItems": "size(segment_items(\"categories\", 'segmentId'))"
70
+ # }
71
+ # }
72
+ # ```
73
+ #
74
+ # Example response:
75
+ # ```json
76
+ # {
77
+ # "recommId": "a7ac55a4-8d6e-4f19-addc-abac4164d8a8",
78
+ # "recomms":
79
+ # [
80
+ # {
81
+ # "id": "category-fantasy-books",
82
+ # "reqlEvaluations": {
83
+ # "countItems": 486
84
+ # }
85
+ # },
86
+ # {
87
+ # "id": "category-sci-fi-costumes",
88
+ # "reqlEvaluations": {
89
+ # "countItems": 19
90
+ # }
91
+ # }
92
+ # ],
93
+ # "numberNextRecommsCalls": 0
94
+ # }
95
+ # ```
96
+ #
60
97
  #
61
98
  def initialize(user_id, count, optional = {})
62
99
  @user_id = user_id
@@ -69,12 +106,13 @@ module RecombeeApiClient
69
106
  @logic = optional['logic']
70
107
  @expert_settings = optional['expertSettings']
71
108
  @return_ab_group = optional['returnAbGroup']
109
+ @reql_expressions = optional['reqlExpressions']
72
110
  @optional = optional
73
111
  @timeout = 3000
74
112
  @ensure_https = false
75
113
  @optional.each do |par, _|
76
114
  raise UnknownOptionalParameter.new(par) unless %w[scenario cascadeCreate filter booster logic
77
- expertSettings returnAbGroup].include? par
115
+ expertSettings returnAbGroup reqlExpressions].include? par
78
116
  end
79
117
  end
80
118
 
@@ -94,6 +132,7 @@ module RecombeeApiClient
94
132
  p['logic'] = @optional['logic'] if @optional.include? 'logic'
95
133
  p['expertSettings'] = @optional['expertSettings'] if @optional.include? 'expertSettings'
96
134
  p['returnAbGroup'] = @optional['returnAbGroup'] if @optional.include? 'returnAbGroup'
135
+ p['reqlExpressions'] = @optional['reqlExpressions'] if @optional.include? 'reqlExpressions'
97
136
 
98
137
  p
99
138
  end
@@ -24,7 +24,7 @@ module RecombeeApiClient
24
24
  #
25
25
  class SearchItemSegments < ApiRequest
26
26
  attr_reader :user_id, :search_query, :count, :scenario, :cascade_create, :filter, :booster, :logic,
27
- :expert_settings, :return_ab_group
27
+ :expert_settings, :return_ab_group, :reql_expressions
28
28
  attr_accessor :timeout, :ensure_https
29
29
 
30
30
  ##
@@ -57,6 +57,43 @@ module RecombeeApiClient
57
57
  #
58
58
  # - +returnAbGroup+ -> If there is a custom AB-testing running, return the name of the group to which the request belongs.
59
59
  #
60
+ # - +reqlExpressions+ -> A dictionary of [ReQL](https://docs.recombee.com/reql) expressions that will be executed for each recommended Item Segment.
61
+ # This can be used to compute additional properties of the recommended Item Segments.
62
+ #
63
+ # The keys are the names of the expressions, and the values are the actual ReQL expressions.
64
+ #
65
+ # Example request:
66
+ # ```json
67
+ # {
68
+ # "reqlExpressions": {
69
+ # "countItems": "size(segment_items(\"categories\", 'segmentId'))"
70
+ # }
71
+ # }
72
+ # ```
73
+ #
74
+ # Example response:
75
+ # ```json
76
+ # {
77
+ # "recommId": "a7ac55a4-8d6e-4f19-addc-abac4164d8a8",
78
+ # "recomms":
79
+ # [
80
+ # {
81
+ # "id": "category-fantasy-books",
82
+ # "reqlEvaluations": {
83
+ # "countItems": 486
84
+ # }
85
+ # },
86
+ # {
87
+ # "id": "category-sci-fi-costumes",
88
+ # "reqlEvaluations": {
89
+ # "countItems": 19
90
+ # }
91
+ # }
92
+ # ],
93
+ # "numberNextRecommsCalls": 0
94
+ # }
95
+ # ```
96
+ #
60
97
  #
61
98
  def initialize(user_id, search_query, count, optional = {})
62
99
  @user_id = user_id
@@ -70,12 +107,13 @@ module RecombeeApiClient
70
107
  @logic = optional['logic']
71
108
  @expert_settings = optional['expertSettings']
72
109
  @return_ab_group = optional['returnAbGroup']
110
+ @reql_expressions = optional['reqlExpressions']
73
111
  @optional = optional
74
112
  @timeout = 3000
75
113
  @ensure_https = false
76
114
  @optional.each do |par, _|
77
115
  raise UnknownOptionalParameter.new(par) unless %w[scenario cascadeCreate filter booster logic
78
- expertSettings returnAbGroup].include? par
116
+ expertSettings returnAbGroup reqlExpressions].include? par
79
117
  end
80
118
  end
81
119
 
@@ -96,6 +134,7 @@ module RecombeeApiClient
96
134
  p['logic'] = @optional['logic'] if @optional.include? 'logic'
97
135
  p['expertSettings'] = @optional['expertSettings'] if @optional.include? 'expertSettings'
98
136
  p['returnAbGroup'] = @optional['returnAbGroup'] if @optional.include? 'returnAbGroup'
137
+ p['reqlExpressions'] = @optional['reqlExpressions'] if @optional.include? 'reqlExpressions'
99
138
 
100
139
  p
101
140
  end
@@ -1,3 +1,3 @@
1
1
  module RecombeeApiClient
2
- VERSION = '6.0.0'
2
+ VERSION = '6.1.0'
3
3
  end
@@ -19,7 +19,7 @@ module RecombeeApiClient
19
19
  include HTTParty
20
20
 
21
21
  BATCH_MAX_SIZE = 10_000
22
- USER_AGENT = { 'User-Agent' => 'recombee-ruby-api-client/6.0.0' }
22
+ USER_AGENT = { 'User-Agent' => 'recombee-ruby-api-client/6.1.0' }
23
23
 
24
24
  ##
25
25
  # - +account+ -> Name of your account at Recombee
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recombee_api_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0
4
+ version: 6.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ondřej Fiedler