Skip to content

Commit 65753fd

Browse files
chore: add docstrings to raw response properties (#1696)
1 parent 5f9435b commit 65753fd

27 files changed

+594
-0
lines changed

Diff for: src/openai/resources/audio/audio.py

+22
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,21 @@ def speech(self) -> Speech:
4747

4848
@cached_property
4949
def with_raw_response(self) -> AudioWithRawResponse:
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/openai/openai-python#accessing-raw-response-data-eg-headers
55+
"""
5056
return AudioWithRawResponse(self)
5157

5258
@cached_property
5359
def with_streaming_response(self) -> AudioWithStreamingResponse:
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/openai/openai-python#with_streaming_response
64+
"""
5465
return AudioWithStreamingResponse(self)
5566

5667

@@ -69,10 +80,21 @@ def speech(self) -> AsyncSpeech:
6980

7081
@cached_property
7182
def with_raw_response(self) -> AsyncAudioWithRawResponse:
83+
"""
84+
This property can be used as a prefix for any HTTP method call to return the
85+
the raw response object instead of the parsed content.
86+
87+
For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
88+
"""
7289
return AsyncAudioWithRawResponse(self)
7390

7491
@cached_property
7592
def with_streaming_response(self) -> AsyncAudioWithStreamingResponse:
93+
"""
94+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
95+
96+
For more information, see https://www.github.com/openai/openai-python#with_streaming_response
97+
"""
7698
return AsyncAudioWithStreamingResponse(self)
7799

78100

Diff for: src/openai/resources/audio/speech.py

+22
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,21 @@
3131
class Speech(SyncAPIResource):
3232
@cached_property
3333
def with_raw_response(self) -> SpeechWithRawResponse:
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/openai/openai-python#accessing-raw-response-data-eg-headers
39+
"""
3440
return SpeechWithRawResponse(self)
3541

3642
@cached_property
3743
def with_streaming_response(self) -> SpeechWithStreamingResponse:
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/openai/openai-python#with_streaming_response
48+
"""
3849
return SpeechWithStreamingResponse(self)
3950

4051
def create(
@@ -104,10 +115,21 @@ def create(
104115
class AsyncSpeech(AsyncAPIResource):
105116
@cached_property
106117
def with_raw_response(self) -> AsyncSpeechWithRawResponse:
118+
"""
119+
This property can be used as a prefix for any HTTP method call to return the
120+
the raw response object instead of the parsed content.
121+
122+
For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
123+
"""
107124
return AsyncSpeechWithRawResponse(self)
108125

109126
@cached_property
110127
def with_streaming_response(self) -> AsyncSpeechWithStreamingResponse:
128+
"""
129+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
130+
131+
For more information, see https://www.github.com/openai/openai-python#with_streaming_response
132+
"""
111133
return AsyncSpeechWithStreamingResponse(self)
112134

113135
async def create(

Diff for: src/openai/resources/audio/transcriptions.py

+22
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,21 @@
2929
class Transcriptions(SyncAPIResource):
3030
@cached_property
3131
def with_raw_response(self) -> TranscriptionsWithRawResponse:
32+
"""
33+
This property can be used as a prefix for any HTTP method call to return the
34+
the raw response object instead of the parsed content.
35+
36+
For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
37+
"""
3238
return TranscriptionsWithRawResponse(self)
3339

3440
@cached_property
3541
def with_streaming_response(self) -> TranscriptionsWithStreamingResponse:
42+
"""
43+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
44+
45+
For more information, see https://www.github.com/openai/openai-python#with_streaming_response
46+
"""
3647
return TranscriptionsWithStreamingResponse(self)
3748

3849
def create(
@@ -125,10 +136,21 @@ def create(
125136
class AsyncTranscriptions(AsyncAPIResource):
126137
@cached_property
127138
def with_raw_response(self) -> AsyncTranscriptionsWithRawResponse:
139+
"""
140+
This property can be used as a prefix for any HTTP method call to return the
141+
the raw response object instead of the parsed content.
142+
143+
For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
144+
"""
128145
return AsyncTranscriptionsWithRawResponse(self)
129146

130147
@cached_property
131148
def with_streaming_response(self) -> AsyncTranscriptionsWithStreamingResponse:
149+
"""
150+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
151+
152+
For more information, see https://www.github.com/openai/openai-python#with_streaming_response
153+
"""
132154
return AsyncTranscriptionsWithStreamingResponse(self)
133155

134156
async def create(

Diff for: src/openai/resources/audio/translations.py

+22
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,21 @@
2828
class Translations(SyncAPIResource):
2929
@cached_property
3030
def with_raw_response(self) -> TranslationsWithRawResponse:
31+
"""
32+
This property can be used as a prefix for any HTTP method call to return the
33+
the raw response object instead of the parsed content.
34+
35+
For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
36+
"""
3137
return TranslationsWithRawResponse(self)
3238

3339
@cached_property
3440
def with_streaming_response(self) -> TranslationsWithStreamingResponse:
41+
"""
42+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
43+
44+
For more information, see https://www.github.com/openai/openai-python#with_streaming_response
45+
"""
3546
return TranslationsWithStreamingResponse(self)
3647

3748
def create(
@@ -109,10 +120,21 @@ def create(
109120
class AsyncTranslations(AsyncAPIResource):
110121
@cached_property
111122
def with_raw_response(self) -> AsyncTranslationsWithRawResponse:
123+
"""
124+
This property can be used as a prefix for any HTTP method call to return the
125+
the raw response object instead of the parsed content.
126+
127+
For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
128+
"""
112129
return AsyncTranslationsWithRawResponse(self)
113130

114131
@cached_property
115132
def with_streaming_response(self) -> AsyncTranslationsWithStreamingResponse:
133+
"""
134+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
135+
136+
For more information, see https://www.github.com/openai/openai-python#with_streaming_response
137+
"""
116138
return AsyncTranslationsWithStreamingResponse(self)
117139

118140
async def create(

Diff for: src/openai/resources/batches.py

+22
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,21 @@
2727
class Batches(SyncAPIResource):
2828
@cached_property
2929
def with_raw_response(self) -> BatchesWithRawResponse:
30+
"""
31+
This property can be used as a prefix for any HTTP method call to return the
32+
the raw response object instead of the parsed content.
33+
34+
For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
35+
"""
3036
return BatchesWithRawResponse(self)
3137

3238
@cached_property
3339
def with_streaming_response(self) -> BatchesWithStreamingResponse:
40+
"""
41+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
42+
43+
For more information, see https://www.github.com/openai/openai-python#with_streaming_response
44+
"""
3445
return BatchesWithStreamingResponse(self)
3546

3647
def create(
@@ -221,10 +232,21 @@ def cancel(
221232
class AsyncBatches(AsyncAPIResource):
222233
@cached_property
223234
def with_raw_response(self) -> AsyncBatchesWithRawResponse:
235+
"""
236+
This property can be used as a prefix for any HTTP method call to return the
237+
the raw response object instead of the parsed content.
238+
239+
For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
240+
"""
224241
return AsyncBatchesWithRawResponse(self)
225242

226243
@cached_property
227244
def with_streaming_response(self) -> AsyncBatchesWithStreamingResponse:
245+
"""
246+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
247+
248+
For more information, see https://www.github.com/openai/openai-python#with_streaming_response
249+
"""
228250
return AsyncBatchesWithStreamingResponse(self)
229251

230252
async def create(

Diff for: src/openai/resources/beta/assistants.py

+22
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,21 @@
3535
class Assistants(SyncAPIResource):
3636
@cached_property
3737
def with_raw_response(self) -> AssistantsWithRawResponse:
38+
"""
39+
This property can be used as a prefix for any HTTP method call to return the
40+
the raw response object instead of the parsed content.
41+
42+
For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
43+
"""
3844
return AssistantsWithRawResponse(self)
3945

4046
@cached_property
4147
def with_streaming_response(self) -> AssistantsWithStreamingResponse:
48+
"""
49+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
50+
51+
For more information, see https://www.github.com/openai/openai-python#with_streaming_response
52+
"""
4253
return AssistantsWithStreamingResponse(self)
4354

4455
def create(
@@ -410,10 +421,21 @@ def delete(
410421
class AsyncAssistants(AsyncAPIResource):
411422
@cached_property
412423
def with_raw_response(self) -> AsyncAssistantsWithRawResponse:
424+
"""
425+
This property can be used as a prefix for any HTTP method call to return the
426+
the raw response object instead of the parsed content.
427+
428+
For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
429+
"""
413430
return AsyncAssistantsWithRawResponse(self)
414431

415432
@cached_property
416433
def with_streaming_response(self) -> AsyncAssistantsWithStreamingResponse:
434+
"""
435+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
436+
437+
For more information, see https://www.github.com/openai/openai-python#with_streaming_response
438+
"""
417439
return AsyncAssistantsWithStreamingResponse(self)
418440

419441
async def create(

Diff for: src/openai/resources/beta/beta.py

+22
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,21 @@ def threads(self) -> Threads:
4949

5050
@cached_property
5151
def with_raw_response(self) -> BetaWithRawResponse:
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/openai/openai-python#accessing-raw-response-data-eg-headers
57+
"""
5258
return BetaWithRawResponse(self)
5359

5460
@cached_property
5561
def with_streaming_response(self) -> BetaWithStreamingResponse:
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/openai/openai-python#with_streaming_response
66+
"""
5667
return BetaWithStreamingResponse(self)
5768

5869

@@ -71,10 +82,21 @@ def threads(self) -> AsyncThreads:
7182

7283
@cached_property
7384
def with_raw_response(self) -> AsyncBetaWithRawResponse:
85+
"""
86+
This property can be used as a prefix for any HTTP method call to return the
87+
the raw response object instead of the parsed content.
88+
89+
For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
90+
"""
7491
return AsyncBetaWithRawResponse(self)
7592

7693
@cached_property
7794
def with_streaming_response(self) -> AsyncBetaWithStreamingResponse:
95+
"""
96+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
97+
98+
For more information, see https://www.github.com/openai/openai-python#with_streaming_response
99+
"""
78100
return AsyncBetaWithStreamingResponse(self)
79101

80102

Diff for: src/openai/resources/beta/threads/messages.py

+22
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,21 @@
2929
class Messages(SyncAPIResource):
3030
@cached_property
3131
def with_raw_response(self) -> MessagesWithRawResponse:
32+
"""
33+
This property can be used as a prefix for any HTTP method call to return the
34+
the raw response object instead of the parsed content.
35+
36+
For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
37+
"""
3238
return MessagesWithRawResponse(self)
3339

3440
@cached_property
3541
def with_streaming_response(self) -> MessagesWithStreamingResponse:
42+
"""
43+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
44+
45+
For more information, see https://www.github.com/openai/openai-python#with_streaming_response
46+
"""
3647
return MessagesWithStreamingResponse(self)
3748

3849
def create(
@@ -292,10 +303,21 @@ def delete(
292303
class AsyncMessages(AsyncAPIResource):
293304
@cached_property
294305
def with_raw_response(self) -> AsyncMessagesWithRawResponse:
306+
"""
307+
This property can be used as a prefix for any HTTP method call to return the
308+
the raw response object instead of the parsed content.
309+
310+
For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
311+
"""
295312
return AsyncMessagesWithRawResponse(self)
296313

297314
@cached_property
298315
def with_streaming_response(self) -> AsyncMessagesWithStreamingResponse:
316+
"""
317+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
318+
319+
For more information, see https://www.github.com/openai/openai-python#with_streaming_response
320+
"""
299321
return AsyncMessagesWithStreamingResponse(self)
300322

301323
async def create(

Diff for: src/openai/resources/beta/threads/runs/runs.py

+22
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,21 @@ def steps(self) -> Steps:
5252

5353
@cached_property
5454
def with_raw_response(self) -> RunsWithRawResponse:
55+
"""
56+
This property can be used as a prefix for any HTTP method call to return the
57+
the raw response object instead of the parsed content.
58+
59+
For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
60+
"""
5561
return RunsWithRawResponse(self)
5662

5763
@cached_property
5864
def with_streaming_response(self) -> RunsWithStreamingResponse:
65+
"""
66+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
67+
68+
For more information, see https://www.github.com/openai/openai-python#with_streaming_response
69+
"""
5970
return RunsWithStreamingResponse(self)
6071

6172
@overload
@@ -889,10 +900,21 @@ def steps(self) -> AsyncSteps:
889900

890901
@cached_property
891902
def with_raw_response(self) -> AsyncRunsWithRawResponse:
903+
"""
904+
This property can be used as a prefix for any HTTP method call to return the
905+
the raw response object instead of the parsed content.
906+
907+
For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
908+
"""
892909
return AsyncRunsWithRawResponse(self)
893910

894911
@cached_property
895912
def with_streaming_response(self) -> AsyncRunsWithStreamingResponse:
913+
"""
914+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
915+
916+
For more information, see https://www.github.com/openai/openai-python#with_streaming_response
917+
"""
896918
return AsyncRunsWithStreamingResponse(self)
897919

898920
@overload

0 commit comments

Comments
 (0)