NOTE This feature requires theTo receive sequence updates provide a callback via Instructor’sstream
option to be set totrue
.
onSequenceUpdate()
that will be called each time a new item is received from LLM.
The callback provided a full sequence that has been retrieved so far. You can
get the last added object from the sequence via $sequence->last()
.
Remember that while the sequence is being updated, the data is not validated -
only when the sequence is fully extracted, the objects are validated and a full
sequence is returned (see example below).