px0 0.0.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 (145) hide show
  1. px0-0.0.1/PKG-INFO +608 -0
  2. px0-0.0.1/README.md +596 -0
  3. px0-0.0.1/pyproject.toml +53 -0
  4. px0-0.0.1/setup.cfg +4 -0
  5. px0-0.0.1/src/px0/__init__.py +17 -0
  6. px0-0.0.1/src/px0/_hooks/__init__.py +4 -0
  7. px0-0.0.1/src/px0/_hooks/sdkhooks.py +74 -0
  8. px0-0.0.1/src/px0/_hooks/types.py +124 -0
  9. px0-0.0.1/src/px0/_version.py +15 -0
  10. px0-0.0.1/src/px0/api_keys.py +587 -0
  11. px0-0.0.1/src/px0/auth.py +2271 -0
  12. px0-0.0.1/src/px0/basesdk.py +392 -0
  13. px0-0.0.1/src/px0/errors/__init__.py +39 -0
  14. px0-0.0.1/src/px0/errors/apierror.py +27 -0
  15. px0-0.0.1/src/px0/errors/no_response_error.py +17 -0
  16. px0-0.0.1/src/px0/errors/px0defaulterror.py +40 -0
  17. px0-0.0.1/src/px0/errors/px0error.py +30 -0
  18. px0-0.0.1/src/px0/errors/responsevalidationerror.py +27 -0
  19. px0-0.0.1/src/px0/health.py +169 -0
  20. px0-0.0.1/src/px0/httpclient.py +125 -0
  21. px0-0.0.1/src/px0/models/__init__.py +1090 -0
  22. px0-0.0.1/src/px0/models/addteammemberop.py +30 -0
  23. px0-0.0.1/src/px0/models/apikey.py +96 -0
  24. px0-0.0.1/src/px0/models/apikeycreatedresponse.py +39 -0
  25. px0-0.0.1/src/px0/models/archivepromptop.py +80 -0
  26. px0-0.0.1/src/px0/models/archiveversionop.py +87 -0
  27. px0-0.0.1/src/px0/models/changepasswordop.py +17 -0
  28. px0-0.0.1/src/px0/models/changepasswordrequest.py +16 -0
  29. px0-0.0.1/src/px0/models/createapikeyrequest.py +49 -0
  30. px0-0.0.1/src/px0/models/createjoinrequestop.py +16 -0
  31. px0-0.0.1/src/px0/models/createorgop.py +44 -0
  32. px0-0.0.1/src/px0/models/createpromptop.py +95 -0
  33. px0-0.0.1/src/px0/models/createpromptpayloadop.py +95 -0
  34. px0-0.0.1/src/px0/models/createpromptpayloadrequest.py +23 -0
  35. px0-0.0.1/src/px0/models/createpromptrequest.py +37 -0
  36. px0-0.0.1/src/px0/models/createteamop.py +64 -0
  37. px0-0.0.1/src/px0/models/createversionop.py +92 -0
  38. px0-0.0.1/src/px0/models/createversionrequest.py +13 -0
  39. px0-0.0.1/src/px0/models/deleteapikeyop.py +18 -0
  40. px0-0.0.1/src/px0/models/deleteorgop.py +16 -0
  41. px0-0.0.1/src/px0/models/deletepromptpayloadop.py +77 -0
  42. px0-0.0.1/src/px0/models/deletepromptversionop.py +74 -0
  43. px0-0.0.1/src/px0/models/deleteteamop.py +16 -0
  44. px0-0.0.1/src/px0/models/demoteversionop.py +87 -0
  45. px0-0.0.1/src/px0/models/diffversionsop.py +111 -0
  46. px0-0.0.1/src/px0/models/duplicateversionop.py +87 -0
  47. px0-0.0.1/src/px0/models/getadmininboxop.py +36 -0
  48. px0-0.0.1/src/px0/models/getpromptop.py +80 -0
  49. px0-0.0.1/src/px0/models/getpromptpayloadop.py +90 -0
  50. px0-0.0.1/src/px0/models/getversionop.py +87 -0
  51. px0-0.0.1/src/px0/models/healthcheckop.py +17 -0
  52. px0-0.0.1/src/px0/models/inboxitem.py +46 -0
  53. px0-0.0.1/src/px0/models/leaveteamop.py +19 -0
  54. px0-0.0.1/src/px0/models/listallpromptsop.py +82 -0
  55. px0-0.0.1/src/px0/models/listapikeysop.py +30 -0
  56. px0-0.0.1/src/px0/models/listorgpeopleop.py +71 -0
  57. px0-0.0.1/src/px0/models/listorgteamsop.py +50 -0
  58. px0-0.0.1/src/px0/models/listpromptpayloadsop.py +80 -0
  59. px0-0.0.1/src/px0/models/listpromptsop.py +112 -0
  60. px0-0.0.1/src/px0/models/listteammembersop.py +78 -0
  61. px0-0.0.1/src/px0/models/listuserorgsop.py +36 -0
  62. px0-0.0.1/src/px0/models/listuserteamsop.py +36 -0
  63. px0-0.0.1/src/px0/models/listversionsop.py +125 -0
  64. px0-0.0.1/src/px0/models/listversiontagsop.py +90 -0
  65. px0-0.0.1/src/px0/models/loginop.py +29 -0
  66. px0-0.0.1/src/px0/models/loginrequest.py +16 -0
  67. px0-0.0.1/src/px0/models/meop.py +18 -0
  68. px0-0.0.1/src/px0/models/movepromptop.py +97 -0
  69. px0-0.0.1/src/px0/models/organization.py +20 -0
  70. px0-0.0.1/src/px0/models/organizationwithrole.py +33 -0
  71. px0-0.0.1/src/px0/models/promoteversionop.py +87 -0
  72. px0-0.0.1/src/px0/models/prompt.py +58 -0
  73. px0-0.0.1/src/px0/models/promptpayload.py +71 -0
  74. px0-0.0.1/src/px0/models/promptversion.py +77 -0
  75. px0-0.0.1/src/px0/models/registerop.py +18 -0
  76. px0-0.0.1/src/px0/models/registerrequest.py +37 -0
  77. px0-0.0.1/src/px0/models/removeorgmemberop.py +26 -0
  78. px0-0.0.1/src/px0/models/removeteammemberop.py +24 -0
  79. px0-0.0.1/src/px0/models/removeversiontagop.py +74 -0
  80. px0-0.0.1/src/px0/models/renderliveop.py +79 -0
  81. px0-0.0.1/src/px0/models/renderrequest.py +33 -0
  82. px0-0.0.1/src/px0/models/renderresponse.py +31 -0
  83. px0-0.0.1/src/px0/models/renderversionop.py +86 -0
  84. px0-0.0.1/src/px0/models/resetpasswordop.py +20 -0
  85. px0-0.0.1/src/px0/models/resetpasswordrequest.py +16 -0
  86. px0-0.0.1/src/px0/models/resolvejoinrequestop.py +37 -0
  87. px0-0.0.1/src/px0/models/restorepromptop.py +78 -0
  88. px0-0.0.1/src/px0/models/security.py +42 -0
  89. px0-0.0.1/src/px0/models/setversiontagop.py +108 -0
  90. px0-0.0.1/src/px0/models/team.py +41 -0
  91. px0-0.0.1/src/px0/models/teamjoinrequest.py +40 -0
  92. px0-0.0.1/src/px0/models/teammemberresponse.py +23 -0
  93. px0-0.0.1/src/px0/models/triggerpasswordresetop.py +17 -0
  94. px0-0.0.1/src/px0/models/triggerpasswordresetrequest.py +13 -0
  95. px0-0.0.1/src/px0/models/triggerverificationemailop.py +30 -0
  96. px0-0.0.1/src/px0/models/updatemeop.py +18 -0
  97. px0-0.0.1/src/px0/models/updatemerequest.py +13 -0
  98. px0-0.0.1/src/px0/models/updateorgop.py +61 -0
  99. px0-0.0.1/src/px0/models/updatepromptop.py +38 -0
  100. px0-0.0.1/src/px0/models/updatepromptpayloadop.py +105 -0
  101. px0-0.0.1/src/px0/models/updatepromptpayloadrequest.py +46 -0
  102. px0-0.0.1/src/px0/models/updatepromptrequest.py +33 -0
  103. px0-0.0.1/src/px0/models/updateteammemberroleop.py +75 -0
  104. px0-0.0.1/src/px0/models/updateteamop.py +80 -0
  105. px0-0.0.1/src/px0/models/updateversionop.py +99 -0
  106. px0-0.0.1/src/px0/models/updateversionrequest.py +13 -0
  107. px0-0.0.1/src/px0/models/user.py +36 -0
  108. px0-0.0.1/src/px0/models/verifyemailop.py +17 -0
  109. px0-0.0.1/src/px0/models/verifyrequest.py +16 -0
  110. px0-0.0.1/src/px0/organizations.py +1179 -0
  111. px0-0.0.1/src/px0/prompt_payloads.py +1047 -0
  112. px0-0.0.1/src/px0/prompt_renders.py +457 -0
  113. px0-0.0.1/src/px0/prompt_versions.py +2711 -0
  114. px0-0.0.1/src/px0/prompts.py +1701 -0
  115. px0-0.0.1/src/px0/py.typed +1 -0
  116. px0-0.0.1/src/px0/sdk.py +212 -0
  117. px0-0.0.1/src/px0/sdkconfiguration.py +49 -0
  118. px0-0.0.1/src/px0/team_memberships.py +1353 -0
  119. px0-0.0.1/src/px0/teams.py +1215 -0
  120. px0-0.0.1/src/px0/types/__init__.py +24 -0
  121. px0-0.0.1/src/px0/types/base64fileinput.py +43 -0
  122. px0-0.0.1/src/px0/types/basemodel.py +77 -0
  123. px0-0.0.1/src/px0/utils/__init__.py +178 -0
  124. px0-0.0.1/src/px0/utils/annotations.py +79 -0
  125. px0-0.0.1/src/px0/utils/datetimes.py +23 -0
  126. px0-0.0.1/src/px0/utils/dynamic_imports.py +54 -0
  127. px0-0.0.1/src/px0/utils/enums.py +134 -0
  128. px0-0.0.1/src/px0/utils/eventstreaming.py +326 -0
  129. px0-0.0.1/src/px0/utils/forms.py +239 -0
  130. px0-0.0.1/src/px0/utils/headers.py +136 -0
  131. px0-0.0.1/src/px0/utils/logger.py +27 -0
  132. px0-0.0.1/src/px0/utils/metadata.py +119 -0
  133. px0-0.0.1/src/px0/utils/queryparams.py +217 -0
  134. px0-0.0.1/src/px0/utils/requestbodies.py +67 -0
  135. px0-0.0.1/src/px0/utils/retries.py +356 -0
  136. px0-0.0.1/src/px0/utils/security.py +215 -0
  137. px0-0.0.1/src/px0/utils/serializers.py +306 -0
  138. px0-0.0.1/src/px0/utils/unmarshal_json_response.py +38 -0
  139. px0-0.0.1/src/px0/utils/url.py +155 -0
  140. px0-0.0.1/src/px0/utils/values.py +137 -0
  141. px0-0.0.1/src/px0.egg-info/PKG-INFO +608 -0
  142. px0-0.0.1/src/px0.egg-info/SOURCES.txt +143 -0
  143. px0-0.0.1/src/px0.egg-info/dependency_links.txt +1 -0
  144. px0-0.0.1/src/px0.egg-info/requires.txt +3 -0
  145. px0-0.0.1/src/px0.egg-info/top_level.txt +1 -0
