Skip to content

Commit f768ab7

Browse files
authored
Merge pull request #130 from writer/release-please--branches--main--changes--next
2 parents 99318d9 + aba0476 commit f768ab7

23 files changed

+596
-115
lines changed

.release-please-manifest.json

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

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 21
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/writerai%2Fwriter-82683f2fd5f8778a27960ebabda40d6dc4640bdfb77ac4ec7f173b8bf8076d3c.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/writerai%2Fwriter-fcd4d82943d0aeefc300520f0ee4684456ef647140f1d6ba9ffcb86278d83d3a.yml

CHANGELOG.md

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

3+
## 1.6.0 (2024-12-16)
4+
5+
Full Changelog: [v1.5.0...v1.6.0](https://github.com/writer/writer-python/compare/v1.5.0...v1.6.0)
6+
7+
### Features
8+
9+
* **api:** add streaming to application generation ([#132](https://github.com/writer/writer-python/issues/132)) ([c142caa](https://github.com/writer/writer-python/commit/c142caa6b2d646b270ec50c800c37effd9b90c49))
10+
* **api:** api update ([#131](https://github.com/writer/writer-python/issues/131)) ([efadeb6](https://github.com/writer/writer-python/commit/efadeb67a868c57775a1205a5765ccc9f45997e2))
11+
12+
13+
### Chores
14+
15+
* **internal:** add support for TypeAliasType ([#137](https://github.com/writer/writer-python/issues/137)) ([4523c9d](https://github.com/writer/writer-python/commit/4523c9dc88771fce1b330fcf57a4499af7606c44))
16+
* **internal:** bump pydantic dependency ([#134](https://github.com/writer/writer-python/issues/134)) ([eb1ebfe](https://github.com/writer/writer-python/commit/eb1ebfe452164409a68fc7c6d83d5fdd9ce3b089))
17+
* **internal:** bump pyright ([#129](https://github.com/writer/writer-python/issues/129)) ([f1b2b64](https://github.com/writer/writer-python/commit/f1b2b6458b47f1861bb7d297b007b6ee09123a85))
18+
* **internal:** bump pyright ([#136](https://github.com/writer/writer-python/issues/136)) ([66af392](https://github.com/writer/writer-python/commit/66af39233901307387129f1eb95859434ad18760))
19+
* **internal:** updated imports ([#138](https://github.com/writer/writer-python/issues/138)) ([fc58a7d](https://github.com/writer/writer-python/commit/fc58a7de32363b013cc390ebc7c237cf74fa4137))
20+
* make the `Omit` type public ([#133](https://github.com/writer/writer-python/issues/133)) ([94b63bb](https://github.com/writer/writer-python/commit/94b63bbc992974c0f794dcfe4ced4d7fb2284c50))
21+
22+
23+
### Documentation
24+
25+
* **readme:** example snippet for client context manager ([#139](https://github.com/writer/writer-python/issues/139)) ([30ae872](https://github.com/writer/writer-python/commit/30ae8729b37d27572eafbd521e52eb114b635f8e))
26+
* **readme:** fix http client proxies example ([#135](https://github.com/writer/writer-python/issues/135)) ([4e39cfe](https://github.com/writer/writer-python/commit/4e39cfec407d89fcbe03e8283e7c7bc499bc7b40))
27+
328
## 1.5.0 (2024-11-28)
429

530
Full Changelog: [v1.4.0...v1.5.0](https://github.com/writer/writer-python/compare/v1.4.0...v1.5.0)

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,18 +384,19 @@ can also get all the extra fields on the Pydantic model as a dict with
384384

385385
You can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:
386386

387-
- Support for proxies
388-
- Custom transports
387+
- Support for [proxies](https://www.python-httpx.org/advanced/proxies/)
388+
- Custom [transports](https://www.python-httpx.org/advanced/transports/)
389389
- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality
390390

391391
```python
392+
import httpx
392393
from writerai import Writer, DefaultHttpxClient
393394

394395
client = Writer(
395396
# Or use the `WRITER_BASE_URL` env var
396397
base_url="http://my.test.server.example.com:8083",
397398
http_client=DefaultHttpxClient(
398-
proxies="http://my.test.proxy.example.com",
399+
proxy="http://my.test.proxy.example.com",
399400
transport=httpx.HTTPTransport(local_address="0.0.0.0"),
400401
),
401402
)
@@ -411,6 +412,16 @@ client.with_options(http_client=DefaultHttpxClient(...))
411412

412413
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
413414

415+
```py
416+
from writerai import Writer
417+
418+
with Writer() as client:
419+
# make requests here
420+
...
421+
422+
# HTTP client is now closed
423+
```
424+
414425
## Versioning
415426

416427
This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:

api.md

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

55
```python
6-
from writerai.types import ApplicationGenerateContentResponse
6+
from writerai.types import ApplicationGenerateContentChunk, ApplicationGenerateContentResponse
77
```
88

99
Methods:

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "writer-sdk"
3-
version = "1.5.0"
3+
version = "1.6.0"
44
description = "The official Python library for the writer API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -10,7 +10,7 @@ authors = [
1010
dependencies = [
1111
"httpx>=0.23.0, <1",
1212
"pydantic>=1.9.0, <3",
13-
"typing-extensions>=4.7, <5",
13+
"typing-extensions>=4.10, <5",
1414
"anyio>=3.5.0, <5",
1515
"distro>=1.7.0, <2",
1616
"sniffio",

requirements-dev.lock

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ platformdirs==3.11.0
6363
# via virtualenv
6464
pluggy==1.5.0
6565
# via pytest
66-
pydantic==2.9.2
66+
pydantic==2.10.3
6767
# via writer-sdk
68-
pydantic-core==2.23.4
68+
pydantic-core==2.27.1
6969
# via pydantic
7070
pygments==2.18.0
7171
# via rich
72-
pyright==1.1.380
72+
pyright==1.1.390
7373
pytest==8.3.3
7474
# via pytest-asyncio
7575
pytest-asyncio==0.24.0
@@ -97,6 +97,7 @@ typing-extensions==4.12.2
9797
# via mypy
9898
# via pydantic
9999
# via pydantic-core
100+
# via pyright
100101
# via writer-sdk
101102
virtualenv==20.24.5
102103
# via nox

requirements.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ httpx==0.25.2
3131
idna==3.4
3232
# via anyio
3333
# via httpx
34-
pydantic==2.9.2
34+
pydantic==2.10.3
3535
# via writer-sdk
36-
pydantic-core==2.23.4
36+
pydantic-core==2.27.1
3737
# via pydantic
3838
sniffio==1.3.0
3939
# via anyio

src/writerai/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
from . import types
4-
from ._types import NOT_GIVEN, NoneType, NotGiven, Transport, ProxiesTypes
4+
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
55
from ._utils import file_from_path
66
from ._client import Client, Stream, Writer, Timeout, Transport, AsyncClient, AsyncStream, AsyncWriter, RequestOptions
77
from ._models import BaseModel
@@ -36,6 +36,7 @@
3636
"ProxiesTypes",
3737
"NotGiven",
3838
"NOT_GIVEN",
39+
"Omit",
3940
"WriterError",
4041
"APIError",
4142
"APIStatusError",

src/writerai/_client.py

Lines changed: 60 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import httpx
1010

11-
from . import resources, _exceptions
11+
from . import _exceptions
1212
from ._qs import Querystring
1313
from ._types import (
1414
NOT_GIVEN,
@@ -24,35 +24,27 @@
2424
get_async_library,
2525
)
2626
from ._version import __version__
27+
from .resources import chat, files, graphs, models, completions, applications
2728
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
2829
from ._exceptions import WriterError, APIStatusError
2930
from ._base_client import (
3031
DEFAULT_MAX_RETRIES,
3132
SyncAPIClient,
3233
AsyncAPIClient,
3334
)
35+
from .resources.tools import tools
3436

35-
__all__ = [
36-
"Timeout",
37-
"Transport",
38-
"ProxiesTypes",
39-
"RequestOptions",
40-
"resources",
41-
"Writer",
42-
"AsyncWriter",
43-
"Client",
44-
"AsyncClient",
45-
]
37+
__all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Writer", "AsyncWriter", "Client", "AsyncClient"]
4638

4739

4840
class Writer(SyncAPIClient):
49-
applications: resources.ApplicationsResource
50-
chat: resources.ChatResource
51-
completions: resources.CompletionsResource
52-
models: resources.ModelsResource
53-
graphs: resources.GraphsResource
54-
files: resources.FilesResource
55-
tools: resources.ToolsResource
41+
applications: applications.ApplicationsResource
42+
chat: chat.ChatResource
43+
completions: completions.CompletionsResource
44+
models: models.ModelsResource
45+
graphs: graphs.GraphsResource
46+
files: files.FilesResource
47+
tools: tools.ToolsResource
5648
with_raw_response: WriterWithRawResponse
5749
with_streaming_response: WriterWithStreamedResponse
5850

@@ -112,13 +104,13 @@ def __init__(
112104

113105
self._default_stream_cls = Stream
114106

115-
self.applications = resources.ApplicationsResource(self)
116-
self.chat = resources.ChatResource(self)
117-
self.completions = resources.CompletionsResource(self)
118-
self.models = resources.ModelsResource(self)
119-
self.graphs = resources.GraphsResource(self)
120-
self.files = resources.FilesResource(self)
121-
self.tools = resources.ToolsResource(self)
107+
self.applications = applications.ApplicationsResource(self)
108+
self.chat = chat.ChatResource(self)
109+
self.completions = completions.CompletionsResource(self)
110+
self.models = models.ModelsResource(self)
111+
self.graphs = graphs.GraphsResource(self)
112+
self.files = files.FilesResource(self)
113+
self.tools = tools.ToolsResource(self)
122114
self.with_raw_response = WriterWithRawResponse(self)
123115
self.with_streaming_response = WriterWithStreamedResponse(self)
124116

@@ -228,13 +220,13 @@ def _make_status_error(
228220

229221

230222
class AsyncWriter(AsyncAPIClient):
231-
applications: resources.AsyncApplicationsResource
232-
chat: resources.AsyncChatResource
233-
completions: resources.AsyncCompletionsResource
234-
models: resources.AsyncModelsResource
235-
graphs: resources.AsyncGraphsResource
236-
files: resources.AsyncFilesResource
237-
tools: resources.AsyncToolsResource
223+
applications: applications.AsyncApplicationsResource
224+
chat: chat.AsyncChatResource
225+
completions: completions.AsyncCompletionsResource
226+
models: models.AsyncModelsResource
227+
graphs: graphs.AsyncGraphsResource
228+
files: files.AsyncFilesResource
229+
tools: tools.AsyncToolsResource
238230
with_raw_response: AsyncWriterWithRawResponse
239231
with_streaming_response: AsyncWriterWithStreamedResponse
240232

@@ -294,13 +286,13 @@ def __init__(
294286

295287
self._default_stream_cls = AsyncStream
296288

297-
self.applications = resources.AsyncApplicationsResource(self)
298-
self.chat = resources.AsyncChatResource(self)
299-
self.completions = resources.AsyncCompletionsResource(self)
300-
self.models = resources.AsyncModelsResource(self)
301-
self.graphs = resources.AsyncGraphsResource(self)
302-
self.files = resources.AsyncFilesResource(self)
303-
self.tools = resources.AsyncToolsResource(self)
289+
self.applications = applications.AsyncApplicationsResource(self)
290+
self.chat = chat.AsyncChatResource(self)
291+
self.completions = completions.AsyncCompletionsResource(self)
292+
self.models = models.AsyncModelsResource(self)
293+
self.graphs = graphs.AsyncGraphsResource(self)
294+
self.files = files.AsyncFilesResource(self)
295+
self.tools = tools.AsyncToolsResource(self)
304296
self.with_raw_response = AsyncWriterWithRawResponse(self)
305297
self.with_streaming_response = AsyncWriterWithStreamedResponse(self)
306298

@@ -411,46 +403,46 @@ def _make_status_error(
411403

412404
class WriterWithRawResponse:
413405
def __init__(self, client: Writer) -> None:
414-
self.applications = resources.ApplicationsResourceWithRawResponse(client.applications)
415-
self.chat = resources.ChatResourceWithRawResponse(client.chat)
416-
self.completions = resources.CompletionsResourceWithRawResponse(client.completions)
417-
self.models = resources.ModelsResourceWithRawResponse(client.models)
418-
self.graphs = resources.GraphsResourceWithRawResponse(client.graphs)
419-
self.files = resources.FilesResourceWithRawResponse(client.files)
420-
self.tools = resources.ToolsResourceWithRawResponse(client.tools)
406+
self.applications = applications.ApplicationsResourceWithRawResponse(client.applications)
407+
self.chat = chat.ChatResourceWithRawResponse(client.chat)
408+
self.completions = completions.CompletionsResourceWithRawResponse(client.completions)
409+
self.models = models.ModelsResourceWithRawResponse(client.models)
410+
self.graphs = graphs.GraphsResourceWithRawResponse(client.graphs)
411+
self.files = files.FilesResourceWithRawResponse(client.files)
412+
self.tools = tools.ToolsResourceWithRawResponse(client.tools)
421413

422414

423415
class AsyncWriterWithRawResponse:
424416
def __init__(self, client: AsyncWriter) -> None:
425-
self.applications = resources.AsyncApplicationsResourceWithRawResponse(client.applications)
426-
self.chat = resources.AsyncChatResourceWithRawResponse(client.chat)
427-
self.completions = resources.AsyncCompletionsResourceWithRawResponse(client.completions)
428-
self.models = resources.AsyncModelsResourceWithRawResponse(client.models)
429-
self.graphs = resources.AsyncGraphsResourceWithRawResponse(client.graphs)
430-
self.files = resources.AsyncFilesResourceWithRawResponse(client.files)
431-
self.tools = resources.AsyncToolsResourceWithRawResponse(client.tools)
417+
self.applications = applications.AsyncApplicationsResourceWithRawResponse(client.applications)
418+
self.chat = chat.AsyncChatResourceWithRawResponse(client.chat)
419+
self.completions = completions.AsyncCompletionsResourceWithRawResponse(client.completions)
420+
self.models = models.AsyncModelsResourceWithRawResponse(client.models)
421+
self.graphs = graphs.AsyncGraphsResourceWithRawResponse(client.graphs)
422+
self.files = files.AsyncFilesResourceWithRawResponse(client.files)
423+
self.tools = tools.AsyncToolsResourceWithRawResponse(client.tools)
432424

433425

434426
class WriterWithStreamedResponse:
435427
def __init__(self, client: Writer) -> None:
436-
self.applications = resources.ApplicationsResourceWithStreamingResponse(client.applications)
437-
self.chat = resources.ChatResourceWithStreamingResponse(client.chat)
438-
self.completions = resources.CompletionsResourceWithStreamingResponse(client.completions)
439-
self.models = resources.ModelsResourceWithStreamingResponse(client.models)
440-
self.graphs = resources.GraphsResourceWithStreamingResponse(client.graphs)
441-
self.files = resources.FilesResourceWithStreamingResponse(client.files)
442-
self.tools = resources.ToolsResourceWithStreamingResponse(client.tools)
428+
self.applications = applications.ApplicationsResourceWithStreamingResponse(client.applications)
429+
self.chat = chat.ChatResourceWithStreamingResponse(client.chat)
430+
self.completions = completions.CompletionsResourceWithStreamingResponse(client.completions)
431+
self.models = models.ModelsResourceWithStreamingResponse(client.models)
432+
self.graphs = graphs.GraphsResourceWithStreamingResponse(client.graphs)
433+
self.files = files.FilesResourceWithStreamingResponse(client.files)
434+
self.tools = tools.ToolsResourceWithStreamingResponse(client.tools)
443435

444436

445437
class AsyncWriterWithStreamedResponse:
446438
def __init__(self, client: AsyncWriter) -> None:
447-
self.applications = resources.AsyncApplicationsResourceWithStreamingResponse(client.applications)
448-
self.chat = resources.AsyncChatResourceWithStreamingResponse(client.chat)
449-
self.completions = resources.AsyncCompletionsResourceWithStreamingResponse(client.completions)
450-
self.models = resources.AsyncModelsResourceWithStreamingResponse(client.models)
451-
self.graphs = resources.AsyncGraphsResourceWithStreamingResponse(client.graphs)
452-
self.files = resources.AsyncFilesResourceWithStreamingResponse(client.files)
453-
self.tools = resources.AsyncToolsResourceWithStreamingResponse(client.tools)
439+
self.applications = applications.AsyncApplicationsResourceWithStreamingResponse(client.applications)
440+
self.chat = chat.AsyncChatResourceWithStreamingResponse(client.chat)
441+
self.completions = completions.AsyncCompletionsResourceWithStreamingResponse(client.completions)
442+
self.models = models.AsyncModelsResourceWithStreamingResponse(client.models)
443+
self.graphs = graphs.AsyncGraphsResourceWithStreamingResponse(client.graphs)
444+
self.files = files.AsyncFilesResourceWithStreamingResponse(client.files)
445+
self.tools = tools.AsyncToolsResourceWithStreamingResponse(client.tools)
454446

455447

456448
Client = Writer

0 commit comments

Comments
 (0)