Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ USER vscode
RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.35.0" RYE_INSTALL_OPTION="--yes" bash
ENV PATH=/home/vscode/.rye/shims:$PATH

RUN echo "[[ -d .venv ]] && source .venv/bin/activate" >> /home/vscode/.bashrc
RUN echo "[[ -d .venv ]] && source .venv/bin/activate || export PATH=\$PATH" >> /home/vscode/.bashrc
3 changes: 3 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
}
}
}
},
"features": {
"ghcr.io/devcontainers/features/node:1": {}
}

// Features to add to the dev container. More info: https://containers.dev/features.
Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/create-releases.yml

This file was deleted.

8 changes: 6 additions & 2 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# workflow for re-running publishing to PyPI in case it fails for some reason
# you can run this workflow by navigating to https://www.github.com/isaacus-dev/isaacus-python/actions/workflows/publish-pypi.yml
# This workflow is triggered when a GitHub release is created.
# It can also be run manually to re-publish to PyPI in case it failed for some reason.
# You can run this workflow by navigating to https://www.github.com/isaacus-dev/isaacus-python/actions/workflows/publish-pypi.yml
name: Publish PyPI
on:
workflow_dispatch:

release:
types: [published]

jobs:
publish:
name: publish
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ jobs:
run: |
bash ./bin/check-release-environment
env:
STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }}
PYPI_TOKEN: ${{ secrets.ISAACUS_PYPI_TOKEN || secrets.PYPI_TOKEN }}
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.0.1-alpha.0"
".": "0.1.0-alpha.1"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-874c20d494cb37fc2f1c78b089cf16065bd2910c0fcb4dcc89cc55b73a3d6fc4.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-5f5feba7202b37bb046fcbe0389f011c14816d03a3d5c2a008d9736bff840f1a.yml
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Changelog

