Documentation
¶
Index ¶
- type Config
- type Provider
- func (p *Provider) Close() error
- func (p *Provider) Complete(ctx context.Context, req *types.CompletionRequest) (*types.CompletionResponse, error)
- func (p *Provider) EstimateTokens(ctx context.Context, messages []*types.Message, model string) (int, error)
- func (p *Provider) GetModels(ctx context.Context) ([]*types.Model, error)
- func (p *Provider) GetName() string
- func (p *Provider) Initialize(config types.Config) error
- func (p *Provider) Stream(ctx context.Context, req *types.CompletionRequest, ...) error
- func (p *Provider) ValidateModel(model string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
types.BaseConfig
ProjectID string `json:"project_id,omitempty"`
Location string `json:"location,omitempty"`
}
Config holds Google AI-specific configuration
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements the Google AI provider
func (*Provider) Complete ¶
func (p *Provider) Complete(ctx context.Context, req *types.CompletionRequest) (*types.CompletionResponse, error)
Complete performs a completion request
func (*Provider) EstimateTokens ¶
func (p *Provider) EstimateTokens(ctx context.Context, messages []*types.Message, model string) (int, error)
EstimateTokens estimates token count for messages
func (*Provider) Initialize ¶
Initialize sets up the provider with configuration
func (*Provider) Stream ¶
func (p *Provider) Stream(ctx context.Context, req *types.CompletionRequest, callback types.StreamCallback) error
Stream performs a streaming completion request
func (*Provider) ValidateModel ¶
ValidateModel checks if a model is supported
Click to show internal directories.
Click to hide internal directories.