createSession method

Future<Session> createSession([
  1. SessionConfig sessionConfig = const SessionConfig()
])

Creates a new lower-level session from the initialized engine.

Implementation

Future<Session> createSession([
  SessionConfig sessionConfig = const SessionConfig(),
]) async {
  _ensureInitialized();
  try {
    final handle = await LiteRtLmNativeRuntime.instance.createSession(
      _handle,
      sessionConfig,
    );
    return Session._(handle);
  } on LiteRtLmNativeException {
    _state = _EngineState.failed;
    rethrow;
  }
}