recombee_api_client 2.0.1 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -3
- data/lib/recombee_api_client/api/add_item_property.rb +1 -1
- data/lib/recombee_api_client/api/delete_view_portion.rb +0 -2
- data/lib/recombee_api_client/api/list_item_view_portions.rb +0 -2
- data/lib/recombee_api_client/api/list_user_view_portions.rb +0 -2
- data/lib/recombee_api_client/api/set_view_portion.rb +1 -3
- data/lib/recombee_api_client/version.rb +1 -1
- data/lib/recombee_api_client.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67a55a5aad6cdef70d224b317e7487b91df21ebd
|
4
|
+
data.tar.gz: 1178066744ec92b39a3660e854ce709b4d431be6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a06bfcbbb78f7b94231f542673be408222d25bd8eb1f22de6ccfedb9d1ce43cd7912621268d8799700221fe3bb3868db41f67157cfa0d79437a37800c46cc08
|
7
|
+
data.tar.gz: d4ccb9bd5fd18ad5279b09380fc447220e517b60783eace5e78c42df031c7b5a926820c1e9304fd4d2751f345b75b790393a0ecc5eb0f1b14a8095e5dc096656
|
data/README.md
CHANGED
@@ -75,16 +75,19 @@ client = RecombeeClient('--my-database-id--', '--my-secret-token--')
|
|
75
75
|
client.send(ResetDatabase.new) # Clear everything from the database
|
76
76
|
|
77
77
|
# We will use computers as items in this example
|
78
|
-
# Computers have
|
78
|
+
# Computers have five properties
|
79
79
|
# - price (floating point number)
|
80
80
|
# - number of processor cores (integer number)
|
81
81
|
# - description (string)
|
82
|
+
# - date from which it is in stock (timestamp)
|
83
|
+
# - image (url of computer's photo)
|
82
84
|
|
83
85
|
# Add properties of items
|
84
86
|
client.send(AddItemProperty.new('price', 'double'))
|
85
87
|
client.send(AddItemProperty.new('num-cores', 'int'))
|
86
88
|
client.send(AddItemProperty.new('description', 'string'))
|
87
|
-
client.send(AddItemProperty.new('
|
89
|
+
client.send(AddItemProperty.new('in_stock_from', 'timestamp'))
|
90
|
+
client.send(AddItemProperty.new('image', 'image'))
|
88
91
|
|
89
92
|
# Prepare requests for setting a catalog of computers
|
90
93
|
requests = (1..NUM).map do |i|
|
@@ -95,7 +98,8 @@ requests = (1..NUM).map do |i|
|
|
95
98
|
'price' => rand(15000.0 .. 25000.0),
|
96
99
|
'num-cores' => rand(1..8),
|
97
100
|
'description' => 'Great computer',
|
98
|
-
'
|
101
|
+
'in_stock_from' => DateTime.now,
|
102
|
+
'image' => "http://examplesite.com/products/computer-#{i}.jpg"
|
99
103
|
},
|
100
104
|
#optional parameters:
|
101
105
|
{
|
@@ -18,7 +18,7 @@ module RecombeeApiClient
|
|
18
18
|
# * *Required arguments*
|
19
19
|
# - +property_name+ -> Name of the item property to be created. Currently, the following names are reserved:`id`, `itemid`, case insensitively. Also, the length of the property name must not exceed 63 characters.
|
20
20
|
#
|
21
|
-
# - +type+ -> Value type of the item property to be created. One of: `int`, `double`, `string`, `boolean`, `timestamp`, `set`
|
21
|
+
# - +type+ -> Value type of the item property to be created. One of: `int`, `double`, `string`, `boolean`, `timestamp`, `set`, `image` or `imageList`.
|
22
22
|
#
|
23
23
|
#
|
24
24
|
def initialize(property_name, type)
|
@@ -7,8 +7,6 @@ module RecombeeApiClient
|
|
7
7
|
require_relative '../errors'
|
8
8
|
|
9
9
|
##
|
10
|
-
#The view portions feature is currently experimental.
|
11
|
-
#
|
12
10
|
#Deletes an existing view portion specified by (`userId`, `itemId`, `sessionId`) from the database.
|
13
11
|
#
|
14
12
|
class DeleteViewPortion < ApiRequest
|
@@ -7,8 +7,6 @@ module RecombeeApiClient
|
|
7
7
|
require_relative '../errors'
|
8
8
|
|
9
9
|
##
|
10
|
-
#The view portions feature is currently experimental.
|
11
|
-
#
|
12
10
|
#Sets viewed portion of an item (for example a video or article) by a user (at a session).
|
13
11
|
#If you send new request with the same (`userId`, `itemId`, `sessionId`), the portion gets updated.
|
14
12
|
#
|
@@ -24,7 +22,7 @@ module RecombeeApiClient
|
|
24
22
|
# - +portion+ -> Viewed portion of the item (number between 0.0 (viewed nothing) and 1.0 (viewed full item) ). It should be the really viewed part of the item, no matter seeking, so 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`.
|
25
23
|
#
|
26
24
|
# * *Optional arguments (given as hash optional)*
|
27
|
-
# - +sessionId+ -> ID of session in which the user viewed the item. Default is `
|
25
|
+
# - +sessionId+ -> ID of session in which the user viewed the item. Default is `null` (`None`, `nil`, `NULL` etc. depending on language).
|
28
26
|
# - +timestamp+ -> UTC timestamp of the rating as ISO8601-1 pattern or UTC epoch time. The default value is the current time.
|
29
27
|
# - +cascadeCreate+ -> Sets whether the given user/item should be created if not present in the database.
|
30
28
|
#
|
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/2.0
|
21
|
+
USER_AGENT = {'User-Agent' => 'recombee-ruby-api-client/2.1.0'}
|
22
22
|
|
23
23
|
##
|
24
24
|
# - +account+ -> Name of your account at Recombee
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recombee_api_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ondřej Fiedler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|