Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
2ab398d
feat(client): support file upload requests
stainless-app[bot] Jul 31, 2025
889d576
chore(internal): fix ruff target version
stainless-app[bot] Aug 6, 2025
a3141f5
chore: update @stainless-api/prism-cli to v5.15.0
stainless-app[bot] Aug 9, 2025
7af966e
chore(internal): update comment in script
stainless-app[bot] Aug 9, 2025
22b520b
chore(internal): codegen related update
stainless-app[bot] Aug 12, 2025
0518028
chore: update github action
stainless-app[bot] Aug 22, 2025
f86cbce
chore(internal): change ci workflow machines
stainless-app[bot] Aug 26, 2025
10253fe
fix: avoid newer type syntax
stainless-app[bot] Aug 27, 2025
6f0ae86
chore(internal): update pyright exclude list
stainless-app[bot] Aug 27, 2025
5a2287e
chore(internal): add Sequence related utils
stainless-app[bot] Aug 30, 2025
d2733a9
feat(types): replace List[str] with SequenceNotStr in params
stainless-app[bot] Sep 3, 2025
5a20497
feat: improve future compat with pydantic v3
stainless-app[bot] Sep 4, 2025
d5732d5
chore(internal): move mypy configurations to `pyproject.toml` file
stainless-app[bot] Sep 5, 2025
e00ccd0
chore(tests): simplify `get_platform` test
stainless-app[bot] Sep 6, 2025
68a7057
chore(internal): update pydantic dependency
stainless-app[bot] Sep 17, 2025
38d13e0
chore(types): change optional parameter type from NotGiven to Omit
stainless-app[bot] Oct 10, 2025
57b055e
chore: do not install brew dependencies in ./scripts/bootstrap by def…
stainless-app[bot] Sep 20, 2025
35b03bd
chore: improve example values
stainless-app[bot] Sep 23, 2025
491dbdc
chore: remove custom code
stainless-app[bot] Oct 10, 2025
88190d6
feat(api): added embedding endpoint
stainless-app[bot] Oct 12, 2025
6d99681
codegen metadata
stainless-app[bot] Oct 12, 2025
f4e26b5
codegen metadata
stainless-app[bot] Oct 12, 2025
1cbe275
codegen metadata
stainless-app[bot] Oct 12, 2025
920ae0b
feat(sdk): add embeddings endpoint
stainless-app[bot] Oct 12, 2025
204a05d
feat(api): rename embedding -> embeddings
stainless-app[bot] Oct 12, 2025
3074c3a
codegen metadata
stainless-app[bot] Oct 12, 2025
b934279
feat(api): revert embedding -> embeddings
stainless-app[bot] Oct 12, 2025
4c1cfaa
codegen metadata
stainless-app[bot] Oct 12, 2025
2fafb55
chore(api): try to force regen SDK
stainless-app[bot] Oct 12, 2025
079645e
chore(sdk): restore original example
stainless-app[bot] Oct 12, 2025
cf60482
feat(sdk): toggle to force regen
stainless-app[bot] Oct 12, 2025
25d2067
feat(sdk): untoggle to force regen
stainless-app[bot] Oct 12, 2025
b838d18
codegen metadata
stainless-app[bot] Oct 12, 2025
5c7462d
fix(sdk)!: add `_response` to response models to finally fix duplicat…
stainless-app[bot] Oct 12, 2025
0ad7114
feat(api)!: reduce max length of embeddings input
stainless-app[bot] Oct 13, 2025
5d4a1b9
fix(api): typo
stainless-app[bot] Oct 14, 2025
caa70f7
docs(sdk): make embeddings example first
stainless-app[bot] Oct 14, 2025
2c43b6c
release: 0.9.0
stainless-app[bot] Oct 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ jobs:
run: ./scripts/lint

