handlers

package
v0.0.0-...-2e23435 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DeprecatedBotUsername = "@instruct-lab-bot"

	AccessCheckFailed = "Access check failed."
	LabelsNotFound    = "Required labels not found."
	BotEnabled        = "Bot is successfully enabled."
	NotAllowed        = "Command not allowed"
)
View Source
const (
	TaxonomyPath        = "taxonomy"
	RepoSkillPath       = "/compositional_skills/bot_skills"
	RepoKnowledgePath   = "/knowledge/bot_knowledge"
	SkillStr            = "skill"
	KnowledgeStr        = "knowledge"
	YamlFileName        = "qna.yaml"
	AttributionFileName = "attribution.txt"
)
View Source
const (
	MaxLen = 110
)

Variables

This section is empty.

Functions

This section is empty.

Types

type KnowledgePRRequest

type KnowledgePRRequest struct {
	Name             string   `json:"name"`
	Email            string   `json:"email"`
	Task_description string   `json:"task_description"`
	Task_details     string   `json:"task_details"`
	Repo             string   `json:"repo"`
	Commit           string   `json:"commit"`
	Patterns         string   `json:"patterns"`
	Title_work       string   `json:"title_work"`
	Link_work        string   `json:"link_work"`
	Revision         string   `json:"revision"`
	License_work     string   `json:"license_work"`
	Creators         string   `json:"creators"`
	Domain           string   `json:"domain"`
	Questions        []string `json:"questions"`
	Answers          []string `json:"answers"`
}

type KnowledgeYaml

type KnowledgeYaml struct {
	Task_description string `yaml:"task_description"`
	Created_by       string `yaml:"created_by"`
	Domain           string `yaml:"domain"`
	Seed_examples    []struct {
		Question yaml.Node
		Answer   yaml.Node
	} `yaml:"seed_examples"`
	Document struct {
		Repo     string   `yaml:"repo"`
		Commit   string   `yaml:"commit"`
		Patterns []string `yaml:"patterns"`
	} `yaml:"document"`
}

type PRComment

type PRComment struct {
	// contains filtered or unexported fields
}

type PRCommentHandler

type PRCommentHandler struct {
	githubapp.ClientCreator
	Logger         *zap.SugaredLogger
	RedisHostPort  string
	RequiredLabels []string
	BotUsername    string
	Maintainers    []string
}

func (*PRCommentHandler) Handle

func (h *PRCommentHandler) Handle(ctx context.Context, eventType, deliveryID string, payload []byte) error

func (*PRCommentHandler) Handles

func (h *PRCommentHandler) Handles() []string

type PullRequestCreateHandler

type PullRequestCreateHandler struct {
	githubapp.ClientCreator
	Logger         *zap.SugaredLogger
	TaxonomyRepo   string
	GithubUsername string
	GithubToken    string
}

func (*PullRequestCreateHandler) KnowledgePRHandler

func (prc *PullRequestCreateHandler) KnowledgePRHandler(w http.ResponseWriter, r *http.Request)

func (*PullRequestCreateHandler) SkillPRHandler

func (prc *PullRequestCreateHandler) SkillPRHandler(w http.ResponseWriter, r *http.Request)

type PullRequestEventHandler

type PullRequestEventHandler struct {
	githubapp.ClientCreator
	Logger         *zap.SugaredLogger
	RequiredLabels []string
	BotUsername    string
	Maintainers    []string
}

func (*PullRequestEventHandler) Handle

func (h *PullRequestEventHandler) Handle(ctx context.Context, eventType, deliveryID string, payload []byte) error

func (*PullRequestEventHandler) Handles

func (h *PullRequestEventHandler) Handles() []string

type PullRequestTask

type PullRequestTask struct {
	PullRequestCreateHandler
	// contains filtered or unexported fields
}

type SkillPRRequest

type SkillPRRequest struct {
	Name             string   `json:"name"`
	Email            string   `json:"email"`
	Task_description string   `json:"task_description"`
	Task_details     string   `json:"task_details"`
	Title_work       string   `json:"title_work"`
	Link_work        string   `json:"link_work"`
	License_work     string   `json:"license_work"`
	Creators         string   `json:"creators"`
	Questions        []string `json:"questions"`
	Contexts         []string `json:"contexts"`
	Answers          []string `json:"answers"`
}

type SkillYaml

type SkillYaml struct {
	Task_description string `yaml:"task_description"`
	Created_by       string `yaml:"created_by"`
	Seed_examples    []struct {
		Question yaml.Node
		Context  yaml.Node
		Answer   yaml.Node
	} `yaml:"seed_examples"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL