recombee_api_client.api_requests.add_rating module

class recombee_api_client.api_requests.add_rating.AddRating(user_id: str, item_id: str, rating: float, timestamp: Union[str, int] = UUID('d934298d-a4fe-4275-879e-a115bf39d69a'), cascade_create: bool = UUID('d934298d-a4fe-4275-879e-a115bf39d69a'), recomm_id: str = UUID('d934298d-a4fe-4275-879e-a115bf39d69a'), additional_data: dict = UUID('d934298d-a4fe-4275-879e-a115bf39d69a'))

Bases: recombee_api_client.api_requests.request.Request

Adds a rating of given item made by a given user.

Required parameters:

  • user_id – User who submitted the rating

  • item_id – Rated item

  • rating – Rating rescaled to interval [-1.0,1.0], where -1.0 means the worst rating possible, 0.0 means neutral, and 1.0 means absolutely positive rating. For example, in the case of 5-star evaluations, rating = (numStars-3)/2 formula may be used for the conversion.

Optional parameters:

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