Skip to content

Commit 719311b

Browse files
release: 2.2.0-rc1 (#234)
* docs: swap examples used in readme (#231) * chore(internal): slight transform perf improvement (#233) * chore(internal): expand CI branch coverage (#235) * chore(internal): reduce CI branch coverage * fix(perf): skip traversing types for NotGiven values * fix(perf): optimize some hot paths * chore(internal): update pyright settings * chore(client): minor internal fixes * chore(internal): bump pyright version * chore(internal): base client updates * chore(internal): update models test * docs(api): updates to API spec * feat(api): add translation endpoint * codegen metadata * chore(ci): add timeout thresholds for CI jobs * chore(internal): import reformatting * chore(internal): fix list file params * chore(internal): refactor retries to not use recursion * docs(api): updates to API spec * fix(pydantic v1): more robust ModelField.annotation check * feat(api): add ai detect tool endpoint * chore(internal): minor formatting changes * chore(ci): run on more branches and use depot runners * chore(ci): only use depot for staging repos * chore: broadly detect json family of content-type headers * docs(api): updates to API spec * docs(api): updates to API spec * feat(chat): add parse method (#237) Co-authored-by: Robert Craigie <robert@craigie.dev> * release: 2.2.0-rc1 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> Co-authored-by: Robert Craigie <robert@craigie.dev>
1 parent ef6e33f commit 719311b

63 files changed

Lines changed: 1649 additions & 543 deletions

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
name: CI
22
on:
33
push:
4-
branches:
5-
- main
6-
pull_request:
7-
branches:
8-
- main
9-
- next
4+
branches-ignore:
5+
- 'generated'
6+
- 'codegen/**'
7+
- 'integrated/**'
8+
- 'stl-preview-head/**'
9+
- 'stl-preview-base/**'
1010

1111
jobs:
1212
lint:
13+
timeout-minutes: 10
1314
name: lint
14-
runs-on: ubuntu-latest
15-
15+
runs-on: ${{ github.repository == 'stainless-sdks/writer-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
1616
steps:
1717
- uses: actions/checkout@v4
1818

@@ -31,9 +31,9 @@ jobs:
3131
run: ./scripts/lint
3232

3333
test:
34+
timeout-minutes: 10
3435
name: test
35-
runs-on: ubuntu-latest
36-
36+
runs-on: ${{ github.repository == 'stainless-sdks/writer-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
3737
steps:
3838
- uses: actions/checkout@v4
3939

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "2.1.0"
2+
".": "2.2.0-rc1"
33
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 30
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/writerai%2Fwriter-d15316b8a3a086ae9ec8eea0d436b0885262df9bcf23b9587ad059e50357c220.yml
3-
openapi_spec_hash: 4f81a4f4840438f80eff345e76ead962
4-
config_hash: ee2e5a914fd298a6f4c740f5ce187f87
1+
configured_endpoints: 32
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/writerai%2Fwriter-a0e83ebfd81856b538d16c7a41ccdc11687ee558e1435a40f3bb7e0d6e1ab7c8.yml
3+
openapi_spec_hash: 8ac62303a9158c13f344975cb0786bc6
4+
config_hash: b1d3b26784527ee46af49c1bb9e93193

CHANGELOG.md

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

3+
## 2.2.0-rc1 (2025-04-25)
4+
5+
Full Changelog: [v2.1.0...v2.2.0-rc1](https://github.com/writer/writer-python/compare/v2.1.0...v2.2.0-rc1)
6+
7+
### Features
8+
9+
* **api:** add ai detect tool endpoint ([5155d78](https://github.com/writer/writer-python/commit/5155d7885097a4d62236c97d299db5b392c19c46))
10+
* **api:** add translation endpoint ([c475528](https://github.com/writer/writer-python/commit/c475528d5d31a8cc2919b9d9315e3dd4d5fac9aa))
11+
* **chat:** add parse method ([#237](https://github.com/writer/writer-python/issues/237)) ([81aae52](https://github.com/writer/writer-python/commit/81aae52c2dc0cc227dfa4b5e04d0b95140f40cbf))
12+
13+
14+
### Bug Fixes
15+
16+
* **perf:** optimize some hot paths ([b1304d3](https://github.com/writer/writer-python/commit/b1304d306bb7e1e001de04d30be69adca53dbb63))
17+
* **perf:** skip traversing types for NotGiven values ([db0383a](https://github.com/writer/writer-python/commit/db0383a6c77cb059eab8d0c48d1ef27842128d14))
18+
* **pydantic v1:** more robust ModelField.annotation check ([fe810b2](https://github.com/writer/writer-python/commit/fe810b23a492ad0266e4f6ccb765946f92b2cee6))
19+
20+
21+
### Chores
22+
23+
* broadly detect json family of content-type headers ([128b22a](https://github.com/writer/writer-python/commit/128b22aced2c242dc36e50b638db667febd56b09))
24+
* **ci:** add timeout thresholds for CI jobs ([7e48fde](https://github.com/writer/writer-python/commit/7e48fde8c5e170e19a5ac3c6dcba6dccc2d592a2))
25+
* **ci:** only use depot for staging repos ([4e41929](https://github.com/writer/writer-python/commit/4e41929b07a15cdf4041a5a6ca2f41d5281cfbc5))
26+
* **ci:** run on more branches and use depot runners ([00cad5e](https://github.com/writer/writer-python/commit/00cad5e1a4b252d252a2c14f5631f65d9b3ce90c))
27+
* **client:** minor internal fixes ([8f42cd8](https://github.com/writer/writer-python/commit/8f42cd864779a07e2f9401e1690d1f241e2dcb1a))
28+
* **internal:** base client updates ([77cdb4a](https://github.com/writer/writer-python/commit/77cdb4aa35a6dc165bbf3e36b151377f25b77704))
29+
* **internal:** bump pyright version ([bcd957a](https://github.com/writer/writer-python/commit/bcd957a67bface1dc31c111928cf2bf604df0b56))
30+
* **internal:** expand CI branch coverage ([#235](https://github.com/writer/writer-python/issues/235)) ([672e10d](https://github.com/writer/writer-python/commit/672e10da46e802e25dce515311370c5faedf6721))
31+
* **internal:** fix list file params ([d8f9820](https://github.com/writer/writer-python/commit/d8f98203056e0ded99fa8a05f43d30c3e3762ab3))
32+
* **internal:** import reformatting ([3994040](https://github.com/writer/writer-python/commit/3994040da781e1c42eae00996609baffc8b04ee4))
33+
* **internal:** minor formatting changes ([2064f80](https://github.com/writer/writer-python/commit/2064f80ff07f1d731bcbf5f02105777f153b2981))
34+
* **internal:** reduce CI branch coverage ([725029b](https://github.com/writer/writer-python/commit/725029b1896669ea364ddc7795c0d4f3be56c890))
35+
* **internal:** refactor retries to not use recursion ([acf730e](https://github.com/writer/writer-python/commit/acf730e5cf9b2b579338a03a6f90692c662544c1))
36+
* **internal:** slight transform perf improvement ([#233](https://github.com/writer/writer-python/issues/233)) ([92b7914](https://github.com/writer/writer-python/commit/92b7914f583d680b6f85bee45a7177ca2b3a61ee))
37+
* **internal:** update models test ([ba97e8f](https://github.com/writer/writer-python/commit/ba97e8f02e8e252cc11cacc46dfd30a73cb6ed43))
38+
* **internal:** update pyright settings ([8f7e894](https://github.com/writer/writer-python/commit/8f7e89421ed0a77f814fb7810212d19f1d795ba9))
39+
40+
41+
### Documentation
42+
43+
* **api:** updates to API spec ([fa87048](https://github.com/writer/writer-python/commit/fa870480b59f2b9bac562615c78c2c5d08932351))
44+
* **api:** updates to API spec ([7606fe4](https://github.com/writer/writer-python/commit/7606fe4c32d1e28d84d0b10a951d3cfe030b8f84))
45+
* **api:** updates to API spec ([a423a7e](https://github.com/writer/writer-python/commit/a423a7e58237a6202d9fafcd200e2f3cd79321bb))
46+
* **api:** updates to API spec ([91598ac](https://github.com/writer/writer-python/commit/91598ac7aabbb3b94bfd28a46249e46b893f1d69))
47+
* swap examples used in readme ([#231](https://github.com/writer/writer-python/issues/231)) ([e944c5b](https://github.com/writer/writer-python/commit/e944c5bf1cef967cb2de23ca844152d66f714b68))
48+
349
## 2.1.0 (2025-04-04)
450

551
Full Changelog: [v2.1.0-rc1...v2.1.0](https://github.com/writer/writer-python/compare/v2.1.0-rc1...v2.1.0)

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ To install the package from PyPI, use `pip`:
1818

1919
```sh
2020
# install from PyPI
21-
pip install writer-sdk
21+
pip install --pre writer-sdk
2222
```
2323

2424
## Prequisites
@@ -255,9 +255,12 @@ client = Writer()
255255
chat_completion = client.chat.chat(
256256
messages=[{"role": "user"}],
257257
model="model",
258-
stream_options={"include_usage": True},
258+
response_format={
259+
"type": "text",
260+
"json_schema": {},
261+
},
259262
)
260-
print(chat_completion.stream_options)
263+
print(chat_completion.response_format)
261264
```
262265

263266
## File uploads

api.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,16 @@ Methods:
162162
Types:
163163

164164
```python
165-
from writerai.types import ToolContextAwareSplittingResponse, ToolParsePdfResponse
165+
from writerai.types import (
166+
ToolAIDetectResponse,
167+
ToolContextAwareSplittingResponse,
168+
ToolParsePdfResponse,
169+
)
166170
```
167171

168172
Methods:
169173

174+
- <code title="post /v1/tools/ai-detect">client.tools.<a href="./src/writerai/resources/tools/tools.py">ai_detect</a>(\*\*<a href="src/writerai/types/tool_ai_detect_params.py">params</a>) -> <a href="./src/writerai/types/tool_ai_detect_response.py">ToolAIDetectResponse</a></code>
170175
- <code title="post /v1/tools/context-aware-splitting">client.tools.<a href="./src/writerai/resources/tools/tools.py">context_aware_splitting</a>(\*\*<a href="src/writerai/types/tool_context_aware_splitting_params.py">params</a>) -> <a href="./src/writerai/types/tool_context_aware_splitting_response.py">ToolContextAwareSplittingResponse</a></code>
171176
- <code title="post /v1/tools/pdf-parser/{file_id}">client.tools.<a href="./src/writerai/resources/tools/tools.py">parse_pdf</a>(file_id, \*\*<a href="src/writerai/types/tool_parse_pdf_params.py">params</a>) -> <a href="./src/writerai/types/tool_parse_pdf_response.py">ToolParsePdfResponse</a></code>
172177

@@ -182,6 +187,18 @@ Methods:
182187

183188
- <code title="post /v1/tools/comprehend/medical">client.tools.comprehend.<a href="./src/writerai/resources/tools/comprehend.py">medical</a>(\*\*<a href="src/writerai/types/tools/comprehend_medical_params.py">params</a>) -> <a href="./src/writerai/types/tools/comprehend_medical_response.py">ComprehendMedicalResponse</a></code>
184189

190+
# Translation
191+
192+
Types:
193+
194+
```python
195+
from writerai.types import TranslationRequest, TranslationResponse
196+
```
197+
198+
Methods:
199+
200+
- <code title="post /v1/translation">client.translation.<a href="./src/writerai/resources/translation.py">translate</a>(\*\*<a href="src/writerai/types/translation_translate_params.py">params</a>) -> <a href="./src/writerai/types/translation_response.py">TranslationResponse</a></code>
201+
185202
# Vision
186203

187204
Types:

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "writer-sdk"
3-
version = "2.1.0"
3+
version = "2.2.0-rc1"
44
description = "The official Python library for the writer API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -44,7 +44,7 @@ Repository = "https://github.com/writer/writer-python"
4444
managed = true
4545
# version pins are in requirements-dev.lock
4646
dev-dependencies = [
47-
"pyright>=1.1.359",
47+
"pyright==1.1.399",
4848
"mypy",
4949
"respx",
5050
"pytest",
@@ -150,6 +150,7 @@ exclude = [
150150
]
151151

152152
reportImplicitOverride = true
153+
reportOverlappingOverload = false
153154

154155
reportImportCycles = false
155156
reportPrivateUsage = false

requirements-dev.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pydantic-core==2.27.1
7676
# via pydantic
7777
pygments==2.18.0
7878
# via rich
79-
pyright==1.1.392.post0
79+
pyright==1.1.399
8080
pytest==8.3.3
8181
# via pytest-asyncio
8282
pytest-asyncio==0.24.0

0 commit comments

Comments
 (0)