TemplateGenerativeModel class final

A generative model that connects to a remote server template.

Available extensions
Annotations
  • @experimental

Properties

client → ApiClient
The API client.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
model → ({String name, String prefix})
The normalized model name.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

generateContent(String templateId, {required Map<String, Object?> inputs, TemplateToolConfig? toolConfig}) Future<GenerateContentResponse>
Generates content from a template with the given templateId and inputs.
generateContentStream(String templateId, {required Map<String, Object?> inputs, TemplateToolConfig? toolConfig}) Stream<GenerateContentResponse>
Generates a stream of content responding to templateId and inputs.
makeRequest<T>(Task task, Map<String, Object?> params, T parse(Map<String, Object?>)) Future<T>
Make a unary request for task with JSON encodable params.
inherited
makeTemplateRequest<T>(TemplateTask task, String templateId, Map<String, Object?>? inputs, Iterable<Content>? history, List<TemplateTool>? tools, TemplateToolConfig? toolConfig, T parse(Map<String, Object?>)) Future<T>
Makes a unary request to a template-based API.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
startChat(String templateId, {required Map<String, Object?> inputs, List<Content>? history, List<TemplateTool>? tools, TemplateToolConfig? toolConfig, int? maxTurns}) TemplateChatSession

Available on TemplateGenerativeModel, provided by the StartTemplateChatExtension extension

Starts a TemplateChatSession that will use this model to respond to messages.
streamTemplateRequest<T>(TemplateTask task, String templateId, Map<String, Object?>? inputs, Iterable<Content>? history, List<TemplateTool>? tools, TemplateToolConfig? toolConfig, T parse(Map<String, Object?>)) Stream<T>
Makes a streaming request to a template-based API.
inherited
taskUri(Task task) Uri
Returns a URI for the given task.
inherited
templateGenerateContentWithHistory(Iterable<Content> history, String templateId, {required Map<String, Object?> inputs, List<TemplateTool>? tools, TemplateToolConfig? toolConfig}) Future<GenerateContentResponse>
Generates content from a template with the given templateId, inputs and history.
templateGenerateContentWithHistoryStream(Iterable<Content> history, String templateId, {required Map<String, Object?> inputs, List<TemplateTool>? tools, TemplateToolConfig? toolConfig}) Stream<GenerateContentResponse>
Generates a stream of content from a template with the given templateId, inputs and history.
templateName(String templateId) String
Returns the template name for the given templateId.
inherited
templateTaskUri(TemplateTask task, String templateId) Uri
Returns the URI for the given task and templateId.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited