send method

Future<void> send({
  1. Content? input,
  2. bool turnComplete = false,
})

Sends content to the server.

input (optional): The content to send. turnComplete (optional): Indicates if the turn is complete. Defaults to false.

Implementation

Future<void> send({
  Content? input,
  bool turnComplete = false,
}) async {
  _checkWsStatus();
  var clientMessage = input != null
      ? LiveClientContent(turns: [input], turnComplete: turnComplete)
      : LiveClientContent(turnComplete: turnComplete);
  var clientJson = jsonEncode(clientMessage.toJson());
  _ws.sink.add(clientJson);
}