build:
if: github.repository == 'stainless-sdks/isaacus-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
timeout-minutes: 10
name: build
permissions:
contents: read
id-token: write
runs-on: depot-ubuntu-24.04
runs-on: ${{ github.repository == 'stainless-sdks/isaacus-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4

Expand All @@ -61,12 +61,14 @@ jobs:
run: rye build

- name: Get GitHub OIDC Token
if: github.repository == 'stainless-sdks/isaacus-python'
id: github-oidc
uses: actions/github-script@v6
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Upload tarball
if: github.repository == 'stainless-sdks/isaacus-python'
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.8.0"
".": "0.9.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 3
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-a0aa3bcfef3af964f7172cecc6e969193a4ca96b26f8c47e7f50d852b13ef356.yml
openapi_spec_hash: e243aed52e8a3c6dad6254c57408fdc4
config_hash: bfe30148ec88e8bbbf4a348a9fdfc00a
configured_endpoints: 4
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-ee884a4336559147aacf9a927a540f21e9760f00d2d5588af00fa8a25e2707d9.yml
openapi_spec_hash: 2ba78bd360942c63a7d08dba791f00d2
config_hash: a85580968a69d8d6fadf96e5e2d6870e
55 changes: 55 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,60 @@
# Changelog

## 0.9.0 (2025-10-14)

Full Changelog: [v0.8.0...v0.9.0](https://github.com/isaacus-dev/isaacus-python/compare/v0.8.0...v0.9.0)

### ⚠ BREAKING CHANGES

* **api:** reduce max length of embeddings input
* **sdk:** add `_response` to response models to finally fix duplicated names

### Features

* **api:** added embedding endpoint ([88190d6](https://github.com/isaacus-dev/isaacus-python/commit/88190d6d33c8d5e3cf59dfd3c488b5ae9abec93b))
* **api:** reduce max length of embeddings input ([0ad7114](https://github.com/isaacus-dev/isaacus-python/commit/0ad7114b5fec2fde9aaa830a6ba6163ad3b6fccc))
* **api:** rename embedding -> embeddings ([204a05d](https://github.com/isaacus-dev/isaacus-python/commit/204a05d7b1504901766db3c0d0d8ea47a22a16ed))
* **api:** revert embedding -> embeddings ([b934279](https://github.com/isaacus-dev/isaacus-python/commit/b9342795e50374817b8e3dc2e2f1163a2ff0805a))
* **client:** support file upload requests ([2ab398d](https://github.com/isaacus-dev/isaacus-python/commit/2ab398dde07e98411c9b6efd76f7b7120a9633a8))
* improve future compat with pydantic v3 ([5a20497](https://github.com/isaacus-dev/isaacus-python/commit/5a20497a9c4bbf88056df12a0c686566dc9bd162))
* **sdk:** add embeddings endpoint ([920ae0b](https://github.com/isaacus-dev/isaacus-python/commit/920ae0b65f2362ac098f8b94979b1e821f5143d8))
* **sdk:** toggle to force regen ([cf60482](https://github.com/isaacus-dev/isaacus-python/commit/cf60482ba0dd3933daee477fa9bd4ae29d900fb4))
* **sdk:** untoggle to force regen ([25d2067](https://github.com/isaacus-dev/isaacus-python/commit/25d2067fad4bb46ca595001f6e82458fd3d24a23))
* **types:** replace List[str] with SequenceNotStr in params ([d2733a9](https://github.com/isaacus-dev/isaacus-python/commit/d2733a9d0f16531537a9db017a8e29d2c8fb3912))


### Bug Fixes

* **api:** typo ([5d4a1b9](https://github.com/isaacus-dev/isaacus-python/commit/5d4a1b99e8a6ac2a1c3cc4e83e7b65108eea335a))
* avoid newer type syntax ([10253fe](https://github.com/isaacus-dev/isaacus-python/commit/10253fe93ed8142b52cf5199486221e81ac6ce5a))
* **sdk:** add `_response` to response models to finally fix duplicated names ([5c7462d](https://github.com/isaacus-dev/isaacus-python/commit/5c7462dd25c67c44126eb946a656a6b841dc6a50))


### Chores

* **api:** try to force regen SDK ([2fafb55](https://github.com/isaacus-dev/isaacus-python/commit/2fafb555c1a20d7c359c91c35fd1f54868cffe54))
* do not install brew dependencies in ./scripts/bootstrap by default ([57b055e](https://github.com/isaacus-dev/isaacus-python/commit/57b055ed56fdcc58b4663e4ddad32afac25e7ec1))
* improve example values ([35b03bd](https://github.com/isaacus-dev/isaacus-python/commit/35b03bdbf4ceaccd00102e23d639a01d5bea136a))
* **internal:** add Sequence related utils ([5a2287e](https://github.com/isaacus-dev/isaacus-python/commit/5a2287ef854d250048c070f3fd88b00ca84b0d3c))
* **internal:** change ci workflow machines ([f86cbce](https://github.com/isaacus-dev/isaacus-python/commit/f86cbcef2583658466e95eaba4aba61f79646ef9))
* **internal:** codegen related update ([22b520b](https://github.com/isaacus-dev/isaacus-python/commit/22b520b3c67e570f9267135111a89542ee2bdf7f))
* **internal:** fix ruff target version ([889d576](https://github.com/isaacus-dev/isaacus-python/commit/889d576cdc28d06404c6ee3ce0c67bf4d3be75c4))
* **internal:** move mypy configurations to `pyproject.toml` file ([d5732d5](https://github.com/isaacus-dev/isaacus-python/commit/d5732d5e0145763723e8be24cbd8296f9a385264))
* **internal:** update comment in script ([7af966e](https://github.com/isaacus-dev/isaacus-python/commit/7af966e1677b44d412eda96c5ee8e9866f77ccfb))
* **internal:** update pydantic dependency ([68a7057](https://github.com/isaacus-dev/isaacus-python/commit/68a70578a2e269fa3b2c46e3c29e82ba770090d6))
* **internal:** update pyright exclude list ([6f0ae86](https://github.com/isaacus-dev/isaacus-python/commit/6f0ae86899883fe77aa669d595c623bedc2dc5c8))
* remove custom code ([491dbdc](https://github.com/isaacus-dev/isaacus-python/commit/491dbdcd82984d099b8ee11e94894ad450b2424d))
* **sdk:** restore original example ([079645e](https://github.com/isaacus-dev/isaacus-python/commit/079645e85259c2e4d3f6aa86b2ca2c21ce97367a))
* **tests:** simplify `get_platform` test ([e00ccd0](https://github.com/isaacus-dev/isaacus-python/commit/e00ccd0c41c3751eb3fae880223ebb05eae0f154))
* **types:** change optional parameter type from NotGiven to Omit ([38d13e0](https://github.com/isaacus-dev/isaacus-python/commit/38d13e0514b001d1a34446b881783d559e246865))
* update @stainless-api/prism-cli to v5.15.0 ([a3141f5](https://github.com/isaacus-dev/isaacus-python/commit/a3141f59b0ff6334fde2a9740fd2f86824fe5083))
* update github action ([0518028](https://github.com/isaacus-dev/isaacus-python/commit/05180288265bc111dba1c62fbfcd90139a6299ad))


### Documentation

* **sdk:** make embeddings example first ([caa70f7](https://github.com/isaacus-dev/isaacus-python/commit/caa70f7acf6ce910d8cf80425437ca51970cd255))

## 0.8.0 (2025-07-25)

Full Changelog: [v0.7.0...v0.8.0](https://github.com/isaacus-dev/isaacus-python/compare/v0.7.0...v0.8.0)
Expand Down
91 changes: 52 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ client = Isaacus(
api_key=os.environ.get("ISAACUS_API_KEY"), # This is the default and can be omitted
)

universal_classification = client.classifications.universal.create(
model="kanon-universal-classifier",
query="This is a confidentiality clause.",
texts=["I agree not to tell anyone about the document."],
embedding_response = client.embeddings.create(
model="kanon-2-embedder",
texts=[
"Are restraints of trade enforceable under English law?",
"What is a non-compete clause?",
],
)
print(universal_classification.classifications)
print(embedding_response.embeddings)
```

While you can provide an `api_key` keyword argument,
Expand All @@ -60,12 +62,14 @@ client = AsyncIsaacus(


async def main() -> None:
universal_classification = await client.classifications.universal.create(
model="kanon-universal-classifier",
query="This is a confidentiality clause.",
texts=["I agree not to tell anyone about the document."],
embedding_response = await client.embeddings.create(
model="kanon-2-embedder",
texts=[
"Are restraints of trade enforceable under English law?",
"What is a non-compete clause?",
],
)
print(universal_classification.classifications)
print(embedding_response.embeddings)


asyncio.run(main())
Expand Down Expand Up @@ -97,12 +101,14 @@ async def main() -> None:
api_key="My API Key",
http_client=DefaultAioHttpClient(),
) as client:
universal_classification = await client.classifications.universal.create(
model="kanon-universal-classifier",
query="This is a confidentiality clause.",
texts=["I agree not to tell anyone about the document."],
embedding_response = await client.embeddings.create(
model="kanon-2-embedder",
texts=[
"Are restraints of trade enforceable under English law?",
"What is a non-compete clause?",
],
)
print(universal_classification.classifications)
print(embedding_response.embeddings)


asyncio.run(main())
Expand All @@ -126,7 +132,7 @@ from isaacus import Isaacus

client = Isaacus()

universal_classification = client.classifications.universal.create(
universal_classification_response = client.classifications.universal.create(
model="kanon-universal-classifier",
query="This is a confidentiality clause.",
texts=["I agree not to tell anyone about the document."],
Expand All @@ -136,7 +142,7 @@ universal_classification = client.classifications.universal.create(
"size": 512,
},
)
print(universal_classification.classifications)
print(universal_classification_response.classifications)
```

## Handling errors
Expand All @@ -155,10 +161,12 @@ from isaacus import Isaacus
client = Isaacus()

try:
client.classifications.universal.create(
model="kanon-universal-classifier",
query="This is a confidentiality clause.",
texts=["I agree not to tell anyone about the document."],
client.embeddings.create(
model="kanon-2-embedder",
texts=[
"Are restraints of trade enforceable under English law?",
"What is a non-compete clause?",
],
)
except isaacus.APIConnectionError as e:
print("The server could not be reached")
Expand Down Expand Up @@ -202,10 +210,12 @@ client = Isaacus(
)

# Or, configure per-request:
client.with_options(max_retries=5).classifications.universal.create(
model="kanon-universal-classifier",
query="This is a confidentiality clause.",
texts=["I agree not to tell anyone about the document."],
client.with_options(max_retries=5).embeddings.create(
model="kanon-2-embedder",
texts=[
"Are restraints of trade enforceable under English law?",
"What is a non-compete clause?",
],
)
```

Expand All @@ -229,10 +239,12 @@ client = Isaacus(
)

# Override per-request:
client.with_options(timeout=5.0).classifications.universal.create(
model="kanon-universal-classifier",
query="This is a confidentiality clause.",
texts=["I agree not to tell anyone about the document."],
client.with_options(timeout=5.0).embeddings.create(
model="kanon-2-embedder",
texts=[
"Are restraints of trade enforceable under English law?",
"What is a non-compete clause?",
],
)
```

Expand Down Expand Up @@ -274,15 +286,14 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
from isaacus import Isaacus

client = Isaacus()
response = client.classifications.universal.with_raw_response.create(
model="kanon-universal-classifier",
query="This is a confidentiality clause.",
texts=["I agree not to tell anyone about the document."],
response = client.embeddings.with_raw_response.create(
model="kanon-2-embedder",
texts=["Are restraints of trade enforceable under English law?", "What is a non-compete clause?"],
)
print(response.headers.get('X-My-Header'))

universal = response.parse() # get the object that `classifications.universal.create()` would have returned
print(universal.classifications)
embedding = response.parse() # get the object that `embeddings.create()` would have returned
print(embedding.embeddings)
```

These methods return an [`APIResponse`](https://github.com/isaacus-dev/isaacus-python/tree/main/src/isaacus/_response.py) object.
Expand All @@ -296,10 +307,12 @@ The above interface eagerly reads the full response body when you make the reque
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.

```python
with client.classifications.universal.with_streaming_response.create(
model="kanon-universal-classifier",
query="This is a confidentiality clause.",
texts=["I agree not to tell anyone about the document."],
with client.embeddings.with_streaming_response.create(
model="kanon-2-embedder",
texts=[
"Are restraints of trade enforceable under English law?",
"What is a non-compete clause?",
],
) as response:
print(response.headers.get("X-My-Header"))

Expand Down
24 changes: 18 additions & 6 deletions api.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,40 @@
# Embeddings

Types:

```python
from isaacus.types import EmbeddingResponse
```

Methods:

- <code title="post /embeddings">client.embeddings.<a href="./src/isaacus/resources/embeddings.py">create</a>(\*\*<a href="src/isaacus/types/embedding_create_params.py">params</a>) -> <a href="./src/isaacus/types/embedding_response.py">EmbeddingResponse</a></code>

# Classifications

## Universal

Types:

```python
from isaacus.types.classifications import UniversalClassification
from isaacus.types.classifications import UniversalClassificationResponse
```

Methods:

- <code title="post /classifications/universal">client.classifications.universal.<a href="./src/isaacus/resources/classifications/universal.py">create</a>(\*\*<a href="src/isaacus/types/classifications/universal_create_params.py">params</a>) -> <a href="./src/isaacus/types/classifications/universal_classification.py">UniversalClassification</a></code>
- <code title="post /classifications/universal">client.classifications.universal.<a href="./src/isaacus/resources/classifications/universal.py">create</a>(\*\*<a href="src/isaacus/types/classifications/universal_create_params.py">params</a>) -> <a href="./src/isaacus/types/classifications/universal_classification_response.py">UniversalClassificationResponse</a></code>

# Rerankings

Types:

```python
from isaacus.types import Reranking
from isaacus.types import RerankingResponse
```

Methods:

- <code title="post /rerankings">client.rerankings.<a href="./src/isaacus/resources/rerankings.py">create</a>(\*\*<a href="src/isaacus/types/reranking_create_params.py">params</a>) -> <a href="./src/isaacus/types/reranking.py">Reranking</a></code>
- <code title="post /rerankings">client.rerankings.<a href="./src/isaacus/resources/rerankings.py">create</a>(\*\*<a href="src/isaacus/types/reranking_create_params.py">params</a>) -> <a href="./src/isaacus/types/reranking_response.py">RerankingResponse</a></code>

# Extractions

Expand All @@ -31,9 +43,9 @@ Methods:
Types:

```python
from isaacus.types.extractions import AnswerExtraction
from isaacus.types.extractions import AnswerExtractionResponse
```

Methods:

- <code title="post /extractions/qa">client.extractions.qa.<a href="./src/isaacus/resources/extractions/qa.py">create</a>(\*\*<a href="src/isaacus/types/extractions/qa_create_params.py">params</a>) -> <a href="./src/isaacus/types/extractions/answer_extraction.py">AnswerExtraction</a></code>
- <code title="post /extractions/qa">client.extractions.qa.<a href="./src/isaacus/resources/extractions/qa.py">create</a>(\*\*<a href="src/isaacus/types/extractions/qa_create_params.py">params</a>) -> <a href="./src/isaacus/types/extractions/answer_extraction_response.py">AnswerExtractionResponse</a></code>
50 changes: 0 additions & 50 deletions mypy.ini

This file was deleted.

Loading