createSession method

  1. @override
Future<void> createSession({
  1. required int sessionId,
  2. required double temperature,
  3. required int topK,
  4. double? topP,
  5. int? maxOutputTokens,
  6. String? systemInstruction,
  7. List<LocalAiTool>? tools,
})
override

Implementation

@override
Future<void> createSession({
  required int sessionId,
  required double temperature,
  required int topK,
  double? topP,
  int? maxOutputTokens,
  String? systemInstruction,
  List<LocalAiTool>? tools,
}) async {
  calls.add('createSession');
  final error = createSessionError;
  if (error != null) throw error;
  sessions.add(
    FakeLocalAiSession(
      id: sessionId,
      temperature: temperature,
      topK: topK,
      topP: topP,
      maxOutputTokens: maxOutputTokens,
      systemInstruction: systemInstruction,
      toolNames: [for (final tool in tools ?? const []) tool.name],
    ),
  );
}