Skip to content

Commit

Permalink
Merge pull request #14 from symflower/logging
Browse files Browse the repository at this point in the history
Make logging requests/responses of LLM queries more human-readable for now
  • Loading branch information
zimmski authored Apr 3, 2024
2 parents 25d6b53 + 87af3c5 commit df10ae2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
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

0 comments on commit df10ae2

Please sign in to comment.