trieve_client/models/
recommendation_event.rs

1/*
2 * Trieve API
3 *
4 * Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5 *
6 * The version of the OpenAPI document: 0.11.7
7 * Contact: developers@trieve.ai
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12
13#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
14pub struct RecommendationEvent {
15    #[serde(rename = "created_at")]
16    pub created_at: String,
17    #[serde(rename = "dataset_id")]
18    pub dataset_id: uuid::Uuid,
19    #[serde(rename = "id")]
20    pub id: uuid::Uuid,
21    #[serde(rename = "negative_ids")]
22    pub negative_ids: Vec<uuid::Uuid>,
23    #[serde(rename = "negative_tracking_ids")]
24    pub negative_tracking_ids: Vec<String>,
25    #[serde(rename = "positive_ids")]
26    pub positive_ids: Vec<uuid::Uuid>,
27    #[serde(rename = "positive_tracking_ids")]
28    pub positive_tracking_ids: Vec<String>,
29    #[serde(rename = "recommendation_type")]
30    pub recommendation_type: String,
31    #[serde(rename = "request_params", deserialize_with = "Option::deserialize")]
32    pub request_params: Option<serde_json::Value>,
33    #[serde(rename = "results")]
34    pub results: Vec<serde_json::Value>,
35    #[serde(rename = "top_score")]
36    pub top_score: f32,
37    #[serde(rename = "user_id")]
38    pub user_id: String,
39}
40
41impl RecommendationEvent {
42    pub fn new(created_at: String, dataset_id: uuid::Uuid, id: uuid::Uuid, negative_ids: Vec<uuid::Uuid>, negative_tracking_ids: Vec<String>, positive_ids: Vec<uuid::Uuid>, positive_tracking_ids: Vec<String>, recommendation_type: String, request_params: Option<serde_json::Value>, results: Vec<serde_json::Value>, top_score: f32, user_id: String) -> RecommendationEvent {
43        RecommendationEvent {
44            created_at,
45            dataset_id,
46            id,
47            negative_ids,
48            negative_tracking_ids,
49            positive_ids,
50            positive_tracking_ids,
51            recommendation_type,
52            request_params,
53            results,
54            top_score,
55            user_id,
56        }
57    }
58}
59