conversationForTest function

Conversation conversationForTest(
  1. ConversationHandle handle, {
  2. ConversationConfig? config,
  3. bool engineClosed()?,
  4. Set<void Function()>? engineCloseListeners,
})

A conversation over handle, for tests that drive it with a fake; a test calls engineCloseListeners as an engine's close would.

Implementation

Conversation conversationForTest(
  ConversationHandle handle, {
  ConversationConfig? config,
  bool Function()? engineClosed,
  Set<void Function()>? engineCloseListeners,
}) => Conversation._(
  handle,
  config: config ?? ConversationConfig(),
  thinkingTokenBudgetCapsNothing: () {},
  engineClosed: engineClosed ?? () => false,
  engineCloseListeners: engineCloseListeners ?? {},
);