Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MediaLister ¶
type MediaLister interface {
ListByCursor(ctx context.Context, userID int, limit int, beforeID int) ([]*mediadomain.Media, error)
}
MediaLister provides access to media items for AI context injection.
type TextGenHandler ¶
type TextGenHandler struct {
// contains filtered or unexported fields
}
TextGenHandler handles AI text generation requests.
func NewTextGenHandler ¶
func NewTextGenHandler( textGenService TextGenerationService, mediaService MediaLister, logger kernel.Logger, ) *TextGenHandler
NewTextGenHandler creates a new TextGenHandler. A nil logger degrades to a discard sink so the handler is safe to construct in any context.
func (*TextGenHandler) Enhance ¶
func (h *TextGenHandler) Enhance(w http.ResponseWriter, r *http.Request)
Enhance handles the "Enhance with AI" / "Generate with AI" endpoint.
func (*TextGenHandler) Translate ¶
func (h *TextGenHandler) Translate(w http.ResponseWriter, r *http.Request)
Translate handles the "Translate with AI" endpoint.
type TextGenerationService ¶
type TextGenerationService interface {
EnhanceText(
ctx context.Context,
content, format, mediaContext string,
) (textgendomain.EnhanceResult, error)
TranslateText(
ctx context.Context,
content, title, metaDescription, sourceLang, targetLang, format string,
) (textgendomain.TranslateResult, error)
}
TextGenerationService defines the interface for AI text generation.