startChat method
TemplateChatSession
startChat(
- String templateId, {
- required Map<
String, Object?> inputs, - List<
Content> ? history, - List<
TemplateTool> ? tools, - TemplateToolConfig? toolConfig,
- int? maxTurns,
Starts a TemplateChatSession that will use this model to respond to messages.
final chat = model.startChat('my_template', inputs: {'language': 'en'});
final response = await chat.sendMessage(Content.text('Hello there.'));
print(response.text);
Implementation
TemplateChatSession startChat(String templateId,
{required Map<String, Object?> inputs,
List<Content>? history,
List<TemplateTool>? tools,
TemplateToolConfig? toolConfig,
int? maxTurns}) =>
TemplateChatSession._(
templateGenerateContentWithHistory,
templateGenerateContentWithHistoryStream,
templateId,
inputs,
history ?? [],
tools ?? [],
toolConfig,
maxTurns ?? 5);