vapi_client/models/
trieve_knowledge_base_search_plan.rs

1/*
2 * Vapi API
3 *
4 * Voice AI for developers.
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct TrieveKnowledgeBaseSearchPlan {
16    /// Specifies the number of top chunks to return. This corresponds to the `page_size` parameter in Trieve.
17    #[serde(rename = "topK", skip_serializing_if = "Option::is_none")]
18    pub top_k: Option<f64>,
19    /// If true, stop words (specified in server/src/stop-words.txt in the git repo) will be removed. This will preserve queries that are entirely stop words.
20    #[serde(rename = "removeStopWords", skip_serializing_if = "Option::is_none")]
21    pub remove_stop_words: Option<bool>,
22    /// This is the score threshold to filter out chunks with a score below the threshold for cosine distance metric. For Manhattan Distance, Euclidean Distance, and Dot Product, it will filter out scores above the threshold distance. This threshold applies before weight and bias modifications. If not specified, this defaults to no threshold. A threshold of 0 will default to no threshold.
23    #[serde(rename = "scoreThreshold", skip_serializing_if = "Option::is_none")]
24    pub score_threshold: Option<f64>,
25    /// This is the search method used when searching for relevant chunks from the vector store.
26    #[serde(rename = "searchType")]
27    pub search_type: SearchTypeTrue,
28}
29
30impl TrieveKnowledgeBaseSearchPlan {
31    pub fn new(search_type: SearchTypeTrue) -> TrieveKnowledgeBaseSearchPlan {
32        TrieveKnowledgeBaseSearchPlan {
33            top_k: None,
34            remove_stop_words: None,
35            score_threshold: None,
36            search_type,
37        }
38    }
39}
40/// This is the search method used when searching for relevant chunks from the vector store.
41#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
42pub enum SearchTypeTrue {
43    #[serde(rename = "fulltext")]
44    Fulltext,
45    #[serde(rename = "semantic")]
46    Semantic,
47    #[serde(rename = "hybrid")]
48    Hybrid,
49    #[serde(rename = "bm25")]
50    Bm25,
51}
52
53impl Default for SearchTypeTrue {
54    fn default() -> SearchTypeTrue {
55        Self::Fulltext
56    }
57}