eval

package
v0.0.0-...-41187c1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicMatch

type BasicMatch struct {
	// The system message to provide context.
	//
	// Example: "You are about to be asked a question. Please answer as concisely as possible."
	SystemContent string `hcl:"system,attr"`

	// The user message containing the instruction.
	//
	// Example: "OpenAI was founded in 20"
	UserContent string `hcl:"user,attr"`

	// The ideal response.
	//
	// Example: "15"
	Ideal string `hcl:"ideal,attr"`
}

BasicMatch contains the data for an OpenAI "evals.elsuite.basic.match:Match" evaluation.

func (*BasicMatch) MarshalJSON

func (e *BasicMatch) MarshalJSON() ([]byte, error)

MarshalJSON is a custom JSON marshaler for the BasicMatch struct.

type BasicMatches

type BasicMatches []*BasicMatch

BasicMatches is a slice of EvalBasicMatch that can be marshaled to JSONL.

func ReadHCL

func ReadHCL(path string) (BasicMatches, error)

ReadHCL reads the HCL file at the given path and returns the BasicMatches slice.

func (BasicMatches) WriteFile

func (bms BasicMatches) WriteFile(path string) error

MarshalJSON is a custom JSON marshaler for the EvalBasicMatches slice, printing each evaluation on a new line.

type DataTemplate

type DataTemplate struct {
	Input []*openai.ChatMessage `json:"input"`
	Ideal string                `json:"ideal"`
}

DataTemplate is a template for the JSON data generated by all evaluation types.

Jump to

Keyboard shortcuts

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