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 .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 29
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/writerai%2Fwriter-710e8a17bc916b755685592b3831e6732f3ba02904f970084aef0ac86fd79ed5.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/writerai%2Fwriter-9f17b2629bd54f56bc3e48ec710b11e2ba84302725f8da9e9ed390bbed5d3b5b.yml
60 changes: 32 additions & 28 deletions src/writerai/resources/graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,24 @@ def with_streaming_response(self) -> GraphsResourceWithStreamingResponse:
def create(
self,
*,
name: str,
description: str | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> GraphCreateResponse:
"""Create graph
"""
Create graph

Args:
name: The name of the graph.

This can be at most 255 characters.
description: A description of the graph (max 255 characters). Omitting this field leaves the
description unchanged.

description: A description of the graph. This can be at most 255 characters.
name: The name of the graph (max 255 characters). Omitting this field leaves the name
unchanged.

extra_headers: Send extra headers

Expand All @@ -96,8 +97,8 @@ def create(
"/v1/graphs",
body=maybe_transform(
{
"name": name,
"description": description,
"name": name,
},
graph_create_params.GraphCreateParams,
),
Expand Down Expand Up @@ -144,23 +145,24 @@ def update(
self,
graph_id: str,
*,
name: str,
description: str | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> GraphUpdateResponse:
"""Update graph
"""
Update the name and description of a Knowledge Graph.

Args:
name: The name of the graph.

This can be at most 255 characters.
description: A description of the graph (max 255 characters). Omitting this field leaves the
description unchanged.

description: A description of the graph. This can be at most 255 characters.
name: The name of the graph (max 255 characters). Omitting this field leaves the name
unchanged.

extra_headers: Send extra headers

Expand All @@ -176,8 +178,8 @@ def update(
f"/v1/graphs/{graph_id}",
body=maybe_transform(
{
"name": name,
"description": description,
"name": name,
},
graph_update_params.GraphUpdateParams,
),
Expand Down Expand Up @@ -528,23 +530,24 @@ def with_streaming_response(self) -> AsyncGraphsResourceWithStreamingResponse:
async def create(
self,
*,
name: str,
description: str | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> GraphCreateResponse:
"""Create graph
"""
Create graph

Args:
name: The name of the graph.

This can be at most 255 characters.
description: A description of the graph (max 255 characters). Omitting this field leaves the
description unchanged.

description: A description of the graph. This can be at most 255 characters.
name: The name of the graph (max 255 characters). Omitting this field leaves the name
unchanged.

extra_headers: Send extra headers

Expand All @@ -558,8 +561,8 @@ async def create(
"/v1/graphs",
body=await async_maybe_transform(
{
"name": name,
"description": description,
"name": name,
},
graph_create_params.GraphCreateParams,
),
Expand Down Expand Up @@ -606,23 +609,24 @@ async def update(
self,
graph_id: str,
*,
name: str,
description: str | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> GraphUpdateResponse:
"""Update graph
"""
Update the name and description of a Knowledge Graph.

Args:
name: The name of the graph.

This can be at most 255 characters.
description: A description of the graph (max 255 characters). Omitting this field leaves the
description unchanged.

description: A description of the graph. This can be at most 255 characters.
name: The name of the graph (max 255 characters). Omitting this field leaves the name
unchanged.

extra_headers: Send extra headers

Expand All @@ -638,8 +642,8 @@ async def update(
f"/v1/graphs/{graph_id}",
body=await async_maybe_transform(
{
"name": name,
"description": description,
"name": name,
},
graph_update_params.GraphUpdateParams,
),
Expand Down
16 changes: 11 additions & 5 deletions src/writerai/types/graph_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@

from __future__ import annotations

from typing_extensions import Required, TypedDict
from typing_extensions import TypedDict

__all__ = ["GraphCreateParams"]


class GraphCreateParams(TypedDict, total=False):
name: Required[str]
"""The name of the graph. This can be at most 255 characters."""

description: str
"""A description of the graph. This can be at most 255 characters."""
"""A description of the graph (max 255 characters).

Omitting this field leaves the description unchanged.
"""

name: str
"""The name of the graph (max 255 characters).

Omitting this field leaves the name unchanged.
"""
16 changes: 11 additions & 5 deletions src/writerai/types/graph_update_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@

from __future__ import annotations

from typing_extensions import Required, TypedDict
from typing_extensions import TypedDict

__all__ = ["GraphUpdateParams"]


class GraphUpdateParams(TypedDict, total=False):
name: Required[str]
"""The name of the graph. This can be at most 255 characters."""

description: str
"""A description of the graph. This can be at most 255 characters."""
"""A description of the graph (max 255 characters).

Omitting this field leaves the description unchanged.
"""

name: str
"""The name of the graph (max 255 characters).

Omitting this field leaves the name unchanged.
"""
6 changes: 3 additions & 3 deletions src/writerai/types/question.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Subquery(BaseModel):
query: str
"""The subquery that was asked."""

sources: List[Source]
sources: List[Optional[Source]]


class Question(BaseModel):
Expand All @@ -25,6 +25,6 @@ class Question(BaseModel):
question: str
"""The question that was asked."""

sources: List[Source]
sources: List[Optional[Source]]

subqueries: Optional[List[Subquery]] = None
subqueries: Optional[List[Optional[Subquery]]] = None
6 changes: 3 additions & 3 deletions src/writerai/types/shared/graph_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ class Subquery(BaseModel):
query: str
"""The subquery that was asked."""

sources: List[Source]
sources: List[Optional[Source]]


class GraphData(BaseModel):
sources: Optional[List[Source]] = None
sources: Optional[List[Optional[Source]]] = None

status: Optional[Literal["processing", "finished"]] = None

subqueries: Optional[List[Subquery]] = None
subqueries: Optional[List[Optional[Subquery]]] = None
10 changes: 5 additions & 5 deletions src/writerai/types/shared_params/graph_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Iterable
from typing import Iterable, Optional
from typing_extensions import Literal, Required, TypedDict

from .source import Source
Expand All @@ -17,12 +17,12 @@ class Subquery(TypedDict, total=False):
query: Required[str]
"""The subquery that was asked."""

sources: Required[Iterable[Source]]
sources: Required[Iterable[Optional[Source]]]


class GraphData(TypedDict, total=False):
sources: Iterable[Source]
sources: Iterable[Optional[Source]]

status: Literal["processing", "finished"]
status: Optional[Literal["processing", "finished"]]

subqueries: Iterable[Subquery]
subqueries: Iterable[Optional[Subquery]]
Loading