hindsight-client 0.2.0__tar.gz → 0.2.1__tar.gz

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 (119) hide show
  1. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/.openapi-generator/FILES +1 -48
  2. hindsight_client-0.2.1/.openapi-generator/VERSION +1 -0
  3. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/PKG-INFO +1 -1
  4. hindsight_client-0.2.1/hindsight_client_api/__init__.py +81 -0
  5. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/api_client.py +6 -13
  6. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/configuration.py +4 -15
  7. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/exceptions.py +2 -22
  8. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/entity_input.py +22 -10
  9. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/memory_item.py +10 -6
  10. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/rest.py +60 -38
  11. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/openapi-generator-config.yaml +3 -1
  12. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/pyproject.toml +1 -1
  13. hindsight_client-0.2.0/.openapi-generator/VERSION +0 -1
  14. hindsight_client-0.2.0/hindsight_client_api/__init__.py +0 -142
  15. hindsight_client-0.2.0/hindsight_client_api/docs/AddBackgroundRequest.md +0 -31
  16. hindsight_client-0.2.0/hindsight_client_api/docs/BackgroundResponse.md +0 -31
  17. hindsight_client-0.2.0/hindsight_client_api/docs/BankListItem.md +0 -35
  18. hindsight_client-0.2.0/hindsight_client_api/docs/BankListResponse.md +0 -30
  19. hindsight_client-0.2.0/hindsight_client_api/docs/BankProfileResponse.md +0 -33
  20. hindsight_client-0.2.0/hindsight_client_api/docs/BankStatsResponse.md +0 -39
  21. hindsight_client-0.2.0/hindsight_client_api/docs/BanksApi.md +0 -517
  22. hindsight_client-0.2.0/hindsight_client_api/docs/Budget.md +0 -15
  23. hindsight_client-0.2.0/hindsight_client_api/docs/CancelOperationResponse.md +0 -32
  24. hindsight_client-0.2.0/hindsight_client_api/docs/ChunkData.md +0 -33
  25. hindsight_client-0.2.0/hindsight_client_api/docs/ChunkIncludeOptions.md +0 -30
  26. hindsight_client-0.2.0/hindsight_client_api/docs/ChunkResponse.md +0 -35
  27. hindsight_client-0.2.0/hindsight_client_api/docs/CreateBankRequest.md +0 -32
  28. hindsight_client-0.2.0/hindsight_client_api/docs/DeleteDocumentResponse.md +0 -33
  29. hindsight_client-0.2.0/hindsight_client_api/docs/DeleteResponse.md +0 -32
  30. hindsight_client-0.2.0/hindsight_client_api/docs/DispositionTraits.md +0 -32
  31. hindsight_client-0.2.0/hindsight_client_api/docs/DocumentResponse.md +0 -36
  32. hindsight_client-0.2.0/hindsight_client_api/docs/DocumentsApi.md +0 -313
  33. hindsight_client-0.2.0/hindsight_client_api/docs/EntitiesApi.md +0 -230
  34. hindsight_client-0.2.0/hindsight_client_api/docs/EntityDetailResponse.md +0 -36
  35. hindsight_client-0.2.0/hindsight_client_api/docs/EntityIncludeOptions.md +0 -30
  36. hindsight_client-0.2.0/hindsight_client_api/docs/EntityListItem.md +0 -35
  37. hindsight_client-0.2.0/hindsight_client_api/docs/EntityListResponse.md +0 -30
  38. hindsight_client-0.2.0/hindsight_client_api/docs/EntityObservationResponse.md +0 -31
  39. hindsight_client-0.2.0/hindsight_client_api/docs/EntityStateResponse.md +0 -32
  40. hindsight_client-0.2.0/hindsight_client_api/docs/GraphDataResponse.md +0 -33
  41. hindsight_client-0.2.0/hindsight_client_api/docs/HTTPValidationError.md +0 -29
  42. hindsight_client-0.2.0/hindsight_client_api/docs/IncludeOptions.md +0 -31
  43. hindsight_client-0.2.0/hindsight_client_api/docs/ListDocumentsResponse.md +0 -33
  44. hindsight_client-0.2.0/hindsight_client_api/docs/ListMemoryUnitsResponse.md +0 -33
  45. hindsight_client-0.2.0/hindsight_client_api/docs/MemoryApi.md +0 -499
  46. hindsight_client-0.2.0/hindsight_client_api/docs/MemoryItem.md +0 -34
  47. hindsight_client-0.2.0/hindsight_client_api/docs/MonitoringApi.md +0 -136
  48. hindsight_client-0.2.0/hindsight_client_api/docs/OperationResponse.md +0 -36
  49. hindsight_client-0.2.0/hindsight_client_api/docs/OperationsApi.md +0 -154
  50. hindsight_client-0.2.0/hindsight_client_api/docs/OperationsListResponse.md +0 -31
  51. hindsight_client-0.2.0/hindsight_client_api/docs/RecallRequest.md +0 -36
  52. hindsight_client-0.2.0/hindsight_client_api/docs/RecallResponse.md +0 -33
  53. hindsight_client-0.2.0/hindsight_client_api/docs/RecallResult.md +0 -40
  54. hindsight_client-0.2.0/hindsight_client_api/docs/ReflectFact.md +0 -35
  55. hindsight_client-0.2.0/hindsight_client_api/docs/ReflectIncludeOptions.md +0 -30
  56. hindsight_client-0.2.0/hindsight_client_api/docs/ReflectRequest.md +0 -35
  57. hindsight_client-0.2.0/hindsight_client_api/docs/ReflectResponse.md +0 -32
  58. hindsight_client-0.2.0/hindsight_client_api/docs/RetainRequest.md +0 -31
  59. hindsight_client-0.2.0/hindsight_client_api/docs/RetainResponse.md +0 -33
  60. hindsight_client-0.2.0/hindsight_client_api/docs/UpdateDispositionRequest.md +0 -30
  61. hindsight_client-0.2.0/hindsight_client_api/docs/ValidationError.md +0 -31
  62. hindsight_client-0.2.0/hindsight_client_api/docs/ValidationErrorLocInner.md +0 -28
  63. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/.gitignore +0 -0
  64. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/.openapi-generator-ignore +0 -0
  65. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/README.md +0 -0
  66. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client/__init__.py +0 -0
  67. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client/hindsight_client.py +0 -0
  68. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/api/__init__.py +0 -0
  69. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/api/banks_api.py +0 -0
  70. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/api/documents_api.py +0 -0
  71. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/api/entities_api.py +0 -0
  72. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/api/memory_api.py +0 -0
  73. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/api/monitoring_api.py +0 -0
  74. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/api/operations_api.py +0 -0
  75. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/api_response.py +0 -0
  76. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/__init__.py +1 -1
  77. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/add_background_request.py +0 -0
  78. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/background_response.py +0 -0
  79. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/bank_list_item.py +0 -0
  80. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/bank_list_response.py +0 -0
  81. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/bank_profile_response.py +0 -0
  82. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/bank_stats_response.py +0 -0
  83. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/budget.py +0 -0
  84. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/cancel_operation_response.py +0 -0
  85. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/chunk_data.py +0 -0
  86. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/chunk_include_options.py +0 -0
  87. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/chunk_response.py +0 -0
  88. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/create_bank_request.py +0 -0
  89. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/delete_document_response.py +0 -0
  90. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/delete_response.py +0 -0
  91. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/disposition_traits.py +0 -0
  92. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/document_response.py +0 -0
  93. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/entity_detail_response.py +0 -0
  94. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/entity_include_options.py +0 -0
  95. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/entity_list_item.py +0 -0
  96. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/entity_list_response.py +0 -0
  97. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/entity_observation_response.py +0 -0
  98. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/entity_state_response.py +0 -0
  99. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/graph_data_response.py +0 -0
  100. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/http_validation_error.py +0 -0
  101. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/include_options.py +0 -0
  102. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/list_documents_response.py +0 -0
  103. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/list_memory_units_response.py +0 -0
  104. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/operation_response.py +0 -0
  105. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/operations_list_response.py +0 -0
  106. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/recall_request.py +0 -0
  107. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/recall_response.py +0 -0
  108. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/recall_result.py +0 -0
  109. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/reflect_fact.py +0 -0
  110. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/reflect_include_options.py +0 -0
  111. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/reflect_request.py +0 -0
  112. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/reflect_response.py +0 -0
  113. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/retain_request.py +0 -0
  114. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/retain_response.py +0 -0
  115. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/update_disposition_request.py +0 -0
  116. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/validation_error.py +0 -0
  117. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/hindsight_client_api/models/validation_error_loc_inner.py +0 -0
  118. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/tests/__init__.py +0 -0
  119. {hindsight_client-0.2.0 → hindsight_client-0.2.1}/tests/test_main_operations.py +0 -0
