cr_mr_code_snippet

package
v1.3.0-rc.0...-d217119 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CodeSnippet

type CodeSnippet struct {
	CodeLanguage string
	SelectedCode string
	Truncated    bool // if there are too many changes, we have to truncate the content according to the model context
	UserLang     string
	// contains filtered or unexported fields
}

CodeSnippet 最小 review 单元为 CodeSnippet 1. 当用户选择了一段代码,这本身就是 CodeSnippet 2. 用户选择了一个文件,那么会有多个 CodeSnippet 3. 用户选择整个 mrReviewer,那么需要有多个 CodeSnippet

func (CodeSnippet) CodeReview

func (cs CodeSnippet) CodeReview(i18n i18n.Translator, lang i18n.LanguageCodes, aiSessionID string) string

func (CodeSnippet) GetMarkdownCode

func (cs CodeSnippet) GetMarkdownCode() string

type PromptStruct

type PromptStruct = struct {
	Messages []openai.ChatCompletionMessage `yaml:"messages"`
}

Jump to

Keyboard shortcuts

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