recombee_api_client.api_requests.set_view_portion module

class recombee_api_client.api_requests.set_view_portion.SetViewPortion(user_id: str, item_id: str, portion: float, session_id: str = UUID('c1ef6d9e-c808-4b22-9e85-17640c299b06'), timestamp: Union[str, int] = UUID('c1ef6d9e-c808-4b22-9e85-17640c299b06'), cascade_create: bool = UUID('c1ef6d9e-c808-4b22-9e85-17640c299b06'), recomm_id: str = UUID('c1ef6d9e-c808-4b22-9e85-17640c299b06'), additional_data: dict = UUID('c1ef6d9e-c808-4b22-9e85-17640c299b06'))

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:

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

  • 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() → dict

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

get_query_parameters() → dict

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