Documentation
¶
Index ¶
- Variables
- func BaseNameFromFuncName(full string) string
- func FormatToolDisplayLines(name string, rawArgs json.RawMessage) []string
- func FuncName(fn any) (string, error)
- func FuncSignature(fn any) (string, error)
- func LegacyProseOutsideToolCalls(text string) string
- func StripLegacyToolBlocks(text string) string
- func UserFacingLegacyToolError(err error) string
- func ValidateInvocationNames(invs []Invocation, allowed map[string]struct{}) error
- func ValidateLegacyToolLines(text string) error
- type FormatToolLinesFunc
- type Invocation
- type LegacyStreamWriter
- func (w *LegacyStreamWriter) DisplayRendered() bool
- func (w *LegacyStreamWriter) Flush() error
- func (w *LegacyStreamWriter) HasOpenToolCalls() bool
- func (w *LegacyStreamWriter) Invocations() []Invocation
- func (w *LegacyStreamWriter) TruncatedContent() string
- func (w *LegacyStreamWriter) Write(p []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrLegacyToolBlockComplete = errors.New("legacy tool_calls block complete")
View Source
var ErrMalformedLegacyTool = errors.New("malformed legacy tool block")
View Source
var ErrUnknownLegacyTool = errors.New("unknown legacy tool name")
Functions ¶
func BaseNameFromFuncName ¶
func FormatToolDisplayLines ¶ added in v0.20260525.0
func FormatToolDisplayLines(name string, rawArgs json.RawMessage) []string
func FuncSignature ¶
func LegacyProseOutsideToolCalls ¶ added in v0.20260525.0
func StripLegacyToolBlocks ¶ added in v0.20260525.0
func UserFacingLegacyToolError ¶ added in v0.20260525.0
func ValidateInvocationNames ¶ added in v0.20260523.0
func ValidateInvocationNames(invs []Invocation, allowed map[string]struct{}) error
func ValidateLegacyToolLines ¶ added in v0.20260523.0
Types ¶
type FormatToolLinesFunc ¶ added in v0.20260523.0
type FormatToolLinesFunc func(name string, args json.RawMessage) []string
type Invocation ¶
type Invocation struct {
Name string
Args json.RawMessage
}
func ExtractToolInvocations ¶
func ExtractToolInvocations(text string) ([]Invocation, error)
func ParseToolCallsBlock ¶ added in v0.20260523.0
func ParseToolCallsBlock(block string) ([]Invocation, error)
type LegacyStreamWriter ¶ added in v0.20260523.0
type LegacyStreamWriter struct {
Out io.Writer
Format FormatToolLinesFunc
Allowed map[string]struct{}
// contains filtered or unexported fields
}
func NewLegacyStreamWriter ¶ added in v0.20260523.0
func NewLegacyStreamWriter(out io.Writer, format FormatToolLinesFunc, allowed map[string]struct{}) *LegacyStreamWriter
func (*LegacyStreamWriter) DisplayRendered ¶ added in v0.20260523.0
func (w *LegacyStreamWriter) DisplayRendered() bool
func (*LegacyStreamWriter) Flush ¶ added in v0.20260523.0
func (w *LegacyStreamWriter) Flush() error
func (*LegacyStreamWriter) HasOpenToolCalls ¶ added in v0.20260523.0
func (w *LegacyStreamWriter) HasOpenToolCalls() bool
func (*LegacyStreamWriter) Invocations ¶ added in v0.20260523.0
func (w *LegacyStreamWriter) Invocations() []Invocation
func (*LegacyStreamWriter) TruncatedContent ¶ added in v0.20260523.0
func (w *LegacyStreamWriter) TruncatedContent() string
Click to show internal directories.
Click to hide internal directories.