Documentation
¶
Index ¶
- func New(promptDir string) (interfaces.PromptService, error)
- type Service
- func (s *Service) GeneratePrompt(ctx context.Context, templateName string, alert *alert.Alert) (string, error)
- func (s *Service) GeneratePromptWithParams(ctx context.Context, templateName string, alert *alert.Alert, ...) (string, error)
- func (s *Service) ReadPromptFile(ctx context.Context, templateName string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(promptDir string) (interfaces.PromptService, error)
New creates a new prompt service with preloaded templates from the specified directory
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements the PromptService interface
func (*Service) GeneratePrompt ¶
func (s *Service) GeneratePrompt(ctx context.Context, templateName string, alert *alert.Alert) (string, error)
GeneratePrompt generates a prompt from template name and alert data
func (*Service) GeneratePromptWithParams ¶ added in v0.7.0
func (s *Service) GeneratePromptWithParams(ctx context.Context, templateName string, alert *alert.Alert, params map[string]any) (string, error)
GeneratePromptWithParams generates a prompt from template name, alert data, and custom parameters
Click to show internal directories.
Click to hide internal directories.