Documentation
¶
Index ¶
- type ImagenConfig
- type ImagenProvider
- func (p *ImagenProvider) CalculateCost(inputTokens, outputTokens, cachedTokens int) types.CostInfo
- func (p *ImagenProvider) Close() error
- func (p *ImagenProvider) Predict(ctx context.Context, req providers.PredictionRequest) (providers.PredictionResponse, error)
- func (p *ImagenProvider) PredictStream(ctx context.Context, req providers.PredictionRequest) (<-chan providers.StreamChunk, error)
- func (p *ImagenProvider) SupportsStreaming() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ImagenConfig ¶
type ImagenConfig 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 ImagenProvider ¶
type ImagenProvider struct {
providers.BaseProvider
Model string
BaseURL string
ApiKey string
ProjectID string
Location string
Defaults providers.ProviderDefaults
HTTPClient *http.Client
}
ImagenProvider implements the Provider interface for Google's Imagen image generation
func NewImagenProvider ¶
func NewImagenProvider(config ImagenConfig) *ImagenProvider
NewImagenProvider creates a new Imagen provider
func (*ImagenProvider) CalculateCost ¶
func (p *ImagenProvider) CalculateCost(inputTokens, outputTokens, cachedTokens int) types.CostInfo
CalculateCost calculates cost breakdown (simplified for Imagen)
func (*ImagenProvider) Predict ¶
func (p *ImagenProvider) Predict(ctx context.Context, req providers.PredictionRequest) (providers.PredictionResponse, error)
Predict generates images based on the last user message
func (*ImagenProvider) PredictStream ¶
func (p *ImagenProvider) PredictStream( ctx context.Context, req providers.PredictionRequest, ) (<-chan providers.StreamChunk, error)
PredictStream is not supported for image generation
func (*ImagenProvider) SupportsStreaming ¶
func (p *ImagenProvider) SupportsStreaming() bool
SupportsStreaming returns false for Imagen
Click to show internal directories.
Click to hide internal directories.