Skip to content

Commit 15bc434

Browse files
authored
docs: Correct GenerateContentResponse type documentation, remove async keyword (#140)
1 parent 8f05227 commit 15bc434

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

google/generativeai/types/generation_types.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -351,27 +351,27 @@ def rewrite_stream_error():
351351
)
352352

353353

354-
GENERATE_CONTENT_RESPONSE_DOC = """Instances of this class manage the response of the `generate_content_async` method.
354+
GENERATE_CONTENT_RESPONSE_DOC = """Instances of this class manage the response of the `generate_content` method.
355355
356-
These are returned by `GenerativeModel.generate_content_async` and `ChatSession.send_message_async`.
356+
These are returned by `GenerativeModel.generate_content` and `ChatSession.send_message`.
357357
This object is based on the low level `glm.GenerateContentResponse` class which just has `prompt_feedback`
358358
and `candidates` attributes. This class adds several quick accessors for common use cases.
359359
360360
The same object type is returned for both `stream=True/False`.
361361
362362
### Streaming
363363
364-
When you pass `stream=True` to `GenerativeModel.generate_content_async` or `ChatSession.send_message_async`,
364+
When you pass `stream=True` to `GenerativeModel.generate_content` or `ChatSession.send_message`,
365365
iterate over this object to receive chunks of the response:
366366
367367
```
368-
response = model.generate_content_async(..., stream=True):
369-
async for chunk in response:
368+
response = model.generate_content(..., stream=True):
369+
for chunk in response:
370370
print(chunk.text)
371371
```
372372
373-
`AsyncGenerateContentResponse.prompt_feedback` is available immediately but
374-
`AsyncGenerateContentResponse.candidates`, and all the attributes derived from them (`.text`, `.parts`),
373+
`GenerateContentResponse.prompt_feedback` is available immediately but
374+
`GenerateContentResponse.candidates`, and all the attributes derived from them (`.text`, `.parts`),
375375
are only available after the iteration is complete.
376376
"""
377377

0 commit comments

Comments
 (0)