diff --git a/src/libs/Recombee/Generated/Recombee.IRecommendationsClient.CreateByDatabaseIdRecommsComposite.g.cs b/src/libs/Recombee/Generated/Recombee.IRecommendationsClient.CreateByDatabaseIdRecommsComposite.g.cs index 9df30f5..a816b14 100644 --- a/src/libs/Recombee/Generated/Recombee.IRecommendationsClient.CreateByDatabaseIdRecommsComposite.g.cs +++ b/src/libs/Recombee/Generated/Recombee.IRecommendationsClient.CreateByDatabaseIdRecommsComposite.g.cs @@ -6,7 +6,7 @@ public partial interface IRecommendationsClient { /// /// Composite Recommendation
- /// Composite Recommendation returns both a *source entity* (e.g., an Item or [Item Segment](https://docs.recombee.com/segmentations.html)) and a list of related recommendations in a single response.
+ /// 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.
/// 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>*.
/// See detailed **examples and configuration guidance** in the [Composite Scenarios documentation](https://docs.recombee.com/scenarios#composite-recommendations).
/// **Structure**
@@ -38,7 +38,7 @@ public partial interface IRecommendationsClient global::System.Threading.CancellationToken cancellationToken = default); /// /// Composite Recommendation
- /// Composite Recommendation returns both a *source entity* (e.g., an Item or [Item Segment](https://docs.recombee.com/segmentations.html)) and a list of related recommendations in a single response.
+ /// 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.
/// 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>*.
/// See detailed **examples and configuration guidance** in the [Composite Scenarios documentation](https://docs.recombee.com/scenarios#composite-recommendations).
/// **Structure**
@@ -76,6 +76,9 @@ public partial interface IRecommendationsClient /// /// ID of the segment from `contextSegmentationId` for which the recommendations are to be generated. /// + /// + /// Search query provided by the user. It is used for the full-text search. Only applicable if the *scenario* corresponds to a search scenario. + /// /// /// 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. /// @@ -99,6 +102,7 @@ public partial interface IRecommendationsClient string? userId = default, global::Recombee.Logic? logic = default, string? segmentId = default, + string? searchQuery = default, bool? cascadeCreate = default, object? sourceSettings = default, object? resultSettings = default, diff --git a/src/libs/Recombee/Generated/Recombee.IRecommendationsClient.CreateByDatabaseIdRecommsNextItemSegmentsByRecommId.g.cs b/src/libs/Recombee/Generated/Recombee.IRecommendationsClient.CreateByDatabaseIdRecommsNextItemSegmentsByRecommId.g.cs new file mode 100644 index 0000000..dd70060 --- /dev/null +++ b/src/libs/Recombee/Generated/Recombee.IRecommendationsClient.CreateByDatabaseIdRecommsNextItemSegmentsByRecommId.g.cs @@ -0,0 +1,65 @@ +#nullable enable + +namespace Recombee +{ + public partial interface IRecommendationsClient + { + /// + /// Recommend Next Item Segments
+ /// Returns [Item Segments](https://docs.recombee.com/segmentations) to be shown as the next recommendations when a user scrolls (e.g., within a carousel or feed of Item Segments such as brands, artists, topics, or categories).
+ /// The request requires the `recommId` of a base recommendation request and the number of Segments to return (`count`).
+ /// The base request can be one of:
+ /// - [Recommend Item Segments to Item](https://docs.recombee.com/api#recommend-item-segments-to-item)
+ /// - [Recommend Item Segments to User](https://docs.recombee.com/api#recommend-item-segments-to-user)
+ /// - [Recommend Item Segments to Item Segment](https://docs.recombee.com/api#recommend-item-segments-to-item-segment)
+ /// - [Search Item Segments](https://docs.recombee.com/api#search-item-segments)
+ /// All other parameters are inherited from the base request associated with the provided `recommId`.
+ /// This endpoint can be called multiple times for a single `recommId`. Each call returns different Item Segments that have not been recommended in previous calls.
+ /// The number of calls made so far is returned in the `numberNextRecommsCalls` field.
+ /// Requests can be made up to 30 minutes after the base request or the most recent Recommend Next Item Segments call.
+ /// For billing purposes, each call to this endpoint is counted as a separate recommendation request. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateByDatabaseIdRecommsNextItemSegmentsByRecommIdAsync( + string databaseId, + string recommId, + + global::Recombee.RecommendNextItemSegmentsParameters request, + global::Recombee.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Recommend Next Item Segments
+ /// Returns [Item Segments](https://docs.recombee.com/segmentations) to be shown as the next recommendations when a user scrolls (e.g., within a carousel or feed of Item Segments such as brands, artists, topics, or categories).
+ /// The request requires the `recommId` of a base recommendation request and the number of Segments to return (`count`).
+ /// The base request can be one of:
+ /// - [Recommend Item Segments to Item](https://docs.recombee.com/api#recommend-item-segments-to-item)
+ /// - [Recommend Item Segments to User](https://docs.recombee.com/api#recommend-item-segments-to-user)
+ /// - [Recommend Item Segments to Item Segment](https://docs.recombee.com/api#recommend-item-segments-to-item-segment)
+ /// - [Search Item Segments](https://docs.recombee.com/api#search-item-segments)
+ /// All other parameters are inherited from the base request associated with the provided `recommId`.
+ /// This endpoint can be called multiple times for a single `recommId`. Each call returns different Item Segments that have not been recommended in previous calls.
+ /// The number of calls made so far is returned in the `numberNextRecommsCalls` field.
+ /// Requests can be made up to 30 minutes after the base request or the most recent Recommend Next Item Segments call.
+ /// For billing purposes, each call to this endpoint is counted as a separate recommendation request. + ///
+ /// + /// + /// + /// Number of item segments to be recommended + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateByDatabaseIdRecommsNextItemSegmentsByRecommIdAsync( + string databaseId, + string recommId, + int count, + global::Recombee.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Recombee/Generated/Recombee.JsonSerializerContext.g.cs b/src/libs/Recombee/Generated/Recombee.JsonSerializerContext.g.cs index 583f9de..532c901 100644 --- a/src/libs/Recombee/Generated/Recombee.JsonSerializerContext.g.cs +++ b/src/libs/Recombee/Generated/Recombee.JsonSerializerContext.g.cs @@ -98,6 +98,7 @@ namespace Recombee [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Recombee.SearchItemsParameters))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Recombee.SearchItemSegmentsParameters))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Recombee.RecommendNextItemsParameters))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Recombee.RecommendNextItemSegmentsParameters))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Recombee.CreatePropertyBasedSegmentationParameters))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Recombee.UpdatePropertyBasedSegmentationParameters))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Recombee.CreateAutoReQLSegmentationParameters))] diff --git a/src/libs/Recombee/Generated/Recombee.JsonSerializerContextTypes.g.cs b/src/libs/Recombee/Generated/Recombee.JsonSerializerContextTypes.g.cs index 004270e..69e8056 100644 --- a/src/libs/Recombee/Generated/Recombee.JsonSerializerContextTypes.g.cs +++ b/src/libs/Recombee/Generated/Recombee.JsonSerializerContextTypes.g.cs @@ -196,163 +196,167 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Recombee.CreatePropertyBasedSegmentationParameters? Type42 { get; set; } + public global::Recombee.RecommendNextItemSegmentsParameters? Type42 { get; set; } /// /// /// - public global::Recombee.UpdatePropertyBasedSegmentationParameters? Type43 { get; set; } + public global::Recombee.CreatePropertyBasedSegmentationParameters? Type43 { get; set; } /// /// /// - public global::Recombee.CreateAutoReQLSegmentationParameters? Type44 { get; set; } + public global::Recombee.UpdatePropertyBasedSegmentationParameters? Type44 { get; set; } /// /// /// - public global::Recombee.UpdateAutoReQLSegmentationParameters? Type45 { get; set; } + public global::Recombee.CreateAutoReQLSegmentationParameters? Type45 { get; set; } /// /// /// - public global::Recombee.CreateManualReQLSegmentationParameters? Type46 { get; set; } + public global::Recombee.UpdateAutoReQLSegmentationParameters? Type46 { get; set; } /// /// /// - public global::Recombee.UpdateManualReQLSegmentationParameters? Type47 { get; set; } + public global::Recombee.CreateManualReQLSegmentationParameters? Type47 { get; set; } /// /// /// - public global::Recombee.ManualReQLSegmentParameters? Type48 { get; set; } + public global::Recombee.UpdateManualReQLSegmentationParameters? Type48 { get; set; } /// /// /// - public global::Recombee.SearchResponse? Type49 { get; set; } + public global::Recombee.ManualReQLSegmentParameters? Type49 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type50 { get; set; } + public global::Recombee.SearchResponse? Type50 { get; set; } /// /// /// - public global::Recombee.Recommendation? Type51 { get; set; } + public global::System.Collections.Generic.IList? Type51 { get; set; } /// /// /// - public global::Recombee.RecommendationResponse? Type52 { get; set; } + public global::Recombee.Recommendation? Type52 { get; set; } /// /// /// - public global::Recombee.CompositeRecommendationResponse? Type53 { get; set; } + public global::Recombee.RecommendationResponse? Type53 { get; set; } /// /// /// - public global::Recombee.Batch? Type54 { get; set; } + public global::Recombee.CompositeRecommendationResponse? Type54 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type55 { get; set; } + public global::Recombee.Batch? Type55 { get; set; } /// /// /// - public global::Recombee.Item? Type56 { get; set; } + public global::System.Collections.Generic.IList? Type56 { get; set; } /// /// /// - public global::Recombee.User? Type57 { get; set; } + public global::Recombee.Item? Type57 { get; set; } /// /// /// - public global::Recombee.Series? Type58 { get; set; } + public global::Recombee.User? Type58 { get; set; } /// /// /// - public global::Recombee.Group? Type59 { get; set; } + public global::Recombee.Series? Type59 { get; set; } /// /// /// - public global::Recombee.SearchSynonymParams? Type60 { get; set; } + public global::Recombee.Group? Type60 { get; set; } /// /// /// - public global::Recombee.SearchSynonym? Type61 { get; set; } + public global::Recombee.SearchSynonymParams? Type61 { get; set; } /// /// /// - public global::Recombee.ListSearchSynonymsResponse? Type62 { get; set; } + public global::Recombee.SearchSynonym? Type62 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type63 { get; set; } + public global::Recombee.ListSearchSynonymsResponse? Type63 { get; set; } /// /// /// - public global::Recombee.Scenario? Type64 { get; set; } + public global::System.Collections.Generic.IList? Type64 { get; set; } /// /// /// - public global::Recombee.Segmentation? Type65 { get; set; } + public global::Recombee.Scenario? Type65 { get; set; } /// /// /// - public global::Recombee.ListSegmentationsResponse? Type66 { get; set; } + public global::Recombee.Segmentation? Type66 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type67 { get; set; } + public global::Recombee.ListSegmentationsResponse? Type67 { get; set; } /// /// /// - public global::Recombee.PutItemsPropertiesType? Type68 { get; set; } + public global::System.Collections.Generic.IList? Type68 { get; set; } /// /// /// - public global::Recombee.PutUsersPropertiesType? Type69 { get; set; } + public global::Recombee.PutItemsPropertiesType? Type69 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type70 { get; set; } + public global::Recombee.PutUsersPropertiesType? Type70 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type71 { get; set; } + public global::System.Collections.Generic.IList? Type71 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type72 { get; set; } + public global::System.Collections.Generic.IList? Type72 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type73 { get; set; } + public global::System.Collections.Generic.IList? Type73 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type74 { get; set; } + public global::System.Collections.Generic.IList? Type74 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type75 { get; set; } + public global::System.Collections.Generic.IList? Type75 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type76 { get; set; } + public global::System.Collections.Generic.IList? Type76 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type77 { get; set; } + public global::System.Collections.Generic.IList? Type77 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type78 { get; set; } + public global::System.Collections.Generic.IList? Type78 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type79 { get; set; } + public global::System.Collections.Generic.IList? Type79 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type80 { get; set; } + public global::System.Collections.Generic.IList? Type80 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type81 { get; set; } + public global::System.Collections.Generic.IList? Type81 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type82 { get; set; } /// /// diff --git a/src/libs/Recombee/Generated/Recombee.Models.CompositeRecommendationParameters.g.cs b/src/libs/Recombee/Generated/Recombee.Models.CompositeRecommendationParameters.g.cs index 55d5765..63a64b4 100644 --- a/src/libs/Recombee/Generated/Recombee.Models.CompositeRecommendationParameters.g.cs +++ b/src/libs/Recombee/Generated/Recombee.Models.CompositeRecommendationParameters.g.cs @@ -48,6 +48,12 @@ public sealed partial class CompositeRecommendationParameters [global::System.Text.Json.Serialization.JsonPropertyName("segmentId")] public string? SegmentId { get; set; } + /// + /// Search query provided by the user. It is used for the full-text search. Only applicable if the *scenario* corresponds to a search scenario. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("searchQuery")] + public string? SearchQuery { get; set; } + /// /// 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. /// @@ -99,6 +105,9 @@ public sealed partial class CompositeRecommendationParameters /// /// ID of the segment from `contextSegmentationId` for which the recommendations are to be generated. /// + /// + /// Search query provided by the user. It is used for the full-text search. Only applicable if the *scenario* corresponds to a search scenario. + /// /// /// 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. /// @@ -121,6 +130,7 @@ public CompositeRecommendationParameters( string? userId, global::Recombee.Logic? logic, string? segmentId, + string? searchQuery, bool? cascadeCreate, object? sourceSettings, object? resultSettings, @@ -132,6 +142,7 @@ public CompositeRecommendationParameters( this.UserId = userId; this.Logic = logic; this.SegmentId = segmentId; + this.SearchQuery = searchQuery; this.CascadeCreate = cascadeCreate; this.SourceSettings = sourceSettings; this.ResultSettings = resultSettings; diff --git a/src/libs/Recombee/Generated/Recombee.Models.RecommendNextItemSegmentsParameters.Json.g.cs b/src/libs/Recombee/Generated/Recombee.Models.RecommendNextItemSegmentsParameters.Json.g.cs new file mode 100644 index 0000000..e9b9091 --- /dev/null +++ b/src/libs/Recombee/Generated/Recombee.Models.RecommendNextItemSegmentsParameters.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Recombee +{ + public sealed partial class RecommendNextItemSegmentsParameters + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Recombee.RecommendNextItemSegmentsParameters? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Recombee.RecommendNextItemSegmentsParameters), + jsonSerializerContext) as global::Recombee.RecommendNextItemSegmentsParameters; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Recombee.RecommendNextItemSegmentsParameters? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Recombee.RecommendNextItemSegmentsParameters), + jsonSerializerContext).ConfigureAwait(false)) as global::Recombee.RecommendNextItemSegmentsParameters; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Recombee/Generated/Recombee.Models.RecommendNextItemSegmentsParameters.g.cs b/src/libs/Recombee/Generated/Recombee.Models.RecommendNextItemSegmentsParameters.g.cs new file mode 100644 index 0000000..a1f83e7 --- /dev/null +++ b/src/libs/Recombee/Generated/Recombee.Models.RecommendNextItemSegmentsParameters.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace Recombee +{ + /// + /// + /// + public sealed partial class RecommendNextItemSegmentsParameters + { + /// + /// Number of item segments to be recommended + /// + [global::System.Text.Json.Serialization.JsonPropertyName("count")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Count { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Number of item segments to be recommended + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RecommendNextItemSegmentsParameters( + int count) + { + this.Count = count; + } + + /// + /// Initializes a new instance of the class. + /// + public RecommendNextItemSegmentsParameters() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Recombee/Generated/Recombee.RecommendationsClient.CreateByDatabaseIdRecommsComposite.g.cs b/src/libs/Recombee/Generated/Recombee.RecommendationsClient.CreateByDatabaseIdRecommsComposite.g.cs index 345668b..bb1ffc2 100644 --- a/src/libs/Recombee/Generated/Recombee.RecommendationsClient.CreateByDatabaseIdRecommsComposite.g.cs +++ b/src/libs/Recombee/Generated/Recombee.RecommendationsClient.CreateByDatabaseIdRecommsComposite.g.cs @@ -45,7 +45,7 @@ partial void ProcessCreateByDatabaseIdRecommsCompositeResponseContent( /// /// Composite Recommendation
- /// Composite Recommendation returns both a *source entity* (e.g., an Item or [Item Segment](https://docs.recombee.com/segmentations.html)) and a list of related recommendations in a single response.
+ /// 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.
/// 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>*.
/// See detailed **examples and configuration guidance** in the [Composite Scenarios documentation](https://docs.recombee.com/scenarios#composite-recommendations).
/// **Structure**
@@ -478,7 +478,7 @@ partial void ProcessCreateByDatabaseIdRecommsCompositeResponseContent( } /// /// Composite Recommendation
- /// Composite Recommendation returns both a *source entity* (e.g., an Item or [Item Segment](https://docs.recombee.com/segmentations.html)) and a list of related recommendations in a single response.
+ /// 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.
/// 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>*.
/// See detailed **examples and configuration guidance** in the [Composite Scenarios documentation](https://docs.recombee.com/scenarios#composite-recommendations).
/// **Structure**
@@ -516,6 +516,9 @@ partial void ProcessCreateByDatabaseIdRecommsCompositeResponseContent( /// /// ID of the segment from `contextSegmentationId` for which the recommendations are to be generated. /// + /// + /// Search query provided by the user. It is used for the full-text search. Only applicable if the *scenario* corresponds to a search scenario. + /// /// /// 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. /// @@ -539,6 +542,7 @@ partial void ProcessCreateByDatabaseIdRecommsCompositeResponseContent( string? userId = default, global::Recombee.Logic? logic = default, string? segmentId = default, + string? searchQuery = default, bool? cascadeCreate = default, object? sourceSettings = default, object? resultSettings = default, @@ -554,6 +558,7 @@ partial void ProcessCreateByDatabaseIdRecommsCompositeResponseContent( UserId = userId, Logic = logic, SegmentId = segmentId, + SearchQuery = searchQuery, CascadeCreate = cascadeCreate, SourceSettings = sourceSettings, ResultSettings = resultSettings, diff --git a/src/libs/Recombee/Generated/Recombee.RecommendationsClient.CreateByDatabaseIdRecommsNextItemSegmentsByRecommId.g.cs b/src/libs/Recombee/Generated/Recombee.RecommendationsClient.CreateByDatabaseIdRecommsNextItemSegmentsByRecommId.g.cs new file mode 100644 index 0000000..b35fd96 --- /dev/null +++ b/src/libs/Recombee/Generated/Recombee.RecommendationsClient.CreateByDatabaseIdRecommsNextItemSegmentsByRecommId.g.cs @@ -0,0 +1,522 @@ + +#nullable enable + +namespace Recombee +{ + public partial class RecommendationsClient + { + + + private static readonly global::Recombee.EndPointSecurityRequirement s_CreateByDatabaseIdRecommsNextItemSegmentsByRecommIdSecurityRequirement0 = + new global::Recombee.EndPointSecurityRequirement + { + Authorizations = new global::Recombee.EndPointAuthorizationRequirement[] + { new global::Recombee.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Recombee.EndPointSecurityRequirement[] s_CreateByDatabaseIdRecommsNextItemSegmentsByRecommIdSecurityRequirements = + new global::Recombee.EndPointSecurityRequirement[] + { s_CreateByDatabaseIdRecommsNextItemSegmentsByRecommIdSecurityRequirement0, + }; + partial void PrepareCreateByDatabaseIdRecommsNextItemSegmentsByRecommIdArguments( + global::System.Net.Http.HttpClient httpClient, + ref string databaseId, + ref string recommId, + global::Recombee.RecommendNextItemSegmentsParameters request); + partial void PrepareCreateByDatabaseIdRecommsNextItemSegmentsByRecommIdRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string databaseId, + string recommId, + global::Recombee.RecommendNextItemSegmentsParameters request); + partial void ProcessCreateByDatabaseIdRecommsNextItemSegmentsByRecommIdResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCreateByDatabaseIdRecommsNextItemSegmentsByRecommIdResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Recommend Next Item Segments
+ /// Returns [Item Segments](https://docs.recombee.com/segmentations) to be shown as the next recommendations when a user scrolls (e.g., within a carousel or feed of Item Segments such as brands, artists, topics, or categories).
+ /// The request requires the `recommId` of a base recommendation request and the number of Segments to return (`count`).
+ /// The base request can be one of:
+ /// - [Recommend Item Segments to Item](https://docs.recombee.com/api#recommend-item-segments-to-item)
+ /// - [Recommend Item Segments to User](https://docs.recombee.com/api#recommend-item-segments-to-user)
+ /// - [Recommend Item Segments to Item Segment](https://docs.recombee.com/api#recommend-item-segments-to-item-segment)
+ /// - [Search Item Segments](https://docs.recombee.com/api#search-item-segments)
+ /// All other parameters are inherited from the base request associated with the provided `recommId`.
+ /// This endpoint can be called multiple times for a single `recommId`. Each call returns different Item Segments that have not been recommended in previous calls.
+ /// The number of calls made so far is returned in the `numberNextRecommsCalls` field.
+ /// Requests can be made up to 30 minutes after the base request or the most recent Recommend Next Item Segments call.
+ /// For billing purposes, each call to this endpoint is counted as a separate recommendation request. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreateByDatabaseIdRecommsNextItemSegmentsByRecommIdAsync( + string databaseId, + string recommId, + + global::Recombee.RecommendNextItemSegmentsParameters request, + global::Recombee.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareCreateByDatabaseIdRecommsNextItemSegmentsByRecommIdArguments( + httpClient: HttpClient, + databaseId: ref databaseId, + recommId: ref recommId, + request: request); + + + var __authorizations = global::Recombee.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateByDatabaseIdRecommsNextItemSegmentsByRecommIdSecurityRequirements, + operationName: "CreateByDatabaseIdRecommsNextItemSegmentsByRecommIdAsync"); + + using var __timeoutCancellationTokenSource = global::Recombee.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Recombee.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Recombee.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + var __pathBuilder = new global::Recombee.PathBuilder( + path: $"/{databaseId}/recomms/next/item-segments/{recommId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Recombee.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Recombee.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateByDatabaseIdRecommsNextItemSegmentsByRecommIdRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + databaseId: databaseId, + recommId: recommId, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Recombee.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Recombee.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "createByDatabaseIdRecommsNextItemSegmentsByRecommId", + methodName: "CreateByDatabaseIdRecommsNextItemSegmentsByRecommIdAsync", + pathTemplate: "$\"/{databaseId}/recomms/next/item-segments/{recommId}\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Recombee.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Recombee.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "createByDatabaseIdRecommsNextItemSegmentsByRecommId", + methodName: "CreateByDatabaseIdRecommsNextItemSegmentsByRecommIdAsync", + pathTemplate: "$\"/{databaseId}/recomms/next/item-segments/{recommId}\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Recombee.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Recombee.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::Recombee.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Recombee.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "createByDatabaseIdRecommsNextItemSegmentsByRecommId", + methodName: "CreateByDatabaseIdRecommsNextItemSegmentsByRecommIdAsync", + pathTemplate: "$\"/{databaseId}/recomms/next/item-segments/{recommId}\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Recombee.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreateByDatabaseIdRecommsNextItemSegmentsByRecommIdResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Recombee.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Recombee.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "createByDatabaseIdRecommsNextItemSegmentsByRecommId", + methodName: "CreateByDatabaseIdRecommsNextItemSegmentsByRecommIdAsync", + pathTemplate: "$\"/{databaseId}/recomms/next/item-segments/{recommId}\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Recombee.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Recombee.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "createByDatabaseIdRecommsNextItemSegmentsByRecommId", + methodName: "CreateByDatabaseIdRecommsNextItemSegmentsByRecommIdAsync", + pathTemplate: "$\"/{databaseId}/recomms/next/item-segments/{recommId}\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + throw new global::Recombee.ApiException( + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + throw new global::Recombee.ApiException( + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + statusCode: __response.StatusCode) + { + ResponseBody = __content_404, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateByDatabaseIdRecommsNextItemSegmentsByRecommIdResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Recombee.RecommendationResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::Recombee.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Recombee.RecommendationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::Recombee.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Recommend Next Item Segments
+ /// Returns [Item Segments](https://docs.recombee.com/segmentations) to be shown as the next recommendations when a user scrolls (e.g., within a carousel or feed of Item Segments such as brands, artists, topics, or categories).
+ /// The request requires the `recommId` of a base recommendation request and the number of Segments to return (`count`).
+ /// The base request can be one of:
+ /// - [Recommend Item Segments to Item](https://docs.recombee.com/api#recommend-item-segments-to-item)
+ /// - [Recommend Item Segments to User](https://docs.recombee.com/api#recommend-item-segments-to-user)
+ /// - [Recommend Item Segments to Item Segment](https://docs.recombee.com/api#recommend-item-segments-to-item-segment)
+ /// - [Search Item Segments](https://docs.recombee.com/api#search-item-segments)
+ /// All other parameters are inherited from the base request associated with the provided `recommId`.
+ /// This endpoint can be called multiple times for a single `recommId`. Each call returns different Item Segments that have not been recommended in previous calls.
+ /// The number of calls made so far is returned in the `numberNextRecommsCalls` field.
+ /// Requests can be made up to 30 minutes after the base request or the most recent Recommend Next Item Segments call.
+ /// For billing purposes, each call to this endpoint is counted as a separate recommendation request. + ///
+ /// + /// + /// + /// Number of item segments to be recommended + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreateByDatabaseIdRecommsNextItemSegmentsByRecommIdAsync( + string databaseId, + string recommId, + int count, + global::Recombee.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Recombee.RecommendNextItemSegmentsParameters + { + Count = count, + }; + + return await CreateByDatabaseIdRecommsNextItemSegmentsByRecommIdAsync( + databaseId: databaseId, + recommId: recommId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Recombee/Generated/autosdk.generated-examples.json b/src/libs/Recombee/Generated/autosdk.generated-examples.json index da92e53..6e67bf8 100644 --- a/src/libs/Recombee/Generated/autosdk.generated-examples.json +++ b/src/libs/Recombee/Generated/autosdk.generated-examples.json @@ -92,9 +92,9 @@ "Order": 9, "Title": "Composite Recommendation", "Slug": "composite-recommendation", - "Description": "Composite Recommendation returns both a *source entity* (e.g., an Item or [Item Segment](https://docs.recombee.com/segmentations.html)) and a list of related recommendations in a single response.\n\nIt is ideal for use cases such as personalized homepage sections (*Articles from \u003Ccategory\u003E*), *Because You Watched \u003Cmovie\u003E*, or *Artists Related to Your Favorite Artist \u003Cartist\u003E*.\n\nSee detailed **examples and configuration guidance** in the [Composite Scenarios documentation](https://docs.recombee.com/scenarios#composite-recommendations).\n\n**Structure**\n\nThe endpoint operates in two stages:\n1. Recommends the *source* (e.g., an Item Segment or item) to the user.\n2. Recommends *results* (items or Item Segments) related to that *source*.\n\nFor example, *Articles from \u003Ccategory\u003E* can be decomposed into:\n - [Recommend Item Segments To User](https://docs.recombee.com/api#recommend-item-segments-to-user) to find the category.\n - [Recommend Items To Item Segment](https://docs.recombee.com/api#recommend-items-to-item-segment) to recommend articles from that category.\n\nSince the first step uses [Recommend Item Segments To User](https://docs.recombee.com/api#recommend-items-to-user), you must include the \u0060userId\u0060 parameter in the *Composite Recommendation* request.\n\nEach *Composite Recommendation* counts as a single recommendation API request for billing.\n\n**Stage-specific Parameters**\n\nAdditional parameters can be supplied via [sourceSettings](https://docs.recombee.com/api#composite-recommendation-param-sourceSettings) and [resultSettings](https://docs.recombee.com/api#composite-recommendation-param-resultSettings).\nIn the example above:\n - \u0060sourceSettings\u0060 may include any parameter valid for [Recommend Item Segments To User](https://docs.recombee.com/api#recommend-items-to-user) (e.g., \u0060filter\u0060, \u0060booster\u0060).\n - \u0060resultSettings\u0060 may include any parameter valid for [Recommend Items To Item Segment](https://docs.recombee.com/api#recommend-items-to-item-segment).\n\nSee [this example](https://docs.recombee.com/api#composite-recommendation-example-setting-parameters-for-individual-stages) for more details.", + "Description": "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.\n\nIt is ideal for use cases such as personalized homepage sections (*Articles from \u003Ccategory\u003E*), *Because You Watched \u003Cmovie\u003E*, or *Artists Related to Your Favorite Artist \u003Cartist\u003E*.\n\nSee detailed **examples and configuration guidance** in the [Composite Scenarios documentation](https://docs.recombee.com/scenarios#composite-recommendations).\n\n**Structure**\n\nThe endpoint operates in two stages:\n1. Recommends the *source* (e.g., an Item Segment or item) to the user.\n2. Recommends *results* (items or Item Segments) related to that *source*.\n\nFor example, *Articles from \u003Ccategory\u003E* can be decomposed into:\n - [Recommend Item Segments To User](https://docs.recombee.com/api#recommend-item-segments-to-user) to find the category.\n - [Recommend Items To Item Segment](https://docs.recombee.com/api#recommend-items-to-item-segment) to recommend articles from that category.\n\nSince the first step uses [Recommend Item Segments To User](https://docs.recombee.com/api#recommend-items-to-user), you must include the \u0060userId\u0060 parameter in the *Composite Recommendation* request.\n\nEach *Composite Recommendation* counts as a single recommendation API request for billing.\n\n**Stage-specific Parameters**\n\nAdditional parameters can be supplied via [sourceSettings](https://docs.recombee.com/api#composite-recommendation-param-sourceSettings) and [resultSettings](https://docs.recombee.com/api#composite-recommendation-param-resultSettings).\nIn the example above:\n - \u0060sourceSettings\u0060 may include any parameter valid for [Recommend Item Segments To User](https://docs.recombee.com/api#recommend-items-to-user) (e.g., \u0060filter\u0060, \u0060booster\u0060).\n - \u0060resultSettings\u0060 may include any parameter valid for [Recommend Items To Item Segment](https://docs.recombee.com/api#recommend-items-to-item-segment).\n\nSee [this example](https://docs.recombee.com/api#composite-recommendation-example-setting-parameters-for-individual-stages) for more details.", "Language": "http", - "Code": "### Composite Recommendation\nPOST {{host}}/{{databaseId}}/recomms/composite/\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022scenario\u0022: \u0022string\u0022,\n \u0022count\u0022: 0,\n \u0022itemId\u0022: \u0022string\u0022,\n \u0022userId\u0022: \u0022string\u0022,\n \u0022logic\u0022: \u0022string\u0022,\n \u0022segmentId\u0022: \u0022string\u0022,\n \u0022cascadeCreate\u0022: true,\n \u0022sourceSettings\u0022: {},\n \u0022resultSettings\u0022: {},\n \u0022expertSettings\u0022: {}\n}\n\n## Responses\n# 200\n# Description: Successful operation.\n# Content-Type: application/json\n# 400\n# Description: Count is not a positive integer, provided scenario not found.\n# 404\n# Description: contextSegmentId not found in the context segmentation, userId not found in the database and cascadeCreate is false, itemId not found in the database and cascadeCreate is false.", + "Code": "### Composite Recommendation\nPOST {{host}}/{{databaseId}}/recomms/composite/\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022scenario\u0022: \u0022string\u0022,\n \u0022count\u0022: 0,\n \u0022itemId\u0022: \u0022string\u0022,\n \u0022userId\u0022: \u0022string\u0022,\n \u0022logic\u0022: \u0022string\u0022,\n \u0022segmentId\u0022: \u0022string\u0022,\n \u0022searchQuery\u0022: \u0022string\u0022,\n \u0022cascadeCreate\u0022: true,\n \u0022sourceSettings\u0022: {},\n \u0022resultSettings\u0022: {},\n \u0022expertSettings\u0022: {}\n}\n\n## Responses\n# 200\n# Description: Successful operation.\n# Content-Type: application/json\n# 400\n# Description: Count is not a positive integer, provided scenario not found.\n# 404\n# Description: contextSegmentId not found in the context segmentation, userId not found in the database and cascadeCreate is false, itemId not found in the database and cascadeCreate is false.", "Format": "http", "OperationId": "createByDatabaseIdRecommsComposite", "Setup": null @@ -156,6 +156,17 @@ }, { "Order": 15, + "Title": "Recommend Next Item Segments", + "Slug": "recommend-next-item-segments", + "Description": "Returns [Item Segments](https://docs.recombee.com/segmentations) to be shown as the next recommendations when a user scrolls (e.g., within a carousel or feed of Item Segments such as brands, artists, topics, or categories).\n\nThe request requires the \u0060recommId\u0060 of a base recommendation request and the number of Segments to return (\u0060count\u0060).\n\nThe base request can be one of:\n - [Recommend Item Segments to Item](https://docs.recombee.com/api#recommend-item-segments-to-item)\n - [Recommend Item Segments to User](https://docs.recombee.com/api#recommend-item-segments-to-user)\n - [Recommend Item Segments to Item Segment](https://docs.recombee.com/api#recommend-item-segments-to-item-segment)\n - [Search Item Segments](https://docs.recombee.com/api#search-item-segments)\n\nAll other parameters are inherited from the base request associated with the provided \u0060recommId\u0060.\n\nThis endpoint can be called multiple times for a single \u0060recommId\u0060. Each call returns different Item Segments that have not been recommended in previous calls.\nThe number of calls made so far is returned in the \u0060numberNextRecommsCalls\u0060 field.\n\nRequests can be made up to 30 minutes after the base request or the most recent Recommend Next Item Segments call.\n\nFor billing purposes, each call to this endpoint is counted as a separate recommendation request.", + "Language": "http", + "Code": "### Recommend Next Item Segments\nPOST {{host}}/{{databaseId}}/recomms/next/item-segments/{{recommId}}\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022count\u0022: 0\n}\n\n## Responses\n# 200\n# Description: Successful operation.\n# Content-Type: application/json\n# 400\n# Description: Parameter \u0060count\u0060 is not given or is not a positive integer. Parameter \u0060recommId\u0060 is not an UUID.\n# 404\n# Description: Base request with the given \u0060recommId\u0060 does not exist or has expired.", + "Format": "http", + "OperationId": "createByDatabaseIdRecommsNextItemSegmentsByRecommId", + "Setup": null + }, + { + "Order": 16, "Title": "Recommend Next Items", "Slug": "recommend-next-items", "Description": "Returns items 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.\n\nIt accepts \u0060recommId\u0060 of a base recommendation request (e.g., request from the first page) and the number of items that shall be returned (\u0060count\u0060).\nThe base request can be one of:\n - [Recommend Items to Item](https://docs.recombee.com/api#recommend-items-to-item)\n - [Recommend Items to User](https://docs.recombee.com/api#recommend-items-to-user)\n - [Recommend Items to Item Segment](https://docs.recombee.com/api#recommend-items-to-item-segment)\n - [Search Items](https://docs.recombee.com/api#search-items)\n\nAll the other parameters are inherited from the base request.\n\n*Recommend next items* can be called many times for a single \u0060recommId\u0060 and each call returns different (previously not recommended) items.\nThe number of *Recommend next items* calls performed so far is returned in the \u0060numberNextRecommsCalls\u0060 field.\n\n*Recommend next items* can be requested up to 30 minutes after the base request or a previous *Recommend next items* call.\n\nFor billing purposes, each call to *Recommend next items* is counted as a separate recommendation request.", @@ -166,7 +177,7 @@ "Setup": null }, { - "Order": 16, + "Order": 17, "Title": "Recommend Item Segments to User", "Slug": "recommend-item-segments-to-user", "Description": "Recommends the top Segments from a [Segmentation](https://docs.recombee.com/segmentations) for a particular user, based on the user\u0027s past interactions.\n\nBased on the used Segmentation, this endpoint can be used for example for:\n\n - Recommending the top categories for the user\n - Recommending the top genres for the user\n - Recommending the top brands for the user\n - Recommending the top artists for the user\n\nYou need to set the used Segmentation the Admin UI in the [Scenario settings](https://docs.recombee.com/scenarios) prior to using this endpoint.\n\nThe returned segments are sorted by relevance (first segment being the most relevant).\n\nIt is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters.", @@ -177,7 +188,7 @@ "Setup": null }, { - "Order": 17, + "Order": 18, "Title": "Recommend Items to User", "Slug": "recommend-items-to-user", "Description": "Based on the user\u0027s past interactions (purchases, ratings, etc.) with the items, recommends top-N items that are most likely to be of high value for the given user.\n\nThe most typical use cases are recommendations on the homepage, in some \u0022Picked just for you\u0022 section, or in email.\n\nThe returned items are sorted by relevance (the first item being the most relevant).\n\nBesides the recommended items, also a unique \u0060recommId\u0060 is returned in the response. It can be used to:\n\n- Let Recombee know that this recommendation was successful (e.g., user clicked one of the recommended items). See [Reported metrics](https://docs.recombee.com/admin_ui#reported-metrics).\n- Get subsequent recommended items when the user scrolls down (*infinite scroll*) or goes to the next page. See [Recommend Next Items](https://docs.recombee.com/api#recommend-next-items).\n\nIt 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.", @@ -188,7 +199,7 @@ "Setup": null }, { - "Order": 18, + "Order": 19, "Title": "Recommend Users to User", "Slug": "recommend-users-to-user", "Description": "Gets users similar to the given user, based on the user\u0027s past interactions (purchases, ratings, etc.) and values of properties.\n\nIt 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.\n\nThe returned users are sorted by similarity (the first user being the most similar).", @@ -199,7 +210,7 @@ "Setup": null }, { - "Order": 19, + "Order": 20, "Title": "Search Item Segments", "Slug": "search-item-segments", "Description": "Full-text personalized search that returns Segments from a Segmentation. The results are based on the provided \u0060searchQuery\u0060 and also on the user\u0027s past interactions (purchases, ratings, etc.).\n\nBased on the used Segmentation, this endpoint can be used for example for:\n\n - Searching within categories or brands\n - Searching within genres or artists\n\nFor example if the user is searching for \u0022iPhone\u0022 this endpoint can return \u0022cell phones\u0022 category.\n\nYou need to set the used Segmentation the Admin UI in the Scenario settings prior to using this endpoint.\n\nThe returned segments are sorted by relevance (first segment being the most relevant).\n\nIt is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters.", @@ -210,7 +221,7 @@ "Setup": null }, { - "Order": 20, + "Order": 21, "Title": "Search Items", "Slug": "search-items", "Description": "Full-text personalized search. The results are based on the provided \u0060searchQuery\u0060 and also on the user\u0027s past interactions (purchases, ratings, etc.) with the items (items more suitable for the user are preferred in the results).\n\nAll the string and set item properties are indexed by the search engine.\n\nThis 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. \n\nThe returned items are sorted by relevance (the first item being the most relevant).\n\nBesides the recommended items, also a unique \u0060recommId\u0060 is returned in the response. It can be used to:\n\n- 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#reported-metrics).\n- Get subsequent search results when the user scrolls down or goes to the next page. See [Recommend Next Items](https://docs.recombee.com/api#recommend-next-items).\n\nIt 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.", @@ -221,7 +232,7 @@ "Setup": null }, { - "Order": 21, + "Order": 22, "Title": "Add Search Synonym", "Slug": "add-search-synonym", "Description": "Adds a new synonym for the [Search items](https://docs.recombee.com/api#search-items).\n\nWhen the \u0060term\u0060 is used in the search query, the \u0060synonym\u0060 is also used for the full-text search.\nUnless \u0060oneWay=true\u0060, it works also in the opposite way (\u0060synonym\u0060 -\u003E \u0060term\u0060).\n\nAn example of a synonym can be \u0060science fiction\u0060 for the term \u0060sci-fi\u0060.", @@ -232,7 +243,7 @@ "Setup": null }, { - "Order": 22, + "Order": 23, "Title": "List Search Synonyms", "Slug": "list-search-synonyms", "Description": "Gives the list of synonyms defined in the database.", @@ -243,7 +254,7 @@ "Setup": null }, { - "Order": 23, + "Order": 24, "Title": "List Segmentations", "Slug": "list-segmentations", "Description": "Return all existing items Segmentations.", @@ -254,7 +265,7 @@ "Setup": null }, { - "Order": 24, + "Order": 25, "Title": "Get Segmentation", "Slug": "get-segmentation", "Description": "Get existing Segmentation.", @@ -265,7 +276,7 @@ "Setup": null }, { - "Order": 25, + "Order": 26, "Title": "List Series Items", "Slug": "list-series-items", "Description": "Lists all the items present in the given series, sorted according to their time index values.", @@ -276,7 +287,7 @@ "Setup": null }, { - "Order": 26, + "Order": 27, "Title": "List Series", "Slug": "list-series", "Description": "Gets the list of all the series currently present in the database.", @@ -287,7 +298,7 @@ "Setup": null }, { - "Order": 27, + "Order": 28, "Title": "List Item Bookmarks", "Slug": "list-item-bookmarks", "Description": "Lists all the ever-made bookmarks of the given item.", @@ -298,7 +309,7 @@ "Setup": null }, { - "Order": 28, + "Order": 29, "Title": "List Item Cart Additions", "Slug": "list-item-cart-additions", "Description": "Lists all the ever-made cart additions of the given item.", @@ -309,7 +320,7 @@ "Setup": null }, { - "Order": 29, + "Order": 30, "Title": "List Item Detail Views", "Slug": "list-item-detail-views", "Description": "Lists all the detail views of the given item ever made by different users.", @@ -320,7 +331,7 @@ "Setup": null }, { - "Order": 30, + "Order": 31, "Title": "List Item Purchases", "Slug": "list-item-purchases", "Description": "Lists all the ever-made purchases of the given item.", @@ -331,7 +342,7 @@ "Setup": null }, { - "Order": 31, + "Order": 32, "Title": "List Item Ratings", "Slug": "list-item-ratings", "Description": "Lists all the ratings of an item ever submitted by different users.", @@ -342,7 +353,7 @@ "Setup": null }, { - "Order": 32, + "Order": 33, "Title": "List Item View Portions", "Slug": "list-item-view-portions", "Description": "Lists all the view portions of an item ever submitted by different users.", @@ -353,7 +364,7 @@ "Setup": null }, { - "Order": 33, + "Order": 34, "Title": "List User Bookmarks", "Slug": "list-user-bookmarks", "Description": "Lists all the bookmarks ever made by the given user.", @@ -364,7 +375,7 @@ "Setup": null }, { - "Order": 34, + "Order": 35, "Title": "List User Cart Additions", "Slug": "list-user-cart-additions", "Description": "Lists all the cart additions ever made by the given user.", @@ -375,7 +386,7 @@ "Setup": null }, { - "Order": 35, + "Order": 36, "Title": "List User Detail Views", "Slug": "list-user-detail-views", "Description": "Lists all the detail views of different items ever made by the given user.", @@ -386,7 +397,7 @@ "Setup": null }, { - "Order": 36, + "Order": 37, "Title": "List User Purchases", "Slug": "list-user-purchases", "Description": "Lists all the purchases ever made by the given user.", @@ -397,7 +408,7 @@ "Setup": null }, { - "Order": 37, + "Order": 38, "Title": "List User Ratings", "Slug": "list-user-ratings", "Description": "Lists all the ratings ever submitted by the given user.", @@ -408,7 +419,7 @@ "Setup": null }, { - "Order": 38, + "Order": 39, "Title": "List User View Portions", "Slug": "list-user-view-portions", "Description": "Lists all the view portions ever submitted by the given user.", @@ -419,7 +430,7 @@ "Setup": null }, { - "Order": 39, + "Order": 40, "Title": "Get User Values", "Slug": "get-user-values", "Description": "Gets all the current property values of the given user.", @@ -430,7 +441,7 @@ "Setup": null }, { - "Order": 40, + "Order": 41, "Title": "Get User Property Info", "Slug": "get-user-property-info", "Description": "Gets information about specified user property.", @@ -441,7 +452,7 @@ "Setup": null }, { - "Order": 41, + "Order": 42, "Title": "List User Properties", "Slug": "list-user-properties", "Description": "Gets the list of all the user properties in your database.", @@ -452,7 +463,7 @@ "Setup": null }, { - "Order": 42, + "Order": 43, "Title": "List Users", "Slug": "list-users", "Description": "Gets a list of IDs of users currently present in the catalog.", diff --git a/src/libs/Recombee/openapi.yaml b/src/libs/Recombee/openapi.yaml index 0d046aa..232559d 100644 --- a/src/libs/Recombee/openapi.yaml +++ b/src/libs/Recombee/openapi.yaml @@ -2595,17 +2595,69 @@ paths: description: count is not a positive integer. '404': description: contextSegmentId not found in the context segmentation + /{databaseId}/recomms/next/item-segments/{recommId}: + post: + summary: Recommend Next Item Segments + description: "Returns [Item Segments](https://docs.recombee.com/segmentations) to be shown as the next recommendations when a user scrolls (e.g., within a carousel or feed of Item Segments such as\ + \ brands, artists, topics, or categories).\n\nThe request requires the `recommId` of a base recommendation request and the number of Segments to return (`count`).\n\nThe base request can be one\ + \ of:\n - [Recommend Item Segments to Item](https://docs.recombee.com/api#recommend-item-segments-to-item)\n - [Recommend Item Segments to User](https://docs.recombee.com/api#recommend-item-segments-to-user)\n\ + \ - [Recommend Item Segments to Item Segment](https://docs.recombee.com/api#recommend-item-segments-to-item-segment)\n - [Search Item Segments](https://docs.recombee.com/api#search-item-segments)\n\ + \nAll other parameters are inherited from the base request associated with the provided `recommId`.\n\nThis endpoint can be called multiple times for a single `recommId`. Each call returns different\ + \ Item Segments that have not been recommended in previous calls.\nThe number of calls made so far is returned in the `numberNextRecommsCalls` field.\n\nRequests can be made up to 30 minutes after\ + \ the base request or the most recent Recommend Next Item Segments call.\n\nFor billing purposes, each call to this endpoint is counted as a separate recommendation request.\n" + tags: + - Recommendations + parameters: + - name: databaseId + in: path + description: ID of your database. + required: true + schema: + type: string + - name: recommId + in: path + description: ID of the base recommendation request for which next recommendations should be returned + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RecommendNextItemSegmentsParameters' + description: Recommendation parameters definition + required: true + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/RecommendationResponse' + examples: + response: + value: + recommId: 768448ea-10b3-4028-bb76-4b2f95121d19 + recomms: + - id: Comedy + - id: Drama + - id: Action + numberNextRecommsCalls: 4 + '400': + description: Parameter `count` is not given or is not a positive integer. Parameter `recommId` is not an UUID. + '404': + description: Base request with the given `recommId` does not exist or has expired. /{databaseId}/recomms/composite/: post: summary: Composite Recommendation - description: "Composite Recommendation returns both a *source entity* (e.g., an Item or [Item Segment](https://docs.recombee.com/segmentations.html)) and a list of related recommendations in a single\ - \ response.\n\nIt is ideal for use cases such as personalized homepage sections (*Articles from *), *Because You Watched *, or *Artists Related to Your Favorite Artist *.\n\ - \nSee detailed **examples and configuration guidance** in the [Composite Scenarios documentation](https://docs.recombee.com/scenarios#composite-recommendations).\n\n**Structure**\n\nThe endpoint\ - \ operates in two stages:\n1. Recommends the *source* (e.g., an Item Segment or item) to the user.\n2. Recommends *results* (items or Item Segments) related to that *source*.\n\nFor example, *Articles\ - \ from * can be decomposed into:\n - [Recommend Item Segments To User](https://docs.recombee.com/api#recommend-item-segments-to-user) to find the category.\n - [Recommend Items To Item\ - \ Segment](https://docs.recombee.com/api#recommend-items-to-item-segment) to recommend articles from that category.\n\nSince the first step uses [Recommend Item Segments To User](https://docs.recombee.com/api#recommend-items-to-user),\ - \ you must include the `userId` parameter in the *Composite Recommendation* request.\n\nEach *Composite Recommendation* counts as a single recommendation API request for billing.\n\n**Stage-specific\ - \ Parameters**\n\nAdditional parameters can be supplied via [sourceSettings](https://docs.recombee.com/api#composite-recommendation-param-sourceSettings) and [resultSettings](https://docs.recombee.com/api#composite-recommendation-param-resultSettings).\n\ + description: "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.\n\ + \nIt is ideal for use cases such as personalized homepage sections (*Articles from *), *Because You Watched *, or *Artists Related to Your Favorite Artist *.\n\nSee detailed\ + \ **examples and configuration guidance** in the [Composite Scenarios documentation](https://docs.recombee.com/scenarios#composite-recommendations).\n\n**Structure**\n\nThe endpoint operates in\ + \ two stages:\n1. Recommends the *source* (e.g., an Item Segment or item) to the user.\n2. Recommends *results* (items or Item Segments) related to that *source*.\n\nFor example, *Articles from\ + \ * can be decomposed into:\n - [Recommend Item Segments To User](https://docs.recombee.com/api#recommend-item-segments-to-user) to find the category.\n - [Recommend Items To Item Segment](https://docs.recombee.com/api#recommend-items-to-item-segment)\ + \ to recommend articles from that category.\n\nSince the first step uses [Recommend Item Segments To User](https://docs.recombee.com/api#recommend-items-to-user), you must include the `userId` parameter\ + \ in the *Composite Recommendation* request.\n\nEach *Composite Recommendation* counts as a single recommendation API request for billing.\n\n**Stage-specific Parameters**\n\nAdditional parameters\ + \ can be supplied via [sourceSettings](https://docs.recombee.com/api#composite-recommendation-param-sourceSettings) and [resultSettings](https://docs.recombee.com/api#composite-recommendation-param-resultSettings).\n\ In the example above:\n - `sourceSettings` may include any parameter valid for [Recommend Item Segments To User](https://docs.recombee.com/api#recommend-items-to-user) (e.g., `filter`, `booster`).\n\ \ - `resultSettings` may include any parameter valid for [Recommend Items To Item Segment](https://docs.recombee.com/api#recommend-items-to-item-segment).\n\nSee [this example](https://docs.recombee.com/api#composite-recommendation-example-setting-parameters-for-individual-stages)\ \ for more details.\n" @@ -4670,6 +4722,11 @@ components: segmentId: description: 'ID of the segment from `contextSegmentationId` for which the recommendations are to be generated. + ' + type: string + searchQuery: + description: 'Search query provided by the user. It is used for the full-text search. Only applicable if the *scenario* corresponds to a search scenario. + ' type: string cascadeCreate: @@ -4848,6 +4905,16 @@ components: count: description: 'Number of items to be recommended + ' + type: integer + RecommendNextItemSegmentsParameters: + type: object + required: + - count + properties: + count: + description: 'Number of item segments to be recommended + ' type: integer CreatePropertyBasedSegmentationParameters: