recombee_api_client 4.0.0 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/recombee_api_client/api/add_bookmark.rb +1 -1
- data/lib/recombee_api_client/api/add_cart_addition.rb +3 -3
- data/lib/recombee_api_client/api/add_detail_view.rb +1 -1
- data/lib/recombee_api_client/api/add_group.rb +1 -1
- data/lib/recombee_api_client/api/add_item.rb +2 -2
- data/lib/recombee_api_client/api/add_item_property.rb +1 -1
- data/lib/recombee_api_client/api/add_manual_reql_segment.rb +69 -0
- data/lib/recombee_api_client/api/add_purchase.rb +4 -4
- data/lib/recombee_api_client/api/add_rating.rb +1 -1
- data/lib/recombee_api_client/api/add_series.rb +1 -1
- data/lib/recombee_api_client/api/add_user_property.rb +2 -2
- data/lib/recombee_api_client/api/create_auto_reql_segmentation.rb +75 -0
- data/lib/recombee_api_client/api/create_manual_reql_segmentation.rb +71 -0
- data/lib/recombee_api_client/api/create_property_based_segmentation.rb +76 -0
- data/lib/recombee_api_client/api/delete_bookmark.rb +3 -3
- data/lib/recombee_api_client/api/delete_cart_addition.rb +3 -3
- data/lib/recombee_api_client/api/delete_detail_view.rb +3 -3
- data/lib/recombee_api_client/api/delete_group.rb +2 -2
- data/lib/recombee_api_client/api/delete_item.rb +2 -2
- data/lib/recombee_api_client/api/delete_manual_reql_segment.rb +52 -0
- data/lib/recombee_api_client/api/delete_more_items.rb +3 -3
- data/lib/recombee_api_client/api/delete_purchase.rb +3 -3
- data/lib/recombee_api_client/api/delete_rating.rb +2 -2
- data/lib/recombee_api_client/api/delete_search_synonym.rb +1 -1
- data/lib/recombee_api_client/api/delete_segmentation.rb +50 -0
- data/lib/recombee_api_client/api/delete_series.rb +1 -1
- data/lib/recombee_api_client/api/delete_user.rb +1 -1
- data/lib/recombee_api_client/api/delete_user_property.rb +1 -1
- data/lib/recombee_api_client/api/get_item_values.rb +2 -2
- data/lib/recombee_api_client/api/get_segmentation.rb +50 -0
- data/lib/recombee_api_client/api/get_user_values.rb +2 -2
- data/lib/recombee_api_client/api/insert_to_group.rb +2 -2
- data/lib/recombee_api_client/api/insert_to_series.rb +2 -2
- data/lib/recombee_api_client/api/list_group_items.rb +1 -1
- data/lib/recombee_api_client/api/list_item_bookmarks.rb +2 -2
- data/lib/recombee_api_client/api/list_item_cart_additions.rb +2 -2
- data/lib/recombee_api_client/api/list_item_detail_views.rb +2 -2
- data/lib/recombee_api_client/api/list_item_purchases.rb +2 -2
- data/lib/recombee_api_client/api/list_item_ratings.rb +2 -2
- data/lib/recombee_api_client/api/list_item_view_portions.rb +2 -2
- data/lib/recombee_api_client/api/list_items.rb +1 -1
- data/lib/recombee_api_client/api/list_segmentations.rb +51 -0
- data/lib/recombee_api_client/api/list_series_items.rb +2 -2
- data/lib/recombee_api_client/api/list_user_bookmarks.rb +1 -1
- data/lib/recombee_api_client/api/list_user_cart_additions.rb +1 -1
- data/lib/recombee_api_client/api/list_user_detail_views.rb +1 -1
- data/lib/recombee_api_client/api/list_user_purchases.rb +1 -1
- data/lib/recombee_api_client/api/list_user_ratings.rb +1 -1
- data/lib/recombee_api_client/api/list_user_view_portions.rb +1 -1
- data/lib/recombee_api_client/api/list_users.rb +1 -1
- data/lib/recombee_api_client/api/merge_users.rb +2 -2
- data/lib/recombee_api_client/api/recommend_item_segments_to_item.rb +131 -0
- data/lib/recombee_api_client/api/recommend_item_segments_to_item_segment.rb +131 -0
- data/lib/recombee_api_client/api/recommend_item_segments_to_user.rb +111 -0
- data/lib/recombee_api_client/api/recommend_items_to_item.rb +26 -26
- data/lib/recombee_api_client/api/recommend_items_to_user.rb +23 -23
- data/lib/recombee_api_client/api/recommend_next_items.rb +2 -2
- data/lib/recombee_api_client/api/recommend_users_to_item.rb +18 -18
- data/lib/recombee_api_client/api/recommend_users_to_user.rb +21 -21
- data/lib/recombee_api_client/api/reset_database.rb +1 -1
- data/lib/recombee_api_client/api/search_item_segments.rb +114 -0
- data/lib/recombee_api_client/api/search_items.rb +17 -17
- data/lib/recombee_api_client/api/set_view_portion.rb +3 -3
- data/lib/recombee_api_client/api/update_auto_reql_segmentation.rb +69 -0
- data/lib/recombee_api_client/api/update_manual_reql_segment.rb +67 -0
- data/lib/recombee_api_client/api/update_manual_reql_segmentation.rb +65 -0
- data/lib/recombee_api_client/api/update_more_items.rb +3 -3
- data/lib/recombee_api_client/api/update_property_based_segmentation.rb +69 -0
- data/lib/recombee_api_client/version.rb +1 -1
- data/lib/recombee_api_client.rb +1 -1
- metadata +18 -2
@@ -7,11 +7,11 @@ module RecombeeApiClient
|
|
7
7
|
require_relative '../errors'
|
8
8
|
|
9
9
|
##
|
10
|
-
#
|
10
|
+
#Gets users similar to the given user, based on the user's past interactions (purchases, ratings, etc.) and values of properties.
|
11
11
|
#
|
12
|
-
#It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters.
|
12
|
+
#It is also possible to use POST HTTP method (for example in the case of a very long ReQL filter) - query parameters then become body parameters.
|
13
13
|
#
|
14
|
-
#The returned users are sorted by similarity (first user being the most similar).
|
14
|
+
#The returned users are sorted by similarity (the first user being the most similar).
|
15
15
|
#
|
16
16
|
class RecommendUsersToUser < ApiRequest
|
17
17
|
attr_reader :user_id, :count, :scenario, :cascade_create, :return_properties, :included_properties, :filter, :booster, :logic, :diversity, :min_relevance, :rotation_rate, :rotation_time, :expert_settings, :return_ab_group
|
@@ -24,14 +24,14 @@ module RecombeeApiClient
|
|
24
24
|
# - +count+ -> Number of users to be recommended (N for the top-N recommendation).
|
25
25
|
#
|
26
26
|
# * *Optional arguments (given as hash optional)*
|
27
|
-
# - +scenario+ -> Scenario defines a particular application of recommendations. It can be for example "homepage", "cart" or "emailing".
|
27
|
+
# - +scenario+ -> Scenario defines a particular application of recommendations. It can be, for example, "homepage", "cart", or "emailing".
|
28
28
|
#
|
29
|
-
#You can set various settings to the [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com). You can also see performance of each scenario in the Admin UI separately, so you can check how well each application performs.
|
29
|
+
#You can set various settings to the [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com). You can also see the performance of each scenario in the Admin UI separately, so you can check how well each application performs.
|
30
30
|
#
|
31
|
-
#The AI
|
31
|
+
#The AI that optimizes models to get the best results may optimize different scenarios separately or even use different models in each of the scenarios.
|
32
32
|
#
|
33
|
-
# - +cascadeCreate+ -> If the user 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 user, as the user will be already known to the system.
|
34
|
-
# - +returnProperties+ -> With `returnProperties=true`, property values of the recommended users are returned along with their IDs in a JSON dictionary. The acquired property values can be used
|
33
|
+
# - +cascadeCreate+ -> If the user 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 user, as the user will be already known to the system.
|
34
|
+
# - +returnProperties+ -> With `returnProperties=true`, property values of the recommended users are returned along with their IDs in a JSON dictionary. The acquired property values can be used to easily display the recommended users.
|
35
35
|
#
|
36
36
|
#Example response:
|
37
37
|
#```
|
@@ -58,7 +58,7 @@ module RecombeeApiClient
|
|
58
58
|
# }
|
59
59
|
#```
|
60
60
|
#
|
61
|
-
# - +includedProperties+ -> Allows
|
61
|
+
# - +includedProperties+ -> Allows specifying which properties should be returned when `returnProperties=true` is set. The properties are given as a comma-separated list.
|
62
62
|
#
|
63
63
|
#Example response for `includedProperties=country`:
|
64
64
|
#```
|
@@ -83,32 +83,32 @@ module RecombeeApiClient
|
|
83
83
|
# }
|
84
84
|
#```
|
85
85
|
#
|
86
|
-
# - +filter+ -> Boolean-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to filter recommended items based on the values of their attributes.
|
86
|
+
# - +filter+ -> Boolean-returning [ReQL](https://docs.recombee.com/reql.html) expression, which allows you to filter recommended items based on the values of their attributes.
|
87
87
|
#
|
88
|
-
#Filters can be
|
88
|
+
#Filters can also be assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
|
89
89
|
#
|
90
|
-
# - +booster+ -> Number-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to boost recommendation rate of some items based on the values of their attributes.
|
90
|
+
# - +booster+ -> Number-returning [ReQL](https://docs.recombee.com/reql.html) expression, which allows you to boost the recommendation rate of some items based on the values of their attributes.
|
91
91
|
#
|
92
|
-
#Boosters can be
|
92
|
+
#Boosters can also be assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
|
93
93
|
#
|
94
|
-
# - +logic+ -> Logic specifies particular behavior of the recommendation models. You can pick tailored logic for your domain and use case.
|
95
|
-
#See [this section](https://docs.recombee.com/recommendation_logics.html) for list of available logics and other details.
|
94
|
+
# - +logic+ -> Logic specifies the particular behavior of the recommendation models. You can pick tailored logic for your domain and use case.
|
95
|
+
#See [this section](https://docs.recombee.com/recommendation_logics.html) for a list of available logics and other details.
|
96
96
|
#
|
97
97
|
#The difference between `logic` and `scenario` is that `logic` specifies mainly behavior, while `scenario` specifies the place where recommendations are shown to the users.
|
98
98
|
#
|
99
|
-
#Logic can be
|
99
|
+
#Logic can also be set to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
|
100
100
|
#
|
101
|
-
# - +diversity+ -> **Expert option** Real number from [0.0, 1.0] which determines how
|
101
|
+
# - +diversity+ -> **Expert option** Real number from [0.0, 1.0], which determines how mutually dissimilar the recommended users should be. The default value is 0.0, i.e., no diversification. Value 1.0 means maximal diversification.
|
102
102
|
#
|
103
|
-
# - +minRelevance+ -> **Expert option** Specifies the threshold of how
|
103
|
+
# - +minRelevance+ -> **Expert option** Specifies the threshold of how relevant must the recommended users be. Possible values one of: "low", "medium", "high".
|
104
104
|
#
|
105
|
-
# - +rotationRate+ -> **Expert option** If your users browse the system in real-time, it may easily happen that you wish to offer them recommendations multiple times. Here comes the question: how much should the recommendations change? Should they remain the same, or should they rotate? Recombee API allows you to control this per
|
105
|
+
# - +rotationRate+ -> **Expert option** If your users browse the system in real-time, it may easily happen that you wish to offer them recommendations multiple times. Here comes the question: how much should the recommendations change? Should they remain the same, or should they rotate? Recombee API allows you to control this per request in a backward fashion. You may penalize a user for being recommended in the near past. For the specific user, `rotationRate=1` means maximal rotation, `rotationRate=0` means absolutely no rotation. You may also use, for example, `rotationRate=0.2` for only slight rotation of recommended users.
|
106
106
|
#
|
107
|
-
# - +rotationTime+ -> **Expert option** Taking *rotationRate* into account, specifies how long
|
107
|
+
# - +rotationTime+ -> **Expert option** Taking *rotationRate* into account, specifies how long it takes for a user to recover from the penalization. For example, `rotationTime=7200.0` means that users recommended less than 2 hours ago are penalized.
|
108
108
|
#
|
109
109
|
# - +expertSettings+ -> Dictionary of custom options.
|
110
110
|
#
|
111
|
-
# - +returnAbGroup+ -> If there is a custom AB-testing running, return name of group to which the request belongs.
|
111
|
+
# - +returnAbGroup+ -> If there is a custom AB-testing running, return the name of the group to which the request belongs.
|
112
112
|
#
|
113
113
|
#
|
114
114
|
def initialize(user_id, count, optional = {})
|
@@ -7,7 +7,7 @@ module RecombeeApiClient
|
|
7
7
|
require_relative '../errors'
|
8
8
|
|
9
9
|
##
|
10
|
-
#Completely erases all your data, including items, item properties, series, user database, purchases, ratings, detail views, and bookmarks. Make sure the request
|
10
|
+
#Completely erases all your data, including items, item properties, series, user database, purchases, ratings, detail views, and bookmarks. Make sure the request is never executed in the production environment! Resetting your database is irreversible.
|
11
11
|
#
|
12
12
|
class ResetDatabase < ApiRequest
|
13
13
|
|
@@ -0,0 +1,114 @@
|
|
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
|
+
#
|
11
|
+
#Full-text personalized search that returns Segments from a Segmentation. The results are based on the provided `searchQuery` and also on the user's past interactions (purchases, ratings, etc.).
|
12
|
+
#
|
13
|
+
#Based on the used Segmentation, this endpoint can be used for example for:
|
14
|
+
#
|
15
|
+
# - Searching within categories or brands
|
16
|
+
# - Searching within genres or artists
|
17
|
+
#
|
18
|
+
#For example if the user is searching for "iPhone" this endpoint can return "cell phones" category.
|
19
|
+
#
|
20
|
+
#You need to set the used Segmentation the Admin UI in the Scenario settings prior to using this endpoint.
|
21
|
+
#
|
22
|
+
#The returned segments are sorted by relevance (first segment being the most relevant).
|
23
|
+
#
|
24
|
+
#It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters.
|
25
|
+
#
|
26
|
+
class SearchItemSegments < ApiRequest
|
27
|
+
attr_reader :user_id, :search_query, :count, :scenario, :cascade_create, :filter, :booster, :logic, :expert_settings, :return_ab_group
|
28
|
+
attr_accessor :timeout
|
29
|
+
attr_accessor :ensure_https
|
30
|
+
|
31
|
+
##
|
32
|
+
# * *Required arguments*
|
33
|
+
# - +user_id+ -> ID of the user for whom personalized search will be performed.
|
34
|
+
# - +search_query+ -> Search query provided by the user. It is used for the full-text search.
|
35
|
+
# - +count+ -> Number of segments to be returned (N for the top-N results).
|
36
|
+
#
|
37
|
+
# * *Optional arguments (given as hash optional)*
|
38
|
+
# - +scenario+ -> Scenario defines a particular application of recommendations. It can be, for example, "homepage", "cart", or "emailing".
|
39
|
+
#
|
40
|
+
#You can set various settings to the [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com). You can also see the performance of each scenario in the Admin UI separately, so you can check how well each application performs.
|
41
|
+
#
|
42
|
+
#The AI that optimizes models to get the best results may optimize different scenarios separately or even use different models in each of the scenarios.
|
43
|
+
#
|
44
|
+
# - +cascadeCreate+ -> If the user 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 user, as the user will be already known to the system.
|
45
|
+
#
|
46
|
+
# - +filter+ -> Boolean-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to filter recommended segments based on the `segmentationId`.
|
47
|
+
#
|
48
|
+
# - +booster+ -> Number-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to boost recommendation rate of some segments based on the `segmentationId`.
|
49
|
+
#
|
50
|
+
# - +logic+ -> Logic specifies the particular behavior of the recommendation models. You can pick tailored logic for your domain and use case.
|
51
|
+
#See [this section](https://docs.recombee.com/recommendation_logics.html) for a list of available logics and other details.
|
52
|
+
#
|
53
|
+
#The difference between `logic` and `scenario` is that `logic` specifies mainly behavior, while `scenario` specifies the place where recommendations are shown to the users.
|
54
|
+
#
|
55
|
+
#Logic can also be set to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
|
56
|
+
#
|
57
|
+
# - +expertSettings+ -> Dictionary of custom options.
|
58
|
+
#
|
59
|
+
# - +returnAbGroup+ -> If there is a custom AB-testing running, return the name of the group to which the request belongs.
|
60
|
+
#
|
61
|
+
#
|
62
|
+
def initialize(user_id, search_query, count, optional = {})
|
63
|
+
@user_id = user_id
|
64
|
+
@search_query = search_query
|
65
|
+
@count = count
|
66
|
+
optional = normalize_optional(optional)
|
67
|
+
@scenario = optional['scenario']
|
68
|
+
@cascade_create = optional['cascadeCreate']
|
69
|
+
@filter = optional['filter']
|
70
|
+
@booster = optional['booster']
|
71
|
+
@logic = optional['logic']
|
72
|
+
@expert_settings = optional['expertSettings']
|
73
|
+
@return_ab_group = optional['returnAbGroup']
|
74
|
+
@optional = optional
|
75
|
+
@timeout = 3000
|
76
|
+
@ensure_https = false
|
77
|
+
@optional.each do |par, _|
|
78
|
+
fail UnknownOptionalParameter.new(par) unless ["scenario","cascadeCreate","filter","booster","logic","expertSettings","returnAbGroup"].include? par
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
# HTTP method
|
83
|
+
def method
|
84
|
+
:post
|
85
|
+
end
|
86
|
+
|
87
|
+
# Values of body parameters as a Hash
|
88
|
+
def body_parameters
|
89
|
+
p = Hash.new
|
90
|
+
p['searchQuery'] = @search_query
|
91
|
+
p['count'] = @count
|
92
|
+
p['scenario'] = @optional['scenario'] if @optional.include? 'scenario'
|
93
|
+
p['cascadeCreate'] = @optional['cascadeCreate'] if @optional.include? 'cascadeCreate'
|
94
|
+
p['filter'] = @optional['filter'] if @optional.include? 'filter'
|
95
|
+
p['booster'] = @optional['booster'] if @optional.include? 'booster'
|
96
|
+
p['logic'] = @optional['logic'] if @optional.include? 'logic'
|
97
|
+
p['expertSettings'] = @optional['expertSettings'] if @optional.include? 'expertSettings'
|
98
|
+
p['returnAbGroup'] = @optional['returnAbGroup'] if @optional.include? 'returnAbGroup'
|
99
|
+
p
|
100
|
+
end
|
101
|
+
|
102
|
+
# Values of query parameters as a Hash.
|
103
|
+
# name of parameter => value of the parameter
|
104
|
+
def query_parameters
|
105
|
+
params = {}
|
106
|
+
params
|
107
|
+
end
|
108
|
+
|
109
|
+
# Relative path to the endpoint
|
110
|
+
def path
|
111
|
+
"/{databaseId}/search/users/#{@user_id}/item-segments/"
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
@@ -11,16 +11,16 @@ module RecombeeApiClient
|
|
11
11
|
#
|
12
12
|
#All the string and set item properties are indexed by the search engine.
|
13
13
|
#
|
14
|
-
#This endpoint should be used in a search box
|
14
|
+
#This endpoint should be used in a search box on your website/app. It can be called multiple times as the user is typing the query in order to get the most viable suggestions based on the current state of the query, or once after submitting the whole query.
|
15
15
|
#
|
16
|
-
#The returned items are sorted by relevance (first item being the most relevant).
|
16
|
+
#The returned items are sorted by relevance (the first item being the most relevant).
|
17
17
|
#
|
18
18
|
#Besides the recommended items, also a unique `recommId` is returned in the response. It can be used to:
|
19
19
|
#
|
20
|
-
#- Let Recombee know that this search was successful (e.g
|
20
|
+
#- Let Recombee know that this search was successful (e.g., user clicked one of the recommended items). See [Reported metrics](https://docs.recombee.com/admin_ui.html#reported-metrics).
|
21
21
|
#- Get subsequent search results when the user scrolls down or goes to the next page. See [Recommend Next Items](https://docs.recombee.com/api.html#recommend-next-items).
|
22
22
|
#
|
23
|
-
#It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters.
|
23
|
+
#It is also possible to use POST HTTP method (for example in the case of a very long ReQL filter) - query parameters then become body parameters.
|
24
24
|
#
|
25
25
|
class SearchItems < ApiRequest
|
26
26
|
attr_reader :user_id, :search_query, :count, :scenario, :cascade_create, :return_properties, :included_properties, :filter, :booster, :logic, :expert_settings, :return_ab_group
|
@@ -36,12 +36,12 @@ module RecombeeApiClient
|
|
36
36
|
# * *Optional arguments (given as hash optional)*
|
37
37
|
# - +scenario+ -> Scenario defines a particular search field in your user interface.
|
38
38
|
#
|
39
|
-
#You can set various settings to the [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com). You can also see performance of each scenario in the Admin UI separately, so you can check how well each field performs.
|
39
|
+
#You can set various settings to the [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com). You can also see the performance of each scenario in the Admin UI separately, so you can check how well each field performs.
|
40
40
|
#
|
41
|
-
#The AI
|
41
|
+
#The AI that optimizes models to get the best results may optimize different scenarios separately, or even use different models in each of the scenarios.
|
42
42
|
#
|
43
|
-
# - +cascadeCreate+ -> If the user does not exist in the database, returns a list of non-personalized search results and creates the user in the database. This allows for example rotations in the following recommendations for that user, as the user will be already known to the system.
|
44
|
-
# - +returnProperties+ -> With `returnProperties=true`, property values of the recommended items are returned along with their IDs in a JSON dictionary. The acquired property values can be used
|
43
|
+
# - +cascadeCreate+ -> If the user does not exist in the database, returns a list of non-personalized search results and creates the user in the database. This allows, for example, rotations in the following recommendations for that user, as the user will be already known to the system.
|
44
|
+
# - +returnProperties+ -> With `returnProperties=true`, property values of the recommended items are returned along with their IDs in a JSON dictionary. The acquired property values can be used to easily display the recommended items to the user.
|
45
45
|
#
|
46
46
|
#Example response:
|
47
47
|
#```
|
@@ -72,7 +72,7 @@ module RecombeeApiClient
|
|
72
72
|
# }
|
73
73
|
#```
|
74
74
|
#
|
75
|
-
# - +includedProperties+ -> Allows
|
75
|
+
# - +includedProperties+ -> Allows specifying which properties should be returned when `returnProperties=true` is set. The properties are given as a comma-separated list.
|
76
76
|
#
|
77
77
|
#Example response for `includedProperties=description,price`:
|
78
78
|
#```
|
@@ -99,24 +99,24 @@ module RecombeeApiClient
|
|
99
99
|
# }
|
100
100
|
#```
|
101
101
|
#
|
102
|
-
# - +filter+ -> Boolean-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to filter recommended items based on the values of their attributes.
|
102
|
+
# - +filter+ -> Boolean-returning [ReQL](https://docs.recombee.com/reql.html) expression, which allows you to filter recommended items based on the values of their attributes.
|
103
103
|
#
|
104
|
-
#Filters can be
|
104
|
+
#Filters can also be assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
|
105
105
|
#
|
106
|
-
# - +booster+ -> Number-returning [ReQL](https://docs.recombee.com/reql.html) expression which allows you to boost recommendation rate of some items based on the values of their attributes.
|
106
|
+
# - +booster+ -> Number-returning [ReQL](https://docs.recombee.com/reql.html) expression, which allows you to boost the recommendation rate of some items based on the values of their attributes.
|
107
107
|
#
|
108
|
-
#Boosters can be
|
108
|
+
#Boosters can also be assigned to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
|
109
109
|
#
|
110
|
-
# - +logic+ -> Logic specifies particular behavior of the recommendation models. You can pick tailored logic for your domain and use case.
|
111
|
-
#See [this section](https://docs.recombee.com/recommendation_logics.html) for list of available logics and other details.
|
110
|
+
# - +logic+ -> Logic specifies the particular behavior of the recommendation models. You can pick tailored logic for your domain and use case.
|
111
|
+
#See [this section](https://docs.recombee.com/recommendation_logics.html) for a list of available logics and other details.
|
112
112
|
#
|
113
113
|
#The difference between `logic` and `scenario` is that `logic` specifies mainly behavior, while `scenario` specifies the place where recommendations are shown to the users.
|
114
114
|
#
|
115
|
-
#Logic can be
|
115
|
+
#Logic can also be set to a [scenario](https://docs.recombee.com/scenarios.html) in the [Admin UI](https://admin.recombee.com).
|
116
116
|
#
|
117
117
|
# - +expertSettings+ -> Dictionary of custom options.
|
118
118
|
#
|
119
|
-
# - +returnAbGroup+ -> If there is a custom AB-testing running, return name of group to which the request belongs.
|
119
|
+
# - +returnAbGroup+ -> If there is a custom AB-testing running, return the name of the group to which the request belongs.
|
120
120
|
#
|
121
121
|
#
|
122
122
|
def initialize(user_id, search_query, count, optional = {})
|
@@ -8,7 +8,7 @@ module RecombeeApiClient
|
|
8
8
|
|
9
9
|
##
|
10
10
|
#Sets viewed portion of an item (for example a video or article) by a user (at a session).
|
11
|
-
#If you send new request with the same (`userId`, `itemId`, `sessionId`), the portion gets updated.
|
11
|
+
#If you send a new request with the same (`userId`, `itemId`, `sessionId`), the portion gets updated.
|
12
12
|
#
|
13
13
|
class SetViewPortion < ApiRequest
|
14
14
|
attr_reader :user_id, :item_id, :portion, :session_id, :timestamp, :cascade_create, :recomm_id, :additional_data
|
@@ -19,10 +19,10 @@ module RecombeeApiClient
|
|
19
19
|
# * *Required arguments*
|
20
20
|
# - +user_id+ -> User who viewed a portion of the item
|
21
21
|
# - +item_id+ -> Viewed item
|
22
|
-
# - +portion+ -> Viewed portion of the item (number between 0.0 (viewed nothing) and 1.0 (viewed full item) ). It should be the
|
22
|
+
# - +portion+ -> Viewed portion of the item (number between 0.0 (viewed nothing) and 1.0 (viewed full item) ). It should be the actual viewed part of the item, no matter the seeking. For example, if the user seeked immediately to half of the item and then viewed 10% of the item, the `portion` should still be `0.1`.
|
23
23
|
#
|
24
24
|
# * *Optional arguments (given as hash optional)*
|
25
|
-
# - +sessionId+ -> ID of session in which the user viewed the item. Default is `null` (`None`, `nil`, `NULL` etc
|
25
|
+
# - +sessionId+ -> ID of the session in which the user viewed the item. Default is `null` (`None`, `nil`, `NULL` etc., depending on the language).
|
26
26
|
# - +timestamp+ -> UTC timestamp of the rating as ISO8601-1 pattern or UTC epoch time. The default value is the current time.
|
27
27
|
# - +cascadeCreate+ -> Sets whether the given user/item should be created if not present in the database.
|
28
28
|
# - +recommId+ -> If this view portion is based on a recommendation request, `recommId` is the id of the clicked recommendation.
|
@@ -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
|
+
#Update an existing Segmentation.
|
11
|
+
#
|
12
|
+
class UpdateAutoReqlSegmentation < ApiRequest
|
13
|
+
attr_reader :segmentation_id, :expression, :title, :description
|
14
|
+
attr_accessor :timeout
|
15
|
+
attr_accessor :ensure_https
|
16
|
+
|
17
|
+
##
|
18
|
+
# * *Required arguments*
|
19
|
+
# - +segmentation_id+ -> ID of the updated Segmentation
|
20
|
+
#
|
21
|
+
# * *Optional arguments (given as hash optional)*
|
22
|
+
# - +expression+ -> ReQL expression that returns for each item a set with IDs of segments to which the item belongs
|
23
|
+
#
|
24
|
+
# - +title+ -> Human-readable name that is shown in the Recombee Admin UI.
|
25
|
+
#
|
26
|
+
# - +description+ -> Description that is shown in the Recombee Admin UI.
|
27
|
+
#
|
28
|
+
#
|
29
|
+
def initialize(segmentation_id, optional = {})
|
30
|
+
@segmentation_id = segmentation_id
|
31
|
+
optional = normalize_optional(optional)
|
32
|
+
@expression = optional['expression']
|
33
|
+
@title = optional['title']
|
34
|
+
@description = optional['description']
|
35
|
+
@optional = optional
|
36
|
+
@timeout = 10000
|
37
|
+
@ensure_https = false
|
38
|
+
@optional.each do |par, _|
|
39
|
+
fail UnknownOptionalParameter.new(par) unless ["expression","title","description"].include? par
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
# HTTP method
|
44
|
+
def method
|
45
|
+
:post
|
46
|
+
end
|
47
|
+
|
48
|
+
# Values of body parameters as a Hash
|
49
|
+
def body_parameters
|
50
|
+
p = Hash.new
|
51
|
+
p['expression'] = @optional['expression'] if @optional.include? 'expression'
|
52
|
+
p['title'] = @optional['title'] if @optional.include? 'title'
|
53
|
+
p['description'] = @optional['description'] if @optional.include? 'description'
|
54
|
+
p
|
55
|
+
end
|
56
|
+
|
57
|
+
# Values of query parameters as a Hash.
|
58
|
+
# name of parameter => value of the parameter
|
59
|
+
def query_parameters
|
60
|
+
params = {}
|
61
|
+
params
|
62
|
+
end
|
63
|
+
|
64
|
+
# Relative path to the endpoint
|
65
|
+
def path
|
66
|
+
"/{databaseId}/segmentations/auto-reql/#{@segmentation_id}"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,67 @@
|
|
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
|
+
#Update definition of the Segment.
|
11
|
+
#
|
12
|
+
class UpdateManualReqlSegment < ApiRequest
|
13
|
+
attr_reader :segmentation_id, :segment_id, :filter, :title
|
14
|
+
attr_accessor :timeout
|
15
|
+
attr_accessor :ensure_https
|
16
|
+
|
17
|
+
##
|
18
|
+
# * *Required arguments*
|
19
|
+
# - +segmentation_id+ -> ID of the Segmentation to which the updated Segment belongs
|
20
|
+
# - +segment_id+ -> ID of the Segment that will be updated
|
21
|
+
# - +filter+ -> ReQL filter that returns `true` for items that belong to this Segment. Otherwise returns `false`.
|
22
|
+
#
|
23
|
+
#
|
24
|
+
# * *Optional arguments (given as hash optional)*
|
25
|
+
# - +title+ -> Human-readable name of the Segment that is shown in the Recombee Admin UI.
|
26
|
+
#
|
27
|
+
#
|
28
|
+
def initialize(segmentation_id, segment_id, filter, optional = {})
|
29
|
+
@segmentation_id = segmentation_id
|
30
|
+
@segment_id = segment_id
|
31
|
+
@filter = filter
|
32
|
+
optional = normalize_optional(optional)
|
33
|
+
@title = optional['title']
|
34
|
+
@optional = optional
|
35
|
+
@timeout = 10000
|
36
|
+
@ensure_https = false
|
37
|
+
@optional.each do |par, _|
|
38
|
+
fail UnknownOptionalParameter.new(par) unless ["title"].include? par
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# HTTP method
|
43
|
+
def method
|
44
|
+
:post
|
45
|
+
end
|
46
|
+
|
47
|
+
# Values of body parameters as a Hash
|
48
|
+
def body_parameters
|
49
|
+
p = Hash.new
|
50
|
+
p['filter'] = @filter
|
51
|
+
p['title'] = @optional['title'] if @optional.include? 'title'
|
52
|
+
p
|
53
|
+
end
|
54
|
+
|
55
|
+
# Values of query parameters as a Hash.
|
56
|
+
# name of parameter => value of the parameter
|
57
|
+
def query_parameters
|
58
|
+
params = {}
|
59
|
+
params
|
60
|
+
end
|
61
|
+
|
62
|
+
# Relative path to the endpoint
|
63
|
+
def path
|
64
|
+
"/{databaseId}/segmentations/manual-reql/#{@segmentation_id}/segments/#{@segment_id}"
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,65 @@
|
|
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
|
+
#Update an existing Segmentation.
|
11
|
+
#
|
12
|
+
class UpdateManualReqlSegmentation < ApiRequest
|
13
|
+
attr_reader :segmentation_id, :title, :description
|
14
|
+
attr_accessor :timeout
|
15
|
+
attr_accessor :ensure_https
|
16
|
+
|
17
|
+
##
|
18
|
+
# * *Required arguments*
|
19
|
+
# - +segmentation_id+ -> ID of the updated Segmentation
|
20
|
+
#
|
21
|
+
# * *Optional arguments (given as hash optional)*
|
22
|
+
# - +title+ -> Human-readable name that is shown in the Recombee Admin UI.
|
23
|
+
#
|
24
|
+
# - +description+ -> Description that is shown in the Recombee Admin UI.
|
25
|
+
#
|
26
|
+
#
|
27
|
+
def initialize(segmentation_id, optional = {})
|
28
|
+
@segmentation_id = segmentation_id
|
29
|
+
optional = normalize_optional(optional)
|
30
|
+
@title = optional['title']
|
31
|
+
@description = optional['description']
|
32
|
+
@optional = optional
|
33
|
+
@timeout = 10000
|
34
|
+
@ensure_https = false
|
35
|
+
@optional.each do |par, _|
|
36
|
+
fail UnknownOptionalParameter.new(par) unless ["title","description"].include? par
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
# HTTP method
|
41
|
+
def method
|
42
|
+
:post
|
43
|
+
end
|
44
|
+
|
45
|
+
# Values of body parameters as a Hash
|
46
|
+
def body_parameters
|
47
|
+
p = Hash.new
|
48
|
+
p['title'] = @optional['title'] if @optional.include? 'title'
|
49
|
+
p['description'] = @optional['description'] if @optional.include? 'description'
|
50
|
+
p
|
51
|
+
end
|
52
|
+
|
53
|
+
# Values of query parameters as a Hash.
|
54
|
+
# name of parameter => value of the parameter
|
55
|
+
def query_parameters
|
56
|
+
params = {}
|
57
|
+
params
|
58
|
+
end
|
59
|
+
|
60
|
+
# Relative path to the endpoint
|
61
|
+
def path
|
62
|
+
"/{databaseId}/segmentations/manual-reql/#{@segmentation_id}"
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -7,7 +7,7 @@ module RecombeeApiClient
|
|
7
7
|
require_relative '../errors'
|
8
8
|
|
9
9
|
##
|
10
|
-
#
|
10
|
+
#Updates (some) property values of all the items that pass the filter.
|
11
11
|
#
|
12
12
|
#Example: *Setting all the items that are older than a week as unavailable*
|
13
13
|
#
|
@@ -25,8 +25,8 @@ module RecombeeApiClient
|
|
25
25
|
|
26
26
|
##
|
27
27
|
# * *Required arguments*
|
28
|
-
# - +filter+ -> A [ReQL](https://docs.recombee.com/reql.html) expression, which
|
29
|
-
# - +changes+ -> A dictionary where the keys are properties
|
28
|
+
# - +filter+ -> A [ReQL](https://docs.recombee.com/reql.html) expression, which returns `true` for the items that shall be updated.
|
29
|
+
# - +changes+ -> A dictionary where the keys are properties that shall be updated.
|
30
30
|
#
|
31
31
|
def initialize(filter, changes)
|
32
32
|
@filter = filter
|
@@ -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
|
+
#Updates a Property Based Segmentation
|
11
|
+
#
|
12
|
+
class UpdatePropertyBasedSegmentation < ApiRequest
|
13
|
+
attr_reader :segmentation_id, :property_name, :title, :description
|
14
|
+
attr_accessor :timeout
|
15
|
+
attr_accessor :ensure_https
|
16
|
+
|
17
|
+
##
|
18
|
+
# * *Required arguments*
|
19
|
+
# - +segmentation_id+ -> ID of the updated Segmentation
|
20
|
+
#
|
21
|
+
# * *Optional arguments (given as hash optional)*
|
22
|
+
# - +propertyName+ -> Name of the property on which the Segmentation should be based
|
23
|
+
#
|
24
|
+
# - +title+ -> Human-readable name that is shown in the Recombee Admin UI.
|
25
|
+
#
|
26
|
+
# - +description+ -> Description that is shown in the Recombee Admin UI.
|
27
|
+
#
|
28
|
+
#
|
29
|
+
def initialize(segmentation_id, optional = {})
|
30
|
+
@segmentation_id = segmentation_id
|
31
|
+
optional = normalize_optional(optional)
|
32
|
+
@property_name = optional['propertyName']
|
33
|
+
@title = optional['title']
|
34
|
+
@description = optional['description']
|
35
|
+
@optional = optional
|
36
|
+
@timeout = 10000
|
37
|
+
@ensure_https = false
|
38
|
+
@optional.each do |par, _|
|
39
|
+
fail UnknownOptionalParameter.new(par) unless ["propertyName","title","description"].include? par
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
# HTTP method
|
44
|
+
def method
|
45
|
+
:post
|
46
|
+
end
|
47
|
+
|
48
|
+
# Values of body parameters as a Hash
|
49
|
+
def body_parameters
|
50
|
+
p = Hash.new
|
51
|
+
p['propertyName'] = @optional['propertyName'] if @optional.include? 'propertyName'
|
52
|
+
p['title'] = @optional['title'] if @optional.include? 'title'
|
53
|
+
p['description'] = @optional['description'] if @optional.include? 'description'
|
54
|
+
p
|
55
|
+
end
|
56
|
+
|
57
|
+
# Values of query parameters as a Hash.
|
58
|
+
# name of parameter => value of the parameter
|
59
|
+
def query_parameters
|
60
|
+
params = {}
|
61
|
+
params
|
62
|
+
end
|
63
|
+
|
64
|
+
# Relative path to the endpoint
|
65
|
+
def path
|
66
|
+
"/{databaseId}/segmentations/property-based/#{@segmentation_id}"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
data/lib/recombee_api_client.rb
CHANGED
@@ -18,7 +18,7 @@ module RecombeeApiClient
|
|
18
18
|
include HTTParty
|
19
19
|
|
20
20
|
BATCH_MAX_SIZE = 10000
|
21
|
-
USER_AGENT = {'User-Agent' => 'recombee-ruby-api-client/4.
|
21
|
+
USER_AGENT = {'User-Agent' => 'recombee-ruby-api-client/4.1.0'}
|
22
22
|
|
23
23
|
##
|
24
24
|
# - +account+ -> Name of your account at Recombee
|