prompt

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

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

func (*Service) ReadPromptFile added in v0.5.0

func (s *Service) ReadPromptFile(ctx context.Context, templateName string) (string, error)

ReadPromptFile reads a prompt file without template rendering This is used when alert data is passed via system prompt instead of template

Jump to

Keyboard shortcuts

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