infrastructure

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: 11 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 GPTImageService

type GPTImageService struct {
	// contains filtered or unexported fields
}

GPTImageService implements mediadomain.ImageGenerationService using OpenAI GPT Image models. A non-empty baseURL redirects the client to an OpenAI-compatible image API (e.g. Meta Model API for Muse Image); empty keeps OpenAI's default endpoint.

func NewGPTImageService

func NewGPTImageService(apiKey, baseURL, model, size string) *GPTImageService

NewGPTImageService creates a new OpenAI GPT image generation service. A non-empty baseURL points the client at an OpenAI-compatible image API (e.g. Meta Model API for Muse Image); pass "" for OpenAI's default.

func (*GPTImageService) GenerateImage

func (s *GPTImageService) GenerateImage(
	ctx context.Context,
	prompt string,
	references []mediadomain.ImageReference,
) ([]byte, error)

GenerateImage generates a single image using OpenAI's GPT Image API.

func (*GPTImageService) SupportsImageReferences

func (s *GPTImageService) SupportsImageReferences() bool

SupportsImageReferences reports whether the service accepts reference images. GPT Image models accept reference images through the edits endpoint.

type GoogleGeminiService

type GoogleGeminiService struct {
	// contains filtered or unexported fields
}

GoogleGeminiService implements mediadomain.ImageGenerationService using Google Gemini models.

func NewGoogleGeminiService

func NewGoogleGeminiService(apiKey, model, size, aspectRatio string) *GoogleGeminiService

NewGoogleGeminiService creates a new Google Gemini image generation service.

func (*GoogleGeminiService) GenerateImage

func (s *GoogleGeminiService) GenerateImage(
	ctx context.Context,
	prompt string,
	references []mediadomain.ImageReference,
) ([]byte, error)

GenerateImage generates a single image using Google Gemini.

func (*GoogleGeminiService) SupportsImageReferences

func (s *GoogleGeminiService) SupportsImageReferences() bool

SupportsImageReferences reports whether the service accepts reference images. Gemini image models accept inline image parts alongside the prompt.

type GoogleImagen4Service

type GoogleImagen4Service struct {
	// contains filtered or unexported fields
}

GoogleImagen4Service implements mediadomain.ImageGenerationService using Google Imagen 4.

func NewGoogleImagen4Service

func NewGoogleImagen4Service(apiKey, model, size, aspectRatio string) *GoogleImagen4Service

NewGoogleImagen4Service creates a new Google Imagen 4 image generation service.

func (*GoogleImagen4Service) GenerateImage

func (s *GoogleImagen4Service) GenerateImage(
	ctx context.Context,
	prompt string,
	references []mediadomain.ImageReference,
) ([]byte, error)

GenerateImage generates a single image using Google Imagen 4.

func (*GoogleImagen4Service) SupportsImageReferences

func (s *GoogleImagen4Service) SupportsImageReferences() bool

SupportsImageReferences reports whether the service accepts reference images. Imagen 4 is text-to-image only.

Jump to

Keyboard shortcuts

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