ai

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CACHE_SIZE       = 200 * 1024 * 1024 // 200MB
	CACHE_EXPIRE_SEC = 3600
	CACHE_KEY_FORMAT = "OpenAICache/%d/%s"

	LANG_JP               = "ja"
	PROMPT_SYSTEM_MSG_EN  = "You are a helpful security assistant."
	PROMPT_SYSTEM_MSG_JP  = "あなたは役に立つセキュリティアシスタントです。"
	PROMPT_SUMMARY_EN     = "" /* 205-byte string literal not displayed */
	PROMPT_SUMMARY_JP     = "" /* 288-byte string literal not displayed */
	FINDING_FORMAT_FOR_AI = `The RISKEN tool detected the following issue related to cloud security.
Type: %s
Description: %s
`
	RECOMMEND_FORMAT_FOR_AI = `Detail: %s
Recommendation: %s
`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AIClient

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

func (*AIClient) AskAISummaryFromFinding

func (a *AIClient) AskAISummaryFromFinding(ctx context.Context, f *model.Finding, r *model.Recommend, lang string) (string, error)

type AIService

type AIService interface {
	AskAISummaryFromFinding(ctx context.Context, f *model.Finding, r *model.Recommend, lang string) (string, error)
}

func NewAIClient

func NewAIClient(token string, logger logging.Logger) AIService

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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