1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* Hanzo Cloud API
*
* 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/.
*
* The version of the OpenAPI document: v1
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Hit {
/// 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.
#[serde(rename = "doctype", skip_serializing_if = "Option::is_none")]
pub doctype: Option<String>,
/// 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.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// 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.
#[serde(rename = "project", skip_serializing_if = "Option::is_none")]
pub project: Option<String>,
/// 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.
#[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
pub provider: Option<String>,
/// 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.
#[serde(rename = "score", skip_serializing_if = "Option::is_none")]
pub score: Option<f64>,
/// 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).
#[serde(rename = "title", skip_serializing_if = "Option::is_none")]
pub title: Option<String>,
/// 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.
#[serde(rename = "url", skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
}
impl Hit {
pub fn new() -> Hit {
Hit {
doctype: None,
name: None,
project: None,
provider: None,
score: None,
title: None,
url: None,
}
}
}