ion7-llm / stop

module

stop

Functions

Stop.new

Stop.new(opts)
optstable?
→ ion7.llm.Stop

Stop:feed

Append a piece, then probe the buffer for any registered stop string. Returns the matched stop and its position when one fires, nil otherwise.

Stop:feed(piece)
piecestring
→ string?matched_stop
→ integer?position

Stop:text_before

Text accumulated before the matched stop string. Call right after `:feed` returns a hit when you need the assistant's reply minus the stop marker.

Stop:text_before(stop)
stopstring
→ string

Stop:reset

Wipe the rolling buffer. Call between generations.

Stop:reset()

Stop:add

Add an additional stop string at runtime. The list is re-sorted so the new entry slots into the right longest-first position.

Stop:add(s)
sstring

Stop:list

Snapshot of the active stop-string list.

Stop:list()
→ string[]