Documentation
¶
Index ¶
- Constants
- type AIClient
- func (a *AIClient) AskAISummaryFromFinding(ctx context.Context, f *model.Finding, r *model.Recommend, lang string) (string, error)
- func (a *AIClient) AskAISummaryStreamFromFinding(ctx context.Context, f *model.Finding, r *model.Recommend, lang string, ...) error
- func (a *AIClient) ChatAI(ctx context.Context, req *ai.ChatAIRequest) (*ai.ChatAIResponse, error)
- type AIService
Constants ¶
View Source
const ( 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 = `` /* 679-byte string literal not displayed */ PROMPT_SUMMARY_JP = `` /* 1024-byte string literal not displayed */ FINDING_FORMAT_FOR_AI = `` /* 136-byte string literal not displayed */ RECOMMEND_FORMAT_FOR_AI = ` Detail: %s Recommendation: %s ` )
View Source
const ( CACHE_SIZE = 200 * 1024 * 1024 // 200MB CACHE_EXPIRE_SEC = 3600 CACHE_KEY_FORMAT = "OpenAICache/%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 (*AIClient) AskAISummaryStreamFromFinding ¶ added in v0.10.0
func (*AIClient) ChatAI ¶ added in v0.15.0
func (a *AIClient) ChatAI(ctx context.Context, req *ai.ChatAIRequest) (*ai.ChatAIResponse, error)
type AIService ¶
type AIService interface { ChatAI(ctx context.Context, req *ai.ChatAIRequest) (*ai.ChatAIResponse, error) 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 }
Click to show internal directories.
Click to hide internal directories.