google

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package google implements engine.Engine for Google Imagen and Veo APIs.

Image generation is synchronous via the Gemini API: POST /v1beta/models/{model}:predict with API key as query param. Auth: ?key={api_key}, env GOOGLE_API_KEY.

Index

Constants

View Source
const (
	ModelImagen3Generate002 = "imagen-3.0-generate-002"
	ModelImagen3Generate001 = "imagen-3.0-generate-001"
)

Model constants.

Variables

View Source
var (
	ErrMissingAPIKey = errors.New("google: missing API key (set Config.APIKey or GOOGLE_API_KEY)")
	ErrMissingPrompt = errors.New("google: missing prompt in workflow graph")
)

Functions

func ConfigSchema

func ConfigSchema() []engine.ConfigField

ConfigSchema returns the configuration fields required by the Google Imagen engine.

func ModelsByCapability

func ModelsByCapability() map[string][]string

ModelsByCapability returns all known Google Imagen models grouped by capability.

Types

type Config

type Config struct {
	APIKey     string
	BaseURL    string
	Model      string
	HTTPClient *http.Client
}

Config configures the Google Imagen engine.

type Engine

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

Engine implements engine.Engine for Google Imagen.

func New

func New(cfg Config) *Engine

New creates a Google Imagen engine instance.

func (*Engine) Capabilities

func (e *Engine) Capabilities() engine.Capability

Capabilities implements engine.Describer.

func (*Engine) Execute

func (e *Engine) Execute(ctx context.Context, g workflow.Graph) (engine.Result, error)

Execute generates an image via the Google Imagen API.

Jump to

Keyboard shortcuts

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