Skip to content

Commit a2adc50

Browse files
authored
Merge pull request #90 from hyperspell/release-please--branches--main--changes--next
release: 0.15.0
2 parents e4cfd36 + df893b3 commit a2adc50

37 files changed

+652
-903
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,30 @@ jobs:
3030
- name: Run lints
3131
run: ./scripts/lint
3232

33+
upload:
34+
if: github.repository == 'stainless-sdks/hyperspell-python'
35+
timeout-minutes: 10
36+
name: upload
37+
permissions:
38+
contents: read
39+
id-token: write
40+
runs-on: depot-ubuntu-24.04
41+
steps:
42+
- uses: actions/checkout@v4
43+
44+
- name: Get GitHub OIDC Token
45+
id: github-oidc
46+
uses: actions/github-script@v6
47+
with:
48+
script: core.setOutput('github_token', await core.getIDToken());
49+
50+
- name: Upload tarball
51+
env:
52+
URL: https://pkg.stainless.com/s
53+
AUTH: ${{ steps.github-oidc.outputs.github_token }}
54+
SHA: ${{ github.sha }}
55+
run: ./scripts/utils/upload-artifact.sh
56+
3357
test:
3458
timeout-minutes: 10
3559
name: test

.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.12.0"
2+
".": "0.13.0"
33
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 14
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-099cd79547bb459ecbd2442e4f93fc17f4f9a2dead413f06a0b39afb6541db07.yml
3-
openapi_spec_hash: 81afcb8056acd1af983d70f817911738
4-
config_hash: 85255d5a167e2f4bcf8a9314d653ec01
1+
configured_endpoints: 10
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-287b83fd66b657b044f4ab280ab0e72a2ed72c0da50e4a7d09ce98123982262f.yml
3+
openapi_spec_hash: fcef51b5cf5e602a2d8025546e27e24a
4+
config_hash: a39dfe90372d06d735dfb3d27b30409f

CHANGELOG.md

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