@@ -9,54 +9,6 @@ hindsight_client_api/api/operations_api.py
9
9
  hindsight_client_api/api_client.py
10
10
  hindsight_client_api/api_response.py
11
11
  hindsight_client_api/configuration.py
12
- hindsight_client_api/docs/AddBackgroundRequest.md
13
- hindsight_client_api/docs/BackgroundResponse.md
14
- hindsight_client_api/docs/BankListItem.md
15
- hindsight_client_api/docs/BankListResponse.md
16
- hindsight_client_api/docs/BankProfileResponse.md
17
- hindsight_client_api/docs/BankStatsResponse.md
18
- hindsight_client_api/docs/BanksApi.md
19
- hindsight_client_api/docs/Budget.md
20
- hindsight_client_api/docs/CancelOperationResponse.md
21
- hindsight_client_api/docs/ChunkData.md
22
- hindsight_client_api/docs/ChunkIncludeOptions.md
23
- hindsight_client_api/docs/ChunkResponse.md
24
- hindsight_client_api/docs/CreateBankRequest.md
25
- hindsight_client_api/docs/DeleteDocumentResponse.md
26
- hindsight_client_api/docs/DeleteResponse.md
27
- hindsight_client_api/docs/DispositionTraits.md
28
- hindsight_client_api/docs/DocumentResponse.md
29
- hindsight_client_api/docs/DocumentsApi.md
30
- hindsight_client_api/docs/EntitiesApi.md
31
- hindsight_client_api/docs/EntityDetailResponse.md
32
- hindsight_client_api/docs/EntityIncludeOptions.md
33
- hindsight_client_api/docs/EntityListItem.md
34
- hindsight_client_api/docs/EntityListResponse.md
35
- hindsight_client_api/docs/EntityObservationResponse.md
36
- hindsight_client_api/docs/EntityStateResponse.md
37
- hindsight_client_api/docs/GraphDataResponse.md
38
- hindsight_client_api/docs/HTTPValidationError.md
39
- hindsight_client_api/docs/IncludeOptions.md
40
- hindsight_client_api/docs/ListDocumentsResponse.md
41
- hindsight_client_api/docs/ListMemoryUnitsResponse.md
42
- hindsight_client_api/docs/MemoryApi.md
43
- hindsight_client_api/docs/MemoryItem.md
44
- hindsight_client_api/docs/MonitoringApi.md
45
- hindsight_client_api/docs/OperationResponse.md
46
- hindsight_client_api/docs/OperationsApi.md
47
- hindsight_client_api/docs/OperationsListResponse.md
48
- hindsight_client_api/docs/RecallRequest.md
49
- hindsight_client_api/docs/RecallResponse.md
50
- hindsight_client_api/docs/RecallResult.md
51
- hindsight_client_api/docs/ReflectFact.md
52
- hindsight_client_api/docs/ReflectIncludeOptions.md
53
- hindsight_client_api/docs/ReflectRequest.md
54
- hindsight_client_api/docs/ReflectResponse.md
55
- hindsight_client_api/docs/RetainRequest.md
56
- hindsight_client_api/docs/RetainResponse.md
57
- hindsight_client_api/docs/UpdateDispositionRequest.md
58
- hindsight_client_api/docs/ValidationError.md
59
- hindsight_client_api/docs/ValidationErrorLocInner.md
60
12
  hindsight_client_api/exceptions.py
