parser

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONSchemaParser

type JSONSchemaParser struct {
	Schema   map[string]interface{}
	Required []string
}

JSONSchemaParser parses LLM output based on a JSON schema

func NewJSONSchemaParser

func NewJSONSchemaParser(schema map[string]interface{}) *JSONSchemaParser

NewJSONSchemaParser creates a new JSON schema parser

func (*JSONSchemaParser) GetFormatInstructions

func (p *JSONSchemaParser) GetFormatInstructions() string

func (*JSONSchemaParser) Parse

func (p *JSONSchemaParser) Parse(output string) (interface{}, error)

type StructuredOutputParser

type StructuredOutputParser struct {
	Parsers []types.OutputParser
}

StructuredOutputParser combines multiple parsers for complex output

func NewStructuredOutputParser

func NewStructuredOutputParser(parsers ...types.OutputParser) *StructuredOutputParser

func (*StructuredOutputParser) GetFormatInstructions

func (p *StructuredOutputParser) GetFormatInstructions() string

func (*StructuredOutputParser) Parse

func (p *StructuredOutputParser) Parse(output string) (interface{}, error)

type ToolCallParser

type ToolCallParser struct {
	Tools []types.Tool
}

ToolCallParser parses tool calls from LLM output

func NewToolCallParser

func NewToolCallParser(tools []types.Tool) *ToolCallParser

func (*ToolCallParser) GetFormatInstructions

func (p *ToolCallParser) GetFormatInstructions() string

func (*ToolCallParser) Parse

func (p *ToolCallParser) Parse(output string) (interface{}, error)

Jump to

Keyboard shortcuts

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