recombee_api_client.api_requests.set_view_portion module

class recombee_api_client.api_requests.set_view_portion.SetViewPortion(user_id, item_id, portion, session_id=UUID('6201344f-1ed1-4c7b-89f5-75ebc8f49261'), timestamp=UUID('6201344f-1ed1-4c7b-89f5-75ebc8f49261'), cascade_create=UUID('6201344f-1ed1-4c7b-89f5-75ebc8f49261'), recomm_id=UUID('6201344f-1ed1-4c7b-89f5-75ebc8f49261'), additional_data=UUID('6201344f-1ed1-4c7b-89f5-75ebc8f49261'))

Bases: recombee_api_client.api_requests.request.Request

Sets viewed portion of an item (for example a video or article) by a user (at a session). If you send new request with the same (userId, itemId, sessionId), the portion gets updated.

Required parameters:

Parameters
  • user_id – User who viewed a portion of the item

  • item_id – Viewed item

  • 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.

Optional parameters:

Parameters
  • session_id – ID of session in which the user viewed the item. Default is null (None, nil, NULL etc. depending on language).

  • timestamp – UTC timestamp of the rating as ISO8601-1 pattern or UTC epoch time. The default value is the current time.

  • cascade_create – Sets whether the given user/item should be created if not present in the database.

  • recomm_id – If this view portion is based on a recommendation request, recommId is the id of the clicked recommendation.

  • additional_data – A dictionary of additional data for the interaction.

get_body_parameters()

Values of body parameters as a dictionary (name of parameter: value of the parameter).

get_query_parameters()

Values of query parameters as a dictionary (name of parameter: value of the parameter).