px0-0.0.1/PKG-INFO ADDED
@@ -0,0 +1,608 @@
1
+ Metadata-Version: 2.4
2
+ Name: px0
3
+ Version: 0.0.1
4
+ Summary: Python Client SDK Generated by Speakeasy.
5
+ Author: Speakeasy
6
+ License: Apache-2.0
7
+ Requires-Python: >=3.10
8
+ Description-Content-Type: text/markdown
9
+ Requires-Dist: httpcore>=1.0.9
10
+ Requires-Dist: httpx>=0.28.1
11
+ Requires-Dist: pydantic<2.13,>=2.11.2
12
+
13
+ # px0
14
+
15
+ Developer-friendly & type-safe Python SDK specifically catered to leverage *px0* API.
16
+
17
+ [![Built by Speakeasy](https://img.shields.io/badge/Built_by-SPEAKEASY-374151?style=for-the-badge&labelColor=f3f4f6)](https://www.speakeasy.com/?utm_source=px0&utm_campaign=python)
18
+ [![License: MIT](https://img.shields.io/badge/LICENSE_//_MIT-3b5bdb?style=for-the-badge&labelColor=eff6ff)](https://opensource.org/licenses/MIT)
19
+
20
+
21
+ <br /><br />
22
+ > [!IMPORTANT]
23
+ > This SDK is not yet ready for production use. To complete setup please follow the steps outlined in your [workspace](https://app.speakeasy.com/org/px0/px0). Delete this section before > publishing to a package manager.
24
+
25
+ <!-- Start Summary [summary] -->
26
+ ## Summary
27
+
28
+ px0 API: Core API for px0, a modern prompt management, versioning, and execution service.
29
+
30
+ This specification serves as the source of truth for downstream code generation,
31
+ including Documentation, SDKs, CLIs, and Model Context Protocol (MCP) servers.
32
+ All endpoints are rigorously validated against this specification at test time
33
+ to ensure absolute zero-drift between implementation and documentation.
34
+ <!-- End Summary [summary] -->
35
+
36
+ <!-- Start Table of Contents [toc] -->
37
+ ## Table of Contents
38
+ <!-- $toc-max-depth=2 -->
39
+ * [px0](#px0)
40
+ * [SDK Installation](#sdk-installation)
41
+ * [IDE Support](#ide-support)
42
+ * [SDK Example Usage](#sdk-example-usage)
43
+ * [Authentication](#authentication)
44
+ * [Available Resources and Operations](#available-resources-and-operations)
45
+ * [Retries](#retries)
46
+ * [Error Handling](#error-handling)
47
+ * [Server Selection](#server-selection)
48
+ * [Custom HTTP Client](#custom-http-client)
49
+ * [Resource Management](#resource-management)
50
+ * [Debugging](#debugging)
51
+ * [Development](#development)
52
+ * [Maturity](#maturity)
53
+ * [Contributions](#contributions)
54
+
55
+ <!-- End Table of Contents [toc] -->
56
+
57
+ <!-- Start SDK Installation [installation] -->
58
+ ## SDK Installation
59
+
60
+ > [!TIP]
61
+ > To finish publishing your SDK to PyPI you must [run your first generation action](https://www.speakeasy.com/docs/github-setup#step-by-step-guide).
62
+
63
+
64
+ > [!NOTE]
65
+ > **Python version upgrade policy**
66
+ >
67
+ > Once a Python version reaches its [official end of life date](https://devguide.python.org/versions/), a 3-month grace period is provided for users to upgrade. Following this grace period, the minimum python version supported in the SDK will be updated.
68
+
69
+ The SDK can be installed with *uv*, *pip*, or *poetry* package managers.
70
+
71
+ ### uv
72
+
73
+ *uv* is a fast Python package installer and resolver, designed as a drop-in replacement for pip and pip-tools. It's recommended for its speed and modern Python tooling capabilities.
74
+
75
+ ```bash
76
+ uv add git+<UNSET>.git
77
+ ```
78
+
79
+ ### PIP
80
+
81
+ *PIP* is the default package installer for Python, enabling easy installation and management of packages from PyPI via the command line.
82
+
83
+ ```bash
84
+ pip install git+<UNSET>.git
85
+ ```
86
+
87
+ ### Poetry
88
+
89
+ *Poetry* is a modern tool that simplifies dependency management and package publishing by using a single `pyproject.toml` file to handle project metadata and dependencies.
90
+
91
+ ```bash
92
+ poetry add git+<UNSET>.git
93
+ ```
94
+
95
+ ### Shell and script usage with `uv`
96
+
97
+ You can use this SDK in a Python shell with [uv](https://docs.astral.sh/uv/) and the `uvx` command that comes with it like so:
98
+
99
+ ```shell
100
+ uvx --from px0 python
101
+ ```
102
+
103
+ It's also possible to write a standalone Python script without needing to set up a whole project like so:
104
+
105
+ ```python
106
+ #!/usr/bin/env -S uv run --script
107
+ # /// script
108
+ # requires-python = ">=3.10"
109
+ # dependencies = [
110
+ # "px0",
111
+ # ]
112
+ # ///
113
+
114
+ from px0 import Px0
115
+
116
+ sdk = Px0(
117
+ # SDK arguments
118
+ )
119
+
120
+ # Rest of script here...
121
+ ```
122
+
123
+ Once that is saved to a file, you can run it with `uv run script.py` where
124
+ `script.py` can be replaced with the actual file name.
125
+ <!-- End SDK Installation [installation] -->
126
+
127
+ <!-- Start IDE Support [idesupport] -->
128
+ ## IDE Support
129
+
130
+ ### PyCharm
131
+
132
+ Generally, the SDK will work well with most IDEs out of the box. However, when using PyCharm, you can enjoy much better integration with Pydantic by installing an additional plugin.
133
+
134
+ - [PyCharm Pydantic Plugin](https://docs.pydantic.dev/latest/integrations/pycharm/)
135
+ <!-- End IDE Support [idesupport] -->
136
+
137
+ <!-- Start SDK Example Usage [usage] -->
138
+ ## SDK Example Usage
139
+
140
+ ### Example
141
+
142
+ ```python
143
+ # Synchronous Example
144
+ import os
145
+ from px0 import Px0
146
+
147
+
148
+ with Px0(
149
+ bearer_auth=os.getenv("PX0_BEARER_AUTH", ""),
150
+ ) as p_client:
151
+
152
+ res = p_client.health.health_check()
153
+
154
+ # Handle response
155
+ print(res)
156
+ ```
157
+
158
+ </br>
159
+
160
+ The same SDK client can also be used to make asynchronous requests by importing asyncio.
161
+
162
+ ```python
163
+ # Asynchronous Example
164
+ import asyncio
165
+ import os
166
+ from px0 import Px0
167
+
168
+ async def main():
169
+
170
+ async with Px0(
171
+ bearer_auth=os.getenv("PX0_BEARER_AUTH", ""),
172
+ ) as p_client:
173
+
174
+ res = await p_client.health.health_check_async()
175
+
176
+ # Handle response
177
+ print(res)
178
+
179
+ asyncio.run(main())
180
+ ```
181
+ <!-- End SDK Example Usage [usage] -->
182
+
183
+ <!-- Start Authentication [security] -->
184
+ ## Authentication
185
+
186
+ ### Per-Client Security Schemes
187
+
188
+ This SDK supports the following security scheme globally:
189
+
190
+ | Name | Type | Scheme | Environment Variable |
191
+ | ------------- | ---- | ----------- | -------------------- |
192
+ | `bearer_auth` | http | HTTP Bearer | `PX0_BEARER_AUTH` |
193
+
194
+ To authenticate with the API the `bearer_auth` parameter must be set when initializing the SDK client instance. For example:
195
+ ```python
196
+ import os
197
+ from px0 import Px0
198
+
199
+
200
+ with Px0(
201
+ bearer_auth=os.getenv("PX0_BEARER_AUTH", ""),
202
+ ) as p_client:
203
+
204
+ res = p_client.health.health_check()
205
+
206
+ # Handle response
207
+ print(res)
208
+
209
+ ```
210
+
211
+ ### Per-Operation Security Schemes
212
+
213
+ Some operations in this SDK require the security scheme to be specified at the request level. For example:
214
+ ```python
215
+ from px0 import Px0, models
216
+
217
+
218
+ with Px0() as p_client:
219
+
220
+ res = p_client.prompts.create_prompt(security=models.CreatePromptSecurity(
221
+
222
+ ), team_id="71895bf3-6e10-4137-8228-e0422690b1e9", name="My Prompt", description="Useful prompt", slug="my_prompt")
223
+
224
+ # Handle response
225
+ print(res)
226
+
227
+ ```
228
+ <!-- End Authentication [security] -->
229
+
230
+ <!-- Start Available Resources and Operations [operations] -->
231
+ ## Available Resources and Operations
232
+
233
+ <details open>
234
+ <summary>Available methods</summary>
235
+
236
+ ### [APIKeys](docs/sdks/apikeys/README.md)
237
+
238
+ * [create_api_key](docs/sdks/apikeys/README.md#create_api_key) - Create an API Key
239
+ * [list_api_keys](docs/sdks/apikeys/README.md#list_api_keys) - List API Keys
240
+ * [delete_api_key](docs/sdks/apikeys/README.md#delete_api_key) - Delete an API Key
241
+
242
+ ### [Auth](docs/sdks/auth/README.md)
243
+
244
+ * [register](docs/sdks/auth/README.md#register) - Register a new user
245
+ * [login](docs/sdks/auth/README.md#login) - Login
246
+ * [verify_email](docs/sdks/auth/README.md#verify_email) - Verify User Email
247
+ * [trigger_verification_email](docs/sdks/auth/README.md#trigger_verification_email) - Trigger Verification Email
248
+ * [logout](docs/sdks/auth/README.md#logout) - Logout
249
+ * [me](docs/sdks/auth/README.md#me) - Me
250
+ * [update_me](docs/sdks/auth/README.md#update_me) - Update Me
251
+ * [delete_me](docs/sdks/auth/README.md#delete_me) - Delete Me
252
+ * [change_password](docs/sdks/auth/README.md#change_password) - Change Password
253
+ * [trigger_password_reset](docs/sdks/auth/README.md#trigger_password_reset) - Trigger Password Reset
254
+ * [reset_password](docs/sdks/auth/README.md#reset_password) - Reset Password
255
+
256
+ ### [Health](docs/sdks/health/README.md)
257
+
258
+ * [health_check](docs/sdks/health/README.md#health_check) - Health Check
259
+
260
+ ### [Organizations](docs/sdks/organizations/README.md)
261
+
262
+ * [list_user_orgs](docs/sdks/organizations/README.md#list_user_orgs) - List User Organizations
263
+ * [create_org](docs/sdks/organizations/README.md#create_org) - Create Organization
264
+ * [update_org](docs/sdks/organizations/README.md#update_org) - Update Organization
265
+ * [delete_org](docs/sdks/organizations/README.md#delete_org) - Delete Organization
266
+ * [list_org_people](docs/sdks/organizations/README.md#list_org_people) - List Org People
267
+ * [remove_org_member](docs/sdks/organizations/README.md#remove_org_member) - Remove Member from Organization
268
+
269
+ ### [PromptPayloads](docs/sdks/promptpayloads/README.md)
270
+
271
+ * [create_prompt_payload](docs/sdks/promptpayloads/README.md#create_prompt_payload) - Create a Prompt Payload
272
+ * [list_prompt_payloads](docs/sdks/promptpayloads/README.md#list_prompt_payloads) - List Prompt Payloads
273
+ * [get_prompt_payload](docs/sdks/promptpayloads/README.md#get_prompt_payload) - Get a Prompt Payload
274
+ * [update_prompt_payload](docs/sdks/promptpayloads/README.md#update_prompt_payload) - Update a Prompt Payload
275
+ * [delete_prompt_payload](docs/sdks/promptpayloads/README.md#delete_prompt_payload) - Delete a Prompt Payload
276
+
277
+ ### [PromptRenders](docs/sdks/promptrenders/README.md)
278
+
279
+ * [render_live](docs/sdks/promptrenders/README.md#render_live) - Render Live Prompt Version
280
+ * [render_version](docs/sdks/promptrenders/README.md#render_version) - Render Specific Prompt Version
281
+
282
+ ### [PromptVersions](docs/sdks/promptversions/README.md)
283
+
284
+ * [diff_versions](docs/sdks/promptversions/README.md#diff_versions) - Diff Prompt Versions
285
+ * [create_version](docs/sdks/promptversions/README.md#create_version) - Create a Prompt Version
286
+ * [list_versions](docs/sdks/promptversions/README.md#list_versions) - List Prompt Versions
287
+ * [get_version](docs/sdks/promptversions/README.md#get_version) - Get Prompt Version
288
+ * [update_version](docs/sdks/promptversions/README.md#update_version) - Update Prompt Version Draft
289
+ * [delete_prompt_version](docs/sdks/promptversions/README.md#delete_prompt_version) - Delete Prompt Version Draft
290
+ * [promote_version](docs/sdks/promptversions/README.md#promote_version) - Promote Prompt Version
291
+ * [demote_version](docs/sdks/promptversions/README.md#demote_version) - Demote Prompt Version
292
+ * [archive_version](docs/sdks/promptversions/README.md#archive_version) - Archive Prompt Version
293
+ * [duplicate_version](docs/sdks/promptversions/README.md#duplicate_version) - Duplicate Prompt Version
294
+ * [set_version_tag](docs/sdks/promptversions/README.md#set_version_tag) - Attach/Set Version Tag
295
+ * [list_version_tags](docs/sdks/promptversions/README.md#list_version_tags) - List Prompt Version Tags
296
+ * [remove_version_tag](docs/sdks/promptversions/README.md#remove_version_tag) - Remove Version Tag
297
+
298
+ ### [Prompts](docs/sdks/prompts/README.md)
299
+
300
+ * [create_prompt](docs/sdks/prompts/README.md#create_prompt) - Create a Prompt
301
+ * [list_prompts](docs/sdks/prompts/README.md#list_prompts) - List Prompts
302
+ * [list_all_prompts](docs/sdks/prompts/README.md#list_all_prompts) - List all prompts with team filter
303
+ * [get_prompt](docs/sdks/prompts/README.md#get_prompt) - Get a Prompt
304
+ * [update_prompt](docs/sdks/prompts/README.md#update_prompt) - Update a Prompt
305
+ * [archive_prompt](docs/sdks/prompts/README.md#archive_prompt) - Archive a Prompt
306
+ * [restore_prompt](docs/sdks/prompts/README.md#restore_prompt) - Restore a Prompt
307
+ * [move_prompt](docs/sdks/prompts/README.md#move_prompt) - Move a Prompt
308
+
309
+ ### [TeamMemberships](docs/sdks/teammemberships/README.md)
310
+
311
+ * [get_admin_inbox](docs/sdks/teammemberships/README.md#get_admin_inbox) - Get Admin Inbox
312
+ * [list_team_members](docs/sdks/teammemberships/README.md#list_team_members) - List Team Members
313
+ * [add_team_member](docs/sdks/teammemberships/README.md#add_team_member) - Add Team Member
314
+ * [remove_team_member](docs/sdks/teammemberships/README.md#remove_team_member) - Remove Team Member
315
+ * [update_team_member_role](docs/sdks/teammemberships/README.md#update_team_member_role) - Update Team Member Role
316
+ * [create_join_request](docs/sdks/teammemberships/README.md#create_join_request) - Request to Join Team
317
+ * [resolve_join_request](docs/sdks/teammemberships/README.md#resolve_join_request) - Resolve Join Request
318
+
319
+ ### [Teams](docs/sdks/teams/README.md)
320
+
321
+ * [list_user_teams](docs/sdks/teams/README.md#list_user_teams) - List User Teams
322
+ * [leave_team](docs/sdks/teams/README.md#leave_team) - Leave Team
323
+ * [create_team](docs/sdks/teams/README.md#create_team) - Create Team
324
+ * [list_org_teams](docs/sdks/teams/README.md#list_org_teams) - List Org Teams
325
+ * [update_team](docs/sdks/teams/README.md#update_team) - Update Team
326
+ * [delete_team](docs/sdks/teams/README.md#delete_team) - Delete Team
327
+
328
+ </details>
329
+ <!-- End Available Resources and Operations [operations] -->
330
+
331
+ <!-- Start Retries [retries] -->
332
+ ## Retries
333
+
334
+ Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
335
+
336
+ To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call:
337
+ ```python
338
+ import os
339
+ from px0 import Px0
340
+ from px0.utils import BackoffStrategy, RetryConfig
341
+
342
+
343
+ with Px0(
344
+ bearer_auth=os.getenv("PX0_BEARER_AUTH", ""),
345
+ ) as p_client:
346
+
347
+ res = p_client.health.health_check(,
348
+ RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False))
349
+
350
+ # Handle response
351
+ print(res)
352
+
353
+ ```
354
+
355
+ If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK:
356
+ ```python
357
+ import os
358
+ from px0 import Px0
359
+ from px0.utils import BackoffStrategy, RetryConfig
360
+
361
+
362
+ with Px0(
363
+ retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False),
364
+ bearer_auth=os.getenv("PX0_BEARER_AUTH", ""),
365
+ ) as p_client:
366
+
367
+ res = p_client.health.health_check()
368
+
369
+ # Handle response
370
+ print(res)
371
+
372
+ ```
373
+ <!-- End Retries [retries] -->
374
+
375
+ <!-- Start Error Handling [errors] -->
376
+ ## Error Handling
377
+
378
+ [`Px0Error`](./src/px0/errors/px0error.py) is the base class for all HTTP error responses. It has the following properties:
379
+
380
+ | Property | Type | Description |
381
+ | ------------------ | ---------------- | --------------------------------------------------------------------------------------- |
382
+ | `err.message` | `str` | Error message |
383
+ | `err.status_code` | `int` | HTTP response status code eg `404` |
384
+ | `err.headers` | `httpx.Headers` | HTTP response headers |
385
+ | `err.body` | `str` | HTTP body. Can be empty string if no body is returned. |
386
+ | `err.raw_response` | `httpx.Response` | Raw HTTP response |
387
+ | `err.data` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |
388
+
389
+ ### Example
390
+ ```python
391
+ import os
392
+ from px0 import Px0, errors
393
+
394
+
395
+ with Px0(
396
+ bearer_auth=os.getenv("PX0_BEARER_AUTH", ""),
397
+ ) as p_client:
398
+ res = None
399
+ try:
400
+
401
+ res = p_client.auth.register(email="user@example.com", password="secretpassword123", team_id="f47ac10b-58cc-4372-a567-0e02b2c3d479")
402
+
403
+ # Handle response
404
+ print(res)
405
+
406
+
407
+ except errors.Px0Error as e:
408
+ # The base class for HTTP error responses
409
+ print(e.message)
410
+ print(e.status_code)
411
+ print(e.body)
412
+ print(e.headers)
413
+ print(e.raw_response)
414
+
415
+ # Depending on the method different errors may be thrown
416
+ if isinstance(e, errors.APIError):
417
+ print(e.data.error) # str
418
+ ```
419
+
420
+ ### Error Classes
421
+ **Primary errors:**
422
+ * [`Px0Error`](./src/px0/errors/px0error.py): The base class for HTTP error responses.
423
+ * [`APIError`](./src/px0/errors/apierror.py): *
424
+
425
+ <details><summary>Less common errors (5)</summary>
426
+
427
+ <br />
428
+
429
+ **Network errors:**
430
+ * [`httpx.RequestError`](https://www.python-httpx.org/exceptions/#httpx.RequestError): Base class for request errors.
431
+ * [`httpx.ConnectError`](https://www.python-httpx.org/exceptions/#httpx.ConnectError): HTTP client was unable to make a request to a server.
432
+ * [`httpx.TimeoutException`](https://www.python-httpx.org/exceptions/#httpx.TimeoutException): HTTP request timed out.
433
+
434
+
435
+ **Inherit from [`Px0Error`](./src/px0/errors/px0error.py)**:
436
+ * [`ResponseValidationError`](./src/px0/errors/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute.
437
+
438
+ </details>
439
+
440
+ \* Check [the method documentation](#available-resources-and-operations) to see if the error is applicable.
441
+ <!-- End Error Handling [errors] -->
442
+
443
+ <!-- Start Server Selection [server] -->
444
+ ## Server Selection
445
+
446
+ ### Override Server URL Per-Client
447
+
448
+ The default server can be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:
449
+ ```python
450
+ import os
451
+ from px0 import Px0
452
+
453
+
454
+ with Px0(
455
+ server_url="http://localhost:3000",
456
+ bearer_auth=os.getenv("PX0_BEARER_AUTH", ""),
457
+ ) as p_client:
458
+
459
+ res = p_client.health.health_check()
460
+
461
+ # Handle response
462
+ print(res)
463
+
464
+ ```
465
+ <!-- End Server Selection [server] -->
466
+
467
+ <!-- Start Custom HTTP Client [http-client] -->
468
+ ## Custom HTTP Client
469
+
470
+ The Python SDK makes API calls using the [httpx](https://www.python-httpx.org/) HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with your own HTTP client instance.
471
+ Depending on whether you are using the sync or async version of the SDK, you can pass an instance of `HttpClient` or `AsyncHttpClient` respectively, which are Protocol's ensuring that the client has the necessary methods to make API calls.
472
+ This allows you to wrap the client with your own custom logic, such as adding custom headers, logging, or error handling, or you can just pass an instance of `httpx.Client` or `httpx.AsyncClient` directly.
473
+
474
+ For example, you could specify a header for every request that this sdk makes as follows:
475
+ ```python
476
+ from px0 import Px0
477
+ import httpx
478
+
479
+ http_client = httpx.Client(headers={"x-custom-header": "someValue"})
480
+ s = Px0(client=http_client)
481
+ ```
482
+
483
+ or you could wrap the client with your own custom logic:
484
+ ```python
485
+ from px0 import Px0
486
+ from px0.httpclient import AsyncHttpClient
487
+ import httpx
488
+
489
+ class CustomClient(AsyncHttpClient):
490
+ client: AsyncHttpClient
491
+
492
+ def __init__(self, client: AsyncHttpClient):
493
+ self.client = client
494
+
495
+ async def send(
496
+ self,
497
+ request: httpx.Request,
498
+ *,
499
+ stream: bool = False,
500
+ auth: Union[
501
+ httpx._types.AuthTypes, httpx._client.UseClientDefault, None
502
+ ] = httpx.USE_CLIENT_DEFAULT,
503
+ follow_redirects: Union[
504
+ bool, httpx._client.UseClientDefault
505
+ ] = httpx.USE_CLIENT_DEFAULT,
506
+ ) -> httpx.Response:
507
+ request.headers["Client-Level-Header"] = "added by client"
508
+
509
+ return await self.client.send(
510
+ request, stream=stream, auth=auth, follow_redirects=follow_redirects
511
+ )
512
+
513
+ def build_request(
514
+ self,
515
+ method: str,
516
+ url: httpx._types.URLTypes,
517
+ *,
518
+ content: Optional[httpx._types.RequestContent] = None,
519
+ data: Optional[httpx._types.RequestData] = None,
520
+ files: Optional[httpx._types.RequestFiles] = None,
521
+ json: Optional[Any] = None,
522
+ params: Optional[httpx._types.QueryParamTypes] = None,
523
+ headers: Optional[httpx._types.HeaderTypes] = None,
524
+ cookies: Optional[httpx._types.CookieTypes] = None,
525
+ timeout: Union[
526
+ httpx._types.TimeoutTypes, httpx._client.UseClientDefault
527
+ ] = httpx.USE_CLIENT_DEFAULT,
528
+ extensions: Optional[httpx._types.RequestExtensions] = None,
529
+ ) -> httpx.Request:
530
+ return self.client.build_request(
531
+ method,
532
+ url,
533
+ content=content,
534
+ data=data,
535
+ files=files,
536
+ json=json,
537
+ params=params,
538
+ headers=headers,
539
+ cookies=cookies,
540
+ timeout=timeout,
541
+ extensions=extensions,
542
+ )
543
+
544
+ s = Px0(async_client=CustomClient(httpx.AsyncClient()))
545
+ ```
546
+ <!-- End Custom HTTP Client [http-client] -->
547
+
548
+ <!-- Start Resource Management [resource-management] -->
549
+ ## Resource Management
550
+
551
+ The `Px0` class implements the context manager protocol and registers a finalizer function to close the underlying sync and async HTTPX clients it uses under the hood. This will close HTTP connections, release memory and free up other resources held by the SDK. In short-lived Python programs and notebooks that make a few SDK method calls, resource management may not be a concern. However, in longer-lived programs, it is beneficial to create a single SDK instance via a [context manager][context-manager] and reuse it across the application.
552
+
553
+ [context-manager]: https://docs.python.org/3/reference/datamodel.html#context-managers
554
+
555
+ ```python
556
+ import os
557
+ from px0 import Px0
558
+ def main():
559
+
560
+ with Px0(
561
+ bearer_auth=os.getenv("PX0_BEARER_AUTH", ""),
562
+ ) as p_client:
563
+ # Rest of application here...
564
+
565
+
566
+ # Or when using async:
567
+ async def amain():
568
+
569
+ async with Px0(
570
+ bearer_auth=os.getenv("PX0_BEARER_AUTH", ""),
571
+ ) as p_client:
572
+ # Rest of application here...
573
+ ```
574
+ <!-- End Resource Management [resource-management] -->
575
+
576
+ <!-- Start Debugging [debug] -->
577
+ ## Debugging
578
+
579
+ You can setup your SDK to emit debug logs for SDK requests and responses.
580
+
581
+ You can pass your own logger class directly into your SDK.
582
+ ```python
583
+ from px0 import Px0
584
+ import logging
585
+
586
+ logging.basicConfig(level=logging.DEBUG)
587
+ s = Px0(debug_logger=logging.getLogger("px0"))
588
+ ```
589
+
590
+ You can also enable a default debug logger by setting an environment variable `PX0_DEBUG` to true.
591
+ <!-- End Debugging [debug] -->
592
+
593
+ <!-- Placeholder for Future Speakeasy SDK Sections -->
594
+
595
+ # Development
596
+
597
+ ## Maturity
598
+
599
+ This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
600
+ to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
601
+ looking for the latest version.
602
+
603
+ ## Contributions
604
+
605
+ While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation.
606
+ We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.
607
+
608
+ ### SDK Created by [Speakeasy](https://www.speakeasy.com/?utm_source=px0&utm_campaign=python)