Documentation
¶
Index ¶
- Constants
- func ActionDisplayName(action types.Action) string
- func Truncate(s string, maxLen int) string
- type StatusAccumulator
- func (a *StatusAccumulator) AppendReasoning(reasoning string)
- func (a *StatusAccumulator) AppendToolCall(actionName string, params string)
- func (a *StatusAccumulator) AppendToolResult(actionName string, result string)
- func (a *StatusAccumulator) BuildMessage(thinkingPrefix string, maxTotalLen int) string
Constants ¶
const ( // MaxParamsLen is the maximum length for params in "Calling tool X with parameters: ..." MaxParamsLen = 400 // MaxResultLen is the maximum length for result in "Result of X: ..." MaxResultLen = 500 )
Variables ¶
This section is empty.
Functions ¶
func ActionDisplayName ¶
ActionDisplayName returns the action's display name for status messages, or "Tool" if nil.
Types ¶
type StatusAccumulator ¶
type StatusAccumulator struct {
// contains filtered or unexported fields
}
StatusAccumulator holds accumulated status lines for a job's placeholder message. Callers (connectors) are responsible for mutex and for clearing when the job ends.
func NewStatusAccumulator ¶
func NewStatusAccumulator() *StatusAccumulator
NewStatusAccumulator returns a new accumulator.
func (*StatusAccumulator) AppendReasoning ¶
func (a *StatusAccumulator) AppendReasoning(reasoning string)
AppendReasoning appends a "Current thought: ..." line when reasoning is non-empty.
func (*StatusAccumulator) AppendToolCall ¶
func (a *StatusAccumulator) AppendToolCall(actionName string, params string)
AppendToolCall appends a "Calling tool X with parameters: ..." line (params truncated).
func (*StatusAccumulator) AppendToolResult ¶
func (a *StatusAccumulator) AppendToolResult(actionName string, result string)
AppendToolResult appends a "Result of X: ..." line (result truncated).
func (*StatusAccumulator) BuildMessage ¶
func (a *StatusAccumulator) BuildMessage(thinkingPrefix string, maxTotalLen int) string
BuildMessage returns thinkingPrefix + "\n\n" + joined lines, truncated to maxTotalLen if needed. If over the limit, the message is truncated from the start (oldest content dropped) so the latest lines stay visible.