recombee_api_client 6.1.0 → 6.2.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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 946801c5ff87b7b436bdebae1c869bb47adaa63d07f0a779da3da48961fdb704
|
|
4
|
+
data.tar.gz: 14e9ead529eb19b683314182f8cdf2c22f18f208f4d58559a6aa8086e788343f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 41cf5de6569aae7b973a3d03eccd2d819aaadcce8c2afccba7d8b38462c822bb04efbbe033fa96a4ad7d89a7a9891d947c6fe8779fe9732ae2cd59ae1584acae
|
|
7
|
+
data.tar.gz: f8ef99a8dffd542ea917e43a2ae776eeda38308daa9dc12f62155623df2ff633793aa5d5a054c10d48f0065d9633dbe1e382f07fd3fc73d22636e9635b825ebb
|
|
@@ -7,7 +7,7 @@ module RecombeeApiClient
|
|
|
7
7
|
require_relative '../errors'
|
|
8
8
|
|
|
9
9
|
##
|
|
10
|
-
# Composite Recommendation returns both a *source entity* (e.g., an Item or [Item Segment](https://docs.recombee.com/segmentations
|
|
10
|
+
# Composite Recommendation returns both a *source entity* (e.g., an Item or [Item Segment](https://docs.recombee.com/segmentations)) and a list of related recommendations in a single response.
|
|
11
11
|
#
|
|
12
12
|
# It is ideal for use cases such as personalized homepage sections (*Articles from <category>*), *Because You Watched <movie>*, or *Artists Related to Your Favorite Artist <artist>*.
|
|
13
13
|
#
|
|
@@ -37,8 +37,8 @@ module RecombeeApiClient
|
|
|
37
37
|
# See [this example](https://docs.recombee.com/api#composite-recommendation-example-setting-parameters-for-individual-stages) for more details.
|
|
38
38
|
#
|
|
39
39
|
class CompositeRecommendation < ApiRequest
|
|
40
|
-
attr_reader :scenario, :count, :item_id, :user_id, :logic, :segment_id, :
|
|
41
|
-
:result_settings, :expert_settings
|
|
40
|
+
attr_reader :scenario, :count, :item_id, :user_id, :logic, :segment_id, :search_query, :cascade_create,
|
|
41
|
+
:source_settings, :result_settings, :expert_settings
|
|
42
42
|
attr_accessor :timeout, :ensure_https
|
|
43
43
|
|
|
44
44
|
##
|
|
@@ -66,6 +66,8 @@ module RecombeeApiClient
|
|
|
66
66
|
#
|
|
67
67
|
# - +segmentId+ -> ID of the segment from `contextSegmentationId` for which the recommendations are to be generated.
|
|
68
68
|
#
|
|
69
|
+
# - +searchQuery+ -> Search query provided by the user. It is used for the full-text search. Only applicable if the *scenario* corresponds to a search scenario.
|
|
70
|
+
#
|
|
69
71
|
# - +cascadeCreate+ -> If the entity for the source recommendation does not exist in the database, returns a list of non-personalized recommendations and creates the user in the database. This allows, for example, rotations in the following recommendations for that entity, as the entity will be already known to the system.
|
|
70
72
|
#
|
|
71
73
|
# - +sourceSettings+ -> Parameters applied for recommending the *Source* stage. The accepted parameters correspond with the recommendation sub-endpoint used to recommend the *Source*.
|
|
@@ -83,6 +85,7 @@ module RecombeeApiClient
|
|
|
83
85
|
@user_id = optional['userId']
|
|
84
86
|
@logic = optional['logic']
|
|
85
87
|
@segment_id = optional['segmentId']
|
|
88
|
+
@search_query = optional['searchQuery']
|
|
86
89
|
@cascade_create = optional['cascadeCreate']
|
|
87
90
|
@source_settings = optional['sourceSettings']
|
|
88
91
|
@result_settings = optional['resultSettings']
|
|
@@ -91,8 +94,8 @@ module RecombeeApiClient
|
|
|
91
94
|
@timeout = 3000
|
|
92
95
|
@ensure_https = false
|
|
93
96
|
@optional.each do |par, _|
|
|
94
|
-
raise UnknownOptionalParameter.new(par) unless %w[itemId userId logic segmentId
|
|
95
|
-
sourceSettings resultSettings expertSettings].include? par
|
|
97
|
+
raise UnknownOptionalParameter.new(par) unless %w[itemId userId logic segmentId searchQuery
|
|
98
|
+
cascadeCreate sourceSettings resultSettings expertSettings].include? par
|
|
96
99
|
end
|
|
97
100
|
end
|
|
98
101
|
|
|
@@ -110,6 +113,7 @@ module RecombeeApiClient
|
|
|
110
113
|
p['userId'] = @optional['userId'] if @optional.include? 'userId'
|
|
111
114
|
p['logic'] = @optional['logic'] if @optional.include? 'logic'
|
|
112
115
|
p['segmentId'] = @optional['segmentId'] if @optional.include? 'segmentId'
|
|
116
|
+
p['searchQuery'] = @optional['searchQuery'] if @optional.include? 'searchQuery'
|
|
113
117
|
p['cascadeCreate'] = @optional['cascadeCreate'] if @optional.include? 'cascadeCreate'
|
|
114
118
|
p['sourceSettings'] = @optional['sourceSettings'] if @optional.include? 'sourceSettings'
|
|
115
119
|
p['resultSettings'] = @optional['resultSettings'] if @optional.include? 'resultSettings'
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file is auto-generated, do not edit
|
|
3
|
+
#
|
|
4
|
+
|
|
5
|
+
module RecombeeApiClient
|
|
6
|
+
require_relative 'request'
|
|
7
|
+
require_relative '../errors'
|
|
8
|
+
|
|
9
|
+
##
|
|
10
|
+
# Returns Item segments that shall be shown to a user as next recommendations when the user e.g. scrolls the page down (*infinite scroll*) or goes to the next page.
|
|
11
|
+
#
|
|
12
|
+
# It accepts `recommId` of a base recommendation request (e.g., request from the first page) and the number of segments that shall be returned (`count`).
|
|
13
|
+
# The base request can be one of:
|
|
14
|
+
# - [Recommend Item Segments to Item](https://docs.recombee.com/api#recommend-item-segments-to-item)
|
|
15
|
+
# - [Recommend Item Segments to User](https://docs.recombee.com/api#recommend-item-segments-to-user)
|
|
16
|
+
# - [Recommend Item Segments to Item Segment](https://docs.recombee.com/api#recommend-item-segments-to-item-segment)
|
|
17
|
+
# - [Search Item Segments](https://docs.recombee.com/api#search-item-segments)
|
|
18
|
+
#
|
|
19
|
+
# All the other parameters are inherited from the base request.
|
|
20
|
+
#
|
|
21
|
+
# *Recommend next Item segments* can be called many times for a single `recommId` and each call returns different (previously not recommended) segments.
|
|
22
|
+
# The number of *Recommend next Item segments* calls performed so far is returned in the `numberNextRecommsCalls` field.
|
|
23
|
+
#
|
|
24
|
+
# *Recommend next Item segments* can be requested up to 30 minutes after the base request or a previous *Recommend next Item segments* call.
|
|
25
|
+
#
|
|
26
|
+
# For billing purposes, each call to *Recommend next Item segments* is counted as a separate recommendation request.
|
|
27
|
+
#
|
|
28
|
+
class RecommendNextItemSegments < ApiRequest
|
|
29
|
+
attr_reader :recomm_id, :count
|
|
30
|
+
attr_accessor :timeout, :ensure_https
|
|
31
|
+
|
|
32
|
+
##
|
|
33
|
+
# * *Required arguments*
|
|
34
|
+
# - +recomm_id+ -> ID of the base recommendation request for which next recommendations should be returned
|
|
35
|
+
# - +count+ -> Number of item segments to be recommended
|
|
36
|
+
#
|
|
37
|
+
#
|
|
38
|
+
def initialize(recomm_id, count)
|
|
39
|
+
@recomm_id = recomm_id
|
|
40
|
+
@count = count
|
|
41
|
+
@timeout = 3000
|
|
42
|
+
@ensure_https = false
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# HTTP method
|
|
46
|
+
def method
|
|
47
|
+
:post
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Values of body parameters as a Hash
|
|
51
|
+
def body_parameters
|
|
52
|
+
p = {}
|
|
53
|
+
p['count'] = @count
|
|
54
|
+
|
|
55
|
+
p
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Values of query parameters as a Hash.
|
|
59
|
+
# name of parameter => value of the parameter
|
|
60
|
+
def query_parameters
|
|
61
|
+
{}
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Relative path to the endpoint
|
|
65
|
+
def path
|
|
66
|
+
"/{databaseId}/recomms/next/item-segments/#{@recomm_id}"
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
data/lib/recombee_api_client.rb
CHANGED
|
@@ -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.
|
|
22
|
+
USER_AGENT = { 'User-Agent' => 'recombee-ruby-api-client/6.2.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.
|
|
4
|
+
version: 6.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ondřej Fiedler
|
|
@@ -159,6 +159,7 @@ files:
|
|
|
159
159
|
- lib/recombee_api_client/api/recommend_items_to_item.rb
|
|
160
160
|
- lib/recombee_api_client/api/recommend_items_to_item_segment.rb
|
|
161
161
|
- lib/recombee_api_client/api/recommend_items_to_user.rb
|
|
162
|
+
- lib/recombee_api_client/api/recommend_next_item_segments.rb
|
|
162
163
|
- lib/recombee_api_client/api/recommend_next_items.rb
|
|
163
164
|
- lib/recombee_api_client/api/recommend_users_to_item.rb
|
|
164
165
|
- lib/recombee_api_client/api/recommend_users_to_user.rb
|