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,21 @@
1
+ """API response object."""
2
+
3
+ from __future__ import annotations
4
+ from typing import Optional, Generic, Mapping, TypeVar
5
+ from pydantic import Field, StrictInt, StrictBytes, BaseModel
6
+
7
+ T = TypeVar("T")
8
+
9
+ class ApiResponse(BaseModel, Generic[T]):
10
+ """
11
+ API response object
12
+ """
13
+
14
+ status_code: StrictInt = Field(description="HTTP status code")
15
+ headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers")
16
+ data: T = Field(description="Deserialized data given the data type")
17
+ raw_data: StrictBytes = Field(description="Raw data (HTTP response body)")
18
+
19
+ model_config = {
20
+ "arbitrary_types_allowed": True
21
+ }
@@ -0,0 +1,572 @@
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
+ import copy
16
+ import http.client as httplib
17
+ import logging
18
+ from logging import FileHandler
19
+ import sys
20
+ from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union
21
+ from typing_extensions import NotRequired, Self
22
+
23
+ import urllib3
24
+
25
+
26
+ JSON_SCHEMA_VALIDATION_KEYWORDS = {
27
+ 'multipleOf', 'maximum', 'exclusiveMaximum',
28
+ 'minimum', 'exclusiveMinimum', 'maxLength',
29
+ 'minLength', 'pattern', 'maxItems', 'minItems'
30
+ }
31
+
32
+ ServerVariablesT = Dict[str, str]
33
+
34
+ GenericAuthSetting = TypedDict(
35
+ "GenericAuthSetting",
36
+ {
37
+ "type": str,
38
+ "in": str,
39
+ "key": str,
40
+ "value": str,
41
+ },
42
+ )
43
+
44
+
45
+ OAuth2AuthSetting = TypedDict(
46
+ "OAuth2AuthSetting",
47
+ {
48
+ "type": Literal["oauth2"],
49
+ "in": Literal["header"],
50
+ "key": Literal["Authorization"],
51
+ "value": str,
52
+ },
53
+ )
54
+
55
+
56
+ APIKeyAuthSetting = TypedDict(
57
+ "APIKeyAuthSetting",
58
+ {
59
+ "type": Literal["api_key"],
60
+ "in": str,
61
+ "key": str,
62
+ "value": Optional[str],
63
+ },
64
+ )
65
+
66
+
67
+ BasicAuthSetting = TypedDict(
68
+ "BasicAuthSetting",
69
+ {
70
+ "type": Literal["basic"],
71
+ "in": Literal["header"],
72
+ "key": Literal["Authorization"],
73
+ "value": Optional[str],
74
+ },
75
+ )
76
+
77
+
78
+ BearerFormatAuthSetting = TypedDict(
79
+ "BearerFormatAuthSetting",
80
+ {
81
+ "type": Literal["bearer"],
82
+ "in": Literal["header"],
83
+ "format": Literal["JWT"],
84
+ "key": Literal["Authorization"],
85
+ "value": str,
86
+ },
87
+ )
88
+
89
+
90
+ BearerAuthSetting = TypedDict(
91
+ "BearerAuthSetting",
92
+ {
93
+ "type": Literal["bearer"],
94
+ "in": Literal["header"],
95
+ "key": Literal["Authorization"],
96
+ "value": str,
97
+ },
98
+ )
99
+
100
+
101
+ HTTPSignatureAuthSetting = TypedDict(
102
+ "HTTPSignatureAuthSetting",
103
+ {
104
+ "type": Literal["http-signature"],
105
+ "in": Literal["header"],
106
+ "key": Literal["Authorization"],
107
+ "value": None,
108
+ },
109
+ )
110
+
111
+
112
+ AuthSettings = TypedDict(
113
+ "AuthSettings",
114
+ {
115
+ },
116
+ total=False,
117
+ )
118
+
119
+
120
+ class HostSettingVariable(TypedDict):
121
+ description: str
122
+ default_value: str
123
+ enum_values: List[str]
124
+
125
+
126
+ class HostSetting(TypedDict):
127
+ url: str
128
+ description: str
129
+ variables: NotRequired[Dict[str, HostSettingVariable]]
130
+
131
+
132
+ class Configuration:
133
+ """This class contains various settings of the API client.
134
+
135
+ :param host: Base url.
136
+ :param ignore_operation_servers
137
+ Boolean to ignore operation servers for the API client.
138
+ Config will use `host` as the base url regardless of the operation servers.
139
+ :param api_key: Dict to store API key(s).
140
+ Each entry in the dict specifies an API key.
141
+ The dict key is the name of the security scheme in the OAS specification.
142
+ The dict value is the API key secret.
143
+ :param api_key_prefix: Dict to store API prefix (e.g. Bearer).
144
+ The dict key is the name of the security scheme in the OAS specification.
145
+ The dict value is an API key prefix when generating the auth data.
146
+ :param username: Username for HTTP basic authentication.
147
+ :param password: Password for HTTP basic authentication.
148
+ :param access_token: Access token.
149
+ :param server_index: Index to servers configuration.
150
+ :param server_variables: Mapping with string values to replace variables in
151
+ templated server configuration. The validation of enums is performed for
152
+ variables with defined enum values before.
153
+ :param server_operation_index: Mapping from operation ID to an index to server
154
+ configuration.
155
+ :param server_operation_variables: Mapping from operation ID to a mapping with
156
+ string values to replace variables in templated server configuration.
157
+ The validation of enums is performed for variables with defined enum
158
+ values before.
159
+ :param ssl_ca_cert: str - the path to a file of concatenated CA certificates
160
+ in PEM format.
161
+ :param retries: Number of retries for API requests.
162
+ :param ca_cert_data: verify the peer using concatenated CA certificate data
163
+ in PEM (str) or DER (bytes) format.
164
+ :param cert_file: the path to a client certificate file, for mTLS.
165
+ :param key_file: the path to a client key file, for mTLS.
166
+
167
+ """
168
+
169
+ _default: ClassVar[Optional[Self]] = None
170
+
171
+ def __init__(
172
+ self,
173
+ host: Optional[str]=None,
174
+ api_key: Optional[Dict[str, str]]=None,
175
+ api_key_prefix: Optional[Dict[str, str]]=None,
176
+ username: Optional[str]=None,
177
+ password: Optional[str]=None,
178
+ access_token: Optional[str]=None,
179
+ server_index: Optional[int]=None,
180
+ server_variables: Optional[ServerVariablesT]=None,
181
+ server_operation_index: Optional[Dict[int, int]]=None,
182
+ server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None,
183
+ ignore_operation_servers: bool=False,
184
+ ssl_ca_cert: Optional[str]=None,
185
+ retries: Optional[int] = None,
186
+ ca_cert_data: Optional[Union[str, bytes]] = None,
187
+ cert_file: Optional[str]=None,
188
+ key_file: Optional[str]=None,
189
+ *,
190
+ debug: Optional[bool] = None,
191
+ ) -> None:
192
+ """Constructor
193
+ """
194
+ self._base_path = "http://localhost" if host is None else host
195
+ """Default Base url
196
+ """
197
+ self.server_index = 0 if server_index is None and host is None else server_index
198
+ self.server_operation_index = server_operation_index or {}
199
+ """Default server index
200
+ """
201
+ self.server_variables = server_variables or {}
202
+ self.server_operation_variables = server_operation_variables or {}
203
+ """Default server variables
204
+ """
205
+ self.ignore_operation_servers = ignore_operation_servers
206
+ """Ignore operation servers
207
+ """
208
+ self.temp_folder_path = None
209
+ """Temp file folder for downloading files
210
+ """
211
+ # Authentication Settings
212
+ self.api_key = {}
213
+ if api_key:
214
+ self.api_key = api_key
215
+ """dict to store API key(s)
216
+ """
217
+ self.api_key_prefix = {}
218
+ if api_key_prefix:
219
+ self.api_key_prefix = api_key_prefix
220
+ """dict to store API prefix (e.g. Bearer)
221
+ """
222
+ self.refresh_api_key_hook = None
223
+ """function hook to refresh API key if expired
224
+ """
225
+ self.username = username
226
+ """Username for HTTP basic authentication
227
+ """
228
+ self.password = password
229
+ """Password for HTTP basic authentication
230
+ """
231
+ self.access_token = access_token
232
+ """Access token
233
+ """
234
+ self.logger = {}
235
+ """Logging Settings
236
+ """
237
+ self.logger["package_logger"] = logging.getLogger("hindsight_client_api")
238
+ self.logger["urllib3_logger"] = logging.getLogger("urllib3")
239
+ self.logger_format = '%(asctime)s %(levelname)s %(message)s'
240
+ """Log format
241
+ """
242
+ self.logger_stream_handler = None
243
+ """Log stream handler
244
+ """
245
+ self.logger_file_handler: Optional[FileHandler] = None
246
+ """Log file handler
247
+ """
248
+ self.logger_file = None
249
+ """Debug file location
250
+ """
251
+ if debug is not None:
252
+ self.debug = debug
253
+ else:
254
+ self.__debug = False
255
+ """Debug switch
256
+ """
257
+
258
+ self.verify_ssl = True
259
+ """SSL/TLS verification
260
+ Set this to false to skip verifying SSL certificate when calling API
261
+ from https server.
262
+ """
263
+ self.ssl_ca_cert = ssl_ca_cert
264
+ """Set this to customize the certificate file to verify the peer.
265
+ """
266
+ self.ca_cert_data = ca_cert_data
267
+ """Set this to verify the peer using PEM (str) or DER (bytes)
268
+ certificate data.
269
+ """
270
+ self.cert_file = cert_file
271
+ """client certificate file
272
+ """
273
+ self.key_file = key_file
274
+ """client key file
275
+ """
276
+ self.assert_hostname = None
277
+ """Set this to True/False to enable/disable SSL hostname verification.
278
+ """
279
+ self.tls_server_name = None
280
+ """SSL/TLS Server Name Indication (SNI)
281
+ Set this to the SNI value expected by the server.
282
+ """
283
+
284
+ self.connection_pool_maxsize = 100
285
+ """This value is passed to the aiohttp to limit simultaneous connections.
286
+ Default values is 100, None means no-limit.
287
+ """
288
+
289
+ self.proxy: Optional[str] = None
290
+ """Proxy URL
291
+ """
292
+ self.proxy_headers = None
293
+ """Proxy headers
294
+ """
295
+ self.safe_chars_for_path_param = ''
296
+ """Safe chars for path_param
297
+ """
298
+ self.retries = retries
299
+ """Adding retries to override urllib3 default value 3
300
+ """
301
+ # Enable client side validation
302
+ self.client_side_validation = True
303
+
304
+ self.socket_options = None
305
+ """Options to pass down to the underlying urllib3 socket
306
+ """
307
+
308
+ self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z"
309
+ """datetime format
310
+ """
311
+
312
+ self.date_format = "%Y-%m-%d"
313
+ """date format
314
+ """
315
+
316
+ def __deepcopy__(self, memo: Dict[int, Any]) -> Self:
317
+ cls = self.__class__
318
+ result = cls.__new__(cls)
319
+ memo[id(self)] = result
320
+ for k, v in self.__dict__.items():
321
+ if k not in ('logger', 'logger_file_handler'):
322
+ setattr(result, k, copy.deepcopy(v, memo))
323
+ # shallow copy of loggers
324
+ result.logger = copy.copy(self.logger)
325
+ # use setters to configure loggers
326
+ result.logger_file = self.logger_file
327
+ result.debug = self.debug
328
+ return result
329
+
330
+ def __setattr__(self, name: str, value: Any) -> None:
331
+ object.__setattr__(self, name, value)
332
+
333
+ @classmethod
334
+ def set_default(cls, default: Optional[Self]) -> None:
335
+ """Set default instance of configuration.
336
+
337
+ It stores default configuration, which can be
338
+ returned by get_default_copy method.
339
+
340
+ :param default: object of Configuration
341
+ """
342
+ cls._default = default
343
+
344
+ @classmethod
345
+ def get_default_copy(cls) -> Self:
346
+ """Deprecated. Please use `get_default` instead.
347
+
348
+ Deprecated. Please use `get_default` instead.
349
+
350
+ :return: The configuration object.
351
+ """
352
+ return cls.get_default()
353
+
354
+ @classmethod
355
+ def get_default(cls) -> Self:
356
+ """Return the default configuration.
357
+
358
+ This method returns newly created, based on default constructor,
359
+ object of Configuration class or returns a copy of default
360
+ configuration.
361
+
362
+ :return: The configuration object.
363
+ """
364
+ if cls._default is None:
365
+ cls._default = cls()
366
+ return cls._default
367
+
368
+ @property
369
+ def logger_file(self) -> Optional[str]:
370
+ """The logger file.
371
+
372
+ If the logger_file is None, then add stream handler and remove file
373
+ handler. Otherwise, add file handler and remove stream handler.
374
+
375
+ :param value: The logger_file path.
376
+ :type: str
377
+ """
378
+ return self.__logger_file
379
+
380
+ @logger_file.setter
381
+ def logger_file(self, value: Optional[str]) -> None:
382
+ """The logger file.
383
+
384
+ If the logger_file is None, then add stream handler and remove file
385
+ handler. Otherwise, add file handler and remove stream handler.
386
+
387
+ :param value: The logger_file path.
388
+ :type: str
389
+ """
390
+ self.__logger_file = value
391
+ if self.__logger_file:
392
+ # If set logging file,
393
+ # then add file handler and remove stream handler.
394
+ self.logger_file_handler = logging.FileHandler(self.__logger_file)
395
+ self.logger_file_handler.setFormatter(self.logger_formatter)
396
+ for _, logger in self.logger.items():
397
+ logger.addHandler(self.logger_file_handler)
398
+
399
+ @property
400
+ def debug(self) -> bool:
401
+ """Debug status
402
+
403
+ :param value: The debug status, True or False.
404
+ :type: bool
405
+ """
406
+ return self.__debug
407
+
408
+ @debug.setter
409
+ def debug(self, value: bool) -> None:
410
+ """Debug status
411
+
412
+ :param value: The debug status, True or False.
413
+ :type: bool
414
+ """
415
+ self.__debug = value
416
+ if self.__debug:
417
+ # if debug status is True, turn on debug logging
418
+ for _, logger in self.logger.items():
419
+ logger.setLevel(logging.DEBUG)
420
+ # turn on httplib debug
421
+ httplib.HTTPConnection.debuglevel = 1
422
+ else:
423
+ # if debug status is False, turn off debug logging,
424
+ # setting log level to default `logging.WARNING`
425
+ for _, logger in self.logger.items():
426
+ logger.setLevel(logging.WARNING)
427
+ # turn off httplib debug
428
+ httplib.HTTPConnection.debuglevel = 0
429
+
430
+ @property
431
+ def logger_format(self) -> str:
432
+ """The logger format.
433
+
434
+ The logger_formatter will be updated when sets logger_format.
435
+
436
+ :param value: The format string.
437
+ :type: str
438
+ """
439
+ return self.__logger_format
440
+
441
+ @logger_format.setter
442
+ def logger_format(self, value: str) -> None:
443
+ """The logger format.
444
+
445
+ The logger_formatter will be updated when sets logger_format.
446
+
447
+ :param value: The format string.
448
+ :type: str
449
+ """
450
+ self.__logger_format = value
451
+ self.logger_formatter = logging.Formatter(self.__logger_format)
452
+
453
+ def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]:
454
+ """Gets API key (with prefix if set).
455
+
456
+ :param identifier: The identifier of apiKey.
457
+ :param alias: The alternative identifier of apiKey.
458
+ :return: The token for api key authentication.
459
+ """
460
+ if self.refresh_api_key_hook is not None:
461
+ self.refresh_api_key_hook(self)
462
+ key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None)
463
+ if key:
464
+ prefix = self.api_key_prefix.get(identifier)
465
+ if prefix:
466
+ return "%s %s" % (prefix, key)
467
+ else:
468
+ return key
469
+
470
+ return None
471
+
472
+ def get_basic_auth_token(self) -> Optional[str]:
473
+ """Gets HTTP basic authentication header (string).
474
+
475
+ :return: The token for basic HTTP authentication.
476
+ """
477
+ username = ""
478
+ if self.username is not None:
479
+ username = self.username
480
+ password = ""
481
+ if self.password is not None:
482
+ password = self.password
483
+ return urllib3.util.make_headers(
484
+ basic_auth=username + ':' + password
485
+ ).get('authorization')
486
+
487
+ def auth_settings(self)-> AuthSettings:
488
+ """Gets Auth Settings dict for api client.
489
+
490
+ :return: The Auth Settings information dict.
491
+ """
492
+ auth: AuthSettings = {}
493
+ return auth
494
+
495
+ def to_debug_report(self) -> str:
496
+ """Gets the essential information for debugging.
497
+
498
+ :return: The report for debugging.
499
+ """
500
+ return "Python SDK Debug Report:\n"\
501
+ "OS: {env}\n"\
502
+ "Python Version: {pyversion}\n"\
503
+ "Version of the API: 1.0.0\n"\
504
+ "SDK Package Version: 0.0.7".\
505
+ format(env=sys.platform, pyversion=sys.version)
506
+
507
+ def get_host_settings(self) -> List[HostSetting]:
508
+ """Gets an array of host settings
509
+
510
+ :return: An array of host settings
511
+ """
512
+ return [
513
+ {
514
+ 'url': "",
515
+ 'description': "No description provided",
516
+ }
517
+ ]
518
+
519
+ def get_host_from_settings(
520
+ self,
521
+ index: Optional[int],
522
+ variables: Optional[ServerVariablesT]=None,
523
+ servers: Optional[List[HostSetting]]=None,
524
+ ) -> str:
525
+ """Gets host URL based on the index and variables
526
+ :param index: array index of the host settings
527
+ :param variables: hash of variable and the corresponding value
528
+ :param servers: an array of host settings or None
529
+ :return: URL based on host settings
530
+ """
531
+ if index is None:
532
+ return self._base_path
533
+
534
+ variables = {} if variables is None else variables
535
+ servers = self.get_host_settings() if servers is None else servers
536
+
537
+ try:
538
+ server = servers[index]
539
+ except IndexError:
540
+ raise ValueError(
541
+ "Invalid index {0} when selecting the host settings. "
542
+ "Must be less than {1}".format(index, len(servers)))
543
+
544
+ url = server['url']
545
+
546
+ # go through variables and replace placeholders
547
+ for variable_name, variable in server.get('variables', {}).items():
548
+ used_value = variables.get(
549
+ variable_name, variable['default_value'])
550
+
551
+ if 'enum_values' in variable \
552
+ and used_value not in variable['enum_values']:
553
+ raise ValueError(
554
+ "The variable `{0}` in the host URL has invalid value "
555
+ "{1}. Must be {2}.".format(
556
+ variable_name, variables[variable_name],
557
+ variable['enum_values']))
558
+
559
+ url = url.replace("{" + variable_name + "}", used_value)
560
+
561
+ return url
562
+
563
+ @property
564
+ def host(self) -> str:
565
+ """Return generated host."""
566
+ return self.get_host_from_settings(self.server_index, variables=self.server_variables)
567
+
568
+ @host.setter
569
+ def host(self, value: str) -> None:
570
+ """Fix base path."""
571
+ self._base_path = value
572
+ self.server_index = None
@@ -0,0 +1,31 @@
1
+ # AddBackgroundRequest
2
+
3
+ Request model for adding/merging background information.
4
+
5
+ ## Properties
6
+
7
+ Name | Type | Description | Notes
8
+ ------------ | ------------- | ------------- | -------------
9
+ **content** | **str** | New background information to add or merge |
10
+ **update_personality** | **bool** | If true, infer Big Five personality traits from the merged background (default: true) | [optional] [default to True]
11
+
12
+ ## Example
13
+
14
+ ```python
15
+ from hindsight_client_api.models.add_background_request import AddBackgroundRequest
16
+
17
+ # TODO update the JSON string below
18
+ json = "{}"
19
+ # create an instance of AddBackgroundRequest from a JSON string
20
+ add_background_request_instance = AddBackgroundRequest.from_json(json)
21
+ # print the JSON string representation of the object
22
+ print(AddBackgroundRequest.to_json())
23
+
24
+ # convert the object into a dict
25
+ add_background_request_dict = add_background_request_instance.to_dict()
26
+ # create an instance of AddBackgroundRequest from a dict
27
+ add_background_request_from_dict = AddBackgroundRequest.from_dict(add_background_request_dict)
28
+ ```
29
+ [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
30
+
31
+
@@ -0,0 +1,31 @@
1
+ # BackgroundResponse
2
+
3
+ Response model for background update.
4
+
5
+ ## Properties
6
+
7
+ Name | Type | Description | Notes
8
+ ------------ | ------------- | ------------- | -------------
9
+ **background** | **str** | |
10
+ **personality** | [**PersonalityTraits**](PersonalityTraits.md) | | [optional]
11
+
12
+ ## Example
13
+
14
+ ```python
15
+ from hindsight_client_api.models.background_response import BackgroundResponse
16
+
17
+ # TODO update the JSON string below
18
+ json = "{}"
19
+ # create an instance of BackgroundResponse from a JSON string
20
+ background_response_instance = BackgroundResponse.from_json(json)
21
+ # print the JSON string representation of the object
22
+ print(BackgroundResponse.to_json())
23
+
24
+ # convert the object into a dict
25
+ background_response_dict = background_response_instance.to_dict()
26
+ # create an instance of BackgroundResponse from a dict
27
+ background_response_from_dict = BackgroundResponse.from_dict(background_response_dict)
28
+ ```
29
+ [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
30
+
31
+
@@ -0,0 +1,35 @@
1
+ # BankListItem
2
+
3
+ Bank list item with profile summary.
4
+
5
+ ## Properties
6
+
7
+ Name | Type | Description | Notes
8
+ ------------ | ------------- | ------------- | -------------
9
+ **bank_id** | **str** | |
10
+ **name** | **str** | |
11
+ **personality** | [**PersonalityTraits**](PersonalityTraits.md) | |
12
+ **background** | **str** | |
13
+ **created_at** | **str** | | [optional]
14
+ **updated_at** | **str** | | [optional]
15
+
16
+ ## Example
17
+
18
+ ```python
19
+ from hindsight_client_api.models.bank_list_item import BankListItem
20
+
21
+ # TODO update the JSON string below
22
+ json = "{}"
23
+ # create an instance of BankListItem from a JSON string
24
+ bank_list_item_instance = BankListItem.from_json(json)
25
+ # print the JSON string representation of the object
26
+ print(BankListItem.to_json())
27
+
28
+ # convert the object into a dict
29
+ bank_list_item_dict = bank_list_item_instance.to_dict()
30
+ # create an instance of BankListItem from a dict
31
+ bank_list_item_from_dict = BankListItem.from_dict(bank_list_item_dict)
32
+ ```
33
+ [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
34
+
35
+