Đối tượng kết quả được trả về từ lệnh gọi GenerativeModel.generateContentStream(). Lặp lại stream
để nhận các phân đoạn khi chúng được đưa vào và/hoặc sử dụng lời hứa response
để nhận được phản hồi tổng hợp khi luồng hoàn tất.
Chữ ký:
export interface GenerateContentStreamResult
Thuộc tính
Tài sản | Loại | Mô tả |
---|---|---|
phản hồi | Cam kết<AdvancedGenerateContentResponse> | |
luồng | AsyncGenerator<CopyrightGenerateContentResponse> |
generateContentStreamResult.response
Chữ ký:
response: Promise<EnhancedGenerateContentResponse>;
CreateContentStreamResult.stream
Chữ ký:
stream: AsyncGenerator<EnhancedGenerateContentResponse>;