createSession method

  1. @override
Future<String> createSession({
  1. String? systemInstruction,
  2. List<OnDeviceAiTool>? tools,
  3. GenerationConfig? config,
})
override

Creates a conversation and returns its id.

tools is non-null only when the backend reported native tool calling.

Implementation

@override
Future<String> createSession({
  String? systemInstruction,
  List<OnDeviceAiTool>? tools,
  GenerationConfig? config,
}) async {
  final id = 'fake_${++_counter}';
  createdSessions.add(id);
  sessions[id] = FakeSession(systemInstruction, tools);
  return id;
}