View Source Anthropic.Messages.StreamAccumulator (anthropic_community v0.5.0)

Folds a stream of Anthropic.Messages.StreamEvent structs (as produced by Anthropic.Messages.stream/2) into a final Anthropic.Messages.Message — the streaming equivalent of Anthropic.Messages.create/2's return value.

Summary

Functions

Link to this function

accumulate(event_stream)

View Source
@spec accumulate(Enumerable.t()) ::
  {:ok, Anthropic.Messages.Message.t()} | {:error, Anthropic.Error.t()}