generateContentStream method

  1. @experimental
Stream<GenerateContentResponse> generateContentStream(
  1. String templateId, {
  2. required Map<String, Object?> inputs,
  3. TemplateToolConfig? toolConfig,
})

Generates a stream of content responding to templateId and inputs.

Sends a "templateStreamGenerateContent" API request for the server template, and waits for the response.

Implementation

@experimental
Stream<GenerateContentResponse> generateContentStream(String templateId,
    {required Map<String, Object?> inputs, TemplateToolConfig? toolConfig}) {
  return streamTemplateRequest(
      TemplateTask.templateStreamGenerateContent,
      templateId,
      inputs,
      null, // history
      null, // tools
      toolConfig,
      _serializationStrategy.parseGenerateContentResponse);
}