Skip to content

Commit

Permalink
Fix lint.
Browse files Browse the repository at this point in the history
  • Loading branch information
jlewi committed May 3, 2024
1 parent de1de31 commit 8fd8116
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion app/pkg/agent/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"os"
"testing"

"github.com/jlewi/foyle/app/api"

"github.com/jlewi/foyle/app/pkg/config"
"github.com/jlewi/foyle/app/pkg/oai"
"github.com/jlewi/foyle/protos/go/foyle/v1alpha1"
Expand Down Expand Up @@ -71,7 +73,7 @@ func Test_Generate(t *testing.T) {
t.Fatalf("Error creating OpenAI client; %v", err)
}

cfg.Agent.RAG = &config.RAGConfig{
cfg.Agent.RAG = &api.RAGConfig{
MaxResults: 3,
}
cfg.Agent.RAG.Enabled = true
Expand Down
7 changes: 3 additions & 4 deletions app/pkg/eval/evaluator.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package eval

import (
"context"
"fmt"
"os"
"path/filepath"

Expand Down Expand Up @@ -351,7 +350,7 @@ func (e *Evaluator) updateGoogleSheet(ctx context.Context, experiment api.Experi
}

// Prepare the value range to write
writeRange := fmt.Sprintf("%s", sheetName)
writeRange := sheetName
values := [][]interface{}{{"id", "prompt", "actual", "expected", "distance"}}

iter, err := db.NewIterWithContext(ctx, nil)
Expand Down Expand Up @@ -443,7 +442,7 @@ func (e *Evaluator) findUnloadedFiles(ctx context.Context, db *pebble.DB, files
// listEvalFiles returns a list of the all the Foyle files in the eval directory.
func (e *Evaluator) listEvalFiles(ctx context.Context, evalDir string) ([]string, error) {
examples := make([]string, 0, 100)
filepath.Walk(evalDir, func(path string, info os.FileInfo, err error) error {
err := filepath.Walk(evalDir, func(path string, info os.FileInfo, err error) error {
if info.IsDir() {
return nil
}
Expand All @@ -456,7 +455,7 @@ func (e *Evaluator) listEvalFiles(ctx context.Context, evalDir string) ([]string
return nil
})

return examples, nil
return examples, err
}

// loadFoyleFiles loads a bunch of Foyle files representing evaluation data and converts them into example
Expand Down

0 comments on commit 8fd8116

Please sign in to comment.