Documentation
¶
Overview ¶
Package imagen provides Google Imagen image generation provider integration.
Index ¶
- type Config
- type Provider
- func (p *Provider) CalculateCost(inputTokens, outputTokens, cachedTokens int) types.CostInfo
- func (p *Provider) Close() error
- func (p *Provider) Predict(ctx context.Context, req providers.PredictionRequest) (providers.PredictionResponse, error)
- func (p *Provider) PredictStream(ctx context.Context, req providers.PredictionRequest) (<-chan providers.StreamChunk, error)
- func (p *Provider) SupportsStreaming() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v1.1.3
type Config struct {
ID string
Model string
BaseURL string
ApiKey string
ProjectID string
Location string
IncludeRawOutput bool
Defaults providers.ProviderDefaults
}
ImagenConfig holds configuration for creating an Imagen provider
type Provider ¶ added in v1.1.3
type Provider struct {
providers.BaseProvider
Model string
BaseURL string
ApiKey string
ProjectID string
Location string
Defaults providers.ProviderDefaults
HTTPClient *http.Client
}
Provider implements the Provider interface for Google's Imagen image generation
func NewProvider ¶ added in v1.1.3
NewProvider creates a new Imagen provider
func (*Provider) CalculateCost ¶ added in v1.1.3
CalculateCost calculates cost breakdown (simplified for Imagen)
func (*Provider) Predict ¶ added in v1.1.3
func (p *Provider) Predict(ctx context.Context, req providers.PredictionRequest) (providers.PredictionResponse, error)
Predict generates images based on the last user message
func (*Provider) PredictStream ¶ added in v1.1.3
func (p *Provider) PredictStream( ctx context.Context, req providers.PredictionRequest, ) (<-chan providers.StreamChunk, error)
PredictStream is not supported for image generation
func (*Provider) SupportsStreaming ¶ added in v1.1.3
SupportsStreaming returns false for Imagen
Click to show internal directories.
Click to hide internal directories.