Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 35e6cf7

Browse files
stainless-app[bot]stainless-bot
authored andcommittedSep 9, 2024·
chore: add docstrings to raw response properties (#654)
1 parent 6ea5fce commit 35e6cf7

File tree

5 files changed

+110
-0
lines changed

5 files changed

+110
-0
lines changed
 

‎src/anthropic/resources/beta/beta.py

+22
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,21 @@ def prompt_caching(self) -> PromptCaching:
2424

2525
@cached_property
2626
def with_raw_response(self) -> BetaWithRawResponse:
27+
"""
28+
This property can be used as a prefix for any HTTP method call to return the
29+
the raw response object instead of the parsed content.
30+
31+
For more information, see https://www.github.com/anthropics/anthropic-sdk-python#accessing-raw-response-data-eg-headers
32+
"""
2733
return BetaWithRawResponse(self)
2834

2935
@cached_property
3036
def with_streaming_response(self) -> BetaWithStreamingResponse:
37+
"""
38+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
39+
40+
For more information, see https://www.github.com/anthropics/anthropic-sdk-python#with_streaming_response
41+
"""
3142
return BetaWithStreamingResponse(self)
3243

3344

@@ -38,10 +49,21 @@ def prompt_caching(self) -> AsyncPromptCaching:
3849

3950
@cached_property
4051
def with_raw_response(self) -> AsyncBetaWithRawResponse:
52+
"""
53+
This property can be used as a prefix for any HTTP method call to return the
54+
the raw response object instead of the parsed content.
55+
56+
For more information, see https://www.github.com/anthropics/anthropic-sdk-python#accessing-raw-response-data-eg-headers
57+
"""
4158
return AsyncBetaWithRawResponse(self)
4259

4360
@cached_property
4461
def with_streaming_response(self) -> AsyncBetaWithStreamingResponse:
62+
"""
63+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
64+
65+
For more information, see https://www.github.com/anthropics/anthropic-sdk-python#with_streaming_response
66+
"""
4567
return AsyncBetaWithStreamingResponse(self)
4668

4769

‎src/anthropic/resources/beta/prompt_caching/messages.py

+22
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,21 @@
3939
class Messages(SyncAPIResource):
4040
@cached_property
4141
def with_raw_response(self) -> MessagesWithRawResponse:
42+
"""
43+
This property can be used as a prefix for any HTTP method call to return the
44+
the raw response object instead of the parsed content.
45+
46+
For more information, see https://www.github.com/anthropics/anthropic-sdk-python#accessing-raw-response-data-eg-headers
47+
"""
4248
return MessagesWithRawResponse(self)
4349

4450
@cached_property
4551
def with_streaming_response(self) -> MessagesWithStreamingResponse:
52+
"""
53+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
54+
55+
For more information, see https://www.github.com/anthropics/anthropic-sdk-python#with_streaming_response
56+
"""
4657
return MessagesWithStreamingResponse(self)
4758

4859
@overload
@@ -950,10 +961,21 @@ def stream(
950961
class AsyncMessages(AsyncAPIResource):
951962
@cached_property
952963
def with_raw_response(self) -> AsyncMessagesWithRawResponse:
964+
"""
965+
This property can be used as a prefix for any HTTP method call to return the
966+
the raw response object instead of the parsed content.
967+
968+
For more information, see https://www.github.com/anthropics/anthropic-sdk-python#accessing-raw-response-data-eg-headers
969+
"""
953970
return AsyncMessagesWithRawResponse(self)
954971

955972
@cached_property
956973
def with_streaming_response(self) -> AsyncMessagesWithStreamingResponse:
974+
"""
975+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
976+
977+
For more information, see https://www.github.com/anthropics/anthropic-sdk-python#with_streaming_response
978+
"""
957979
return AsyncMessagesWithStreamingResponse(self)
958980

959981
@overload

‎src/anthropic/resources/beta/prompt_caching/prompt_caching.py

+22
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,21 @@ def messages(self) -> Messages:
2323

2424
@cached_property
2525
def with_raw_response(self) -> PromptCachingWithRawResponse:
26+
"""
27+
This property can be used as a prefix for any HTTP method call to return the
28+
the raw response object instead of the parsed content.
29+
30+
For more information, see https://www.github.com/anthropics/anthropic-sdk-python#accessing-raw-response-data-eg-headers
31+
"""
2632
return PromptCachingWithRawResponse(self)
2733

2834
@cached_property
2935
def with_streaming_response(self) -> PromptCachingWithStreamingResponse:
36+
"""
37+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
38+
39+
For more information, see https://www.github.com/anthropics/anthropic-sdk-python#with_streaming_response
40+
"""
3041
return PromptCachingWithStreamingResponse(self)
3142

3243

@@ -37,10 +48,21 @@ def messages(self) -> AsyncMessages:
3748

3849
@cached_property
3950
def with_raw_response(self) -> AsyncPromptCachingWithRawResponse:
51+
"""
52+
This property can be used as a prefix for any HTTP method call to return the
53+
the raw response object instead of the parsed content.
54+
55+
For more information, see https://www.github.com/anthropics/anthropic-sdk-python#accessing-raw-response-data-eg-headers
56+
"""
4057
return AsyncPromptCachingWithRawResponse(self)
4158

4259
@cached_property
4360
def with_streaming_response(self) -> AsyncPromptCachingWithStreamingResponse:
61+
"""
62+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
63+
64+
For more information, see https://www.github.com/anthropics/anthropic-sdk-python#with_streaming_response
65+
"""
4466
return AsyncPromptCachingWithStreamingResponse(self)
4567

4668

‎src/anthropic/resources/completions.py

+22
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,21 @@
3131
class Completions(SyncAPIResource):
3232
@cached_property
3333
def with_raw_response(self) -> CompletionsWithRawResponse:
34+
"""
35+
This property can be used as a prefix for any HTTP method call to return the
36+
the raw response object instead of the parsed content.
37+
38+
For more information, see https://www.github.com/anthropics/anthropic-sdk-python#accessing-raw-response-data-eg-headers
39+
"""
3440
return CompletionsWithRawResponse(self)
3541

3642
@cached_property
3743
def with_streaming_response(self) -> CompletionsWithStreamingResponse:
44+
"""
45+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
46+
47+
For more information, see https://www.github.com/anthropics/anthropic-sdk-python#with_streaming_response
48+
"""
3849
return CompletionsWithStreamingResponse(self)
3950

4051
@overload
@@ -399,10 +410,21 @@ def create(
399410
class AsyncCompletions(AsyncAPIResource):
400411
@cached_property
401412
def with_raw_response(self) -> AsyncCompletionsWithRawResponse:
413+
"""
414+
This property can be used as a prefix for any HTTP method call to return the
415+
the raw response object instead of the parsed content.
416+
417+
For more information, see https://www.github.com/anthropics/anthropic-sdk-python#accessing-raw-response-data-eg-headers
418+
"""
402419
return AsyncCompletionsWithRawResponse(self)
403420

404421
@cached_property
405422
def with_streaming_response(self) -> AsyncCompletionsWithStreamingResponse:
423+
"""
424+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
425+
426+
For more information, see https://www.github.com/anthropics/anthropic-sdk-python#with_streaming_response
427+
"""
406428
return AsyncCompletionsWithStreamingResponse(self)
407429

408430
@overload

‎src/anthropic/resources/messages.py

+22
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,21 @@
4747
class Messages(SyncAPIResource):
4848
@cached_property
4949
def with_raw_response(self) -> MessagesWithRawResponse:
50+
"""
51+
This property can be used as a prefix for any HTTP method call to return the
52+
the raw response object instead of the parsed content.
53+
54+
For more information, see https://www.github.com/anthropics/anthropic-sdk-python#accessing-raw-response-data-eg-headers
55+
"""
5056
return MessagesWithRawResponse(self)
5157

5258
@cached_property
5359
def with_streaming_response(self) -> MessagesWithStreamingResponse:
60+
"""
61+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
62+
63+
For more information, see https://www.github.com/anthropics/anthropic-sdk-python#with_streaming_response
64+
"""
5465
return MessagesWithStreamingResponse(self)
5566

5667
@overload
@@ -968,10 +979,21 @@ def stream(
968979
class AsyncMessages(AsyncAPIResource):
969980
@cached_property
970981
def with_raw_response(self) -> AsyncMessagesWithRawResponse:
982+
"""
983+
This property can be used as a prefix for any HTTP method call to return the
984+
the raw response object instead of the parsed content.
985+
986+
For more information, see https://www.github.com/anthropics/anthropic-sdk-python#accessing-raw-response-data-eg-headers
987+
"""
971988
return AsyncMessagesWithRawResponse(self)
972989

973990
@cached_property
974991
def with_streaming_response(self) -> AsyncMessagesWithStreamingResponse:
992+
"""
993+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
994+
995+
For more information, see https://www.github.com/anthropics/anthropic-sdk-python#with_streaming_response
996+
"""
975997
return AsyncMessagesWithStreamingResponse(self)
976998

977999
@overload

0 commit comments

Comments
 (0)
Please sign in to comment.