GenerateContentStreamResult interface

Obiekt wyniku zwrócony przez wywołanie funkcji GenerativeModel.generateContentStream(). Przesyłaj iteracje ponad stream, aby pobierać fragmenty na bieżąco, lub użyj funkcji response, aby uzyskać zagregowaną odpowiedź po zakończeniu strumienia.

Podpis:

export interface GenerateContentStreamResult 

Właściwości

Właściwość Typ Opis
odpowiedź Obietnica<EnhancedGenerateContentResponse>
transmisja AsyncGenerator<enhancedGenerateContentResponse>

GenerateContentStreamResult.response

Podpis:

response: Promise<EnhancedGenerateContentResponse>;

GenerateContentStreamResult.stream

Podpis:

stream: AsyncGenerator<EnhancedGenerateContentResponse>;