hindsight-client 0.0.13__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. hindsight_client/__init__.py +26 -0
  2. hindsight_client/hindsight_client.py +432 -0
  3. hindsight_client-0.0.13.dist-info/METADATA +56 -0
  4. hindsight_client-0.0.13.dist-info/RECORD +134 -0
  5. hindsight_client-0.0.13.dist-info/WHEEL +4 -0
  6. hindsight_client_api/__init__.py +126 -0
  7. hindsight_client_api/api/__init__.py +6 -0
  8. hindsight_client_api/api/default_api.py +5976 -0
  9. hindsight_client_api/api/monitoring_api.py +281 -0
  10. hindsight_client_api/api_client.py +807 -0
  11. hindsight_client_api/api_response.py +21 -0
  12. hindsight_client_api/configuration.py +572 -0
  13. hindsight_client_api/docs/AddBackgroundRequest.md +31 -0
  14. hindsight_client_api/docs/BackgroundResponse.md +31 -0
  15. hindsight_client_api/docs/BankListItem.md +35 -0
  16. hindsight_client_api/docs/BankListResponse.md +30 -0
  17. hindsight_client_api/docs/BankProfileResponse.md +33 -0
  18. hindsight_client_api/docs/Budget.md +15 -0
  19. hindsight_client_api/docs/ChunkData.md +33 -0
  20. hindsight_client_api/docs/ChunkIncludeOptions.md +30 -0
  21. hindsight_client_api/docs/ChunkResponse.md +35 -0
  22. hindsight_client_api/docs/CreateBankRequest.md +32 -0
  23. hindsight_client_api/docs/DefaultApi.md +1569 -0
  24. hindsight_client_api/docs/DeleteResponse.md +30 -0
  25. hindsight_client_api/docs/DocumentResponse.md +36 -0
  26. hindsight_client_api/docs/EntityDetailResponse.md +36 -0
  27. hindsight_client_api/docs/EntityIncludeOptions.md +30 -0
  28. hindsight_client_api/docs/EntityListItem.md +35 -0
  29. hindsight_client_api/docs/EntityListResponse.md +30 -0
  30. hindsight_client_api/docs/EntityObservationResponse.md +31 -0
  31. hindsight_client_api/docs/EntityStateResponse.md +32 -0
  32. hindsight_client_api/docs/GraphDataResponse.md +33 -0
  33. hindsight_client_api/docs/HTTPValidationError.md +29 -0
  34. hindsight_client_api/docs/IncludeOptions.md +31 -0
  35. hindsight_client_api/docs/ListDocumentsResponse.md +33 -0
  36. hindsight_client_api/docs/ListMemoryUnitsResponse.md +33 -0
  37. hindsight_client_api/docs/MemoryItem.md +34 -0
  38. hindsight_client_api/docs/MetadataFilter.md +32 -0
  39. hindsight_client_api/docs/MonitoringApi.md +72 -0
  40. hindsight_client_api/docs/PersonalityTraits.md +35 -0
  41. hindsight_client_api/docs/RecallRequest.md +37 -0
  42. hindsight_client_api/docs/RecallResponse.md +33 -0
  43. hindsight_client_api/docs/RecallResult.md +40 -0
  44. hindsight_client_api/docs/ReflectFact.md +35 -0
  45. hindsight_client_api/docs/ReflectIncludeOptions.md +30 -0
  46. hindsight_client_api/docs/ReflectRequest.md +34 -0
  47. hindsight_client_api/docs/ReflectResponse.md +31 -0
  48. hindsight_client_api/docs/RetainRequest.md +31 -0
  49. hindsight_client_api/docs/RetainResponse.md +33 -0
  50. hindsight_client_api/docs/UpdatePersonalityRequest.md +30 -0
  51. hindsight_client_api/docs/ValidationError.md +31 -0
  52. hindsight_client_api/docs/ValidationErrorLocInner.md +28 -0
  53. hindsight_client_api/exceptions.py +219 -0
  54. hindsight_client_api/models/__init__.py +54 -0
  55. hindsight_client_api/models/add_background_request.py +89 -0
  56. hindsight_client_api/models/background_response.py +98 -0
  57. hindsight_client_api/models/bank_list_item.py +111 -0
  58. hindsight_client_api/models/bank_list_response.py +95 -0
  59. hindsight_client_api/models/bank_profile_response.py +97 -0
  60. hindsight_client_api/models/budget.py +38 -0
  61. hindsight_client_api/models/chunk_data.py +93 -0
  62. hindsight_client_api/models/chunk_include_options.py +87 -0
  63. hindsight_client_api/models/chunk_response.py +97 -0
  64. hindsight_client_api/models/create_bank_request.py +110 -0
  65. hindsight_client_api/models/delete_response.py +87 -0
  66. hindsight_client_api/models/document_response.py +104 -0
  67. hindsight_client_api/models/entity_detail_response.py +122 -0
  68. hindsight_client_api/models/entity_include_options.py +87 -0
  69. hindsight_client_api/models/entity_list_item.py +112 -0
  70. hindsight_client_api/models/entity_list_response.py +95 -0
  71. hindsight_client_api/models/entity_observation_response.py +94 -0
  72. hindsight_client_api/models/entity_state_response.py +99 -0
  73. hindsight_client_api/models/graph_data_response.py +93 -0
  74. hindsight_client_api/models/http_validation_error.py +95 -0
  75. hindsight_client_api/models/include_options.py +107 -0
  76. hindsight_client_api/models/list_documents_response.py +93 -0
  77. hindsight_client_api/models/list_memory_units_response.py +93 -0
  78. hindsight_client_api/models/memory_item.py +116 -0
  79. hindsight_client_api/models/metadata_filter.py +96 -0
  80. hindsight_client_api/models/personality_traits.py +98 -0
  81. hindsight_client_api/models/recall_request.py +129 -0
  82. hindsight_client_api/models/recall_response.py +142 -0
  83. hindsight_client_api/models/recall_result.py +152 -0
  84. hindsight_client_api/models/reflect_fact.py +122 -0
  85. hindsight_client_api/models/reflect_include_options.py +87 -0
  86. hindsight_client_api/models/reflect_request.py +118 -0
  87. hindsight_client_api/models/reflect_response.py +97 -0
  88. hindsight_client_api/models/retain_request.py +97 -0
  89. hindsight_client_api/models/retain_response.py +93 -0
  90. hindsight_client_api/models/update_personality_request.py +91 -0
  91. hindsight_client_api/models/validation_error.py +99 -0
  92. hindsight_client_api/models/validation_error_loc_inner.py +138 -0
  93. hindsight_client_api/rest.py +213 -0
  94. hindsight_client_api/test/__init__.py +0 -0
  95. hindsight_client_api/test/test_add_background_request.py +53 -0
  96. hindsight_client_api/test/test_background_response.py +53 -0
  97. hindsight_client_api/test/test_bank_list_item.py +60 -0
  98. hindsight_client_api/test/test_bank_list_response.py +68 -0
  99. hindsight_client_api/test/test_bank_profile_response.py +58 -0
  100. hindsight_client_api/test/test_budget.py +33 -0
  101. hindsight_client_api/test/test_chunk_data.py +57 -0
  102. hindsight_client_api/test/test_chunk_include_options.py +51 -0
  103. hindsight_client_api/test/test_chunk_response.py +62 -0
  104. hindsight_client_api/test/test_create_bank_request.py +53 -0
  105. hindsight_client_api/test/test_default_api.py +178 -0
  106. hindsight_client_api/test/test_delete_response.py +52 -0
  107. hindsight_client_api/test/test_document_response.py +64 -0
  108. hindsight_client_api/test/test_entity_detail_response.py +71 -0
  109. hindsight_client_api/test/test_entity_include_options.py +51 -0
  110. hindsight_client_api/test/test_entity_list_item.py +61 -0
  111. hindsight_client_api/test/test_entity_list_response.py +56 -0
  112. hindsight_client_api/test/test_entity_observation_response.py +53 -0
  113. hindsight_client_api/test/test_entity_state_response.py +64 -0
  114. hindsight_client_api/test/test_graph_data_response.py +82 -0
  115. hindsight_client_api/test/test_http_validation_error.py +58 -0
  116. hindsight_client_api/test/test_include_options.py +54 -0
  117. hindsight_client_api/test/test_list_documents_response.py +66 -0
  118. hindsight_client_api/test/test_list_memory_units_response.py +66 -0
  119. hindsight_client_api/test/test_memory_item.py +58 -0
  120. hindsight_client_api/test/test_metadata_filter.py +54 -0
  121. hindsight_client_api/test/test_monitoring_api.py +38 -0
  122. hindsight_client_api/test/test_personality_traits.py +62 -0
  123. hindsight_client_api/test/test_recall_request.py +67 -0
  124. hindsight_client_api/test/test_recall_response.py +76 -0
  125. hindsight_client_api/test/test_recall_result.py +67 -0
  126. hindsight_client_api/test/test_reflect_fact.py +57 -0
  127. hindsight_client_api/test/test_reflect_include_options.py +51 -0
  128. hindsight_client_api/test/test_reflect_request.py +59 -0
  129. hindsight_client_api/test/test_reflect_response.py +55 -0
  130. hindsight_client_api/test/test_retain_request.py +57 -0
  131. hindsight_client_api/test/test_retain_response.py +58 -0
  132. hindsight_client_api/test/test_update_personality_request.py +52 -0
  133. hindsight_client_api/test/test_validation_error.py +60 -0
  134. hindsight_client_api/test/test_validation_error_loc_inner.py +50 -0
