hanzo_client/models/ask_answer.rs
1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
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 AskAnswer {
16 /// Answer is the synthesized prose. EMPTY is a real answer here: nothing in the index matched, or synthesis was unavailable — read `degraded` and `citations` to tell those apart. It is never written without grounding.
17 #[serde(rename = "answer", skip_serializing_if = "Option::is_none")]
18 pub answer: Option<String>,
19 /// Citations are the exact regions the answer was grounded on, and they are the point: an answer is checkable only because every claim in it can be read back at a file and line. Present even when Answer is empty.
20 #[serde(rename = "citations", skip_serializing_if = "Option::is_none")]
21 pub citations: Option<Vec<models::Citation>>,
22 /// Degraded is true when retrieval worked but no synthesizer was reachable. The citations are still real code, so a caller can answer from them itself; a caller that treats this like an error throws away a usable result.
23 #[serde(rename = "degraded", skip_serializing_if = "Option::is_none")]
24 pub degraded: Option<bool>,
25 /// Question is the ask, echoed back.
26 #[serde(rename = "question", skip_serializing_if = "Option::is_none")]
27 pub question: Option<String>,
28}
29
30impl AskAnswer {
31 pub fn new() -> AskAnswer {
32 AskAnswer {
33 answer: None,
34 citations: None,
35 degraded: None,
36 question: None,
37 }
38 }
39}
40