hanzo_client/models/hit.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 Hit {
16 /// DocType is which kind of knowledge matched: kb-page (a wiki page), kb-memory (a unit of agent memory) or kb-source (a document a connector ingested). Those three are the whole indexed set, and searchIn.DocTypes filters on them.
17 #[serde(rename = "doctype", skip_serializing_if = "Option::is_none")]
18 pub doctype: Option<String>,
19 /// Name is the document's name in the framework store — the id to read or open it with. Unique per (org, doctype), so it identifies the document with DocType and not alone.
20 #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
21 pub name: Option<String>,
22 /// Project is the project scope the document was saved under. Absent for a document saved with none, which is also why a project-scoped query cannot reach it.
23 #[serde(rename = "project", skip_serializing_if = "Option::is_none")]
24 pub project: Option<String>,
25 /// Provider is the connector that ingested the document — github, slack, google or notion. Absent for a page or memory written in the product, which came from no connector.
26 #[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
27 pub provider: Option<String>,
28 /// Score is the cosine similarity between the query's embedding and the document's, from -1 to 1, higher being closer — the collection is created with Cosine distance. Hits arrive ordered by it, descending. There is no absolute cutoff: what counts as a good score moves with the query and the embedding model, so compare scores within one response and not across queries.
29 #[serde(rename = "score", skip_serializing_if = "Option::is_none")]
30 pub score: Option<f64>,
31 /// Title is the document's title as it was indexed. Empty for a document saved without one; it is a label to show, never the id (that is Name).
32 #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
33 pub title: Option<String>,
34 /// URL is the document's link back into the app it was ingested from. Absent when the indexed payload carries none, which is the normal case for pages and memories.
35 #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
36 pub url: Option<String>,
37}
38
39impl Hit {
40 pub fn new() -> Hit {
41 Hit {
42 doctype: None,
43 name: None,
44 project: None,
45 provider: None,
46 score: None,
47 title: None,
48 url: None,
49 }
50 }
51}
52