tembo_api_client/models/
search_response.rs1use serde::{Deserialize, Serialize};
12
13#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
14pub struct SearchResponse {
15 #[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}