trieve_client/models/
multi_query.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/// MultiQuery : MultiQuery allows you to construct a dense vector from multiple queries with a weighted sum. This is useful for when you want to emphasize certain features of the query. This only works with Semantic Search and is not compatible with cross encoder re-ranking or highlights.
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct MultiQuery {
16    /// Query to embed for the final weighted sum vector.
17    #[serde(rename = "query")]
18    pub query: String,
19    /// Float value which is applies as a multiplier to the query vector when summing.
20    #[serde(rename = "weight")]
21    pub weight: f32,
22}
23
24impl MultiQuery {
25    /// MultiQuery allows you to construct a dense vector from multiple queries with a weighted sum. This is useful for when you want to emphasize certain features of the query. This only works with Semantic Search and is not compatible with cross encoder re-ranking or highlights.
26    pub fn new(query: String, weight: f32) -> MultiQuery {
27        MultiQuery {
28            query,
29            weight,
30        }
31    }
32}
33