## 0.1.0-alpha.1 (2025-03-04)

Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.1](https://github.com/isaacus-dev/isaacus-python/compare/v0.0.1-alpha.0...v0.1.0-alpha.1)

### Features

* added latest OpenAPI specification ([#1](https://github.com/isaacus-dev/isaacus-python/issues/1)) ([ee4cdd8](https://github.com/isaacus-dev/isaacus-python/commit/ee4cdd8df312a81d4a46da568ff2a37d55127f28))
* added latest OpenAPI specification ([#3](https://github.com/isaacus-dev/isaacus-python/issues/3)) ([e6234c7](https://github.com/isaacus-dev/isaacus-python/commit/e6234c71a201beb74666d0ef7f7077a686f4a690))
* **api:** added latest OpenAPI specification ([#13](https://github.com/isaacus-dev/isaacus-python/issues/13)) ([822a5b5](https://github.com/isaacus-dev/isaacus-python/commit/822a5b561b88de0a7aaca05f786bffaeab16371a))
* **api:** added latest OpenAPI specification ([#4](https://github.com/isaacus-dev/isaacus-python/issues/4)) ([8841b6a](https://github.com/isaacus-dev/isaacus-python/commit/8841b6a28bde24db83c08a864ab3d8aef9007cfa))
* **api:** added latest OpenAPI specification ([#5](https://github.com/isaacus-dev/isaacus-python/issues/5)) ([36f1cd8](https://github.com/isaacus-dev/isaacus-python/commit/36f1cd8f3ebb1abaedbe8b0a4e19c8747011f9f3))
* **api:** added latest OpenAPI specification ([#8](https://github.com/isaacus-dev/isaacus-python/issues/8)) ([0ba3728](https://github.com/isaacus-dev/isaacus-python/commit/0ba3728aa0c7509e344f1c5029ecc54ade403266))
* **api:** update via SDK Studio ([2863c6c](https://github.com/isaacus-dev/isaacus-python/commit/2863c6c6f72258b53649f63cc8cb2e4f480f4818))
* **client:** allow passing `NotGiven` for body ([#6](https://github.com/isaacus-dev/isaacus-python/issues/6)) ([539267b](https://github.com/isaacus-dev/isaacus-python/commit/539267b95ab1a193db15ba46dd2fed6d67b994c9))


### Bug Fixes

* asyncify on non-asyncio runtimes ([268752f](https://github.com/isaacus-dev/isaacus-python/commit/268752f5baa48fff9ebd30ed739cc5765f43dab1))
* **client:** mark some request bodies as optional ([539267b](https://github.com/isaacus-dev/isaacus-python/commit/539267b95ab1a193db15ba46dd2fed6d67b994c9))


### Chores

* **docs:** update client docstring ([#11](https://github.com/isaacus-dev/isaacus-python/issues/11)) ([bb860bc](https://github.com/isaacus-dev/isaacus-python/commit/bb860bc18a916cd707b709bff17e2510973623b5))
* **internal:** fix devcontainers setup ([#7](https://github.com/isaacus-dev/isaacus-python/issues/7)) ([23046c4](https://github.com/isaacus-dev/isaacus-python/commit/23046c49e639ee760e9206e99c3e13baaf5d6b30))
* **internal:** properly set __pydantic_private__ ([#9](https://github.com/isaacus-dev/isaacus-python/issues/9)) ([16c7d5e](https://github.com/isaacus-dev/isaacus-python/commit/16c7d5e011fbb479ff0ba5bc850fc76cabd682cd))
* **internal:** remove unused http client options forwarding ([#12](https://github.com/isaacus-dev/isaacus-python/issues/12)) ([af1ee9e](https://github.com/isaacus-dev/isaacus-python/commit/af1ee9e77d51cbd053d3e48e9adf80f243fb19a5))
* **internal:** update client tests ([ac65c8f](https://github.com/isaacus-dev/isaacus-python/commit/ac65c8f3b45159cd75f14466249e524679c1481d))
* update SDK settings ([#14](https://github.com/isaacus-dev/isaacus-python/issues/14)) ([4d87849](https://github.com/isaacus-dev/isaacus-python/commit/4d878496b4ae774ec92e4bc08f26a708b698685d))


### Documentation

* update URLs from stainlessapi.com to stainless.com ([#10](https://github.com/isaacus-dev/isaacus-python/issues/10)) ([7e625b2](https://github.com/isaacus-dev/isaacus-python/commit/7e625b262c4e480379ddbe5bd2ca983f83c90988))
47 changes: 22 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The Isaacus Python library provides convenient access to the Isaacus REST API fr
application. The library includes type definitions for all request params and response fields,
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).

It is generated with [Stainless](https://www.stainlessapi.com/).
It is generated with [Stainless](https://www.stainless.com/).

## Documentation

Expand All @@ -15,13 +15,10 @@ The REST API documentation can be found on [docs.isaacus.com](https://docs.isaac
## Installation

```sh
# install from the production repo
pip install git+ssh://[email protected]/isaacus-dev/isaacus-python.git
# install from PyPI
pip install --pre isaacus
```

> [!NOTE]
> Once this package is [published to PyPI](https://app.stainlessapi.com/docs/guides/publish), this will become: `pip install --pre isaacus`

## Usage

The full API of this library can be found in [api.md](api.md).
Expand All @@ -31,21 +28,21 @@ import os
from isaacus import Isaacus

client = Isaacus(
bearer_token=os.environ.get("ISAACUS_API_KEY"), # This is the default and can be omitted
api_key=os.environ.get("ISAACUS_API_KEY"), # This is the default and can be omitted
)

universal_classification = client.classifications.universal.create(
model="kanon-uniclassifier",
model="kanon-universal-classifier",
query="This is a confidentiality clause.",
text="The Supplier agrees not to disclose to any person, other than the Customer, any Confidential Information relating to the Contract or the Goods and/or Services, without prior written approval from the Customer.",
text="I agree not to tell anyone about the document.",
)
print(universal_classification.chunks)
```

While you can provide a `bearer_token` keyword argument,
While you can provide an `api_key` keyword argument,
we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
to add `ISAACUS_API_KEY="My Bearer Token"` to your `.env` file
so that your Bearer Token is not stored in source control.
to add `ISAACUS_API_KEY="My API Key"` to your `.env` file
so that your API Key is not stored in source control.

## Async usage

Expand All @@ -57,15 +54,15 @@ import asyncio
from isaacus import AsyncIsaacus

client = AsyncIsaacus(
bearer_token=os.environ.get("ISAACUS_API_KEY"), # This is the default and can be omitted
api_key=os.environ.get("ISAACUS_API_KEY"), # This is the default and can be omitted
)


async def main() -> None:
universal_classification = await client.classifications.universal.create(
model="kanon-uniclassifier",
model="kanon-universal-classifier",
query="This is a confidentiality clause.",
text="The Supplier agrees not to disclose to any person, other than the Customer, any Confidential Information relating to the Contract or the Goods and/or Services, without prior written approval from the Customer.",
text="I agree not to tell anyone about the document.",
)
print(universal_classification.chunks)

Expand Down Expand Up @@ -101,9 +98,9 @@ client = Isaacus()

try:
client.classifications.universal.create(
model="kanon-uniclassifier",
model="kanon-universal-classifier",
query="This is a confidentiality clause.",
text="The Supplier agrees not to disclose to any person, other than the Customer, any Confidential Information relating to the Contract or the Goods and/or Services, without prior written approval from the Customer.",
text="I agree not to tell anyone about the document.",
)
except isaacus.APIConnectionError as e:
print("The server could not be reached")
Expand Down Expand Up @@ -148,9 +145,9 @@ client = Isaacus(

# Or, configure per-request:
client.with_options(max_retries=5).classifications.universal.create(
model="kanon-uniclassifier",
model="kanon-universal-classifier",
query="This is a confidentiality clause.",
text="The Supplier agrees not to disclose to any person, other than the Customer, any Confidential Information relating to the Contract or the Goods and/or Services, without prior written approval from the Customer.",
text="I agree not to tell anyone about the document.",
)
```

Expand All @@ -175,9 +172,9 @@ client = Isaacus(

# Override per-request:
client.with_options(timeout=5.0).classifications.universal.create(
model="kanon-uniclassifier",
model="kanon-universal-classifier",
query="This is a confidentiality clause.",
text="The Supplier agrees not to disclose to any person, other than the Customer, any Confidential Information relating to the Contract or the Goods and/or Services, without prior written approval from the Customer.",
text="I agree not to tell anyone about the document.",
)
```

Expand Down Expand Up @@ -220,9 +217,9 @@ from isaacus import Isaacus

client = Isaacus()
response = client.classifications.universal.with_raw_response.create(
model="kanon-uniclassifier",
model="kanon-universal-classifier",
query="This is a confidentiality clause.",
text="The Supplier agrees not to disclose to any person, other than the Customer, any Confidential Information relating to the Contract or the Goods and/or Services, without prior written approval from the Customer.",
text="I agree not to tell anyone about the document.",
)
print(response.headers.get('X-My-Header'))

Expand All @@ -242,9 +239,9 @@ To stream the response body, use `.with_streaming_response` instead, which requi

```python
with client.classifications.universal.with_streaming_response.create(
model="kanon-uniclassifier",
model="kanon-universal-classifier",
query="This is a confidentiality clause.",
text="The Supplier agrees not to disclose to any person, other than the Customer, any Confidential Information relating to the Contract or the Goods and/or Services, without prior written approval from the Customer.",
text="I agree not to tell anyone about the document.",
) as response:
print(response.headers.get("X-My-Header"))

Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

## Reporting Security Issues

This SDK is generated by [Stainless Software Inc](http://stainlessapi.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken.
This SDK is generated by [Stainless Software Inc](http://stainless.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken.

To report a security issue, please contact the Stainless team at security@stainlessapi.com.
To report a security issue, please contact the Stainless team at security@stainless.com.

## Responsible Disclosure

Expand Down
4 changes: 0 additions & 4 deletions bin/check-release-environment
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

errors=()

if [ -z "${STAINLESS_API_KEY}" ]; then
errors+=("The STAINLESS_API_KEY secret has not been set. Please contact Stainless for an API key & set it in your organization secrets on GitHub.")
fi

if [ -z "${PYPI_TOKEN}" ]; then
errors+=("The ISAACUS_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
fi
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "isaacus"
version = "0.0.1-alpha.0"
version = "0.1.0-alpha.1"
description = "The official Python library for the isaacus API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
Loading
Loading