tembo_api_client/models/
search_response.rs

1/*
2 * Tembo Cloud
3 *
4 * Platform API for Tembo Cloud             </br>             </br>             To find a Tembo Data API, please find it here:             </br>             </br>             [AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/)
5 *
6 * The version of the OpenAPI document: v1.0.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use serde::{Deserialize, Serialize};
12
13#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
14pub struct SearchResponse {
15    /// The file path (in Tembo website repo) to the Tembo document
16    #[serde(rename = "file_path")]
17    pub file_path: String,
18    #[serde(
19        rename = "front_matter",
20        default,
21        with = "::serde_with::rust::double_option",
22        skip_serializing_if = "Option::is_none"
23    )]
24    pub front_matter: Option<Option<serde_json::Value>>,
25    #[serde(rename = "similarity_score")]
26    pub similarity_score: f64,
27}
28
29impl SearchResponse {
30    pub fn new(file_path: String, similarity_score: f64) -> SearchResponse {
31        SearchResponse {
32            file_path,
33            front_matter: None,
34            similarity_score,
35        }
36    }
37}