1use schemars::JsonSchema;
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq)]
6pub struct Entity {
7 pub name: String,
9
10 #[serde(rename = "entityType")]
12 pub entity_type: String,
13
14 pub observations: Vec<String>,
16}
17
18#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq)]
20pub struct Relation {
21 pub from: String,
23
24 pub to: String,
26
27 #[serde(rename = "relationType")]
29 pub relation_type: String,
30}
31
32#[derive(Debug, Clone, Serialize, Deserialize, Default)]
34pub struct KnowledgeGraph {
35 pub entities: Vec<Entity>,
36 pub relations: Vec<Relation>,
37}
38
39#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
41pub struct ObservationInput {
42 #[serde(rename = "entityName")]
43 pub entity_name: String,
44 pub contents: Vec<String>,
45}
46
47#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
49pub struct ObservationResult {
50 #[serde(rename = "entityName")]
51 pub entity_name: String,
52 #[serde(rename = "addedObservations")]
53 pub added_observations: Vec<String>,
54}
55
56#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
58pub struct ObservationDeletion {
59 #[serde(rename = "entityName")]
60 pub entity_name: String,
61 pub observations: Vec<String>,
62}