Skip to content

Commit 87adc98

Browse files
authored
Merge pull request #93 from hyperspell/release-please--branches--main--changes--next
release: 0.19.0
2 parents 17ff9d3 + 0b78ebf commit 87adc98

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1424
-1252
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
timeout-minutes: 10
1818
name: lint
1919
runs-on: ${{ github.repository == 'stainless-sdks/hyperspell-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
20+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
2021
steps:
2122
- uses: actions/checkout@v4
2223

@@ -34,17 +35,31 @@ jobs:
3435
- name: Run lints
3536
run: ./scripts/lint
3637

37-
upload:
38-
if: github.repository == 'stainless-sdks/hyperspell-python'
38+
build:
39+
if: github.repository == 'stainless-sdks/hyperspell-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
3940
timeout-minutes: 10
40-
name: upload
41+
name: build
4142
permissions:
4243
contents: read
4344
id-token: write
4445
runs-on: depot-ubuntu-24.04
4546
steps:
4647
- uses: actions/checkout@v4
4748

49+
- name: Install Rye
50+
run: |
51+
curl -sSf https://rye.astral.sh/get | bash
52+
echo "$HOME/.rye/shims" >> $GITHUB_PATH
53+
env:
54+
RYE_VERSION: '0.44.0'
55+
RYE_INSTALL_OPTION: '--yes'
56+
57+
- name: Install dependencies
58+
run: rye sync --all-features
59+
60+
- name: Run build
61+
run: rye build
62+
4863
- name: Get GitHub OIDC Token
4964
id: github-oidc
5065
uses: actions/github-script@v6
@@ -62,6 +77,7 @@ jobs:
6277
timeout-minutes: 10
6378
name: test
6479
runs-on: ${{ github.repository == 'stainless-sdks/hyperspell-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
80+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
6581
steps:
6682
- uses: actions/checkout@v4
6783

.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.18.0"
2+
".": "0.19.0"
33
}

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 12
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-e89c764e4c847e7825e07bdb7e927a99b29548a8864069365d50974e8d4518fe.yml
3-
openapi_spec_hash: fadd50b9f0b9675cbf5c16c318feef2f
4-
config_hash: 32d007e1683b1936cd145cd41982ebb6
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-4bfa5ab6a0021f526d6f6f622f1872f2ec3467b6d1bd51acfc17bfc6f399f915.yml
3+
openapi_spec_hash: 5b51df5010bab70a1f3f884552ce25c3
4+
config_hash: c894437241b21cedd2d01854f1c7a8ef

CHANGELOG.md

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

3+
## 0.19.0 (2025-07-18)
4+
5+
Full Changelog: [v0.18.0...v0.19.0](https://github.com/hyperspell/python-sdk/compare/v0.18.0...v0.19.0)
6+
7+
### Features
8+
9+
* **api:** api update ([e4edf05](https://github.com/hyperspell/python-sdk/commit/e4edf05d2e2700fef1e70250204aee103ac54686))
10+
* **api:** api update ([7248ff5](https://github.com/hyperspell/python-sdk/commit/7248ff5db8bbc8708f8dfe8afb78d519401ee7f2))
11+
* **api:** update via SDK Studio ([20bf1bb](https://github.com/hyperspell/python-sdk/commit/20bf1bbf36b4b5aa984cd6f405eb98fb6a743dba))
12+
* **api:** update via SDK Studio ([21036b0](https://github.com/hyperspell/python-sdk/commit/21036b0a3b626fa41925b58b24616484158b9361))
13+
* **api:** update via SDK Studio ([bf294db](https://github.com/hyperspell/python-sdk/commit/bf294db204ddb25338ab2370d78d6c378c78686a))
14+
* clean up environment call outs ([e99844e](https://github.com/hyperspell/python-sdk/commit/e99844ee29928beeed51cd47d53e3ababe33e608))
15+
* **client:** add support for aiohttp ([c0845dc](https://github.com/hyperspell/python-sdk/commit/c0845dc8133eb74e72f18651e9da53102609d833))
16+
17+
18+
### Bug Fixes
19+
20+
* **ci:** correct conditional ([980b910](https://github.com/hyperspell/python-sdk/commit/980b910eaa78cf84de10c0521e4ed2f142689ae0))
21+
* **ci:** release-doctor — report correct token name ([6ddb78b](https://github.com/hyperspell/python-sdk/commit/6ddb78b355f8e36a85fcfaf1592618bae5c67473))
22+
* **client:** don't send Content-Type header on GET requests ([f7a04b5](https://github.com/hyperspell/python-sdk/commit/f7a04b5a47aa9a6fc338498a34db4074824c198e))
23+
* **parsing:** correctly handle nested discriminated unions ([f4e309d](https://github.com/hyperspell/python-sdk/commit/f4e309d6a8d85f5aa0cb3fee3e41bf9c6487b5b1))
24+
25+
26+
### Chores
27+
28+
* **ci:** change upload type ([c01d519](https://github.com/hyperspell/python-sdk/commit/c01d519131a2c4620c9454c4e634c2e39053b00c))
29+
* **ci:** only run for pushes and fork pull requests ([991d685](https://github.com/hyperspell/python-sdk/commit/991d6859286e86aa022eb83aab8ecc6e337798f4))
30+
* **internal:** bump pinned h11 dep ([1ce5781](https://github.com/hyperspell/python-sdk/commit/1ce57814e1d392b0c6a51b75c1dd92550f9399c3))
31+
* **internal:** codegen related update ([f7cd6c7](https://github.com/hyperspell/python-sdk/commit/f7cd6c7b1feafef059ecdf6be0bb9adbd5f28929))
32+
* **package:** mark python 3.13 as supported ([b04d1e6](https://github.com/hyperspell/python-sdk/commit/b04d1e6c7d2dbd8852963ee8f08596ed332e04ec))
33+
* **readme:** fix version rendering on pypi ([a109225](https://github.com/hyperspell/python-sdk/commit/a1092259c98715d17ce95259420baf3c3d325db8))
34+
* **tests:** skip some failing tests on the latest python versions ([9eebf62](https://github.com/hyperspell/python-sdk/commit/9eebf628b254b4f463ea7b899dcef53af5362228))
35+
336
## 0.18.0 (2025-06-19)
437

538
Full Changelog: [v0.16.0...v0.18.0](https://github.com/hyperspell/python-sdk/compare/v0.16.0...v0.18.0)

README.md

Lines changed: 61 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Hyperspell Python API library
22

3-
[![PyPI version](<https://img.shields.io/pypi/v/hyperspell.svg?label=pypi%20(stable)>)](https://pypi.org/project/hyperspell/)
3+
<!-- prettier-ignore -->
4+
[![PyPI version](https://img.shields.io/pypi/v/hyperspell.svg?label=pypi%20(stable))](https://pypi.org/project/hyperspell/)
45

56
The Hyperspell Python library provides convenient access to the Hyperspell REST API from any Python 3.8+
67
application. The library includes type definitions for all request params and response fields,
@@ -31,10 +32,10 @@ client = Hyperspell(
3132
api_key=os.environ.get("HYPERSPELL_TOKEN"), # This is the default and can be omitted
3233
)
3334

34-
document_status = client.documents.add(
35+
memory_status = client.memories.add(
3536
text="text",
3637
)
37-
print(document_status.id)
38+
print(memory_status.id)
3839
```
3940

4041
While you can provide an `api_key` keyword argument,
@@ -57,17 +58,50 @@ client = AsyncHyperspell(
5758

5859

5960
async def main() -> None:
60-
document_status = await client.documents.add(
61+
memory_status = await client.memories.add(
6162
text="text",
6263
)
63-
print(document_status.id)
64+
print(memory_status.id)
6465

6566

6667
asyncio.run(main())
6768
```
6869

6970
Functionality between the synchronous and asynchronous clients is otherwise identical.
7071

72+
### With aiohttp
73+
74+
By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.
75+
76+
You can enable this by installing `aiohttp`:
77+
78+
```sh
79+
# install from PyPI
80+
pip install hyperspell[aiohttp]
81+
```
82+
83+
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
84+
85+
```python
86+
import asyncio
87+
from hyperspell import DefaultAioHttpClient
88+
from hyperspell import AsyncHyperspell
89+
90+
91+
async def main() -> None:
92+
async with AsyncHyperspell(
93+
api_key="My API Key",
94+
http_client=DefaultAioHttpClient(),
95+
) as client:
96+
memory_status = await client.memories.add(
97+
text="text",
98+
)
99+
print(memory_status.id)
100+
101+
102+
asyncio.run(main())
103+
```
104+
71105
## Using types
72106

73107
Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:
@@ -88,14 +122,14 @@ from hyperspell import Hyperspell
88122

89123
client = Hyperspell()
90124

91-
all_documents = []
125+
all_memories = []
92126
# Automatically fetches more pages as needed.
93-
for document in client.documents.list(
127+
for memory in client.memories.list(
94128
collection="REPLACE_ME",
95129
):
96-
# Do something with document here
97-
all_documents.append(document)
98-
print(all_documents)
130+
# Do something with memory here
131+
all_memories.append(memory)
132+
print(all_memories)
99133
```
100134

101135
Or, asynchronously:
@@ -108,13 +142,13 @@ client = AsyncHyperspell()
108142

109143

110144
async def main() -> None:
111-
all_documents = []
145+
all_memories = []
112146
# Iterate through items across all pages, issuing requests as needed.
113-
async for document in client.documents.list(
147+
async for memory in client.memories.list(
114148
collection="REPLACE_ME",
115149
):
116-
all_documents.append(document)
117-
print(all_documents)
150+
all_memories.append(memory)
151+
print(all_memories)
118152

119153

120154
asyncio.run(main())
@@ -123,7 +157,7 @@ asyncio.run(main())
123157
Alternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:
124158

125159
```python
126-
first_page = await client.documents.list(
160+
first_page = await client.memories.list(
127161
collection="REPLACE_ME",
128162
)
129163
if first_page.has_next_page():
@@ -137,13 +171,13 @@ if first_page.has_next_page():
137171
Or just work directly with the returned data:
138172

139173
```python
140-
first_page = await client.documents.list(
174+
first_page = await client.memories.list(
141175
collection="REPLACE_ME",
142176
)
143177

144178
print(f"next page cursor: {first_page.next_cursor}") # => "next page cursor: ..."
145-
for document in first_page.items:
146-
print(document.resource_id)
179+
for memory in first_page.items:
180+
print(memory.resource_id)
147181

148182
# Remove `await` for non-async usage.
149183
```
@@ -157,7 +191,7 @@ from hyperspell import Hyperspell
157191

158192
client = Hyperspell()
159193

160-
response = client.query.search(
194+
response = client.memories.search(
161195
query="query",
162196
filter={},
163197
)
@@ -174,7 +208,7 @@ from hyperspell import Hyperspell
174208

175209
client = Hyperspell()
176210

177-
client.documents.upload(
211+
client.memories.upload(
178212
file=Path("/path/to/file"),
179213
)
180214
```
@@ -197,7 +231,7 @@ from hyperspell import Hyperspell
197231
client = Hyperspell()
198232

199233
try:
200-
client.documents.add(
234+
client.memories.add(
201235
text="text",
202236
)
203237
except hyperspell.APIConnectionError as e:
@@ -242,7 +276,7 @@ client = Hyperspell(
242276
)
243277

244278
# Or, configure per-request:
245-
client.with_options(max_retries=5).documents.add(
279+
client.with_options(max_retries=5).memories.add(
246280
text="text",
247281
)
248282
```
@@ -267,7 +301,7 @@ client = Hyperspell(
267301
)
268302

269303
# Override per-request:
270-
client.with_options(timeout=5.0).documents.add(
304+
client.with_options(timeout=5.0).memories.add(
271305
text="text",
272306
)
273307
```
@@ -310,13 +344,13 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
310344
from hyperspell import Hyperspell
311345

312346
client = Hyperspell()
313-
response = client.documents.with_raw_response.add(
347+
response = client.memories.with_raw_response.add(
314348
text="text",
315349
)
316350
print(response.headers.get('X-My-Header'))
317351

318-
document = response.parse() # get the object that `documents.add()` would have returned
319-
print(document.id)
352+
memory = response.parse() # get the object that `memories.add()` would have returned
353+
print(memory.id)
320354
```
321355

322356
These methods return an [`APIResponse`](https://github.com/hyperspell/python-sdk/tree/main/src/hyperspell/_response.py) object.
@@ -330,7 +364,7 @@ The above interface eagerly reads the full response body when you make the reque
330364
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
331365

332366
```python
333-
with client.documents.with_streaming_response.add(
367+
with client.memories.with_streaming_response.add(
334368
text="text",
335369
) as response:
336370
print(response.headers.get("X-My-Header"))

api.md

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,45 +34,34 @@ Methods:
3434

3535
- <code title="get /integrations/web_crawler/index">client.integrations.web_crawler.<a href="./src/hyperspell/resources/integrations/web_crawler.py">index</a>(\*\*<a href="src/hyperspell/types/integrations/web_crawler_index_params.py">params</a>) -> <a href="./src/hyperspell/types/integrations/web_crawler_index_response.py">WebCrawlerIndexResponse</a></code>
3636

37-
# Documents
37+
# Memories
3838

3939
Types:
4040

4141
```python
42-
from hyperspell.types import Document, DocumentStatus, DocumentStatusResponse
42+
from hyperspell.types import Memory, MemoryStatus, MemorySearchResponse, MemoryStatusResponse
4343
```
4444

4545
Methods:
4646

47-
- <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.py">SyncCursorPage[Document]</a></code>
48-
- <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="get /documents/get/{source}/{resource_id}">client.documents.<a href="./src/hyperspell/resources/documents.py">get</a>(resource_id, \*, source) -> <a href="./src/hyperspell/types/document.py">Document</a></code>
50-
- <code title="get /documents/status">client.documents.<a href="./src/hyperspell/resources/documents.py">status</a>() -> <a href="./src/hyperspell/types/document_status_response.py">DocumentStatusResponse</a></code>
51-
- <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>
47+
- <code title="get /memories/list">client.memories.<a href="./src/hyperspell/resources/memories.py">list</a>(\*\*<a href="src/hyperspell/types/memory_list_params.py">params</a>) -> <a href="./src/hyperspell/types/memory.py">SyncCursorPage[Memory]</a></code>
48+
- <code title="post /memories/add">client.memories.<a href="./src/hyperspell/resources/memories.py">add</a>(\*\*<a href="src/hyperspell/types/memory_add_params.py">params</a>) -> <a href="./src/hyperspell/types/memory_status.py">MemoryStatus</a></code>
49+
- <code title="get /memories/get/{source}/{resource_id}">client.memories.<a href="./src/hyperspell/resources/memories.py">get</a>(resource_id, \*, source) -> <a href="./src/hyperspell/types/memory.py">Memory</a></code>
50+
- <code title="post /memories/query">client.memories.<a href="./src/hyperspell/resources/memories.py">search</a>(\*\*<a href="src/hyperspell/types/memory_search_params.py">params</a>) -> <a href="./src/hyperspell/types/memory_search_response.py">MemorySearchResponse</a></code>
51+
- <code title="get /memories/status">client.memories.<a href="./src/hyperspell/resources/memories.py">status</a>() -> <a href="./src/hyperspell/types/memory_status_response.py">MemoryStatusResponse</a></code>
52+
- <code title="post /memories/upload">client.memories.<a href="./src/hyperspell/resources/memories.py">upload</a>(\*\*<a href="src/hyperspell/types/memory_upload_params.py">params</a>) -> <a href="./src/hyperspell/types/memory_status.py">MemoryStatus</a></code>
5253

53-
# Collections
54+
# Vaults
5455

5556
Types:
5657

5758
```python
58-
from hyperspell.types import CollectionListResponse
59+
from hyperspell.types import VaultListResponse
5960
```
6061

6162
Methods:
6263

63-
- <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>
64-
65-
# Query
66-
67-
Types:
68-
69-
```python
70-
from hyperspell.types import QuerySearchResponse
71-
```
72-
73-
Methods:
74-
75-
- <code title="post /query">client.query.<a href="./src/hyperspell/resources/query.py">search</a>(\*\*<a href="src/hyperspell/types/query_search_params.py">params</a>) -> <a href="./src/hyperspell/types/query_search_response.py">QuerySearchResponse</a></code>
64+
- <code title="get /vault/list">client.vaults.<a href="./src/hyperspell/resources/vaults.py">list</a>(\*\*<a href="src/hyperspell/types/vault_list_params.py">params</a>) -> <a href="./src/hyperspell/types/vault_list_response.py">SyncCursorPage[VaultListResponse]</a></code>
7665

7766
# Auth
7867

bin/check-release-environment

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
errors=()
44

55
if [ -z "${PYPI_TOKEN}" ]; then
6-
errors+=("The HYPERSPELL_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
6+
errors+=("The PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
77
fi
88

99
lenErrors=${#errors[@]}

0 commit comments

Comments
 (0)