3+
## 0.13.0 (2025-05-26)
4+
5+
Full Changelog: [v0.12.0...v0.13.0](https://github.com/hyperspell/python-sdk/compare/v0.12.0...v0.13.0)
6+
7+
### Features
8+
9+
* **api:** api update ([74e46e9](https://github.com/hyperspell/python-sdk/commit/74e46e9fc6e453ec408fc2641f8e3526df13927e))
10+
* **api:** api update ([bccb2cc](https://github.com/hyperspell/python-sdk/commit/bccb2cc8cac69ba61476aa224a753b5c88f14eca))
11+
* **api:** api update ([c05d86e](https://github.com/hyperspell/python-sdk/commit/c05d86eac76104c1a6b312663dd6b973070b51ce))
12+
* **api:** api update ([b20e5b5](https://github.com/hyperspell/python-sdk/commit/b20e5b5bf8b894faf515d9ca770d757078d265d9))
13+
* **api:** update via SDK Studio ([5512870](https://github.com/hyperspell/python-sdk/commit/55128707104ac90ebcefe72795161d98c1790e6c))
14+
15+
16+
### Bug Fixes
17+
18+
* **package:** support direct resource imports ([d8b54e0](https://github.com/hyperspell/python-sdk/commit/d8b54e020764be85d1fd2de167deb1e825e6aceb))
19+
20+
21+
### Chores
22+
23+
* **ci:** fix installation instructions ([3567715](https://github.com/hyperspell/python-sdk/commit/3567715ff2540fa63cc0feed569a98d42af731a6))
24+
* **ci:** upload sdks to package manager ([733ed75](https://github.com/hyperspell/python-sdk/commit/733ed759b06612d5da69c9fd241240c951ef1964))
25+
* **docs:** grammar improvements ([5e2a523](https://github.com/hyperspell/python-sdk/commit/5e2a523d1c080c7254e9b2f0e3bc112c0bbfbe09))
26+
* **internal:** avoid errors for isinstance checks on proxies ([c86a164](https://github.com/hyperspell/python-sdk/commit/c86a164ba1bdecfc7db3c4d12c9753d8c99ec232))
27+
328
## 0.12.0 (2025-04-30)
429

530
Full Changelog: [v0.11.0...v0.12.0](https://github.com/hyperspell/python-sdk/compare/v0.11.0...v0.12.0)

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import os
2828
from hyperspell import Hyperspell
2929

3030
client = Hyperspell(
31-
api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted
31+
api_key=os.environ.get("HYPERSPELL_TOKEN"), # This is the default and can be omitted
3232
)
3333

3434
document_status = client.documents.add(
@@ -39,7 +39,7 @@ print(document_status.id)
3939

4040
While you can provide an `api_key` keyword argument,
4141
we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
42-
to add `HYPERSPELL_API_KEY="My API Key"` to your `.env` file
42+
to add `HYPERSPELL_TOKEN="My API Key"` to your `.env` file
4343
so that your API Key is not stored in source control.
4444

4545
## Async usage
@@ -52,7 +52,7 @@ import asyncio
5252
from hyperspell import AsyncHyperspell
5353

5454
client = AsyncHyperspell(
55-
api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted
55+
api_key=os.environ.get("HYPERSPELL_TOKEN"), # This is the default and can be omitted
5656
)
5757

5858

@@ -143,7 +143,7 @@ first_page = await client.documents.list(
143143

144144
print(f"next page cursor: {first_page.next_cursor}") # => "next page cursor: ..."
145145
for document in first_page.items:
146-
print(document.id)
146+
print(document.resource_id)
147147

148148
# Remove `await` for non-async usage.
149149
```
@@ -165,8 +165,9 @@ response = client.query.search(
165165
"after": datetime.fromisoformat("2019-12-27T18:11:19.117"),
166166
"before": datetime.fromisoformat("2019-12-27T18:11:19.117"),
167167
"box": {},
168-
"collections": {"collections": ["string"]},
168+
"collections": {},
169169
"google_calendar": {"calendar_id": "calendar_id"},
170+
"google_drive": {},
170171
"notion": {"notion_page_ids": ["string"]},
171172
"reddit": {
172173
"period": "hour",
@@ -194,7 +195,6 @@ from hyperspell import Hyperspell
194195
client = Hyperspell()
195196

196197
client.documents.upload(
197-
collection="collection",
198198
file=Path("/path/to/file"),
199199
)
200200
```

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ before making any information public.
1616
## Reporting Non-SDK Related Security Issues
1717

1818
If you encounter security issues that are not directly related to SDKs but pertain to the services
19-
or products provided by Hyperspell please follow the respective company's security reporting guidelines.
19+
or products provided by Hyperspell, please follow the respective company's security reporting guidelines.
2020

2121
### Hyperspell Terms and Policies
2222

23-
Please contact hello@hyperspell.com for any questions or concerns regarding security of our services.
23+
Please contact hello@hyperspell.com for any questions or concerns regarding the security of our services.
2424

2525
---
2626

api.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,30 +39,26 @@ Methods:
3939
Types:
4040

4141
```python
42-
from hyperspell.types import Document, DocumentStatus, DocumentListResponse, DocumentGetResponse
42+
from hyperspell.types import DocumentStatus, DocumentListResponse
4343
```
4444

4545
Methods:
4646

4747
- <code title="get /documents/list">client.documents.<a href="./src/hyperspell/resources/documents.py">list</a>(\*\*<a href="src/hyperspell/types/document_list_params.py">params</a>) -> <a href="./src/hyperspell/types/document_list_response.py">SyncCursorPage[DocumentListResponse]</a></code>
4848
- <code title="post /documents/add">client.documents.<a href="./src/hyperspell/resources/documents.py">add</a>(\*\*<a href="src/hyperspell/types/document_add_params.py">params</a>) -> <a href="./src/hyperspell/types/document_status.py">DocumentStatus</a></code>
49-
- <code title="post /documents/scrape">client.documents.<a href="./src/hyperspell/resources/documents.py">add_url</a>(\*\*<a href="src/hyperspell/types/document_add_url_params.py">params</a>) -> <a href="./src/hyperspell/types/document_status.py">DocumentStatus</a></code>
50-
- <code title="get /documents/get/{document_id}">client.documents.<a href="./src/hyperspell/resources/documents.py">get</a>(document_id) -> <a href="./src/hyperspell/types/document_get_response.py">object</a></code>
5149
- <code title="post /documents/upload">client.documents.<a href="./src/hyperspell/resources/documents.py">upload</a>(\*\*<a href="src/hyperspell/types/document_upload_params.py">params</a>) -> <a href="./src/hyperspell/types/document_status.py">DocumentStatus</a></code>
5250

5351
# Collections
5452

5553
Types:
5654

5755
```python
58-
from hyperspell.types import Collection, CollectionListResponse
56+
from hyperspell.types import CollectionListResponse
5957
```
6058

6159
Methods:
6260

63-
- <code title="post /collections/add">client.collections.<a href="./src/hyperspell/resources/collections.py">create</a>(\*\*<a href="src/hyperspell/types/collection_create_params.py">params</a>) -> <a href="./src/hyperspell/types/collection.py">Collection</a></code>
6461
- <code title="get /collections/list">client.collections.<a href="./src/hyperspell/resources/collections.py">list</a>(\*\*<a href="src/hyperspell/types/collection_list_params.py">params</a>) -> <a href="./src/hyperspell/types/collection_list_response.py">SyncCursorPage[CollectionListResponse]</a></code>
65-
- <code title="get /collections/get/{name}">client.collections.<a href="./src/hyperspell/resources/collections.py">get</a>(name) -> <a href="./src/hyperspell/types/collection.py">Collection</a></code>
6662

6763
# Query
6864

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "hyperspell"
3-
version = "0.12.0"
3+
version = "0.13.0"
44
description = "The official Python library for the hyperspell API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

scripts/utils/upload-artifact.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
set -exuo pipefail
3+
4+
RESPONSE=$(curl -X POST "$URL" \
5+
-H "Authorization: Bearer $AUTH" \
6+
-H "Content-Type: application/json")
7+
8+
SIGNED_URL=$(echo "$RESPONSE" | jq -r '.url')
9+
10+
if [[ "$SIGNED_URL" == "null" ]]; then
11+
echo -e "\033[31mFailed to get signed URL.\033[0m"
12+
exit 1
13+
fi
14+
15+
UPLOAD_RESPONSE=$(tar -cz . | curl -v -X PUT \
16+
-H "Content-Type: application/gzip" \
17+
--data-binary @- "$SIGNED_URL" 2>&1)
18+
19+
if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then
20+
echo -e "\033[32mUploaded build to Stainless storage.\033[0m"
21+
echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/hyperspell-python/$SHA'\033[0m"
22+
else
23+
echo -e "\033[31mFailed to upload artifact.\033[0m"
24+
exit 1
25+
fi

src/hyperspell/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3+
import typing as _t
4+
35
from . import types
46
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
57
from ._utils import file_from_path
@@ -78,6 +80,9 @@
7880
"DefaultAsyncHttpxClient",
7981
]
8082

83+
if not _t.TYPE_CHECKING:
84+
from ._utils._resources_proxy import resources as resources
85+
8186
_setup_logging()
8287

8388
# Update the __module__ attribute for exported symbols so that

0 commit comments

Comments
 (0)