Skip to content

Commit a636adf

Browse files
authored
Merge pull request #21 from zeroentropy-ai/release-please--branches--main--changes--next
2 parents 5a06028 + da40133 commit a636adf

35 files changed

+758
-77
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ jobs:
1212
lint:
1313
name: lint
1414
runs-on: ubuntu-latest
15-
1615

1716
steps:
1817
- uses: actions/checkout@v4
@@ -30,6 +29,7 @@ jobs:
3029

3130
- name: Run lints
3231
run: ./scripts/lint
32+
3333
test:
3434
name: test
3535
runs-on: ubuntu-latest
@@ -50,4 +50,3 @@ jobs:
5050

5151
- name: Run tests
5252
run: ./scripts/test
53-

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.1.0-alpha.2"
2+
".": "0.1.0-alpha.3"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 13
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zeroentropy%2Fzeroentropy-79503f9599a8cf36cc6b746114d49c484fc8615cf4d8ef979dc299a88d3045d0.yml
1+
configured_endpoints: 15
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zeroentropy%2Fzeroentropy-99a41bb73e432cb47fe1937219b3c7b109ae534456e8dd019cc00cc1e6018a16.yml

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 0.1.0-alpha.3 (2025-01-28)
4+
5+
Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/zeroentropy-ai/zeroentropy-python/compare/v0.1.0-alpha.2...v0.1.0-alpha.3)
6+
7+
### Chores
8+
9+
* go live ([#15](https://github.com/zeroentropy-ai/zeroentropy-python/issues/15)) ([94648e3](https://github.com/zeroentropy-ai/zeroentropy-python/commit/94648e31f00197387695a5b5d0f832f179f6bd99))
10+
311
## 0.1.0-alpha.2 (2025-01-18)
412

513
Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/zeroentropy-ai/zeroentropy-python/compare/v0.1.0-alpha.1...v0.1.0-alpha.2)

api.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# Admin
2+
3+
Types:
4+
5+
```python
6+
from zeroentropy.types import AdminCreateOrganizationResponse
7+
```
8+
9+
Methods:
10+
11+
- <code title="post /admin/create-organization">client.admin.<a href="./src/zeroentropy/resources/admin.py">create_organization</a>(\*\*<a href="src/zeroentropy/types/admin_create_organization_params.py">params</a>) -> <a href="./src/zeroentropy/types/admin_create_organization_response.py">AdminCreateOrganizationResponse</a></code>
12+
113
# Status
214

315
Types:
@@ -34,6 +46,7 @@ Types:
3446

3547
```python
3648
from zeroentropy.types import (
49+
DocumentUpdateResponse,
3750
DocumentDeleteResponse,
3851
DocumentAddResponse,
3952
DocumentGetInfoResponse,
@@ -44,6 +57,7 @@ from zeroentropy.types import (
4457

4558
Methods:
4659

60+
- <code title="post /documents/update-document">client.documents.<a href="./src/zeroentropy/resources/documents.py">update</a>(\*\*<a href="src/zeroentropy/types/document_update_params.py">params</a>) -> <a href="./src/zeroentropy/types/document_update_response.py">DocumentUpdateResponse</a></code>
4761
- <code title="post /documents/delete-document">client.documents.<a href="./src/zeroentropy/resources/documents.py">delete</a>(\*\*<a href="src/zeroentropy/types/document_delete_params.py">params</a>) -> <a href="./src/zeroentropy/types/document_delete_response.py">DocumentDeleteResponse</a></code>
4862
- <code title="post /documents/add-document">client.documents.<a href="./src/zeroentropy/resources/documents.py">add</a>(\*\*<a href="src/zeroentropy/types/document_add_params.py">params</a>) -> <a href="./src/zeroentropy/types/document_add_response.py">DocumentAddResponse</a></code>
4963
- <code title="post /documents/get-document-info">client.documents.<a href="./src/zeroentropy/resources/documents.py">get_info</a>(\*\*<a href="src/zeroentropy/types/document_get_info_params.py">params</a>) -> <a href="./src/zeroentropy/types/document_get_info_response.py">DocumentGetInfoResponse</a></code>

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "zeroentropy"
3-
version = "0.1.0-alpha.2"
3+
version = "0.1.0-alpha.3"
44
description = "The official Python library for the ZeroEntropy API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -129,6 +129,7 @@ testpaths = ["tests"]
129129
addopts = "--tb=short"
130130
xfail_strict = true
131131
asyncio_mode = "auto"
132+
asyncio_default_fixture_loop_scope = "session"
132133
filterwarnings = [
133134
"error"
134135
]

scripts/bootstrap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -e
44

55
cd "$(dirname "$0")/.."
66

7-
if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
7+
if ! command -v rye >/dev/null 2>&1 && [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
88
brew bundle check >/dev/null 2>&1 || {
99
echo "==> Installing Homebrew dependencies…"
1010
brew bundle

scripts/lint

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ rye run lint
99

1010
echo "==> Making sure it imports"
1111
rye run python -c 'import zeroentropy'
12-

src/zeroentropy/_client.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
get_async_library,
2525
)
2626
from ._version import __version__
27-
from .resources import status, parsers, queries, documents, collections
27+
from .resources import admin, status, parsers, queries, documents, collections
2828
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
2929
from ._exceptions import APIStatusError, ZeroEntropyError
3030
from ._base_client import (
@@ -46,6 +46,7 @@
4646

4747

4848
class ZeroEntropy(SyncAPIClient):
49+
admin: admin.AdminResource
4950
status: status.StatusResource
5051
collections: collections.CollectionsResource
5152
documents: documents.DocumentsResource
@@ -108,6 +109,7 @@ def __init__(
108109
_strict_response_validation=_strict_response_validation,
109110
)
110111

112+
self.admin = admin.AdminResource(self)
111113
self.status = status.StatusResource(self)
112114
self.collections = collections.CollectionsResource(self)
113115
self.documents = documents.DocumentsResource(self)
@@ -222,6 +224,7 @@ def _make_status_error(
222224

223225

224226
class AsyncZeroEntropy(AsyncAPIClient):
227+
admin: admin.AsyncAdminResource
225228
status: status.AsyncStatusResource
226229
collections: collections.AsyncCollectionsResource
227230
documents: documents.AsyncDocumentsResource
@@ -284,6 +287,7 @@ def __init__(
284287
_strict_response_validation=_strict_response_validation,
285288
)
286289

290+
self.admin = admin.AsyncAdminResource(self)
287291
self.status = status.AsyncStatusResource(self)
288292
self.collections = collections.AsyncCollectionsResource(self)
289293
self.documents = documents.AsyncDocumentsResource(self)
@@ -399,6 +403,7 @@ def _make_status_error(
399403

400404
class ZeroEntropyWithRawResponse:
401405
def __init__(self, client: ZeroEntropy) -> None:
406+
self.admin = admin.AdminResourceWithRawResponse(client.admin)
402407
self.status = status.StatusResourceWithRawResponse(client.status)
403408
self.collections = collections.CollectionsResourceWithRawResponse(client.collections)
404409
self.documents = documents.DocumentsResourceWithRawResponse(client.documents)
@@ -408,6 +413,7 @@ def __init__(self, client: ZeroEntropy) -> None:
408413

409414
class AsyncZeroEntropyWithRawResponse:
410415
def __init__(self, client: AsyncZeroEntropy) -> None:
416+
self.admin = admin.AsyncAdminResourceWithRawResponse(client.admin)
411417
self.status = status.AsyncStatusResourceWithRawResponse(client.status)
412418
self.collections = collections.AsyncCollectionsResourceWithRawResponse(client.collections)
413419
self.documents = documents.AsyncDocumentsResourceWithRawResponse(client.documents)
@@ -417,6 +423,7 @@ def __init__(self, client: AsyncZeroEntropy) -> None:
417423

418424
class ZeroEntropyWithStreamedResponse:
419425
def __init__(self, client: ZeroEntropy) -> None:
426+
self.admin = admin.AdminResourceWithStreamingResponse(client.admin)
420427
self.status = status.StatusResourceWithStreamingResponse(client.status)
421428
self.collections = collections.CollectionsResourceWithStreamingResponse(client.collections)
422429
self.documents = documents.DocumentsResourceWithStreamingResponse(client.documents)
@@ -426,6 +433,7 @@ def __init__(self, client: ZeroEntropy) -> None:
426433

427434
class AsyncZeroEntropyWithStreamedResponse:
428435
def __init__(self, client: AsyncZeroEntropy) -> None:
436+
self.admin = admin.AsyncAdminResourceWithStreamingResponse(client.admin)
429437
self.status = status.AsyncStatusResourceWithStreamingResponse(client.status)
430438
self.collections = collections.AsyncCollectionsResourceWithStreamingResponse(client.collections)
431439
self.documents = documents.AsyncDocumentsResourceWithStreamingResponse(client.documents)

src/zeroentropy/_response.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
136136
if cast_to and is_annotated_type(cast_to):
137137
cast_to = extract_type_arg(cast_to, 0)
138138

139+
origin = get_origin(cast_to) or cast_to
140+
139141
if self._is_sse_stream:
140142
if to:
141143
if not is_stream_class_type(to):
@@ -195,8 +197,6 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
195197
if cast_to == bool:
196198
return cast(R, response.text.lower() == "true")
197199

198-
origin = get_origin(cast_to) or cast_to
199-
200200
if origin == APIResponse:
201201
raise RuntimeError("Unexpected state - cast_to is `APIResponse`")
202202

0 commit comments

Comments
 (0)