livingbrain-sdk 0.3.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 (206) hide show
  1. livingbrain_sdk-0.3.1/PKG-INFO +249 -0
  2. livingbrain_sdk-0.3.1/README.md +217 -0
  3. livingbrain_sdk-0.3.1/pyproject.toml +97 -0
  4. livingbrain_sdk-0.3.1/src/livingbrain/__init__.py +514 -0
  5. livingbrain_sdk-0.3.1/src/livingbrain/_default_clients.py +32 -0
  6. livingbrain_sdk-0.3.1/src/livingbrain/brains/__init__.py +4 -0
  7. livingbrain_sdk-0.3.1/src/livingbrain/brains/client.py +769 -0
  8. livingbrain_sdk-0.3.1/src/livingbrain/brains/raw_client.py +1483 -0
  9. livingbrain_sdk-0.3.1/src/livingbrain/captures/__init__.py +37 -0
  10. livingbrain_sdk-0.3.1/src/livingbrain/captures/client.py +766 -0
  11. livingbrain_sdk-0.3.1/src/livingbrain/captures/raw_client.py +1388 -0
  12. livingbrain_sdk-0.3.1/src/livingbrain/captures/types/__init__.py +38 -0
  13. livingbrain_sdk-0.3.1/src/livingbrain/captures/types/capture_chat_turn_request_sender.py +38 -0
  14. livingbrain_sdk-0.3.1/src/livingbrain/captures/types/list_sources_captures_request_status.py +42 -0
  15. livingbrain_sdk-0.3.1/src/livingbrain/client.py +349 -0
  16. livingbrain_sdk-0.3.1/src/livingbrain/core/__init__.py +132 -0
  17. livingbrain_sdk-0.3.1/src/livingbrain/core/api_error.py +23 -0
  18. livingbrain_sdk-0.3.1/src/livingbrain/core/client_wrapper.py +148 -0
  19. livingbrain_sdk-0.3.1/src/livingbrain/core/datetime_utils.py +70 -0
  20. livingbrain_sdk-0.3.1/src/livingbrain/core/enum.py +20 -0
  21. livingbrain_sdk-0.3.1/src/livingbrain/core/file.py +67 -0
  22. livingbrain_sdk-0.3.1/src/livingbrain/core/force_multipart.py +18 -0
  23. livingbrain_sdk-0.3.1/src/livingbrain/core/http_client.py +940 -0
  24. livingbrain_sdk-0.3.1/src/livingbrain/core/http_response.py +63 -0
  25. livingbrain_sdk-0.3.1/src/livingbrain/core/http_sse/__init__.py +42 -0
  26. livingbrain_sdk-0.3.1/src/livingbrain/core/http_sse/_api.py +455 -0
  27. livingbrain_sdk-0.3.1/src/livingbrain/core/http_sse/_decoders.py +74 -0
  28. livingbrain_sdk-0.3.1/src/livingbrain/core/http_sse/_exceptions.py +7 -0
  29. livingbrain_sdk-0.3.1/src/livingbrain/core/http_sse/_models.py +17 -0
  30. livingbrain_sdk-0.3.1/src/livingbrain/core/jsonable_encoder.py +133 -0
  31. livingbrain_sdk-0.3.1/src/livingbrain/core/logging.py +107 -0
  32. livingbrain_sdk-0.3.1/src/livingbrain/core/pagination.py +82 -0
  33. livingbrain_sdk-0.3.1/src/livingbrain/core/parse_error.py +36 -0
  34. livingbrain_sdk-0.3.1/src/livingbrain/core/pydantic_utilities.py +508 -0
  35. livingbrain_sdk-0.3.1/src/livingbrain/core/query_encoder.py +58 -0
  36. livingbrain_sdk-0.3.1/src/livingbrain/core/remove_none_from_dict.py +11 -0
  37. livingbrain_sdk-0.3.1/src/livingbrain/core/request_options.py +40 -0
  38. livingbrain_sdk-0.3.1/src/livingbrain/core/serialization.py +347 -0
  39. livingbrain_sdk-0.3.1/src/livingbrain/environment.py +7 -0
  40. livingbrain_sdk-0.3.1/src/livingbrain/errors/__init__.py +44 -0
  41. livingbrain_sdk-0.3.1/src/livingbrain/errors/bad_request_error.py +11 -0
  42. livingbrain_sdk-0.3.1/src/livingbrain/errors/forbidden_error.py +11 -0
  43. livingbrain_sdk-0.3.1/src/livingbrain/errors/not_found_error.py +11 -0
  44. livingbrain_sdk-0.3.1/src/livingbrain/errors/too_many_requests_error.py +11 -0
  45. livingbrain_sdk-0.3.1/src/livingbrain/errors/unauthorized_error.py +11 -0
  46. livingbrain_sdk-0.3.1/src/livingbrain/py.typed +0 -0
  47. livingbrain_sdk-0.3.1/src/livingbrain/requests/__init__.py +197 -0
  48. livingbrain_sdk-0.3.1/src/livingbrain/requests/ack_all_response.py +10 -0
  49. livingbrain_sdk-0.3.1/src/livingbrain/requests/brain.py +57 -0
  50. livingbrain_sdk-0.3.1/src/livingbrain/requests/brain_profile.py +80 -0
  51. livingbrain_sdk-0.3.1/src/livingbrain/requests/brain_score.py +32 -0
  52. livingbrain_sdk-0.3.1/src/livingbrain/requests/brain_stats.py +53 -0
  53. livingbrain_sdk-0.3.1/src/livingbrain/requests/brief_run_response.py +16 -0
  54. livingbrain_sdk-0.3.1/src/livingbrain/requests/brief_settings.py +21 -0
  55. livingbrain_sdk-0.3.1/src/livingbrain/requests/brief_settings_response.py +28 -0
  56. livingbrain_sdk-0.3.1/src/livingbrain/requests/capture_batch_response.py +18 -0
  57. livingbrain_sdk-0.3.1/src/livingbrain/requests/capture_chat_turn_response.py +21 -0
  58. livingbrain_sdk-0.3.1/src/livingbrain/requests/capture_request.py +58 -0
  59. livingbrain_sdk-0.3.1/src/livingbrain/requests/change_event.py +90 -0
  60. livingbrain_sdk-0.3.1/src/livingbrain/requests/change_list.py +28 -0
  61. livingbrain_sdk-0.3.1/src/livingbrain/requests/connection.py +96 -0
  62. livingbrain_sdk-0.3.1/src/livingbrain/requests/connection_list.py +28 -0
  63. livingbrain_sdk-0.3.1/src/livingbrain/requests/create_webhook_response.py +50 -0
  64. livingbrain_sdk-0.3.1/src/livingbrain/requests/delete_response.py +10 -0
  65. livingbrain_sdk-0.3.1/src/livingbrain/requests/error_response.py +33 -0
  66. livingbrain_sdk-0.3.1/src/livingbrain/requests/graph.py +24 -0
  67. livingbrain_sdk-0.3.1/src/livingbrain/requests/graph_edge.py +62 -0
  68. livingbrain_sdk-0.3.1/src/livingbrain/requests/graph_node.py +50 -0
  69. livingbrain_sdk-0.3.1/src/livingbrain/requests/index_entry.py +38 -0
  70. livingbrain_sdk-0.3.1/src/livingbrain/requests/ingest_source.py +113 -0
  71. livingbrain_sdk-0.3.1/src/livingbrain/requests/markdown_export.py +16 -0
  72. livingbrain_sdk-0.3.1/src/livingbrain/requests/page.py +132 -0
  73. livingbrain_sdk-0.3.1/src/livingbrain/requests/page_connections.py +19 -0
  74. livingbrain_sdk-0.3.1/src/livingbrain/requests/page_delete_response.py +21 -0
  75. livingbrain_sdk-0.3.1/src/livingbrain/requests/page_list.py +28 -0
  76. livingbrain_sdk-0.3.1/src/livingbrain/requests/page_source_ref.py +24 -0
  77. livingbrain_sdk-0.3.1/src/livingbrain/requests/page_version.py +69 -0
  78. livingbrain_sdk-0.3.1/src/livingbrain/requests/profile_directives.py +39 -0
  79. livingbrain_sdk-0.3.1/src/livingbrain/requests/profile_directives_response.py +31 -0
  80. livingbrain_sdk-0.3.1/src/livingbrain/requests/profile_suggestions.py +18 -0
  81. livingbrain_sdk-0.3.1/src/livingbrain/requests/score_delta.py +20 -0
  82. livingbrain_sdk-0.3.1/src/livingbrain/requests/score_factor.py +36 -0
  83. livingbrain_sdk-0.3.1/src/livingbrain/requests/score_history.py +31 -0
  84. livingbrain_sdk-0.3.1/src/livingbrain/requests/score_history_item.py +26 -0
  85. livingbrain_sdk-0.3.1/src/livingbrain/requests/score_metric.py +44 -0
  86. livingbrain_sdk-0.3.1/src/livingbrain/requests/score_suggestion.py +41 -0
  87. livingbrain_sdk-0.3.1/src/livingbrain/requests/score_suggestions.py +29 -0
  88. livingbrain_sdk-0.3.1/src/livingbrain/requests/search_result.py +49 -0
  89. livingbrain_sdk-0.3.1/src/livingbrain/requests/slack_binding.py +65 -0
  90. livingbrain_sdk-0.3.1/src/livingbrain/requests/slack_channel.py +26 -0
  91. livingbrain_sdk-0.3.1/src/livingbrain/requests/slack_disconnect_response.py +10 -0
  92. livingbrain_sdk-0.3.1/src/livingbrain/requests/slack_installation.py +45 -0
  93. livingbrain_sdk-0.3.1/src/livingbrain/requests/slack_o_auth_confirm_response.py +26 -0
  94. livingbrain_sdk-0.3.1/src/livingbrain/requests/slack_o_auth_start_response.py +18 -0
  95. livingbrain_sdk-0.3.1/src/livingbrain/requests/slack_status.py +19 -0
  96. livingbrain_sdk-0.3.1/src/livingbrain/requests/source.py +22 -0
  97. livingbrain_sdk-0.3.1/src/livingbrain/requests/source_list.py +28 -0
  98. livingbrain_sdk-0.3.1/src/livingbrain/requests/source_retry_response.py +15 -0
  99. livingbrain_sdk-0.3.1/src/livingbrain/requests/telegram_connection.py +45 -0
  100. livingbrain_sdk-0.3.1/src/livingbrain/requests/telegram_disconnect_response.py +10 -0
  101. livingbrain_sdk-0.3.1/src/livingbrain/requests/webhook_subscription.py +45 -0
  102. livingbrain_sdk-0.3.1/src/livingbrain/slack/__init__.py +4 -0
  103. livingbrain_sdk-0.3.1/src/livingbrain/slack/client.py +784 -0
  104. livingbrain_sdk-0.3.1/src/livingbrain/slack/raw_client.py +1398 -0
  105. livingbrain_sdk-0.3.1/src/livingbrain/telegram/__init__.py +4 -0
  106. livingbrain_sdk-0.3.1/src/livingbrain/telegram/client.py +280 -0
  107. livingbrain_sdk-0.3.1/src/livingbrain/telegram/raw_client.py +512 -0
  108. livingbrain_sdk-0.3.1/src/livingbrain/types/__init__.py +278 -0
  109. livingbrain_sdk-0.3.1/src/livingbrain/types/ack_all_response.py +15 -0
  110. livingbrain_sdk-0.3.1/src/livingbrain/types/brain.py +81 -0
  111. livingbrain_sdk-0.3.1/src/livingbrain/types/brain_profile.py +123 -0
  112. livingbrain_sdk-0.3.1/src/livingbrain/types/brain_score.py +44 -0
  113. livingbrain_sdk-0.3.1/src/livingbrain/types/brain_stats.py +97 -0
  114. livingbrain_sdk-0.3.1/src/livingbrain/types/brief_run_response.py +24 -0
  115. livingbrain_sdk-0.3.1/src/livingbrain/types/brief_settings.py +31 -0
  116. livingbrain_sdk-0.3.1/src/livingbrain/types/brief_settings_response.py +42 -0
  117. livingbrain_sdk-0.3.1/src/livingbrain/types/capture_batch_response.py +21 -0
  118. livingbrain_sdk-0.3.1/src/livingbrain/types/capture_chat_turn_response.py +31 -0
  119. livingbrain_sdk-0.3.1/src/livingbrain/types/capture_request.py +92 -0
  120. livingbrain_sdk-0.3.1/src/livingbrain/types/capture_request_bucket.py +46 -0
  121. livingbrain_sdk-0.3.1/src/livingbrain/types/capture_request_kind.py +54 -0
  122. livingbrain_sdk-0.3.1/src/livingbrain/types/change_event.py +146 -0
  123. livingbrain_sdk-0.3.1/src/livingbrain/types/change_event_action.py +66 -0
  124. livingbrain_sdk-0.3.1/src/livingbrain/types/change_list.py +31 -0
  125. livingbrain_sdk-0.3.1/src/livingbrain/types/connection.py +148 -0
  126. livingbrain_sdk-0.3.1/src/livingbrain/types/connection_list.py +31 -0
  127. livingbrain_sdk-0.3.1/src/livingbrain/types/connection_source.py +38 -0
  128. livingbrain_sdk-0.3.1/src/livingbrain/types/connection_strength.py +42 -0
  129. livingbrain_sdk-0.3.1/src/livingbrain/types/create_webhook_response.py +64 -0
  130. livingbrain_sdk-0.3.1/src/livingbrain/types/create_webhook_response_events_item.py +46 -0
  131. livingbrain_sdk-0.3.1/src/livingbrain/types/delete_response.py +15 -0
  132. livingbrain_sdk-0.3.1/src/livingbrain/types/error_response.py +39 -0
  133. livingbrain_sdk-0.3.1/src/livingbrain/types/graph.py +27 -0
  134. livingbrain_sdk-0.3.1/src/livingbrain/types/graph_edge.py +94 -0
  135. livingbrain_sdk-0.3.1/src/livingbrain/types/graph_edge_strength.py +42 -0
  136. livingbrain_sdk-0.3.1/src/livingbrain/types/graph_node.py +56 -0
  137. livingbrain_sdk-0.3.1/src/livingbrain/types/graph_node_bucket.py +46 -0
  138. livingbrain_sdk-0.3.1/src/livingbrain/types/graph_node_status.py +50 -0
  139. livingbrain_sdk-0.3.1/src/livingbrain/types/index_entry.py +48 -0
  140. livingbrain_sdk-0.3.1/src/livingbrain/types/index_entry_page_type.py +54 -0
  141. livingbrain_sdk-0.3.1/src/livingbrain/types/index_entry_status.py +50 -0
  142. livingbrain_sdk-0.3.1/src/livingbrain/types/ingest_source.py +161 -0
  143. livingbrain_sdk-0.3.1/src/livingbrain/types/ingest_source_bucket.py +46 -0
  144. livingbrain_sdk-0.3.1/src/livingbrain/types/ingest_source_kind.py +54 -0
  145. livingbrain_sdk-0.3.1/src/livingbrain/types/ingest_source_status.py +46 -0
  146. livingbrain_sdk-0.3.1/src/livingbrain/types/markdown_export.py +26 -0
  147. livingbrain_sdk-0.3.1/src/livingbrain/types/page.py +173 -0
  148. livingbrain_sdk-0.3.1/src/livingbrain/types/page_bucket.py +46 -0
  149. livingbrain_sdk-0.3.1/src/livingbrain/types/page_bucket_source.py +38 -0
  150. livingbrain_sdk-0.3.1/src/livingbrain/types/page_connections.py +27 -0
  151. livingbrain_sdk-0.3.1/src/livingbrain/types/page_delete_response.py +29 -0
  152. livingbrain_sdk-0.3.1/src/livingbrain/types/page_list.py +31 -0
  153. livingbrain_sdk-0.3.1/src/livingbrain/types/page_page_type.py +54 -0
  154. livingbrain_sdk-0.3.1/src/livingbrain/types/page_source_ref.py +42 -0
  155. livingbrain_sdk-0.3.1/src/livingbrain/types/page_status.py +50 -0
  156. livingbrain_sdk-0.3.1/src/livingbrain/types/page_version.py +97 -0
  157. livingbrain_sdk-0.3.1/src/livingbrain/types/profile_directives.py +61 -0
  158. livingbrain_sdk-0.3.1/src/livingbrain/types/profile_directives_response.py +64 -0
  159. livingbrain_sdk-0.3.1/src/livingbrain/types/profile_suggestions.py +26 -0
  160. livingbrain_sdk-0.3.1/src/livingbrain/types/score_delta.py +25 -0
  161. livingbrain_sdk-0.3.1/src/livingbrain/types/score_factor.py +41 -0
  162. livingbrain_sdk-0.3.1/src/livingbrain/types/score_factor_tone.py +42 -0
  163. livingbrain_sdk-0.3.1/src/livingbrain/types/score_history.py +39 -0
  164. livingbrain_sdk-0.3.1/src/livingbrain/types/score_history_item.py +34 -0
  165. livingbrain_sdk-0.3.1/src/livingbrain/types/score_history_range.py +42 -0
  166. livingbrain_sdk-0.3.1/src/livingbrain/types/score_metric.py +55 -0
  167. livingbrain_sdk-0.3.1/src/livingbrain/types/score_suggestion.py +51 -0
  168. livingbrain_sdk-0.3.1/src/livingbrain/types/score_suggestions.py +45 -0
  169. livingbrain_sdk-0.3.1/src/livingbrain/types/search_result.py +68 -0
  170. livingbrain_sdk-0.3.1/src/livingbrain/types/search_result_matched_on.py +42 -0
  171. livingbrain_sdk-0.3.1/src/livingbrain/types/search_result_page_type.py +54 -0
  172. livingbrain_sdk-0.3.1/src/livingbrain/types/search_result_status.py +50 -0
  173. livingbrain_sdk-0.3.1/src/livingbrain/types/slack_binding.py +107 -0
  174. livingbrain_sdk-0.3.1/src/livingbrain/types/slack_binding_status.py +38 -0
  175. livingbrain_sdk-0.3.1/src/livingbrain/types/slack_channel.py +42 -0
  176. livingbrain_sdk-0.3.1/src/livingbrain/types/slack_disconnect_response.py +15 -0
  177. livingbrain_sdk-0.3.1/src/livingbrain/types/slack_installation.py +77 -0
  178. livingbrain_sdk-0.3.1/src/livingbrain/types/slack_installation_status.py +42 -0
  179. livingbrain_sdk-0.3.1/src/livingbrain/types/slack_o_auth_confirm_response.py +48 -0
  180. livingbrain_sdk-0.3.1/src/livingbrain/types/slack_o_auth_start_response.py +31 -0
  181. livingbrain_sdk-0.3.1/src/livingbrain/types/slack_status.py +22 -0
  182. livingbrain_sdk-0.3.1/src/livingbrain/types/source.py +25 -0
  183. livingbrain_sdk-0.3.1/src/livingbrain/types/source_list.py +31 -0
  184. livingbrain_sdk-0.3.1/src/livingbrain/types/source_retry_response.py +20 -0
  185. livingbrain_sdk-0.3.1/src/livingbrain/types/telegram_connection.py +71 -0
  186. livingbrain_sdk-0.3.1/src/livingbrain/types/telegram_connection_status.py +42 -0
  187. livingbrain_sdk-0.3.1/src/livingbrain/types/telegram_disconnect_response.py +15 -0
  188. livingbrain_sdk-0.3.1/src/livingbrain/types/webhook_subscription.py +59 -0
  189. livingbrain_sdk-0.3.1/src/livingbrain/types/webhook_subscription_events_item.py +46 -0
  190. livingbrain_sdk-0.3.1/src/livingbrain/version.py +3 -0
  191. livingbrain_sdk-0.3.1/src/livingbrain/webhooks/__init__.py +37 -0
  192. livingbrain_sdk-0.3.1/src/livingbrain/webhooks/client.py +391 -0
  193. livingbrain_sdk-0.3.1/src/livingbrain/webhooks/raw_client.py +770 -0
  194. livingbrain_sdk-0.3.1/src/livingbrain/webhooks/types/__init__.py +38 -0
  195. livingbrain_sdk-0.3.1/src/livingbrain/webhooks/types/create_webhook_request_events_item.py +46 -0
  196. livingbrain_sdk-0.3.1/src/livingbrain/webhooks/types/update_webhook_request_events_item.py +46 -0
  197. livingbrain_sdk-0.3.1/src/livingbrain/workspace/__init__.py +55 -0
  198. livingbrain_sdk-0.3.1/src/livingbrain/workspace/client.py +2976 -0
  199. livingbrain_sdk-0.3.1/src/livingbrain/workspace/raw_client.py +5389 -0
  200. livingbrain_sdk-0.3.1/src/livingbrain/workspace/types/__init__.py +53 -0
  201. livingbrain_sdk-0.3.1/src/livingbrain/workspace/types/delete_permanently_workspace_request_permanent.py +26 -0
  202. livingbrain_sdk-0.3.1/src/livingbrain/workspace/types/list_connections_workspace_request_strength.py +38 -0
  203. livingbrain_sdk-0.3.1/src/livingbrain/workspace/types/list_pages_workspace_request_bucket.py +42 -0
  204. livingbrain_sdk-0.3.1/src/livingbrain/workspace/types/list_pages_workspace_request_status.py +46 -0
  205. livingbrain_sdk-0.3.1/src/livingbrain/workspace/types/move_page_bucket_request_bucket.py +46 -0
  206. livingbrain_sdk-0.3.1/src/livingbrain/workspace/types/score_history_workspace_request_range.py +38 -0
