trieve-client 0.11.7

Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
Documentation
/*
 * Trieve API
 *
 * Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
 *
 * The version of the OpenAPI document: 0.11.7
 * Contact: developers@trieve.ai
 * Generated by: https://openapi-generator.tech
 */

use crate::models;

/// SortOptions : Sort Options lets you specify different methods to rerank the chunks in the result set. If not specified, this defaults to the score of the chunks.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SortOptions {
    #[serde(rename = "location_bias", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub location_bias: Option<Option<Box<models::GeoInfoWithBias>>>,
    #[serde(rename = "sort_by", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub sort_by: Option<Option<Box<models::QdrantSortBy>>>,
    /// Tag weights is a JSON object which can be used to boost the ranking of chunks with certain tags. This is useful for when you want to be able to bias towards chunks with a certain tag on the fly. The keys are the tag names and the values are the weights.
    #[serde(rename = "tag_weights", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub tag_weights: Option<Option<std::collections::HashMap<String, f32>>>,
    /// Set use_weights to true to use the weights of the chunks in the result set in order to sort them. If not specified, this defaults to true.
    #[serde(rename = "use_weights", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub use_weights: Option<Option<bool>>,
}

impl SortOptions {
    /// Sort Options lets you specify different methods to rerank the chunks in the result set. If not specified, this defaults to the score of the chunks.
    pub fn new() -> SortOptions {
        SortOptions {
            location_bias: None,
            sort_by: None,
            tag_weights: None,
            use_weights: None,
        }
    }
}