61
13
  hindsight_client_api/models/__init__.py
62
14
  hindsight_client_api/models/add_background_request.py
@@ -77,6 +29,7 @@ hindsight_client_api/models/disposition_traits.py
77
29
  hindsight_client_api/models/document_response.py
78
30
  hindsight_client_api/models/entity_detail_response.py
79
31
  hindsight_client_api/models/entity_include_options.py
32
+ hindsight_client_api/models/entity_input.py
80
33
  hindsight_client_api/models/entity_list_item.py
81
34
  hindsight_client_api/models/entity_list_response.py
82
35
  hindsight_client_api/models/entity_observation_response.py
@@ -0,0 +1 @@
1
+ 7.10.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hindsight-client
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Python client for Hindsight - Semantic memory system with personality-driven thinking
5
5
  Author: Hindsight Team
6
6
  Requires-Python: >=3.10
@@ -0,0 +1,81 @@
1
+ # coding: utf-8
2
+
3
+ # flake8: noqa
4
+
5
+ """
6
+ Hindsight HTTP API
7
+
8
+ HTTP API for Hindsight
9
+
10
+ The version of the OpenAPI document: 0.1.0
11
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
12
+
13
+ Do not edit the class manually.
14
+ """ # noqa: E501
15
+
16
+
17
+ __version__ = "0.0.7"
18
+
19
+ # import apis into sdk package
20
+ from hindsight_client_api.api.banks_api import BanksApi
21
+ from hindsight_client_api.api.documents_api import DocumentsApi
22
+ from hindsight_client_api.api.entities_api import EntitiesApi
23
+ from hindsight_client_api.api.memory_api import MemoryApi
24
+ from hindsight_client_api.api.monitoring_api import MonitoringApi
25
+ from hindsight_client_api.api.operations_api import OperationsApi
26
+
27
+ # import ApiClient
28
+ from hindsight_client_api.api_response import ApiResponse
29
+ from hindsight_client_api.api_client import ApiClient
30
+ from hindsight_client_api.configuration import Configuration
31
+ from hindsight_client_api.exceptions import OpenApiException
32
+ from hindsight_client_api.exceptions import ApiTypeError
33
+ from hindsight_client_api.exceptions import ApiValueError
34
+ from hindsight_client_api.exceptions import ApiKeyError
35
+ from hindsight_client_api.exceptions import ApiAttributeError
36
+ from hindsight_client_api.exceptions import ApiException
37
+
38
+ # import models into sdk package
39
+ from hindsight_client_api.models.add_background_request import AddBackgroundRequest
40
+ from hindsight_client_api.models.background_response import BackgroundResponse
41
+ from hindsight_client_api.models.bank_list_item import BankListItem
42
+ from hindsight_client_api.models.bank_list_response import BankListResponse
43
+ from hindsight_client_api.models.bank_profile_response import BankProfileResponse
44
+ from hindsight_client_api.models.bank_stats_response import BankStatsResponse
45
+ from hindsight_client_api.models.budget import Budget
46
+ from hindsight_client_api.models.cancel_operation_response import CancelOperationResponse
47
+ from hindsight_client_api.models.chunk_data import ChunkData
48
+ from hindsight_client_api.models.chunk_include_options import ChunkIncludeOptions
49
+ from hindsight_client_api.models.chunk_response import ChunkResponse
50
+ from hindsight_client_api.models.create_bank_request import CreateBankRequest
51
+ from hindsight_client_api.models.delete_document_response import DeleteDocumentResponse
52
+ from hindsight_client_api.models.delete_response import DeleteResponse
53
+ from hindsight_client_api.models.disposition_traits import DispositionTraits
54
+ from hindsight_client_api.models.document_response import DocumentResponse
55
+ from hindsight_client_api.models.entity_detail_response import EntityDetailResponse
56
+ from hindsight_client_api.models.entity_include_options import EntityIncludeOptions
57
+ from hindsight_client_api.models.entity_input import EntityInput
58
+ from hindsight_client_api.models.entity_list_item import EntityListItem
59
+ from hindsight_client_api.models.entity_list_response import EntityListResponse
60
+ from hindsight_client_api.models.entity_observation_response import EntityObservationResponse
61
+ from hindsight_client_api.models.entity_state_response import EntityStateResponse
62
+ from hindsight_client_api.models.graph_data_response import GraphDataResponse
63
+ from hindsight_client_api.models.http_validation_error import HTTPValidationError
64
+ from hindsight_client_api.models.include_options import IncludeOptions
65
+ from hindsight_client_api.models.list_documents_response import ListDocumentsResponse
66
+ from hindsight_client_api.models.list_memory_units_response import ListMemoryUnitsResponse
67
+ from hindsight_client_api.models.memory_item import MemoryItem
68
+ from hindsight_client_api.models.operation_response import OperationResponse
69
+ from hindsight_client_api.models.operations_list_response import OperationsListResponse
70
+ from hindsight_client_api.models.recall_request import RecallRequest
71
+ from hindsight_client_api.models.recall_response import RecallResponse
72
+ from hindsight_client_api.models.recall_result import RecallResult
73
+ from hindsight_client_api.models.reflect_fact import ReflectFact
74
+ from hindsight_client_api.models.reflect_include_options import ReflectIncludeOptions
75
+ from hindsight_client_api.models.reflect_request import ReflectRequest
76
+ from hindsight_client_api.models.reflect_response import ReflectResponse
77
+ from hindsight_client_api.models.retain_request import RetainRequest
78
+ from hindsight_client_api.models.retain_response import RetainResponse
79
+ from hindsight_client_api.models.update_disposition_request import UpdateDispositionRequest
80
+ from hindsight_client_api.models.validation_error import ValidationError
81
+ from hindsight_client_api.models.validation_error_loc_inner import ValidationErrorLocInner
@@ -21,7 +21,6 @@ import mimetypes
21
21
  import os
