close method

Future<void> close()

Closes every conversation — each waits, at most 30 s, for its generation to end — and deletes the engine, after any conversation still being created. A reply still streaming ends with ConversationClosedException; a later send on any of its conversations, and every other call on the engine, is a StateError. Fails with the page's LiteRtLmPagePoisonedError when a stopped generation never ended: the engine is then left to the page (its delete would wait on that generation for good).

Implementation

Future<void> close() => _closing ??= _close();