pull-pal/llm/common.go
Maximillian von Briesen d92efcb7e9
Prompt improvements (#9)
improve prompt templates to get response in yaml format and make parsing easier
also add debug file functionality so that exact input, prompts, and output can be easily seen for every request
2023-09-04 16:44:59 -04:00

44 lines
949 B
Go

package llm
// File represents a file in a git repository.
type File struct {
Path string `yaml:"path"`
Contents string `yaml:"contents"`
}
type ResponseType int
const (
ResponseAnswer ResponseType = iota
ResponseCodeChange
)
// CodeChangeRequest contains all necessary information for generating a prompt for a LLM.
type CodeChangeRequest struct {
Files []File
Subject string
Body string
IssueNumber int
BaseBranch string
}
// CodeChangeResponse contains data derived from an LLM response to a prompt generated via a CodeChangeRequest.
type CodeChangeResponse struct {
Files []File `yaml:"files"`
Notes string `yaml:"notes"`
}
// TODO support threads
type DiffCommentRequest struct {
File File
Contents string
Diff string
PRNumber int
}
type DiffCommentResponse struct {
Type ResponseType `yaml:"responseType"`
Response string `yaml:"response"`
File File `yaml:"file"`
}