22
22
  import re
23
23
  import tempfile
24
- import uuid
25
24
 
26
25
  from urllib.parse import quote
27
26
  from typing import Tuple, Optional, List, Dict, Union
@@ -360,8 +359,6 @@ class ApiClient:
360
359
  return obj.get_secret_value()
361
360
  elif isinstance(obj, self.PRIMITIVE_TYPES):
362
361
  return obj
363
- elif isinstance(obj, uuid.UUID):
364
- return str(obj)
365
362
  elif isinstance(obj, list):
366
363
  return [
367
364
  self.sanitize_for_serialization(sub_obj) for sub_obj in obj
@@ -388,10 +385,6 @@ class ApiClient:
388
385
  else:
389
386
  obj_dict = obj.__dict__
390
387
 
391
- if isinstance(obj_dict, list):
392
- # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict()
393
- return self.sanitize_for_serialization(obj_dict)
394
-
395
388
  return {
396
389
  key: self.sanitize_for_serialization(val)
397
390
  for key, val in obj_dict.items()
@@ -414,7 +407,7 @@ class ApiClient:
414
407
  data = json.loads(response_text)
415
408
  except ValueError:
416
409
  data = response_text
417
- elif re.match(r'^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE):
410
+ elif re.match(r'^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE):
418
411
  if response_text == "":
419
412
  data = ""
420
413
  else:
@@ -463,13 +456,13 @@ class ApiClient:
463
456
 
464
457
  if klass in self.PRIMITIVE_TYPES:
465
458
  return self.__deserialize_primitive(data, klass)
466
- elif klass is object:
459
+ elif klass == object:
467
460
  return self.__deserialize_object(data)
468
- elif klass is datetime.date:
461
+ elif klass == datetime.date:
469
462
  return self.__deserialize_date(data)
470
- elif klass is datetime.datetime:
463
+ elif klass == datetime.datetime:
471
464
  return self.__deserialize_datetime(data)
472
- elif klass is decimal.Decimal:
465
+ elif klass == decimal.Decimal:
473
466
  return decimal.Decimal(data)
474
467
  elif issubclass(klass, Enum):
475
468
  return self.__deserialize_enum(data, klass)
@@ -527,7 +520,7 @@ class ApiClient:
527
520
  if k in collection_formats:
528
521
  collection_format = collection_formats[k]
529
522
  if collection_format == 'multi':
530
- new_params.extend((k, quote(str(value))) for value in v)
523
+ new_params.extend((k, str(value)) for value in v)
531
524
  else:
532
525
  if collection_format == 'ssv':
533
526
  delimiter = ' '
@@ -17,7 +17,7 @@ import http.client as httplib
17
17
  import logging
18
18
  from logging import FileHandler
19
19
  import sys
20
- from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union
20
+ from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict
21
21
  from typing_extensions import NotRequired, Self
22
22
 
23
23
  import urllib3
@@ -159,10 +159,6 @@ class Configuration:
159
159
  :param ssl_ca_cert: str - the path to a file of concatenated CA certificates
160
160
  in PEM format.
161
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
162
 
167
163
  """
168
164
 
@@ -176,16 +172,13 @@ class Configuration:
176
172
  username: Optional[str]=None,
177
173
  password: Optional[str]=None,
178
174
  access_token: Optional[str]=None,
179
- server_index: Optional[int]=None,
175
+ server_index: Optional[int]=None,
180
176
  server_variables: Optional[ServerVariablesT]=None,
181
177
  server_operation_index: Optional[Dict[int, int]]=None,
182
178
  server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None,
183
179
  ignore_operation_servers: bool=False,
184
180
  ssl_ca_cert: Optional[str]=None,
185
181
  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
182
  *,
190
183
  debug: Optional[bool] = None,
191
184
  ) -> None:
@@ -263,14 +256,10 @@ class Configuration:
263
256
  self.ssl_ca_cert = ssl_ca_cert
264
257
  """Set this to customize the certificate file to verify the peer.
265
258
  """
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
259
+ self.cert_file = None
271
260
  """client certificate file
272
261
  """
273
- self.key_file = key_file
262
+ self.key_file = None
274
263
  """client key file
275
264
  """
276
265
  self.assert_hostname = None
@@ -150,13 +150,6 @@ class ApiException(OpenApiException):
150
150
  if http_resp.status == 404:
151
151
  raise NotFoundException(http_resp=http_resp, body=body, data=data)
152
152
 
153
- # Added new conditions for 409 and 422
154
- if http_resp.status == 409:
155
- raise ConflictException(http_resp=http_resp, body=body, data=data)
156
-
157
- if http_resp.status == 422:
158
- raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
159
-
160
153
  if 500 <= http_resp.status <= 599:
161
154
  raise ServiceException(http_resp=http_resp, body=body, data=data)
162
155
  raise ApiException(http_resp=http_resp, body=body, data=data)
@@ -169,11 +162,8 @@ class ApiException(OpenApiException):
169
162
  error_message += "HTTP response headers: {0}\n".format(
170
163
  self.headers)
171
164
 
172
- if self.body:
173
- error_message += "HTTP response body: {0}\n".format(self.body)
174
-
175
- if self.data:
176
- error_message += "HTTP response data: {0}\n".format(self.data)
165
+ if self.data or self.body:
166
+ error_message += "HTTP response body: {0}\n".format(self.data or self.body)
177
167
 
178
168
  return error_message
179
169
 
@@ -198,16 +188,6 @@ class ServiceException(ApiException):
198
188
  pass
199
189
 
200
190
 
201
- class ConflictException(ApiException):
202
- """Exception for HTTP 409 Conflict."""
203
- pass
204
-
205
-
206
- class UnprocessableEntityException(ApiException):
207
- """Exception for HTTP 422 Unprocessable Entity."""
208
- pass
209
-
210
-
211
191
  def render_path(path_to_item):
212
192
  """Returns a string representation of a path"""
213
193
  result = ""
@@ -22,16 +22,12 @@ from typing import Any, ClassVar, Dict, List, Optional
22
22
  from typing import Optional, Set
23
23
  from typing_extensions import Self
24
24
 
25
-
26
25
  class EntityInput(BaseModel):
27
26
  """
28
27
  Entity to associate with retained content.
29
- """ # noqa: E501
30
-
28
+ """ # noqa: E501
31
29
  text: StrictStr = Field(description="The entity name/text")
32
- type: Optional[StrictStr] = Field(
33
- default=None, description="Optional entity type (e.g., 'PERSON', 'ORG', 'CONCEPT')"
34
- )
30
+ type: Optional[StrictStr] = None
35
31
  __properties: ClassVar[List[str]] = ["text", "type"]
36
32
 
37
33
  model_config = ConfigDict(
@@ -40,12 +36,14 @@ class EntityInput(BaseModel):
40
36
  protected_namespaces=(),
41
37
  )
42
38
 
39
+
43
40
  def to_str(self) -> str:
44
41
  """Returns the string representation of the model using alias"""
45
42
  return pprint.pformat(self.model_dump(by_alias=True))
46
43
 
47
44
  def to_json(self) -> str:
48
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
49
47
  return json.dumps(self.to_dict())
50
48
 
51
49
  @classmethod
@@ -54,8 +52,17 @@ class EntityInput(BaseModel):
54
52
  return cls.from_dict(json.loads(json_str))
55
53
 
56
54
  def to_dict(self) -> Dict[str, Any]:
57
- """Return the dictionary representation of the model using alias."""
58
- excluded_fields: Set[str] = set([])
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
+ ])
59
66
 
60
67
  _dict = self.model_dump(
61
68
  by_alias=True,
@@ -65,7 +72,7 @@ class EntityInput(BaseModel):
65
72
  # set to None if type (nullable) is None
66
73
  # and model_fields_set contains the field
67
74
  if self.type is None and "type" in self.model_fields_set:
68
- _dict["type"] = None
75
+ _dict['type'] = None
69
76
 
70
77
  return _dict
71
78
 
@@ -78,5 +85,10 @@ class EntityInput(BaseModel):
78
85
  if not isinstance(obj, dict):
79
86
  return cls.model_validate(obj)
80
87
 
81
- _obj = cls.model_validate({"text": obj.get("text"), "type": obj.get("type")})
88
+ _obj = cls.model_validate({
89
+ "text": obj.get("text"),
90
+ "type": obj.get("type")
91
+ })
82
92
  return _obj
93
+
94
+
@@ -18,11 +18,11 @@ import re # noqa: F401
18
18
  import json
19
19
 
20
20
  from datetime import datetime
21
- from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from pydantic import BaseModel, ConfigDict, StrictStr
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
+ from hindsight_client_api.models.entity_input import EntityInput
23
24
  from typing import Optional, Set
24
25
  from typing_extensions import Self
25
- from hindsight_client_api.models.entity_input import EntityInput
26
26
 
27
27
  class MemoryItem(BaseModel):
28
28
  """
@@ -33,10 +33,7 @@ class MemoryItem(BaseModel):
33
33
  context: Optional[StrictStr] = None
34
34
  metadata: Optional[Dict[str, StrictStr]] = None
35
35
  document_id: Optional[StrictStr] = None
36
- entities: Optional[List[EntityInput]] = Field(
37
- default=None,
38
- description="Optional entities to combine with auto-extracted entities."
39
- )
36
+ entities: Optional[List[EntityInput]] = None
40
37
  __properties: ClassVar[List[str]] = ["content", "timestamp", "context", "metadata", "document_id", "entities"]
41
38
 
42
39
  model_config = ConfigDict(
@@ -78,6 +75,13 @@ class MemoryItem(BaseModel):
78
75
  exclude=excluded_fields,
79
76
  exclude_none=True,
80
77
  )
78
+ # override the default output from pydantic by calling `to_dict()` of each item in entities (list)
79
+ _items = []
80
+ if self.entities:
81
+ for _item_entities in self.entities:
82
+ if _item_entities:
83
+ _items.append(_item_entities.to_dict())
84
+ _dict['entities'] = _items
81
85
  # set to None if timestamp (nullable) is None
82
86
  # and model_fields_set contains the field
83
87
  if self.timestamp is None and "timestamp" in self.model_fields_set:
@@ -52,36 +52,75 @@ class RESTResponse(io.IOBase):
52
52
  class RESTClientObject:
53
53
 
54
54
  def __init__(self, configuration) -> None:
55
+ # Store configuration for deferred initialization
56
+ # aiohttp.TCPConnector requires a running event loop, so we defer
57
+ # creation until the first request (which runs in async context)
58
+ self._configuration = configuration
59
+ self._pool_manager: Optional[aiohttp.ClientSession] = None
60
+ self._retry_client: Optional[aiohttp_retry.RetryClient] = None
55
61
 
56
- # maxsize is number of requests to host that are allowed in parallel
57
- self.maxsize = configuration.connection_pool_maxsize
62
+ self.proxy = configuration.proxy
63
+ self.proxy_headers = configuration.proxy_headers
64
+
65
+ def _ensure_session(self) -> None:
66
+ """Create aiohttp session lazily (must be called from async context)."""
67
+ if self._pool_manager is not None:
68
+ return
69
+
70
+ configuration = self._configuration
71
+ maxsize = configuration.connection_pool_maxsize
58
72
 
59
- self.ssl_context = ssl.create_default_context(
60
- cafile=configuration.ssl_ca_cert,
61
- cadata=configuration.ca_cert_data,
73
+ ssl_context = ssl.create_default_context(
74
+ cafile=configuration.ssl_ca_cert
62
75
  )
63
76
  if configuration.cert_file:
64
- self.ssl_context.load_cert_chain(
77
+ ssl_context.load_cert_chain(
65
78
  configuration.cert_file, keyfile=configuration.key_file
66
79
  )
67
80
 
68
81
  if not configuration.verify_ssl:
69
- self.ssl_context.check_hostname = False
70
- self.ssl_context.verify_mode = ssl.CERT_NONE
82
+ ssl_context.check_hostname = False
83
+ ssl_context.verify_mode = ssl.CERT_NONE
71
84
 
72
- self.proxy = configuration.proxy
73
- self.proxy_headers = configuration.proxy_headers
85
+ connector = aiohttp.TCPConnector(
86
+ limit=maxsize,
87
+ ssl=ssl_context
88
+ )
74
89
 
75
- self.retries = configuration.retries
90
+ self._pool_manager = aiohttp.ClientSession(
91
+ connector=connector,
92
+ trust_env=True
93
+ )
76
94
 
77
- self.pool_manager: Optional[aiohttp.ClientSession] = None
78
- self.retry_client: Optional[aiohttp_retry.RetryClient] = None
95
+ retries = configuration.retries
96
+ if retries is not None:
97
+ self._retry_client = aiohttp_retry.RetryClient(
98
+ client_session=self._pool_manager,
99
+ retry_options=aiohttp_retry.ExponentialRetry(
100
+ attempts=retries,
101
+ factor=2.0,
102
+ start_timeout=0.1,
103
+ max_timeout=120.0
104
+ )
105
+ )
106
+
107
+ @property
108
+ def pool_manager(self) -> aiohttp.ClientSession:
109
+ """Get the pool manager, initializing if needed."""
110
+ self._ensure_session()
111
+ return self._pool_manager
112
+
113
+ @property
114
+ def retry_client(self) -> Optional[aiohttp_retry.RetryClient]:
115
+ """Get the retry client, initializing if needed."""
116
+ self._ensure_session()
117
+ return self._retry_client
79
118
 
80
- async def close(self) -> None:
81
- if self.pool_manager:
82
- await self.pool_manager.close()
83
- if self.retry_client is not None:
84
- await self.retry_client.close()
119
+ async def close(self):
120
+ if self._pool_manager is not None:
121
+ await self._pool_manager.close()
122
+ if self._retry_client is not None:
123
+ await self._retry_client.close()
85
124
 
86
125
  async def request(
87
126
  self,
@@ -186,27 +225,10 @@ class RESTClientObject:
186
225
  raise ApiException(status=0, reason=msg)
187
226
 
188
227
  pool_manager: Union[aiohttp.ClientSession, aiohttp_retry.RetryClient]
189
-
190
- # https pool manager
191
- if self.pool_manager is None:
192
- self.pool_manager = aiohttp.ClientSession(
193
- connector=aiohttp.TCPConnector(limit=self.maxsize, ssl=self.ssl_context),
194
- trust_env=True,
195
- )
196
- pool_manager = self.pool_manager
197
-
198
- if self.retries is not None and method in ALLOW_RETRY_METHODS:
199
- if self.retry_client is None:
200
- self.retry_client = aiohttp_retry.RetryClient(
201
- client_session=self.pool_manager,
202
- retry_options=aiohttp_retry.ExponentialRetry(
203
- attempts=self.retries,
204
- factor=2.0,
205
- start_timeout=0.1,
206
- max_timeout=120.0
207
- )
208
- )
228
+ if self.retry_client is not None and method in ALLOW_RETRY_METHODS:
209
229
  pool_manager = self.retry_client
230
+ else:
231
+ pool_manager = self.pool_manager
210
232
 
211
233
  r = await pool_manager.request(**args)
212
234
 
@@ -3,7 +3,9 @@ projectName: hindsight-client
3
3
  packageVersion: 0.0.7
4
4
  library: asyncio
5
5
  generateSourceCodeOnly: true
6
- # Don't generate auto tests - we have our own integration tests
6
+ # Don't generate auto tests or docs - we have our own
7
7
  globalProperties:
8
8
  apiTests: false
9
9
  modelTests: false
10
+ apiDocs: false
11
+ modelDocs: false
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "hindsight-client"
3
- version = "0.2.0"
3
+ version = "0.2.1"
4
4
  description = "Python client for Hindsight - Semantic memory system with personality-driven thinking"
5
5
  authors = [
6
6
  {name = "Hindsight Team"}
@@ -1 +0,0 @@
1
- 7.18.0-SNAPSHOT