Documentation ¶
Index ¶
- Constants
- type Client
- type GeminiEmbeddingFunction
- func (e *GeminiEmbeddingFunction) EmbedDocuments(ctx context.Context, documents []string) ([]*types.Embedding, error)
- func (e *GeminiEmbeddingFunction) EmbedQuery(ctx context.Context, document string) (*types.Embedding, error)
- func (e *GeminiEmbeddingFunction) EmbedRecords(ctx context.Context, records []*types.Record, force bool) error
- type Option
Constants ¶
View Source
const ( DefaultEmbeddingModel = "text-embedding-004" ModelContextVar = "model" APIKeyEnvVar = "GEMINI_API_KEY" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { DefaultModel string Client *genai.Client DefaultContext *context.Context MaxBatchSize int // contains filtered or unexported fields }
func NewGeminiClient ¶
type GeminiEmbeddingFunction ¶
type GeminiEmbeddingFunction struct {
// contains filtered or unexported fields
}
func NewGeminiEmbeddingFunction ¶
func NewGeminiEmbeddingFunction(opts ...Option) (*GeminiEmbeddingFunction, error)
func (*GeminiEmbeddingFunction) EmbedDocuments ¶
func (*GeminiEmbeddingFunction) EmbedQuery ¶
func (*GeminiEmbeddingFunction) EmbedRecords ¶
type Option ¶
func WithClient ¶
WithClient sets the generative AI client for the client
func WithDefaultModel ¶
WithDefaultModel sets the default model for the client
func WithEnvAPIKey ¶
func WithEnvAPIKey() Option
WithEnvAPIKey sets the API key for the client from the environment variable GOOGLE_API_KEY
func WithMaxBatchSize ¶
WithMaxBatchSize sets the max batch size for the client - this acts as a limit for the number of embeddings that can be sent in a single request
Click to show internal directories.
Click to hide internal directories.