Skip to content

Commit a2e338a

Browse files
committed
Release: v6.0.0
- Added support for the new Composite Recommendation endpoint - Added new parameter `autoPresented` for Detail View and View Portion interactions - Added new parameter `timeSpent` for View Portion interactions - Added support for `reqlExpressions` on recommended items
1 parent 50c3946 commit a2e338a

180 files changed

Lines changed: 970 additions & 218 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Documentation of the API can be found at [docs.recombee.com](https://docs.recomb
1010

1111
Run the following command in your Go project:
1212
```
13-
go get github.com/recombee/go-api-client/v5@v5.1.0
13+
go get github.com/recombee/go-api-client/v6@v6.0.0
1414
```
1515

1616
## Examples
@@ -29,8 +29,8 @@ import (
2929
"math/rand"
3030
"os"
3131

32-
"github.com/recombee/go-api-client/v5/recombee"
33-
"github.com/recombee/go-api-client/v5/recombee/requests"
32+
"github.com/recombee/go-api-client/v6/recombee"
33+
"github.com/recombee/go-api-client/v6/recombee/requests"
3434
)
3535

3636
func main() {
@@ -111,8 +111,8 @@ package main
111111
import (
112112
"context"
113113
"fmt"
114-
"github.com/recombee/go-api-client/v5/recombee"
115-
"github.com/recombee/go-api-client/v5/recombee/requests"
114+
"github.com/recombee/go-api-client/v6/recombee"
115+
"github.com/recombee/go-api-client/v6/recombee/requests"
116116
"math/rand"
117117
"os"
118118
"time"

examples/batch/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ package main
33
import (
44
"context"
55
"fmt"
6-
"github.com/recombee/go-api-client/v5/recombee"
7-
"github.com/recombee/go-api-client/v5/recombee/bindings"
8-
"github.com/recombee/go-api-client/v5/recombee/requests"
6+
"github.com/recombee/go-api-client/v6/recombee"
7+
"github.com/recombee/go-api-client/v6/recombee/bindings"
8+
"github.com/recombee/go-api-client/v6/recombee/requests"
99
"os"
1010
)
1111

examples/interactions_and_recomms/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"math/rand"
66
"os"
77

8-
"github.com/recombee/go-api-client/v5/recombee"
9-
"github.com/recombee/go-api-client/v5/recombee/requests"
8+
"github.com/recombee/go-api-client/v6/recombee"
9+
"github.com/recombee/go-api-client/v6/recombee/requests"
1010
)
1111

1212
func main() {

examples/item_catalog_and_search/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package main
33
import (
44
"context"
55
"fmt"
6-
"github.com/recombee/go-api-client/v5/recombee"
7-
"github.com/recombee/go-api-client/v5/recombee/requests"
6+
"github.com/recombee/go-api-client/v6/recombee"
7+
"github.com/recombee/go-api-client/v6/recombee/requests"
88
"math/rand"
99
"os"
1010
"time"

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module github.com/recombee/go-api-client/v5
1+
module github.com/recombee/go-api-client/v6
22

33
go 1.18
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// This file is auto-generated
2+
3+
package bindings
4+
5+
// CompositeRecommendationResponse Binding
6+
type CompositeRecommendationResponse struct {
7+
// Id of the composite recommendation request
8+
RecommId string `json:"recommId,omitempty"`
9+
// Parameters of the source stage
10+
Source Recommendation `json:"source,omitempty"`
11+
// Obtained recommendations
12+
Recomms []Recommendation `json:"recomms,omitempty"`
13+
// How many times *Recommend Next Items* have been called for this `recommId`
14+
NumberNextRecommsCalls *int `json:"numberNextRecommsCalls,omitempty"`
15+
}
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
// This file is auto-generated
2+
3+
package bindings
4+
5+
// CompositeRecommendationStageParameters Binding
6+
type CompositeRecommendationStageParameters struct {
7+
// 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.
8+
// Example response with `returnProperties` set in the `resultSettings`:
9+
// ```json
10+
// {
11+
// "recommId": "ee94fa8b-efe7-4b35-abc6-2bc3456d66ed",
12+
// "source": {
13+
// "id": "category-sport"
14+
// },
15+
// "recomms": [
16+
// {
17+
// "id": "article-1024",
18+
// "values": {
19+
// "title": "Champions League: Stunning Comeback Secures Final Spot",
20+
// "categories": ["Sport", "Football"],
21+
// "author": "Jane Smith",
22+
// "url": "newsportal.com/articles/champions-league-comeback"
23+
// }
24+
// },
25+
// {
26+
// "id": "article-2031",
27+
// "values": {
28+
// "title": "Top 10 Moments from the Summer Olympics",
29+
// "categories": ["Sport", "Olympics"],
30+
// "author": "Mark Johnson",
31+
// "url": "newsportal.com/articles/olympic-top-moments"
32+
// }
33+
// },
34+
// {
35+
// "id": "article-3042",
36+
// "values": {
37+
// "title": "Rising Stars in Women's Tennis to Watch This Season",
38+
// "categories": ["Sport", "Tennis"],
39+
// "author": "Laura Chen",
40+
// "url": "newsportal.com/articles/womens-tennis-stars"
41+
// }
42+
// }
43+
// ],
44+
// "numberNextRecommsCalls": 0
45+
// }
46+
// ```
47+
ReturnProperties *bool `json:"returnProperties,omitempty"`
48+
// Allows specifying which properties should be returned when `returnProperties=true` is set. The properties are given as a comma-separated list.
49+
// Example response for `returnProperties=true` and `includedProperties=title,url` set in `resultSettings`:
50+
// ```json
51+
// {
52+
// "recommId": "ee94fa8b-efe7-4b35-abc6-2bc3456d66ed",
53+
// "source": {
54+
// "id": "category-sport"
55+
// },
56+
// "recomms": [
57+
// {
58+
// "id": "article-1024",
59+
// "values": {
60+
// "title": "Champions League: Stunning Comeback Secures Final Spot",
61+
// "url": "newsportal.com/articles/champions-league-comeback"
62+
// }
63+
// },
64+
// {
65+
// "id": "article-2031",
66+
// "values": {
67+
// "title": "Top 10 Moments from the Summer Olympics",
68+
// "url": "newsportal.com/articles/olympic-top-moments"
69+
// }
70+
// },
71+
// {
72+
// "id": "article-3042",
73+
// "values": {
74+
// "title": "Rising Stars in Women's Tennis to Watch This Season",
75+
// "url": "newsportal.com/articles/womens-tennis-stars"
76+
// }
77+
// }
78+
// ],
79+
// "numberNextRecommsCalls": 0
80+
// }
81+
// ```
82+
IncludedProperties *[]string `json:"includedProperties,omitempty"`
83+
// Boolean-returning [ReQL](https://docs.recombee.com/reql) expression, which allows you to filter recommended entities based on the values of their attributes.
84+
// Filters can also be assigned to a [scenario](https://docs.recombee.com/scenarios) in the [Admin UI](https://admin.recombee.com).
85+
Filter *string `json:"filter,omitempty"`
86+
// Number-returning [ReQL](https://docs.recombee.com/reql) expression, which allows you to boost the recommendation rate of some entities based on the values of their attributes.
87+
// Boosters can also be assigned to a [scenario](https://docs.recombee.com/scenarios) in the [Admin UI](https://admin.recombee.com).
88+
Booster *string `json:"booster,omitempty"`
89+
// Logic specifies the particular behavior of the recommendation models. You can pick tailored logic for your domain and use case.
90+
// See [this section](https://docs.recombee.com/recommendation_logics) for a list of available logics and other details.
91+
// The difference between `logic` and `scenario` is that `logic` specifies mainly behavior, while `scenario` specifies the place where recommendations are shown to the users.
92+
// Logic can also be set to a [scenario](https://docs.recombee.com/scenarios) in the [Admin UI](https://admin.recombee.com).
93+
Logic Logic `json:"logic,omitempty"`
94+
// Only usable if the stage corresponds to the one of these recommendation endpoints:
95+
// - [Recommend Items To User](https://docs.recombee.com/api#recommend-items-to-user)
96+
// - [Recommend Items To Item](https://docs.recombee.com/api#recommend-items-to-item)
97+
// - [Recommend Items to Item Segment](https://docs.recombee.com/api#recommend-items-to-item-segment)
98+
// - [Recommend Users to Item](https://docs.recombee.com/api#recommend-users-to-item)
99+
// - [Recommend Users To User](https://docs.recombee.com/api#recommend-users-to-user)
100+
// A dictionary of [ReQL](https://docs.recombee.com/reql) expressions that will be executed for each recommended item.
101+
// This can be used to compute additional properties of the recommended items that are not stored in the database.
102+
// The keys are the names of the expressions, and the values are the actual ReQL expressions.
103+
// Example request:
104+
// ```json
105+
// {
106+
// "reqlExpressions": {
107+
// "isInUsersCity": "context_user[\"city\"] in 'cities'",
108+
// "distanceToUser": "earth_distance('location', context_user[\"location\"])"
109+
// }
110+
// }
111+
// ```
112+
// Example response:
113+
// ```json
114+
// {
115+
// "recommId": "ce52ada4-e4d9-4885-943c-407db2dee837",
116+
// "source": {
117+
// "id": "restaurant-123",
118+
// "reqlEvaluations": {
119+
// "isInUsersCity": true,
120+
// "distanceToUser": 3450.5
121+
// }
122+
// },
123+
// "recomms":
124+
// [
125+
// {
126+
// "id": "restaurant-178",
127+
// "reqlEvaluations": {
128+
// "isInUsersCity": true,
129+
// "distanceToUser": 5200.2
130+
// }
131+
// },
132+
// {
133+
// "id": "bar-42",
134+
// "reqlEvaluations": {
135+
// "isInUsersCity": false,
136+
// "distanceToUser": 2516.0
137+
// }
138+
// }
139+
// ],
140+
// "numberNextRecommsCalls": 0
141+
// }
142+
// ```
143+
ReqlExpressions *map[string]string `json:"reqlExpressions,omitempty"`
144+
// **Expert option:** Only usable if the stage corresponds to the one of these recommendation endpoints:
145+
// - [Recommend Items To User](https://docs.recombee.com/api#recommend-items-to-user)
146+
// - [Recommend Items To Item](https://docs.recombee.com/api#recommend-items-to-item)
147+
// - [Recommend Items to Item Segment](https://docs.recombee.com/api#recommend-items-to-item-segment)
148+
// If the *userId* is provided: Specifies the threshold of how relevant must the recommended items be to the user.
149+
// Possible values one of: `"low"`, `"medium"`, `"high"`.
150+
// The default value is `"low"`, meaning that the system attempts to recommend a number of items equal to *count* at any cost. If there is not enough data (such as interactions or item properties), this may even lead to bestseller-based recommendations being appended to reach the full *count*.
151+
// This behavior may be suppressed by using `"medium"` or `"high"` values. In such case, the system only recommends items of at least the requested relevance and may return less than *count* items when there is not enough data to fulfill it.
152+
MinRelevance *string `json:"minRelevance,omitempty"`
153+
// **Expert option:** Only usable if the stage corresponds to the one of these recommendation endpoints:
154+
// - [Recommend Items To User](https://docs.recombee.com/api#recommend-items-to-user)
155+
// - [Recommend Items To Item](https://docs.recombee.com/api#recommend-items-to-item)
156+
// - [Recommend Items to Item Segment](https://docs.recombee.com/api#recommend-items-to-item-segment)
157+
// - [Recommend Users To User](https://docs.recombee.com/api#recommend-users-to-user)
158+
// If the *userId* is provided: 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.
159+
// You may penalize an item 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 items.
160+
RotationRate *float64 `json:"rotationRate,omitempty"`
161+
// **Expert option:** Only usable if the stage corresponds to the one of these recommendation endpoints:
162+
// - [Recommend Items To User](https://docs.recombee.com/api#recommend-items-to-user)
163+
// - [Recommend Items To Item](https://docs.recombee.com/api#recommend-items-to-item)
164+
// - [Recommend Items to Item Segment](https://docs.recombee.com/api#recommend-items-to-item-segment)
165+
// - [Recommend Users To User](https://docs.recombee.com/api#recommend-users-to-user)
166+
// If the *userId* is provided: Taking *rotationRate* into account, specifies how long it takes for an item to recover from the penalization. For example, `rotationTime=7200.0` means that items recommended less than 2 hours ago are penalized.
167+
RotationTime *float64 `json:"rotationTime,omitempty"`
168+
}

recombee/bindings/detail_view.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ type DetailView struct {
2222
RecommId *string `json:"recommId,omitempty"`
2323
// A dictionary of additional data for the interaction.
2424
AdditionalData *map[string]interface{} `json:"additionalData,omitempty"`
25+
// Indicates whether the item was automatically presented to the user (e.g., in a swiping feed) or explicitly requested by the user (e.g., by clicking on a link). Defaults to `false`.
26+
AutoPresented *bool `json:"autoPresented,omitempty"`
2527
}
2628

2729
// Support both ISO 8601 and epoch time

recombee/bindings/list_search_synonyms_response.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ package bindings
44

55
// ListSearchSynonymsResponse Binding
66
type ListSearchSynonymsResponse struct {
7-
// Defined search synonyms.
7+
// List of synonyms
88
Synonyms []SearchSynonym `json:"synonyms,omitempty"`
99
}

recombee/bindings/logic.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package bindings
55
// Logic Binding
66
type Logic struct {
77
// Name of the logic that should be used
8-
Name string `json:"name,omitempty"`
8+
Name *string `json:"name,omitempty"`
99
// Parameters passed to the logic
1010
Settings *map[string]interface{} `json:"settings,omitempty"`
1111
}

0 commit comments

Comments
 (0)