parsers

package
v0.0.0-...-f8640d3 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Overview

Package parsers contains an interface Parser and implementations used to parse the output of the LLM.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser[TResp any] interface {
	Parse(string) (TResp, error)
}

Parser is an interface that parses a response from an LLM to the given type.

func NewJSONParser

func NewJSONParser[T any]() Parser[T]

NewJSONParser returns a Parser that parses JSON to the given type.

func NewTextParser

func NewTextParser() Parser[string]

NewTextParser returns a parser that simply returns the raw string input.

Directories

Path Synopsis
Package testing provides a fake parser for testing.
Package testing provides a fake parser for testing.

Jump to

Keyboard shortcuts

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