createSession method

Future<void> createSession({
  1. required double temperature,
  2. required int randomSeed,
  3. required int topK,
  4. double? topP,
  5. String? loraPath,
  6. bool? enableVisionModality,
  7. bool? enableAudioModality,
  8. String? systemInstruction,
  9. bool? enableThinking,
})

Implementation

Future<void> createSession({
  required double temperature,
  required int randomSeed,
  required int topK,
  double? topP,
  String? loraPath,
  bool? enableVisionModality,
  bool? enableAudioModality,
  String? systemInstruction,
  bool? enableThinking,
}) async {
  final String pigeonVar_channelName =
      'dev.flutter.pigeon.flutter_gemma.PlatformService.createSession$pigeonVar_messageChannelSuffix';
  final BasicMessageChannel<Object?> pigeonVar_channel =
      BasicMessageChannel<Object?>(
    pigeonVar_channelName,
    pigeonChannelCodec,
    binaryMessenger: pigeonVar_binaryMessenger,
  );
  final List<Object?>? pigeonVar_replyList =
      await pigeonVar_channel.send(<Object?>[
    temperature,
    randomSeed,
    topK,
    topP,
    loraPath,
    enableVisionModality,
    enableAudioModality,
    systemInstruction,
    enableThinking
  ]) as List<Object?>?;
  if (pigeonVar_replyList == null) {
    throw _createConnectionError(pigeonVar_channelName);
  } else if (pigeonVar_replyList.length > 1) {
    throw PlatformException(
      code: pigeonVar_replyList[0]! as String,
      message: pigeonVar_replyList[1] as String?,
      details: pigeonVar_replyList[2],
    );
  } else {
    return;
  }
}