Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make logging requests/responses of LLM queries more human-readable for now #14

Merged
merged 3 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions cmd/eval-symflower-codegen-testing/cmd/evaluate.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,6 @@ func (command *Evaluate) Execute(args []string) (err error) {
}

for _, modelID := range command.Models {
ps := problemsPerModel[modelID]
if len(ps) > 0 {
log.Printf("Problems for %q:", modelID)
for _, p := range ps {
log.Printf("%+v:", p)
}
}

log.Printf("Evaluation score for %q: %s", modelID, metricsPerModel[modelID])
}

Expand Down
6 changes: 3 additions & 3 deletions model/llm/llm.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (m *llm) GenerateTestsForFile(language language.Language, repositoryPath st

importPath := filepath.Join(filepath.Base(repositoryPath), filepath.Dir(filePath))

message, err := llmGenerateTestForFilePrompt(&llmGenerateTestForFilePromptContext{
request, err := llmGenerateTestForFilePrompt(&llmGenerateTestForFilePromptContext{
Language: language,

Code: fileContent,
Expand All @@ -97,11 +97,11 @@ func (m *llm) GenerateTestsForFile(language language.Language, repositoryPath st
return err
}

response, err := m.provider.Query(context.Background(), m.model, message)
response, err := m.provider.Query(context.Background(), m.model, request)
if err != nil {
return err
}
log.Printf("Model %q responded to query %q with: %q", m.ID(), message, response)
log.Printf("Model %q responded to query %s with: %s", m.ID(), string(bytesutil.PrefixLines([]byte(request), []byte("\t"))), string(bytesutil.PrefixLines([]byte(response), []byte("\t"))))

testContent := prompt.ParseResponse(response)

Expand Down
Loading