![]() |
This is the async version of genai.GenerateContentResponse
.
google.generativeai.types.AsyncGenerateContentResponse(
done: bool,
iterator: (None | Iterable[protos.GenerateContentResponse] | AsyncIterable[protos.
GenerateContentResponse]),
result: protos.GenerateContentResponse,
chunks: (Iterable[protos.GenerateContentResponse] | None) = None
)
from_aiterator
from_aiterator(
iterator
)
from_response
@classmethod
from_response( response: protos.GenerateContentResponse )
resolve
resolve()
to_dict
to_dict()
Returns the result as a JSON-compatible dict.
Note: This doesn’t capture the iterator state when streaming, it only captures the accumulated
GenerateContentResponse
fields.
>>> import json
>>> response = model.generate_content('Hello?')
>>> json.dumps(response.to_dict())