Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewReadEmailTool ¶
func NewReadEmailTool(s Service) tool.CallableTool
func NewSendEmailTool ¶
func NewSendEmailTool(s Service) tool.CallableTool
Types ¶
type Config ¶
type Config struct {
Provider string `json:"provider,omitempty" yaml:"Provider,omitempty" toml:"Provider,omitempty"` // smtp, gmail_api, sendgrid
Host string `json:"host" yaml:"Host,omitempty" toml:"Host,omitempty"` // SMTP Host
Port int `json:"port" yaml:"Port,omitempty" toml:"Port,omitempty,omitzero"` // SMTP Port
Username string `json:"username" yaml:"Username,omitempty" toml:"Username,omitempty"`
Password string `json:"password" yaml:"Password,omitempty" toml:"Password,omitempty"`
// IMAP settings for reading emails
IMAPHost string `json:"imap_host,omitempty" yaml:"IMAPHost,omitempty" toml:"IMAPHost,omitempty"`
IMAPPort int `json:"imap_port,omitempty" yaml:"IMAPPort,omitempty" toml:"IMAPPort,omitempty,omitzero"`
// IMAPTLSConfig is set by the application from security.CryptoConfig.TLSConfig()
// to enforce NIST 2030 minimums (TLS 1.2+). Not loaded from config file.
IMAPTLSConfig *tls.Config `json:"-" yaml:"-" toml:"-"`
}
Config holds configuration for Email providers
type ReadEmailRequest ¶
type ReadEmailRequest struct {
Filter string `json:"filter" jsonschema:"description=Filter instructions (e.g. 'unread', 'security alert')"`
}
type SendEmailRequest ¶
type Service ¶
type Service interface {
Send(ctx context.Context, req SendRequest) error
Read(ctx context.Context, filter string) ([]*Email, error)
// Validate performs a lightweight health check to detect misconfigurations at startup.
Validate(ctx context.Context) error
}
Service provides capabilities to send and read emails.
type ToolProvider ¶
type ToolProvider struct {
// contains filtered or unexported fields
}
ToolProvider wraps an email Service and satisfies the tools.ToolProviders interface so email tools can be passed directly to tools.NewRegistry. Without this, email tool construction would be inlined in the registry.
func NewToolProvider ¶
func NewToolProvider(svc Service) *ToolProvider
NewToolProvider creates a ToolProvider from an already-initialised email service.
func (*ToolProvider) GetTools ¶
func (p *ToolProvider) GetTools() []tool.Tool
GetTools returns all email tools (send + read) wired to the underlying service.
Click to show internal directories.
Click to hide internal directories.