@@ -0,0 +1,112 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Hindsight HTTP API
5
+
6
+ HTTP API for Hindsight
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class EntityListItem(BaseModel):
26
+ """
27
+ Entity list item with summary.
28
+ """ # noqa: E501
29
+ id: StrictStr
30
+ canonical_name: StrictStr
31
+ mention_count: StrictInt
32
+ first_seen: Optional[StrictStr] = None
33
+ last_seen: Optional[StrictStr] = None
34
+ metadata: Optional[Dict[str, Any]] = None
35
+ __properties: ClassVar[List[str]] = ["id", "canonical_name", "mention_count", "first_seen", "last_seen", "metadata"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
+ return json.dumps(self.to_dict())
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of EntityListItem from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ """
68
+ excluded_fields: Set[str] = set([
69
+ ])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ # set to None if first_seen (nullable) is None
77
+ # and model_fields_set contains the field
78
+ if self.first_seen is None and "first_seen" in self.model_fields_set:
79
+ _dict['first_seen'] = None
80
+
81
+ # set to None if last_seen (nullable) is None
82
+ # and model_fields_set contains the field
83
+ if self.last_seen is None and "last_seen" in self.model_fields_set:
84
+ _dict['last_seen'] = None
85
+
86
+ # set to None if metadata (nullable) is None
87
+ # and model_fields_set contains the field
88
+ if self.metadata is None and "metadata" in self.model_fields_set:
89
+ _dict['metadata'] = None
90
+
91
+ return _dict
92
+
93
+ @classmethod
94
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
95
+ """Create an instance of EntityListItem from a dict"""
96
+ if obj is None:
97
+ return None
98
+
99
+ if not isinstance(obj, dict):
100
+ return cls.model_validate(obj)
101
+
102
+ _obj = cls.model_validate({
103
+ "id": obj.get("id"),
104
+ "canonical_name": obj.get("canonical_name"),
105
+ "mention_count": obj.get("mention_count"),
106
+ "first_seen": obj.get("first_seen"),
107
+ "last_seen": obj.get("last_seen"),
108
+ "metadata": obj.get("metadata")
109
+ })
110
+ return _obj
111
+
112
+
@@ -0,0 +1,95 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Hindsight HTTP API
5
+
6
+ HTTP API for Hindsight
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict
21
+ from typing import Any, ClassVar, Dict, List
22
+ from hindsight_client_api.models.entity_list_item import EntityListItem
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class EntityListResponse(BaseModel):
27
+ """
28
+ Response model for entity list endpoint.
29
+ """ # noqa: E501
30
+ items: List[EntityListItem]
31
+ __properties: ClassVar[List[str]] = ["items"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of EntityListResponse from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ # override the default output from pydantic by calling `to_dict()` of each item in items (list)
73
+ _items = []
74
+ if self.items:
75
+ for _item_items in self.items:
76
+ if _item_items:
77
+ _items.append(_item_items.to_dict())
78
+ _dict['items'] = _items
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of EntityListResponse from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return cls.model_validate(obj)
89
+
90
+ _obj = cls.model_validate({
91
+ "items": [EntityListItem.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
92
+ })
93
+ return _obj
94
+
95
+
@@ -0,0 +1,94 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Hindsight HTTP API
5
+
6
+ HTTP API for Hindsight
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class EntityObservationResponse(BaseModel):
26
+ """
27
+ An observation about an entity.
28
+ """ # noqa: E501
29
+ text: StrictStr
30
+ mentioned_at: Optional[StrictStr] = None
31
+ __properties: ClassVar[List[str]] = ["text", "mentioned_at"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of EntityObservationResponse from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ # set to None if mentioned_at (nullable) is None
73
+ # and model_fields_set contains the field
74
+ if self.mentioned_at is None and "mentioned_at" in self.model_fields_set:
75
+ _dict['mentioned_at'] = None
76
+
77
+ return _dict
78
+
79
+ @classmethod
80
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
81
+ """Create an instance of EntityObservationResponse from a dict"""
82
+ if obj is None:
83
+ return None
84
+
85
+ if not isinstance(obj, dict):
86
+ return cls.model_validate(obj)
87
+
88
+ _obj = cls.model_validate({
89
+ "text": obj.get("text"),
90
+ "mentioned_at": obj.get("mentioned_at")
91
+ })
92
+ return _obj
93
+
94
+
@@ -0,0 +1,99 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Hindsight HTTP API
5
+
6
+ HTTP API for Hindsight
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictStr
21
+ from typing import Any, ClassVar, Dict, List
22
+ from hindsight_client_api.models.entity_observation_response import EntityObservationResponse
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class EntityStateResponse(BaseModel):
27
+ """
28
+ Current mental model of an entity.
29
+ """ # noqa: E501
30
+ entity_id: StrictStr
31
+ canonical_name: StrictStr
32
+ observations: List[EntityObservationResponse]
33
+ __properties: ClassVar[List[str]] = ["entity_id", "canonical_name", "observations"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of EntityStateResponse from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ # override the default output from pydantic by calling `to_dict()` of each item in observations (list)
75
+ _items = []
76
+ if self.observations:
77
+ for _item_observations in self.observations:
78
+ if _item_observations:
79
+ _items.append(_item_observations.to_dict())
80
+ _dict['observations'] = _items
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of EntityStateResponse from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate({
93
+ "entity_id": obj.get("entity_id"),
94
+ "canonical_name": obj.get("canonical_name"),
95
+ "observations": [EntityObservationResponse.from_dict(_item) for _item in obj["observations"]] if obj.get("observations") is not None else None
96
+ })
97
+ return _obj
98
+
99
+
@@ -0,0 +1,93 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Hindsight HTTP API
5
+
6
+ HTTP API for Hindsight
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictInt
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class GraphDataResponse(BaseModel):
26
+ """
27
+ Response model for graph data endpoint.
28
+ """ # noqa: E501
29
+ nodes: List[Dict[str, Any]]
30
+ edges: List[Dict[str, Any]]
31
+ table_rows: List[Dict[str, Any]]
32
+ total_units: StrictInt
33
+ __properties: ClassVar[List[str]] = ["nodes", "edges", "table_rows", "total_units"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of GraphDataResponse from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ return _dict
75
+
76
+ @classmethod
77
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78
+ """Create an instance of GraphDataResponse from a dict"""
79
+ if obj is None:
80
+ return None
81
+
82
+ if not isinstance(obj, dict):
83
+ return cls.model_validate(obj)
84
+
85
+ _obj = cls.model_validate({
86
+ "nodes": obj.get("nodes"),
87
+ "edges": obj.get("edges"),
88
+ "table_rows": obj.get("table_rows"),
89
+ "total_units": obj.get("total_units")
90
+ })
91
+ return _obj
92
+
93
+
@@ -0,0 +1,95 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Hindsight HTTP API
5
+
6
+ HTTP API for Hindsight
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from hindsight_client_api.models.validation_error import ValidationError
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class HTTPValidationError(BaseModel):
27
+ """
28
+ HTTPValidationError
29
+ """ # noqa: E501
30
+ detail: Optional[List[ValidationError]] = None
31
+ __properties: ClassVar[List[str]] = ["detail"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of HTTPValidationError from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ # override the default output from pydantic by calling `to_dict()` of each item in detail (list)
73
+ _items = []
74
+ if self.detail:
75
+ for _item_detail in self.detail:
76
+ if _item_detail:
77
+ _items.append(_item_detail.to_dict())
78
+ _dict['detail'] = _items
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of HTTPValidationError from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return cls.model_validate(obj)
89
+
90
+ _obj = cls.model_validate({
91
+ "detail": [ValidationError.from_dict(_item) for _item in obj["detail"]] if obj.get("detail") is not None else None
92
+ })
93
+ return _obj
94
+
95
+
@@ -0,0 +1,107 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Hindsight HTTP API
5
+
6
+ HTTP API for Hindsight
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from hindsight_client_api.models.chunk_include_options import ChunkIncludeOptions
23
+ from hindsight_client_api.models.entity_include_options import EntityIncludeOptions
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class IncludeOptions(BaseModel):
28
+ """
29
+ Options for including additional data in recall results.
30
+ """ # noqa: E501
31
+ entities: Optional[EntityIncludeOptions] = None
32
+ chunks: Optional[ChunkIncludeOptions] = None
33
+ __properties: ClassVar[List[str]] = ["entities", "chunks"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of IncludeOptions from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ # override the default output from pydantic by calling `to_dict()` of entities
75
+ if self.entities:
76
+ _dict['entities'] = self.entities.to_dict()
77
+ # override the default output from pydantic by calling `to_dict()` of chunks
78
+ if self.chunks:
79
+ _dict['chunks'] = self.chunks.to_dict()
80
+ # set to None if entities (nullable) is None
81
+ # and model_fields_set contains the field
82
+ if self.entities is None and "entities" in self.model_fields_set:
83
+ _dict['entities'] = None
84
+
85
+ # set to None if chunks (nullable) is None
86
+ # and model_fields_set contains the field
87
+ if self.chunks is None and "chunks" in self.model_fields_set:
88
+ _dict['chunks'] = None
89
+
90
+ return _dict
91
+
92
+ @classmethod
93
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
94
+ """Create an instance of IncludeOptions from a dict"""
95
+ if obj is None:
96
+ return None
97
+
98
+ if not isinstance(obj, dict):
99
+ return cls.model_validate(obj)
100
+
101
+ _obj = cls.model_validate({
102
+ "entities": EntityIncludeOptions.from_dict(obj["entities"]) if obj.get("entities") is not None else None,
103
+ "chunks": ChunkIncludeOptions.from_dict(obj["chunks"]) if obj.get("chunks") is not None else None
104
+ })
105
+ return _obj
106
+
107
+