gptest

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientGpt35 = "GPT35"
)

Variables

This section is empty.

Functions

func PanicIfErr

func PanicIfErr(err error)

func Run

func Run(config SharedConfig, ctx context.Context) error

Types

type BaseIndexer added in v0.2.0

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

func (*BaseIndexer) GetSibylCache added in v0.2.0

func (baseIndexer *BaseIndexer) GetSibylCache() *sibyl2.FuncGraph

func (*BaseIndexer) GetVertexesWithSignature added in v0.2.0

func (baseIndexer *BaseIndexer) GetVertexesWithSignature(s string) []string

func (*BaseIndexer) UploadSrc added in v0.2.0

func (baseIndexer *BaseIndexer) UploadSrc(_ context.Context) error

type ChatGPTClient

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

func (*ChatGPTClient) Ask

func (c *ChatGPTClient) Ask(q string) (string, error)

func (*ChatGPTClient) Prepare

func (c *ChatGPTClient) Prepare(promptFile string) error

func (*ChatGPTClient) SetToken

func (c *ChatGPTClient) SetToken(token string)

type Client

type Client interface {
	SetToken(token string)
	Prepare(promptFile string) error
	Ask(string) (string, error)
}

func GetClient

func GetClient(clientType ClientType) Client

func NewGpt35Client

func NewGpt35Client() Client

type ClientType

type ClientType = string

type DiffMap added in v0.2.0

type DiffMap = map[string][]int

type GitExtractor added in v0.2.0

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

func (*GitExtractor) ExtractDiffMap added in v0.2.0

func (g *GitExtractor) ExtractDiffMap(_ context.Context) (DiffMap, error)

func (*GitExtractor) ExtractDiffMapWithRegex added in v0.2.0

func (g *GitExtractor) ExtractDiffMapWithRegex(_ context.Context) (DiffMap, error)

func (*GitExtractor) ExtractDiffMethods added in v0.2.0

func (g *GitExtractor) ExtractDiffMethods(ctx context.Context) (map[string][]openapi.ObjectFunctionWithSignature, error)

type RepoInfo added in v0.2.0

type RepoInfo struct {
	RepoId  string `json:"repoId"`
	RevHash string `json:"revHash"`
}

func GetRepoInfoFromDir added in v0.2.0

func GetRepoInfoFromDir(srcDir string) (*RepoInfo, error)

type SharedConfig added in v0.2.0

type SharedConfig struct {
	Token       string    `json:"token"`
	SrcDir      string    `json:"srcDir"`
	OutputDir   string    `json:"outputDir"`
	RepoInfo    *RepoInfo `json:"repoInfo"`
	SibylUrl    string    `json:"sibylUrl"`
	Before      string    `json:"before"`
	After       string    `json:"after"`
	FileInclude string    `json:"fileInclude"`
	PromptFile  string    `json:"promptFile"`
}

func DefaultConfig added in v0.2.0

func DefaultConfig() SharedConfig

func (*SharedConfig) GetSibylPort added in v0.2.0

func (conf *SharedConfig) GetSibylPort() string

func (*SharedConfig) LocalSibyl added in v0.2.0

func (conf *SharedConfig) LocalSibyl() bool

func (*SharedConfig) NewSibylClient added in v0.2.0

func (conf *SharedConfig) NewSibylClient() (*openapi.APIClient, error)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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