trieve_client/models/
recommendation_strategy.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/// RecommendationStrategy : Strategy to use for recommendations, either \"average_vector\" or \"best_score\". The default is \"average_vector\". The \"average_vector\" strategy will construct a single average vector from the positive and negative samples then use it to perform a pseudo-search. The \"best_score\" strategy is more advanced and navigates the HNSW with a heuristic of picking edges where the point is closer to the positive samples than it is the negatives.
14/// Strategy to use for recommendations, either \"average_vector\" or \"best_score\". The default is \"average_vector\". The \"average_vector\" strategy will construct a single average vector from the positive and negative samples then use it to perform a pseudo-search. The \"best_score\" strategy is more advanced and navigates the HNSW with a heuristic of picking edges where the point is closer to the positive samples than it is the negatives.
15#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
16pub enum RecommendationStrategy {
17    #[serde(rename = "average_vector")]
18    AverageVector,
19    #[serde(rename = "best_score")]
20    BestScore,
21
22}
23
24impl ToString for RecommendationStrategy {
25    fn to_string(&self) -> String {
26        match self {
27            Self::AverageVector => String::from("average_vector"),
28            Self::BestScore => String::from("best_score"),
29        }
30    }
31}
32
33impl Default for RecommendationStrategy {
34    fn default() -> RecommendationStrategy {
35        Self::AverageVector
36    }
37}
38