api

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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