51 lines
1.2 KiB
Go
51 lines
1.2 KiB
Go
package tool
|
|
|
|
import "nub/internal/llm"
|
|
|
|
// UIEvent ist der einzige Kanal, über den Kern-Pakete Ausgabe erzeugen (E-04).
|
|
// Print-Modus, JSON-Modus und TUI sind dünne Consumer davon.
|
|
type UIEvent interface{ isUIEvent() }
|
|
|
|
type TextDelta struct{ Text string }
|
|
type ThinkingDelta struct{ Text string }
|
|
|
|
type ToolCallStart struct {
|
|
ID string
|
|
Name string
|
|
Input []byte
|
|
}
|
|
|
|
type ToolCallOutput struct {
|
|
ID string
|
|
Name string
|
|
Result Result
|
|
}
|
|
|
|
// ToolStream trägt Zwischenausgabe eines laufenden Tools (z.B. bash-stdout).
|
|
type ToolStream struct {
|
|
ID string
|
|
Text string
|
|
}
|
|
|
|
type TurnDone struct {
|
|
Stop llm.StopReason
|
|
Usage llm.Usage
|
|
}
|
|
|
|
type ErrorEvent struct{ Err error }
|
|
|
|
// CompactionEvent meldet eine abgeschlossene Auto- oder manuelle Compaction
|
|
// (5.7): wie viele Nodes durch die Zusammenfassung ersetzt wurden.
|
|
type CompactionEvent struct {
|
|
ReplacedNodes int
|
|
SummaryTokens int
|
|
}
|
|
|
|
func (TextDelta) isUIEvent() {}
|
|
func (ThinkingDelta) isUIEvent() {}
|
|
func (ToolCallStart) isUIEvent() {}
|
|
func (ToolCallOutput) isUIEvent() {}
|
|
func (ToolStream) isUIEvent() {}
|
|
func (TurnDone) isUIEvent() {}
|
|
func (ErrorEvent) isUIEvent() {}
|
|
func (CompactionEvent) isUIEvent() {}
|