parser

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ParseResult

type ParseResult struct {
	ToolCall    *ToolCall `json:"tool_call,omitempty"`
	FinalAnswer string    `json:"final_answer,omitempty"`
	RawText     string    `json:"raw_text"`
	Confidence  float64   `json:"confidence"`
}

ParseResult represents the result of parsing LLM output

type ReActParser

type ReActParser struct {
	// contains filtered or unexported fields
}

ReActParser handles parsing of ReAct-style outputs with multiple fallback strategies

func NewReActParser

func NewReActParser(modelName string, strict bool) *ReActParser

NewReActParser creates a new parser with the specified configuration

func (*ReActParser) Parse

func (p *ReActParser) Parse(text string) (*ParseResult, error)

Parse attempts to parse the LLM output using multiple strategies

type ToolCall

type ToolCall struct {
	Thought     string         `json:"thought"`
	Action      string         `json:"action"`
	ActionInput map[string]any `json:"action_input"`
}

ToolCall represents a parsed tool call

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL