Skip to main content

trieve_client/models/
score_chunk.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#[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