@@ -0,0 +1,249 @@
1
+ Metadata-Version: 2.1
2
+ Name: livingbrain-sdk
3
+ Version: 0.3.1
4
+ Summary:
5
+ Requires-Python: >=3.10,<4.0
6
+ Classifier: Intended Audience :: Developers
7
+ Classifier: Operating System :: MacOS
8
+ Classifier: Operating System :: Microsoft :: Windows
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Operating System :: POSIX
11
+ Classifier: Operating System :: POSIX :: Linux
12
+ Classifier: Programming Language :: Python
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Programming Language :: Python :: 3.15
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Classifier: Typing :: Typed
22
+ Provides-Extra: aiohttp
23
+ Requires-Dist: aiohttp (>=3.14.1,<4) ; (python_version >= "3.10") and (extra == "aiohttp")
24
+ Requires-Dist: httpx (>=0.21.2)
25
+ Requires-Dist: httpx-aiohttp (>=0.1.8,<0.2.0) ; (python_version >= "3.10") and (extra == "aiohttp")
26
+ Requires-Dist: pydantic (>=2.0.0)
27
+ Requires-Dist: pydantic-core (>=2.18.2,<3.0.0)
28
+ Requires-Dist: typing_extensions (>=4.0.0)
29
+ Project-URL: Repository, https://github.com/ChatAndBuild/livingbrain-python-sdk
30
+ Description-Content-Type: text/markdown
31
+
32
+ # Living Brain Python Library
33
+
34
+ [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2FChatAndBuild%2Flivingbrain-python-sdk)
35
+ [![pypi](https://img.shields.io/pypi/v/livingbrain-sdk)](https://pypi.python.org/pypi/livingbrain-sdk)
36
+
37
+ The Living Brain Python library provides convenient access to the Living Brain APIs from Python.
38
+
39
+ ## Table of Contents
40
+
41
+ - [Installation](#installation)
42
+ - [Reference](#reference)
43
+ - [Usage](#usage)
44
+ - [Environments](#environments)
45
+ - [Async Client](#async-client)
46
+ - [Exception Handling](#exception-handling)
47
+ - [Pagination](#pagination)
48
+ - [Advanced](#advanced)
49
+ - [Access Raw Response Data](#access-raw-response-data)
50
+ - [Retries](#retries)
51
+ - [Timeouts](#timeouts)
52
+ - [Custom Client](#custom-client)
53
+ - [Contributing](#contributing)
54
+
55
+ ## Installation
56
+
57
+ ```sh
58
+ pip install livingbrain-sdk
59
+ ```
60
+
61
+ ## Reference
62
+
63
+ A full reference for this library is available [here](https://github.com/ChatAndBuild/livingbrain-python-sdk/blob/HEAD/./reference.md).
64
+
65
+ ## Usage
66
+
67
+ Instantiate and use the client with the following:
68
+
69
+ ```python
70
+ from livingbrain import LivingBrain
71
+
72
+ client = LivingBrain(
73
+ api_key="<value>",
74
+ subject_id="<x-subject-id>",
75
+ )
76
+
77
+ client.brains.create(
78
+ name="Customer Memory",
79
+ )
80
+ ```
81
+
82
+ ## Environments
83
+
84
+ This SDK allows you to configure different environments for API requests.
85
+
86
+ ```python
87
+ from livingbrain import LivingBrain
88
+ from livingbrain.environment import LivingBrainEnvironment
89
+
90
+ client = LivingBrain(
91
+ environment=LivingBrainEnvironment.PRODUCTION,
92
+ )
93
+ ```
94
+
95
+ ## Async Client
96
+
97
+ The SDK also exports an `async` client so that you can make non-blocking calls to our API. Note that if you are constructing an Async httpx client class to pass into this client, use `httpx.AsyncClient()` instead of `httpx.Client()` (e.g. for the `httpx_client` parameter of this client).
98
+
99
+ ```python
100
+ import asyncio
101
+
102
+ from livingbrain import AsyncLivingBrain
103
+
104
+ client = AsyncLivingBrain(
105
+ api_key="<value>",
106
+ subject_id="<x-subject-id>",
107
+ )
108
+
109
+
110
+ async def main() -> None:
111
+ await client.brains.create(
112
+ name="Customer Memory",
113
+ )
114
+
115
+
116
+ asyncio.run(main())
117
+ ```
118
+
119
+ ## Exception Handling
120
+
121
+ When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
122
+ will be thrown.
123
+
124
+ ```python
125
+ from livingbrain.core.api_error import ApiError
126
+
127
+ try:
128
+ client.brains.create(...)
129
+ except ApiError as e:
130
+ print(e.status_code)
131
+ print(e.body)
132
+ ```
133
+
134
+ ## Pagination
135
+
136
+ Paginated requests will return a `SyncPager` or `AsyncPager`, which can be used as generators for the underlying object.
137
+
138
+ ```python
139
+ from livingbrain import LivingBrain
140
+
141
+ client = LivingBrain(
142
+ api_key="<value>",
143
+ subject_id="<x-subject-id>",
144
+ )
145
+
146
+ client.captures.list_sources(
147
+ brain_id="brainId",
148
+ )
149
+ ```
150
+
151
+ ```python
152
+ # You can also iterate through pages and access the typed response per page
153
+ pager = client.captures.list_sources(...)
154
+ for page in pager.iter_pages():
155
+ print(page.response) # access the typed response for each page
156
+ for item in page:
157
+ print(item)
158
+ ```
159
+
160
+ ## Advanced
161
+
162
+ ### Access Raw Response Data
163
+
164
+ The SDK provides access to raw response data, including headers, through the `.with_raw_response` property.
165
+ The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes.
166
+
167
+ ```python
168
+ from livingbrain import LivingBrain
169
+
170
+ client = LivingBrain(...)
171
+ response = client.brains.with_raw_response.create(...)
172
+ print(response.headers) # access the response headers
173
+ print(response.status_code) # access the response status code
174
+ print(response.data) # access the underlying object
175
+ ```
176
+
177
+ ### Retries
178
+
179
+ The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
180
+ as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
181
+ retry limit (default: 2).
182
+
183
+ Which status codes are retried depends on the `retryStatusCodes` generator configuration:
184
+
185
+ **`legacy`** (current default): retries on
186
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
187
+ - [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
188
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
189
+ - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses) (All server errors, including 500)
190
+
191
+ **`recommended`**: retries on
192
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
193
+ - [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
194
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
195
+ - [502](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502) (Bad Gateway)
196
+ - [503](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503) (Service Unavailable)
197
+ - [504](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504) (Gateway Timeout)
198
+
199
+ Use the `max_retries` request option to configure this behavior.
200
+
201
+ ```python
202
+ client.brains.create(..., request_options={
203
+ "max_retries": 1
204
+ })
205
+ ```
206
+
207
+ ### Timeouts
208
+
209
+ The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
210
+
211
+ ```python
212
+ from livingbrain import LivingBrain
213
+
214
+ client = LivingBrain(..., timeout=20.0)
215
+
216
+ # Override timeout for a specific method
217
+ client.brains.create(..., request_options={
218
+ "timeout": 1
219
+ })
220
+ ```
221
+
222
+ ### Custom Client
223
+
224
+ You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
225
+ and transports.
226
+
227
+ ```python
228
+ import httpx
229
+ from livingbrain import LivingBrain
230
+
231
+ client = LivingBrain(
232
+ ...,
233
+ httpx_client=httpx.Client(
234
+ proxy="http://my.test.proxy.example.com",
235
+ transport=httpx.HTTPTransport(local_address="0.0.0.0"),
236
+ ),
237
+ )
238
+ ```
239
+
240
+ ## Contributing
241
+
242
+ While we value open-source contributions to this SDK, this library is generated programmatically.
243
+ Additions made directly to this library would have to be moved over to our generation code,
244
+ otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
245
+ a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
246
+ an issue first to discuss with us!
247
+
248
+ On the other hand, contributions to the README are always very welcome!
249
+
@@ -0,0 +1,217 @@
1
+ # Living Brain Python Library
2
+
3
+ [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2FChatAndBuild%2Flivingbrain-python-sdk)
4
+ [![pypi](https://img.shields.io/pypi/v/livingbrain-sdk)](https://pypi.python.org/pypi/livingbrain-sdk)
5
+
6
+ The Living Brain Python library provides convenient access to the Living Brain APIs from Python.
7
+
8
+ ## Table of Contents
9
+
10
+ - [Installation](#installation)
11
+ - [Reference](#reference)
12
+ - [Usage](#usage)
13
+ - [Environments](#environments)
14
+ - [Async Client](#async-client)
15
+ - [Exception Handling](#exception-handling)
16
+ - [Pagination](#pagination)
17
+ - [Advanced](#advanced)
18
+ - [Access Raw Response Data](#access-raw-response-data)
19
+ - [Retries](#retries)
20
+ - [Timeouts](#timeouts)
21
+ - [Custom Client](#custom-client)
22
+ - [Contributing](#contributing)
23
+
24
+ ## Installation
25
+
26
+ ```sh
27
+ pip install livingbrain-sdk
28
+ ```
29
+
30
+ ## Reference
31
+
32
+ A full reference for this library is available [here](https://github.com/ChatAndBuild/livingbrain-python-sdk/blob/HEAD/./reference.md).
33
+
34
+ ## Usage
35
+
36
+ Instantiate and use the client with the following:
37
+
38
+ ```python
39
+ from livingbrain import LivingBrain
40
+
41
+ client = LivingBrain(
42
+ api_key="<value>",
43
+ subject_id="<x-subject-id>",
44
+ )
45
+
46
+ client.brains.create(
47
+ name="Customer Memory",
48
+ )
49
+ ```
50
+
51
+ ## Environments
52
+
53
+ This SDK allows you to configure different environments for API requests.
54
+
55
+ ```python
56
+ from livingbrain import LivingBrain
57
+ from livingbrain.environment import LivingBrainEnvironment
58
+
59
+ client = LivingBrain(
60
+ environment=LivingBrainEnvironment.PRODUCTION,
61
+ )
62
+ ```
63
+
64
+ ## Async Client
65
+
66
+ The SDK also exports an `async` client so that you can make non-blocking calls to our API. Note that if you are constructing an Async httpx client class to pass into this client, use `httpx.AsyncClient()` instead of `httpx.Client()` (e.g. for the `httpx_client` parameter of this client).
67
+
68
+ ```python
69
+ import asyncio
70
+
71
+ from livingbrain import AsyncLivingBrain
72
+
73
+ client = AsyncLivingBrain(
74
+ api_key="<value>",
75
+ subject_id="<x-subject-id>",
76
+ )
77
+
78
+
79
+ async def main() -> None:
80
+ await client.brains.create(
81
+ name="Customer Memory",
82
+ )
83
+
84
+
85
+ asyncio.run(main())
86
+ ```
87
+
88
+ ## Exception Handling
89
+
90
+ When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
91
+ will be thrown.
92
+
93
+ ```python
94
+ from livingbrain.core.api_error import ApiError
95
+
96
+ try:
97
+ client.brains.create(...)
98
+ except ApiError as e:
99
+ print(e.status_code)
100
+ print(e.body)
101
+ ```
102
+
103
+ ## Pagination
104
+
105
+ Paginated requests will return a `SyncPager` or `AsyncPager`, which can be used as generators for the underlying object.
106
+
107
+ ```python
108
+ from livingbrain import LivingBrain
109
+
110
+ client = LivingBrain(
111
+ api_key="<value>",
112
+ subject_id="<x-subject-id>",
113
+ )
114
+
115
+ client.captures.list_sources(
116
+ brain_id="brainId",
117
+ )
118
+ ```
119
+
120
+ ```python
121
+ # You can also iterate through pages and access the typed response per page
122
+ pager = client.captures.list_sources(...)
123
+ for page in pager.iter_pages():
124
+ print(page.response) # access the typed response for each page
125
+ for item in page:
126
+ print(item)
127
+ ```
128
+
129
+ ## Advanced
130
+
131
+ ### Access Raw Response Data
132
+
133
+ The SDK provides access to raw response data, including headers, through the `.with_raw_response` property.
134
+ The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes.
135
+
136
+ ```python
137
+ from livingbrain import LivingBrain
138
+
139
+ client = LivingBrain(...)
140
+ response = client.brains.with_raw_response.create(...)
141
+ print(response.headers) # access the response headers
142
+ print(response.status_code) # access the response status code
143
+ print(response.data) # access the underlying object
144
+ ```
145
+
146
+ ### Retries
147
+
148
+ The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
149
+ as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
150
+ retry limit (default: 2).
151
+
152
+ Which status codes are retried depends on the `retryStatusCodes` generator configuration:
153
+
154
+ **`legacy`** (current default): retries on
155
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
156
+ - [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
157
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
158
+ - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses) (All server errors, including 500)
159
+
160
+ **`recommended`**: retries on
161
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
162
+ - [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
163
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
164
+ - [502](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502) (Bad Gateway)
165
+ - [503](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503) (Service Unavailable)
166
+ - [504](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504) (Gateway Timeout)
167
+
168
+ Use the `max_retries` request option to configure this behavior.
169
+
170
+ ```python
171
+ client.brains.create(..., request_options={
172
+ "max_retries": 1
173
+ })
174
+ ```
175
+
176
+ ### Timeouts
177
+
178
+ The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
179
+
180
+ ```python
181
+ from livingbrain import LivingBrain
182
+
183
+ client = LivingBrain(..., timeout=20.0)
184
+
185
+ # Override timeout for a specific method
186
+ client.brains.create(..., request_options={
187
+ "timeout": 1
188
+ })
189
+ ```
190
+
191
+ ### Custom Client
192
+
193
+ You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
194
+ and transports.
195
+
196
+ ```python
197
+ import httpx
198
+ from livingbrain import LivingBrain
199
+
200
+ client = LivingBrain(
201
+ ...,
202
+ httpx_client=httpx.Client(
203
+ proxy="http://my.test.proxy.example.com",
204
+ transport=httpx.HTTPTransport(local_address="0.0.0.0"),
205
+ ),
206
+ )
207
+ ```
208
+
209
+ ## Contributing
210
+
211
+ While we value open-source contributions to this SDK, this library is generated programmatically.
212
+ Additions made directly to this library would have to be moved over to our generation code,
213
+ otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
214
+ a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
215
+ an issue first to discuss with us!
216
+
217
+ On the other hand, contributions to the README are always very welcome!
@@ -0,0 +1,97 @@
1
+ [project]
2
+ name = "livingbrain-sdk"
3
+ dynamic = ["version"]
4
+
5
+ [tool.poetry]
6
+ name = "livingbrain-sdk"
7
+ version = "0.3.1"
8
+ description = ""
9
+ readme = "README.md"
10
+ authors = []
11
+ keywords = []
12
+
13
+ classifiers = [
14
+ "Intended Audience :: Developers",
15
+ "Programming Language :: Python",
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3.10",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Programming Language :: Python :: 3.12",
20
+ "Programming Language :: Python :: 3.13",
21
+ "Programming Language :: Python :: 3.14",
22
+ "Programming Language :: Python :: 3.15",
23
+ "Operating System :: OS Independent",
24
+ "Operating System :: POSIX",
25
+ "Operating System :: MacOS",
26
+ "Operating System :: POSIX :: Linux",
27
+ "Operating System :: Microsoft :: Windows",
28
+ "Topic :: Software Development :: Libraries :: Python Modules",
29
+ "Typing :: Typed"
30
+ ]
31
+ packages = [
32
+ { include = "livingbrain", from = "src"}
33
+ ]
34
+
35
+ [tool.poetry.urls]
36
+ Repository = 'https://github.com/ChatAndBuild/livingbrain-python-sdk'
37
+
38
+ [tool.poetry.dependencies]
39
+ python = "^3.10"
40
+ aiohttp = { version = ">=3.14.1,<4", optional = true, python = ">=3.10"}
41
+ httpx = ">=0.21.2"
42
+ httpx-aiohttp = { version = "^0.1.8", optional = true, python = ">=3.10"}
43
+ pydantic = ">= 2.0.0"
44
+ pydantic-core = ">=2.18.2,<3.0.0"
45
+ typing_extensions = ">= 4.0.0"
46
+
47
+ [tool.poetry.group.dev.dependencies]
48
+ mypy = "==1.13.0"
49
+ pytest = "^9.0.3"
50
+ pytest-asyncio = "^1.0.0"
51
+ pytest-xdist = "^3.6.1"
52
+ python-dateutil = "^2.9.0"
53
+ types-python-dateutil = "^2.9.0.20240316"
54
+ urllib3 = ">=2.6.3,<3.0.0"
55
+ ruff = "==0.11.5"
56
+
57
+ [tool.pytest.ini_options]
58
+ testpaths = [ "tests" ]
59
+ asyncio_mode = "auto"
60
+ norecursedirs = [ "src" ]
61
+ markers = [
62
+ "aiohttp: tests that require httpx_aiohttp to be installed",
63
+ ]
64
+
65
+ [tool.mypy]
66
+ plugins = ["pydantic.mypy"]
67
+
68
+ [tool.ruff]
69
+ line-length = 120
70
+
71
+ [tool.ruff.lint]
72
+ select = [
73
+ "E", # pycodestyle errors
74
+ "F", # pyflakes
75
+ "I", # isort
76
+ ]
77
+ ignore = [
78
+ "E402", # Module level import not at top of file
79
+ "E501", # Line too long
80
+ "E711", # Comparison to `None` should be `cond is not None`
81
+ "E712", # Avoid equality comparisons to `True`; use `if ...:` checks
82
+ "E721", # Use `is` and `is not` for type comparisons, or `isinstance()` for insinstance checks
83
+ "E722", # Do not use bare `except`
84
+ "E731", # Do not assign a `lambda` expression, use a `def`
85
+ "F821", # Undefined name
86
+ "F841" # Local variable ... is assigned to but never used
87
+ ]
88
+
89
+ [tool.ruff.lint.isort]
90
+ section-order = ["future", "standard-library", "third-party", "first-party"]
91
+
92
+ [build-system]
93
+ requires = ["poetry-core"]
94
+ build-backend = "poetry.core.masonry.api"
95
+
96
+ [tool.poetry.extras]
97
+ aiohttp=["aiohttp", "httpx-aiohttp"]