Documentation
¶
Overview ¶
Package app provides the main business logic for the snappr application.
Index ¶
- Constants
- func CheckGHToken() error
- func CheckLLMToken() error
- func GetWorkflowByName(name string, workflowList []config.PromptWorkflow) *config.PromptWorkflow
- func NewDefaultPromptAndKnowledgeConfig(configPath string) error
- func RetrieveKnowledge(sourceName string, knowledgeSources []KnowledgeSource) (string, error)
- type App
- type FileChange
- type KnowledgeSource
- type KnowledgeSourceType
- type PRChanges
- type PRCommentInfo
- type PRCreation
- type PRCreationFile
- type PRReviewMap
- type SnapprUserConfig
Constants ¶
View Source
const ( KnowledgeSourceTypeFile KnowledgeSourceType = "file" KnowledgeSourceTypeURL KnowledgeSourceType = "url" KnowledgeSourceTypeAPI KnowledgeSourceType = "api" KnowledgeSourceTypeText KnowledgeSourceType = "text" NotImplementedMessage string = "Not implemented" )
View Source
const (
ErrUnmarshalLLMResponse = errors.New("error unmarshalling LLM response")
)
Variables ¶
This section is empty.
Functions ¶
func CheckGHToken ¶
func CheckGHToken() error
CheckGHToken checks if the GH_TOKEN environment variable is set.
func CheckLLMToken ¶
func CheckLLMToken() error
CheckLLMToken checks if the LLM_TOKEN environment variable is set.
func GetWorkflowByName ¶
func GetWorkflowByName(name string, workflowList []config.PromptWorkflow) *config.PromptWorkflow
GetWorkflowByName returns workflow information by name from a list of workflows.
func NewDefaultPromptAndKnowledgeConfig ¶
NewDefaultPromptAndKnowledgeConfig creates a config.yaml file with the default prompt and knowledge config.
func RetrieveKnowledge ¶
func RetrieveKnowledge(sourceName string, knowledgeSources []KnowledgeSource) (string, error)
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
func New ¶
func New( cfg *config.Config, githubClient githubClient, llmClient llmClient, logger zerolog.Logger) (*App, error)
New creates a new instance of the App.
func SetupNoEnv ¶
SetupNoEnv sets up the application from a config struct instead of utilizing environment variables.
type FileChange ¶
type KnowledgeSource ¶
type KnowledgeSource struct {
Name string `mapstructure:"name"`
Type KnowledgeSourceType `mapstructure:"type"`
Value string `mapstructure:"value"`
}
type KnowledgeSourceType ¶
type KnowledgeSourceType string
type PRChanges ¶
type PRChanges struct {
Files []FileChange `json:"files"`
}
type PRCommentInfo ¶
type PRCreation ¶
type PRCreation struct {
// Title of the pull request
Title string `json:"title"`
// Body of the pull request
Body string `json:"body"`
// UpdatedFiles is a list of files that have been updated in the pull request
UpdatedFiles []PRCreationFile `json:"updated_files"`
}
type PRCreationFile ¶
type PRReviewMap ¶
type PRReviewMap map[string][]PRCommentInfo
type SnapprUserConfig ¶
type SnapprUserConfig struct {
PromptWorkflows []config.PromptWorkflow `yaml:"promptWorkflows"`
KnowledgeSources []config.KnowledgeSource `yaml:"knowledgeSources"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.