Documentation
¶
Overview ¶
Package markup lifts a model's tool calls out of assistant text.
A model writes a tool call in its own markup — DeepSeek's DSML or its fenced form, Qwen's and Hermes's <tool_call> JSON. The stack serving the model turns that markup into structured tool_calls, and when it misses (the model wrote prose first, then the block) the markup arrives as content and the caller never sees a call. Lift and Scanner do that parse here.
A call is lifted only when its name is one the request offered, and a block with any invalid invoke is left as the text it arrived as: this never invents a call.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner is Lift over a stream of content deltas. Text passes through as soon as it cannot be the start of a block; from the first byte that could begin one, the scanner holds until it can decide. Whitespace beside a lifted block is dropped, so the text a stream yields equals the text Lift returns, whatever the split.
func NewScanner ¶
NewScanner returns a scanner lifting calls named in offered.
func (*Scanner) Feed ¶
Feed takes the next delta and returns the text now known to be text, and the calls completed by it.