ai

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 10 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 advisor. Please explain this in a way that a non-security expert can understand."
	PROMPT_SYSTEM_MSG_JP = "" /* 174-byte string literal not displayed */
	PROMPT_SUMMARY_EN    = `` /* 278-byte string literal not displayed */

	PROMPT_SUMMARY_JP = `` /* 406-byte string literal not displayed */

	FINDING_FORMAT_FOR_AI = `The RISKEN tool detected the following issue related to cloud security.
Type: 
%s

Description: 
%s

ScanResult(json):
%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)

func (*AIClient) AskAISummaryStreamFromFinding added in v0.10.0

func (a *AIClient) AskAISummaryStreamFromFinding(
	ctx context.Context, f *model.Finding, r *model.Recommend, lang string, stream finding.FindingService_GetAISummaryStreamServer,
) error

type AIService

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

func NewAIClient

func NewAIClient(token, model 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