Mead.Session.Turn (mead v0.1.1)

Copy Markdown View Source

One exchange in a conversation: the input, the output once known, and how it ended.

Summary

Functions

Closes a turn with its final status and, when there is one, its output.

Marks a turn that was still in progress as interrupted; any other turn is unchanged.

Builds a turn that has just started and has no output yet.

Types

status()

@type status() :: :in_progress | :ok | :failed | :timeout | :interrupted

t()

@type t() :: %Mead.Session.Turn{
  input: term(),
  output: term(),
  started_at: DateTime.t(),
  status: status()
}

Functions

finish(turn, status, output \\ nil)

@spec finish(t(), status(), term()) :: t()

Closes a turn with its final status and, when there is one, its output.

interrupt(turn)

@spec interrupt(t()) :: t()

Marks a turn that was still in progress as interrupted; any other turn is unchanged.

start(input)

@spec start(term()) :: t()

Builds a turn that has just started and has no output yet.