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 .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.3.0"
".": "2.3.1-rc1"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 33
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/writerai%2Fwriter-0bbaae2a69204cb3ccf6dc4fbb0cef810a4e8c78f09ac639e253e84df0add53a.yml
openapi_spec_hash: 0a9be554ca3af860e3831bd776e50f56
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/writerai%2Fwriter-9e04c6a51c55704029c529f2917d0e2b976cb7b6595128697db031ad7bd61a63.yml
openapi_spec_hash: e8a95522dd13ffe4633cccc34bbd651d
config_hash: 7a38bab086b53b43d2a719cb4d883264
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 2.3.1-rc1 (2025-08-19)

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

### Documentation

* **api:** updates to API spec ([8f5acc8](https://github.com/writer/writer-python/commit/8f5acc859cef51375ed2abf641c7087a36d26e02))

## 2.3.0 (2025-08-14)

Full Changelog: [v2.3.0-rc1...v2.3.0](https://github.com/writer/writer-python/compare/v2.3.0-rc1...v2.3.0)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ To install the package from PyPI, use `pip`:

```sh
# install from PyPI
pip install writer-sdk
pip install --pre writer-sdk
```

## Prequisites
Expand Down Expand Up @@ -116,7 +116,7 @@ You can enable this by installing `aiohttp`:

```sh
# install from PyPI
pip install writer-sdk[aiohttp]
pip install --pre writer-sdk[aiohttp]
```

Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
Expand Down
6 changes: 2 additions & 4 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ from writerai.types import (
Question,
QuestionResponseChunk,
GraphCreateResponse,
GraphRetrieveResponse,
GraphUpdateResponse,
GraphListResponse,
GraphDeleteResponse,
GraphRemoveFileFromGraphResponse,
)
Expand All @@ -134,9 +132,9 @@ from writerai.types import (
Methods:

- <code title="post /v1/graphs">client.graphs.<a href="./src/writerai/resources/graphs.py">create</a>(\*\*<a href="src/writerai/types/graph_create_params.py">params</a>) -> <a href="./src/writerai/types/graph_create_response.py">GraphCreateResponse</a></code>
- <code title="get /v1/graphs/{graph_id}">client.graphs.<a href="./src/writerai/resources/graphs.py">retrieve</a>(graph_id) -> <a href="./src/writerai/types/graph_retrieve_response.py">GraphRetrieveResponse</a></code>
- <code title="get /v1/graphs/{graph_id}">client.graphs.<a href="./src/writerai/resources/graphs.py">retrieve</a>(graph_id) -> <a href="./src/writerai/types/graph.py">Graph</a></code>
- <code title="put /v1/graphs/{graph_id}">client.graphs.<a href="./src/writerai/resources/graphs.py">update</a>(graph_id, \*\*<a href="src/writerai/types/graph_update_params.py">params</a>) -> <a href="./src/writerai/types/graph_update_response.py">GraphUpdateResponse</a></code>
- <code title="get /v1/graphs">client.graphs.<a href="./src/writerai/resources/graphs.py">list</a>(\*\*<a href="src/writerai/types/graph_list_params.py">params</a>) -> <a href="./src/writerai/types/graph_list_response.py">SyncCursorPage[GraphListResponse]</a></code>
- <code title="get /v1/graphs">client.graphs.<a href="./src/writerai/resources/graphs.py">list</a>(\*\*<a href="src/writerai/types/graph_list_params.py">params</a>) -> <a href="./src/writerai/types/graph.py">SyncCursorPage[Graph]</a></code>
- <code title="delete /v1/graphs/{graph_id}">client.graphs.<a href="./src/writerai/resources/graphs.py">delete</a>(graph_id) -> <a href="./src/writerai/types/graph_delete_response.py">GraphDeleteResponse</a></code>
- <code title="post /v1/graphs/{graph_id}/file">client.graphs.<a href="./src/writerai/resources/graphs.py">add_file_to_graph</a>(graph_id, \*\*<a href="src/writerai/types/graph_add_file_to_graph_params.py">params</a>) -> <a href="./src/writerai/types/file.py">File</a></code>
- <code title="post /v1/graphs/question">client.graphs.<a href="./src/writerai/resources/graphs.py">question</a>(\*\*<a href="src/writerai/types/graph_question_params.py">params</a>) -> <a href="./src/writerai/types/question.py">Question</a></code>
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 = "writer-sdk"
version = "2.3.0"
version = "2.3.1-rc1"
description = "The official Python library for the writer API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/writerai/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "writerai"
__version__ = "2.3.0" # x-release-please-version
__version__ = "2.3.1-rc1" # x-release-please-version
23 changes: 11 additions & 12 deletions src/writerai/resources/graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@
from .._streaming import Stream, AsyncStream
from ..pagination import SyncCursorPage, AsyncCursorPage
from ..types.file import File
from ..types.graph import Graph
from .._base_client import AsyncPaginator, make_request_options
from ..types.question import Question
from ..types.graph_list_response import GraphListResponse
from ..types.graph_create_response import GraphCreateResponse
from ..types.graph_delete_response import GraphDeleteResponse
from ..types.graph_update_response import GraphUpdateResponse
from ..types.graph_retrieve_response import GraphRetrieveResponse
from ..types.question_response_chunk import QuestionResponseChunk
from ..types.graph_remove_file_from_graph_response import GraphRemoveFileFromGraphResponse

Expand Down Expand Up @@ -115,7 +114,7 @@ def retrieve(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> GraphRetrieveResponse:
) -> Graph:
"""
Retrieve a Knowledge Graph.

Expand All @@ -135,7 +134,7 @@ def retrieve(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=GraphRetrieveResponse,
cast_to=Graph,
)

def update(
Expand Down Expand Up @@ -205,7 +204,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncCursorPage[GraphListResponse]:
) -> SyncCursorPage[Graph]:
"""
Retrieve a list of Knowledge Graphs.

Expand All @@ -232,7 +231,7 @@ def list(
"""
return self._get_api_list(
"/v1/graphs",
page=SyncCursorPage[GraphListResponse],
page=SyncCursorPage[Graph],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand All @@ -248,7 +247,7 @@ def list(
graph_list_params.GraphListParams,
),
),
model=GraphListResponse,
model=Graph,
)

def delete(
Expand Down Expand Up @@ -620,7 +619,7 @@ async def retrieve(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> GraphRetrieveResponse:
) -> Graph:
"""
Retrieve a Knowledge Graph.

Expand All @@ -640,7 +639,7 @@ async def retrieve(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=GraphRetrieveResponse,
cast_to=Graph,
)

async def update(
Expand Down Expand Up @@ -710,7 +709,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[GraphListResponse, AsyncCursorPage[GraphListResponse]]:
) -> AsyncPaginator[Graph, AsyncCursorPage[Graph]]:
"""
Retrieve a list of Knowledge Graphs.

Expand All @@ -737,7 +736,7 @@ def list(
"""
return self._get_api_list(
"/v1/graphs",
page=AsyncCursorPage[GraphListResponse],
page=AsyncCursorPage[Graph],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand All @@ -753,7 +752,7 @@ def list(
graph_list_params.GraphListParams,
),
),
model=GraphListResponse,
model=Graph,
)

async def delete(
Expand Down
3 changes: 1 addition & 2 deletions src/writerai/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from __future__ import annotations

from .file import File as File
from .graph import Graph as Graph
from .shared import (
Source as Source,
Logprobs as Logprobs,
Expand Down Expand Up @@ -30,7 +31,6 @@
from .file_upload_params import FileUploadParams as FileUploadParams
from .file_retry_response import FileRetryResponse as FileRetryResponse
from .graph_create_params import GraphCreateParams as GraphCreateParams
from .graph_list_response import GraphListResponse as GraphListResponse
from .graph_update_params import GraphUpdateParams as GraphUpdateParams
from .model_list_response import ModelListResponse as ModelListResponse
from .file_delete_response import FileDeleteResponse as FileDeleteResponse
Expand All @@ -48,7 +48,6 @@
from .tool_web_search_params import ToolWebSearchParams as ToolWebSearchParams
from .application_list_params import ApplicationListParams as ApplicationListParams
from .chat_completion_message import ChatCompletionMessage as ChatCompletionMessage
from .graph_retrieve_response import GraphRetrieveResponse as GraphRetrieveResponse
from .question_response_chunk import QuestionResponseChunk as QuestionResponseChunk
from .tool_ai_detect_response import ToolAIDetectResponse as ToolAIDetectResponse
from .tool_parse_pdf_response import ToolParsePdfResponse as ToolParsePdfResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from .._models import BaseModel

__all__ = ["GraphListResponse", "FileStatus", "URL", "URLStatus"]
__all__ = ["Graph", "FileStatus", "URL", "URLStatus"]


class FileStatus(BaseModel):
Expand Down Expand Up @@ -47,7 +47,7 @@ class URL(BaseModel):
"""An array of URLs to exclude from processing within this web connector."""


class GraphListResponse(BaseModel):
class Graph(BaseModel):
id: str
"""The unique identifier of the Knowledge Graph."""

Expand Down
76 changes: 0 additions & 76 deletions src/writerai/types/graph_retrieve_response.py

This file was deleted.

Loading