Versions in this module Expand all Collapse all v0 v0.1.15 Oct 30, 2024 v0.1.14 Oct 30, 2024 Changes in this version + const CITATIONS + const ResponseMIMETypeJson + const RoleModel + const RoleSystem + const RoleTool + const RoleUser + const SAFETY + var ErrInvalidMimeType = errors.New("invalid mime type on content") + var ErrNoContentInResponse = errors.New("no content in generation response") + var ErrUnknownPartInResponse = errors.New("unknown part type in generation response") + type GoogleAI struct + CallbacksHandler callbacks.Handler + func New(ctx context.Context, opts ...Option) (*GoogleAI, error) + func (g *GoogleAI) Call(ctx context.Context, prompt string, options ...llms.CallOption) (string, error) + func (g *GoogleAI) CreateEmbedding(ctx context.Context, texts []string) ([][]float32, error) + func (g *GoogleAI) GenerateContent(ctx context.Context, messages []llms.MessageContent, ...) (*llms.ContentResponse, error) + type HarmBlockThreshold int32 + const HarmBlockLowAndAbove + const HarmBlockMediumAndAbove + const HarmBlockNone + const HarmBlockOnlyHigh + const HarmBlockUnspecified + type Option func(*Options) + func WithAPIKey(apiKey string) Option + func WithCloudLocation(l string) Option + func WithCloudProject(p string) Option + func WithCredentialsFile(credentialsFile string) Option + func WithCredentialsJSON(credentialsJSON []byte) Option + func WithDefaultCandidateCount(defaultCandidateCount int) Option + func WithDefaultEmbeddingModel(defaultEmbeddingModel string) Option + func WithDefaultMaxTokens(maxTokens int) Option + func WithDefaultModel(defaultModel string) Option + func WithDefaultTemperature(defaultTemperature float64) Option + func WithDefaultTopK(defaultTopK int) Option + func WithDefaultTopP(defaultTopP float64) Option + func WithHTTPClient(httpClient *http.Client) Option + func WithHarmThreshold(ht HarmBlockThreshold) Option + func WithRest() Option + type Options struct + ClientOptions []option.ClientOption + CloudLocation string + CloudProject string + DefaultCandidateCount int + DefaultEmbeddingModel string + DefaultMaxTokens int + DefaultModel string + DefaultTemperature float64 + DefaultTopK int + DefaultTopP float64 + HarmThreshold HarmBlockThreshold + func DefaultOptions() Options + func (o *Options) EnsureAuthPresent()