Skip to content

Commit d7b4637

Browse files
feat(api): manual updates
1 parent c1a388e commit d7b4637

7 files changed

Lines changed: 429 additions & 290 deletions

File tree

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 33
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/writerai%2Fwriter-4ec783072dd7f57c6e021a746df7650fb8d7a164d8ec25c7d5cab06c33bc114f.yml
33
openapi_spec_hash: ceab065d515f3681b0c33137da308968
4-
config_hash: d655a846f6872554a75412b27b6ed71f
4+
config_hash: 2b8696f9cec6810cb2acca7441615269

src/writerai/resources/tools/comprehend.py

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
import typing_extensions
56
from typing_extensions import Literal
67

78
import httpx
@@ -43,6 +44,9 @@ def with_streaming_response(self) -> ComprehendResourceWithStreamingResponse:
4344
"""
4445
return ComprehendResourceWithStreamingResponse(self)
4546

47+
@typing_extensions.deprecated(
48+
"Will be removed in a future release. Migrate to `chat.chat` with the LLM tool using the `palmyra-med` model for medical analysis."
49+
)
4650
def medical(
4751
self,
4852
*,
@@ -110,6 +114,9 @@ def with_streaming_response(self) -> AsyncComprehendResourceWithStreamingRespons
110114
"""
111115
return AsyncComprehendResourceWithStreamingResponse(self)
112116

