Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
natexcvi authored Aug 16, 2023
1 parent 38ad867 commit bfab09f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion evaluation/agent_evaluator.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type agentRunner[Input, Output any] struct {
agent agents.Agent[Input, Output]
}

// NewAgentRunner returns a new agent runner that can be used to evaluate the output.
// Returns a new agent runner that can be used to evaluate the output.
func NewAgentRunner[Input, Output any](agent agents.Agent[Input, Output]) Runner[Input, Output] {
return &agentRunner[Input, Output]{
agent: agent,
Expand Down
10 changes: 5 additions & 5 deletions evaluation/evaluator.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"github.com/samber/mo"
)

// GoodnessFunction is a function that takes an input, an output and an error and returns a float64
// which represents the goodness level of the output.
// GoodnessFunction is a function that takes an input, an output and an error (if one occurred) and returns a float64
// which represents the goodness score of the output.
type GoodnessFunction[Input, Output any] func(input Input, output Output, err error) float64

// Options is a struct that contains the options for the evaluator.
Expand All @@ -30,17 +30,17 @@ type Evaluator[Input, Output any] struct {
runner Runner[Input, Output]
}

// NewEvaluator is a function that returns a new Evaluator.
// Creates a new `Evaluator` with the provided configuration.
func NewEvaluator[Input, Output any](runner Runner[Input, Output], options *Options[Input, Output]) *Evaluator[Input, Output] {
return &Evaluator[Input, Output]{
options: options,
runner: runner,
}
}

// Evaluate is a function that runs the tests and evaluates the outputs. It receives a test pack
// Runs the tests and evaluates the outputs. The function receives a test pack
// which is a slice of inputs and returns a slice of float64 which represents the goodness level
// of each output.
// of each respective output.
func (e *Evaluator[Input, Output]) Evaluate(testPack []Input) []float64 {
repetitionChannels := make([]chan []float64, e.options.Repetitions)

Expand Down
2 changes: 1 addition & 1 deletion evaluation/llm_evaluator.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type llmRunner struct {
llm engines.LLM
}

// NewLLMRunner returns a new llm runner that can be used to evaluate the output.
// Returns a new llm runner that can be used to evaluate the output.
func NewLLMRunner(llm engines.LLM) Runner[*engines.ChatPrompt, *engines.ChatMessage] {
return &llmRunner{
llm: llm,
Expand Down

0 comments on commit bfab09f

Please sign in to comment.