@@ -351,27 +351,27 @@ def rewrite_stream_error():
351
351
)
352
352
353
353
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.
355
355
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 `.
357
357
This object is based on the low level `glm.GenerateContentResponse` class which just has `prompt_feedback`
358
358
and `candidates` attributes. This class adds several quick accessors for common use cases.
359
359
360
360
The same object type is returned for both `stream=True/False`.
361
361
362
362
### Streaming
363
363
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 `,
365
365
iterate over this object to receive chunks of the response:
366
366
367
367
```
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:
370
370
print(chunk.text)
371
371
```
372
372
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`),
375
375
are only available after the iteration is complete.
376
376
"""
377
377
0 commit comments