117+
@typing_extensions.deprecated(
118+
"Will be removed in a future release. Migrate to `chat.chat` with the LLM tool using the `palmyra-med` model for medical analysis."
119+
)
113120
async def medical(
114121
self,
115122
*,
@@ -161,33 +168,41 @@ class ComprehendResourceWithRawResponse:
161168
def __init__(self, comprehend: ComprehendResource) -> None:
162169
self._comprehend = comprehend
163170

164-
self.medical = to_raw_response_wrapper(
165-
comprehend.medical,
171+
self.medical = ( # pyright: ignore[reportDeprecated]
172+
to_raw_response_wrapper(
173+
comprehend.medical, # pyright: ignore[reportDeprecated],
174+
)
166175
)
167176

168177

169178
class AsyncComprehendResourceWithRawResponse:
170179
def __init__(self, comprehend: AsyncComprehendResource) -> None:
171180
self._comprehend = comprehend
172181

173-
self.medical = async_to_raw_response_wrapper(
174-
comprehend.medical,
182+
self.medical = ( # pyright: ignore[reportDeprecated]
183+
async_to_raw_response_wrapper(
184+
comprehend.medical, # pyright: ignore[reportDeprecated],
185+
)
175186
)
176187

177188

178189
class ComprehendResourceWithStreamingResponse:
179190
def __init__(self, comprehend: ComprehendResource) -> None:
180191
self._comprehend = comprehend
181192

182-
self.medical = to_streamed_response_wrapper(
183-
comprehend.medical,
193+
self.medical = ( # pyright: ignore[reportDeprecated]
194+
to_streamed_response_wrapper(
195+
comprehend.medical, # pyright: ignore[reportDeprecated],
196+
)
184197
)
185198

186199

187200
class AsyncComprehendResourceWithStreamingResponse:
188201
def __init__(self, comprehend: AsyncComprehendResource) -> None:
189202
self._comprehend = comprehend
190203

191-
self.medical = async_to_streamed_response_wrapper(
192-
comprehend.medical,
204+
self.medical = ( # pyright: ignore[reportDeprecated]
205+
async_to_streamed_response_wrapper(
206+
comprehend.medical, # pyright: ignore[reportDeprecated],
207+
)
193208
)

src/writerai/resources/tools/tools.py

Lines changed: 81 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
import typing_extensions
56
from typing import Union
67
from typing_extensions import Literal
78

@@ -64,6 +65,7 @@ def with_streaming_response(self) -> ToolsResourceWithStreamingResponse:
6465
"""
6566
return ToolsResourceWithStreamingResponse(self)
6667

68+
@typing_extensions.deprecated("Will be removed in a future release. Please migrate to alternative solutions.")
6769
def ai_detect(
6870
self,
6971
*,
@@ -101,6 +103,7 @@ def ai_detect(
101103
cast_to=ToolAIDetectResponse,
102104
)
103105

106+
@typing_extensions.deprecated("Will be removed in a future release. Please migrate to alternative solutions.")
104107
def context_aware_splitting(
105108
self,
106109
*,
@@ -147,6 +150,9 @@ def context_aware_splitting(
147150
cast_to=ToolContextAwareSplittingResponse,
148151
)
149152

153+
@typing_extensions.deprecated(
154+
"Will be removed in a future release. A replacement PDF parsing tool for chat completions is planned; see documentation at dev.writer.com for updates."
155+
)
150156
def parse_pdf(
151157
self,
152158
file_id: str,
@@ -184,6 +190,9 @@ def parse_pdf(
184190
cast_to=ToolParsePdfResponse,
185191
)
186192

193+
@typing_extensions.deprecated(
194+
"Will be removed in a future release. Migrate to `chat.chat` with the web search tool for web search capabilities."
195+
)
187196
def web_search(
188197
self,
189198
*,
@@ -482,6 +491,7 @@ def with_streaming_response(self) -> AsyncToolsResourceWithStreamingResponse:
482491
"""
483492
return AsyncToolsResourceWithStreamingResponse(self)
484493

494+
@typing_extensions.deprecated("Will be removed in a future release. Please migrate to alternative solutions.")
485495
async def ai_detect(
486496
self,
487497
*,
@@ -519,6 +529,7 @@ async def ai_detect(
519529
cast_to=ToolAIDetectResponse,
520530
)
521531

532+
@typing_extensions.deprecated("Will be removed in a future release. Please migrate to alternative solutions.")
522533
async def context_aware_splitting(
523534
self,
524535
*,
@@ -565,6 +576,9 @@ async def context_aware_splitting(
565576
cast_to=ToolContextAwareSplittingResponse,
566577
)
567578

579+
@typing_extensions.deprecated(
580+
"Will be removed in a future release. A replacement PDF parsing tool for chat completions is planned; see documentation at dev.writer.com for updates."
581+
)
568582
async def parse_pdf(
569583
self,
570584
file_id: str,
@@ -602,6 +616,9 @@ async def parse_pdf(
602616
cast_to=ToolParsePdfResponse,
603617
)
604618

619+
@typing_extensions.deprecated(
620+
"Will be removed in a future release. Migrate to `chat.chat` with the web search tool for web search capabilities."
621+
)
605622
async def web_search(
606623
self,
607624
*,
@@ -880,17 +897,25 @@ class ToolsResourceWithRawResponse:
880897
def __init__(self, tools: ToolsResource) -> None:
881898
self._tools = tools
882899

883-
self.ai_detect = to_raw_response_wrapper(
884-
tools.ai_detect,
900+
self.ai_detect = ( # pyright: ignore[reportDeprecated]
901+
to_raw_response_wrapper(
902+
tools.ai_detect, # pyright: ignore[reportDeprecated],
903+
)
885904
)
886-
self.context_aware_splitting = to_raw_response_wrapper(
887-
tools.context_aware_splitting,
905+
self.context_aware_splitting = ( # pyright: ignore[reportDeprecated]
906+
to_raw_response_wrapper(
907+
tools.context_aware_splitting, # pyright: ignore[reportDeprecated],
908+
)
888909
)
889-
self.parse_pdf = to_raw_response_wrapper(
890-
tools.parse_pdf,
910+
self.parse_pdf = ( # pyright: ignore[reportDeprecated]
911+
to_raw_response_wrapper(
912+
tools.parse_pdf, # pyright: ignore[reportDeprecated],
913+
)
891914
)
892-
self.web_search = to_raw_response_wrapper(
893-
tools.web_search,
915+
self.web_search = ( # pyright: ignore[reportDeprecated]
916+
to_raw_response_wrapper(
917+
tools.web_search, # pyright: ignore[reportDeprecated],
918+
)
894919
)
895920

896921
@cached_property
@@ -902,17 +927,25 @@ class AsyncToolsResourceWithRawResponse:
902927
def __init__(self, tools: AsyncToolsResource) -> None:
903928
self._tools = tools
904929

905-
self.ai_detect = async_to_raw_response_wrapper(
906-
tools.ai_detect,
930+
self.ai_detect = ( # pyright: ignore[reportDeprecated]
931+
async_to_raw_response_wrapper(
932+
tools.ai_detect, # pyright: ignore[reportDeprecated],
933+
)
907934
)
908-
self.context_aware_splitting = async_to_raw_response_wrapper(
909-
tools.context_aware_splitting,
935+
self.context_aware_splitting = ( # pyright: ignore[reportDeprecated]
936+
async_to_raw_response_wrapper(
937+
tools.context_aware_splitting, # pyright: ignore[reportDeprecated],
938+
)
910939
)
911-
self.parse_pdf = async_to_raw_response_wrapper(
912-
tools.parse_pdf,
940+
self.parse_pdf = ( # pyright: ignore[reportDeprecated]
941+
async_to_raw_response_wrapper(
942+
tools.parse_pdf, # pyright: ignore[reportDeprecated],
943+
)
913944
)
914-
self.web_search = async_to_raw_response_wrapper(
915-
tools.web_search,
945+
self.web_search = ( # pyright: ignore[reportDeprecated]
946+
async_to_raw_response_wrapper(
947+
tools.web_search, # pyright: ignore[reportDeprecated],
948+
)
916949
)
917950

918951
@cached_property
@@ -924,17 +957,25 @@ class ToolsResourceWithStreamingResponse:
924957
def __init__(self, tools: ToolsResource) -> None:
925958
self._tools = tools
926959

927-
self.ai_detect = to_streamed_response_wrapper(
928-
tools.ai_detect,
960+
self.ai_detect = ( # pyright: ignore[reportDeprecated]
961+
to_streamed_response_wrapper(
962+
tools.ai_detect, # pyright: ignore[reportDeprecated],
963+
)
929964
)
930-
self.context_aware_splitting = to_streamed_response_wrapper(
931-
tools.context_aware_splitting,
965+
self.context_aware_splitting = ( # pyright: ignore[reportDeprecated]
966+
to_streamed_response_wrapper(
967+
tools.context_aware_splitting, # pyright: ignore[reportDeprecated],
968+
)
932969
)
933-
self.parse_pdf = to_streamed_response_wrapper(
934-
tools.parse_pdf,
970+
self.parse_pdf = ( # pyright: ignore[reportDeprecated]
971+
to_streamed_response_wrapper(
972+
tools.parse_pdf, # pyright: ignore[reportDeprecated],
973+
)
935974
)
936-
self.web_search = to_streamed_response_wrapper(
937-
tools.web_search,
975+
self.web_search = ( # pyright: ignore[reportDeprecated]
976+
to_streamed_response_wrapper(
977+
tools.web_search, # pyright: ignore[reportDeprecated],
978+
)
938979
)
939980

940981
@cached_property
@@ -946,17 +987,25 @@ class AsyncToolsResourceWithStreamingResponse:
946987
def __init__(self, tools: AsyncToolsResource) -> None:
947988
self._tools = tools
948989

949-
self.ai_detect = async_to_streamed_response_wrapper(
950-
tools.ai_detect,
990+
self.ai_detect = ( # pyright: ignore[reportDeprecated]
991+
async_to_streamed_response_wrapper(
992+
tools.ai_detect, # pyright: ignore[reportDeprecated],
993+
)
951994
)
952-
self.context_aware_splitting = async_to_streamed_response_wrapper(
953-
tools.context_aware_splitting,
995+
self.context_aware_splitting = ( # pyright: ignore[reportDeprecated]
996+
async_to_streamed_response_wrapper(
997+
tools.context_aware_splitting, # pyright: ignore[reportDeprecated],
998+
)
954999
)
955-
self.parse_pdf = async_to_streamed_response_wrapper(
956-
tools.parse_pdf,
1000+
self.parse_pdf = ( # pyright: ignore[reportDeprecated]
1001+
async_to_streamed_response_wrapper(
1002+
tools.parse_pdf, # pyright: ignore[reportDeprecated],
1003+
)
9571004
)
958-
self.web_search = async_to_streamed_response_wrapper(
959-
tools.web_search,
1005+
self.web_search = ( # pyright: ignore[reportDeprecated]
1006+
async_to_streamed_response_wrapper(
1007+
tools.web_search, # pyright: ignore[reportDeprecated],
1008+
)
9601009
)
9611010

9621011
@cached_property

src/writerai/resources/translation.py

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
import typing_extensions
56
from typing_extensions import Literal
67

78
import httpx
@@ -43,6 +44,9 @@ def with_streaming_response(self) -> TranslationResourceWithStreamingResponse:
4344
"""
4445
return TranslationResourceWithStreamingResponse(self)
4546

47+
@typing_extensions.deprecated(
48+
"Will be removed in a future release. Migrate to `chat.chat` with the translate tool for translation capabilities."
49+
)
4650
def translate(
4751
self,
4852
*,
@@ -145,6 +149,9 @@ def with_streaming_response(self) -> AsyncTranslationResourceWithStreamingRespon
145149
"""
146150
return AsyncTranslationResourceWithStreamingResponse(self)
147151

152+
@typing_extensions.deprecated(
153+
"Will be removed in a future release. Migrate to `chat.chat` with the translate tool for translation capabilities."
154+
)
148155
async def translate(
149156
self,
150157
*,
@@ -231,33 +238,41 @@ class TranslationResourceWithRawResponse:
231238
def __init__(self, translation: TranslationResource) -> None:
232239
self._translation = translation
233240

234-
self.translate = to_raw_response_wrapper(
235-
translation.translate,
241+
self.translate = ( # pyright: ignore[reportDeprecated]
242+
to_raw_response_wrapper(
243+
translation.translate, # pyright: ignore[reportDeprecated],
244+
)
236245
)
237246

238247

239248
class AsyncTranslationResourceWithRawResponse:
240249
def __init__(self, translation: AsyncTranslationResource) -> None:
241250
self._translation = translation
242251

243-
self.translate = async_to_raw_response_wrapper(
244-
translation.translate,
252+
self.translate = ( # pyright: ignore[reportDeprecated]
253+
async_to_raw_response_wrapper(
254+
translation.translate, # pyright: ignore[reportDeprecated],
255+
)
245256
)
246257

247258

248259
class TranslationResourceWithStreamingResponse:
249260
def __init__(self, translation: TranslationResource) -> None:
250261
self._translation = translation
251262

252-
self.translate = to_streamed_response_wrapper(
253-
translation.translate,
263+
self.translate = ( # pyright: ignore[reportDeprecated]
264+
to_streamed_response_wrapper(
265+
translation.translate, # pyright: ignore[reportDeprecated],
266+
)
254267
)
255268

256269

257270
class AsyncTranslationResourceWithStreamingResponse:
258271
def __init__(self, translation: AsyncTranslationResource) -> None:
259272
self._translation = translation
260273

261-
self.translate = async_to_streamed_response_wrapper(
262-
translation.translate,
274+
self.translate = ( # pyright: ignore[reportDeprecated]
275+
async_to_streamed_response_wrapper(
276+
translation.translate, # pyright: ignore[reportDeprecated],
277+
)
263278
)

0 commit comments

Comments
 (0)