trieve_client/models/
score_chunk.rs1use crate::models;
12
13#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
14pub struct ScoreChunk {
15 #[serde(rename = "chunk")]
16 pub chunk: Box<models::NewChunkMetadataTypes>,
17 #[serde(rename = "highlights", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
18 pub highlights: Option<Option<Vec<String>>>,
19 #[serde(rename = "score")]
20 pub score: f32,
21}
22
23impl ScoreChunk {
24 pub fn new(chunk: models::NewChunkMetadataTypes, score: f32) -> ScoreChunk {
25 ScoreChunk {
26 chunk: Box::new(chunk),
27 highlights: None,
28 score,
29 }
30 }
31}
32