You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Alternatively, you can build from source and install the wheel file:
@@ -121,7 +121,7 @@ the changes aren't made through the automated pipeline, you may want to make rel
121
121
122
122
### Publish with a GitHub workflow
123
123
124
-
You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/stainless-sdks/isaacus-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up.
124
+
You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/isaacus-dev/isaacus-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up.
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.",
38
41
)
39
-
print(classify_universal.chunks)
42
+
print(universal_classification.chunks)
40
43
```
41
44
45
+
While you can provide a `bearer_token` keyword argument,
46
+
we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
47
+
to add `ISAACUS_API_KEY="My Bearer Token"` to your `.env` file
48
+
so that your Bearer Token is not stored in source control.
49
+
42
50
## Async usage
43
51
44
52
Simply import `AsyncIsaacus` instead of `Isaacus` and use `await` with each API call:
45
53
46
54
```python
55
+
import os
47
56
import asyncio
48
57
from isaacus import AsyncIsaacus
49
58
50
-
client = AsyncIsaacus()
59
+
client = AsyncIsaacus(
60
+
bearer_token=os.environ.get("ISAACUS_API_KEY"), # This is the default and can be omitted
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.",
58
69
)
59
-
print(classify_universal.chunks)
70
+
print(universal_classification.chunks)
60
71
61
72
62
73
asyncio.run(main())
@@ -89,10 +100,10 @@ from isaacus import Isaacus
89
100
client = Isaacus()
90
101
91
102
try:
92
-
client.classify_universal.create(
93
-
model="model",
94
-
query="query",
95
-
text="text",
103
+
client.classifications.universal.create(
104
+
model="kanon-uniclassifier",
105
+
query="This is a confidentiality clause.",
106
+
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="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="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.",
170
181
)
171
182
```
172
183
@@ -208,20 +219,20 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
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.",
215
226
)
216
227
print(response.headers.get('X-My-Header'))
217
228
218
-
classify_universal= response.parse() # get the object that `classify_universal.create()` would have returned
219
-
print(classify_universal.chunks)
229
+
universal= response.parse() # get the object that `classifications.universal.create()` would have returned
230
+
print(universal.chunks)
220
231
```
221
232
222
-
These methods return an [`APIResponse`](https://github.com/stainless-sdks/isaacus-python/tree/main/src/isaacus/_response.py) object.
233
+
These methods return an [`APIResponse`](https://github.com/isaacus-dev/isaacus-python/tree/main/src/isaacus/_response.py) object.
223
234
224
-
The async client returns an [`AsyncAPIResponse`](https://github.com/stainless-sdks/isaacus-python/tree/main/src/isaacus/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
235
+
The async client returns an [`AsyncAPIResponse`](https://github.com/isaacus-dev/isaacus-python/tree/main/src/isaacus/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
225
236
226
237
#### `.with_streaming_response`
227
238
@@ -230,10 +241,10 @@ The above interface eagerly reads the full response body when you make the reque
230
241
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.
231
242
232
243
```python
233
-
with client.classify_universal.with_streaming_response.create(
234
-
model="model",
235
-
query="query",
236
-
text="text",
244
+
with client.classifications.universal.with_streaming_response.create(
245
+
model="kanon-uniclassifier",
246
+
query="This is a confidentiality clause.",
247
+
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.",
237
248
) as response:
238
249
print(response.headers.get("X-My-Header"))
239
250
@@ -329,7 +340,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con
329
340
330
341
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
331
342
332
-
We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/isaacus-python/issues) with questions, bugs, or suggestions.
343
+
We are keen for your feedback; please open an [issue](https://www.github.com/isaacus-dev/isaacus-python/issues) with questions, bugs, or suggestions.
0 commit comments