Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CodeChangeRequest ¶
type CodeChangeRequest struct { Files []File Subject string Body string IssueNumber int BaseBranch string }
CodeChangeRequest contains all necessary information for generating a prompt for a LLM.
func (CodeChangeRequest) GetPrompt ¶
func (req CodeChangeRequest) GetPrompt() (string, error)
GetPrompt converts the information in the request to a prompt for an LLM.
func (CodeChangeRequest) MustGetPrompt ¶
func (req CodeChangeRequest) MustGetPrompt() string
MustGetPrompt only returns the prompt, but panics if the data in the request cannot populate the template.
func (CodeChangeRequest) String ¶
func (req CodeChangeRequest) String() string
String is the string representation of a CodeChangeRequest. Functionally, it contains the LLM prompt.
type CodeChangeResponse ¶
CodeChangeResponse contains data derived from an LLM response to a prompt generated via a CodeChangeRequest.
func ParseCodeChangeResponse ¶
func ParseCodeChangeResponse(llmResponse string) (CodeChangeResponse, error)
ParseCodeChangeResponse parses the LLM's response to CodeChangeRequest (string) into a CodeChangeResponse.
func (CodeChangeResponse) String ¶
func (res CodeChangeResponse) String() string
String is a string representation of CodeChangeResponse.
type DiffCommentRequest ¶
TODO support threads
func (DiffCommentRequest) GetPrompt ¶
func (req DiffCommentRequest) GetPrompt() (string, error)
GetPrompt converts the information in the request to a prompt for an LLM.
func (DiffCommentRequest) MustGetPrompt ¶
func (req DiffCommentRequest) MustGetPrompt() string
MustGetPrompt only returns the prompt, but panics if the data in the request cannot populate the template.
func (DiffCommentRequest) String ¶
func (req DiffCommentRequest) String() string
type DiffCommentResponse ¶
type DiffCommentResponse struct { Type ResponseType `yaml:"responseType"` Response string `yaml:"response"` File File `yaml:"file"` }
func ParseDiffCommentResponse ¶
func ParseDiffCommentResponse(llmResponse string) (DiffCommentResponse, error)
func (DiffCommentResponse) String ¶
func (res DiffCommentResponse) String() string
String is a string representation of DiffCommentResponse.
type OpenAIClient ¶
type OpenAIClient struct {
// contains filtered or unexported fields
}
func NewOpenAIClient ¶
func NewOpenAIClient(log *zap.Logger, defaultModel, token, debugDir string) *OpenAIClient
func (*OpenAIClient) EvaluateCCR ¶
func (oc *OpenAIClient) EvaluateCCR(ctx context.Context, model string, req CodeChangeRequest) (res CodeChangeResponse, err error)
func (*OpenAIClient) EvaluateDiffComment ¶
func (oc *OpenAIClient) EvaluateDiffComment(ctx context.Context, model string, req DiffCommentRequest) (res DiffCommentResponse, err error)
type ResponseType ¶
type ResponseType int
const ( ResponseAnswer ResponseType = iota ResponseCodeChange )