Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SimpleFlash ¶
type SimpleFlash struct {
ModelName string
MultiModalModelName string
ProjectLocation string
ProjectID string
Client *genai.Client
Cache *bigcache.BigCache
Timeout time.Duration
}
func New ¶
func New(modelName, multiModalModelName, projectLocation, projectID string, cache bool) (*SimpleFlash, error)
func (*SimpleFlash) CountTextTokens ¶
func (sf *SimpleFlash) CountTextTokens(prompt string) (int, error)
CountTextTokens tries to count the number of tokens in the given prompt, using the VertexAI API
func (*SimpleFlash) InitCache ¶
func (sf *SimpleFlash) InitCache() error
InitCache initializes the BigCache cache
func (*SimpleFlash) QueryGemini ¶
func (sf *SimpleFlash) QueryGemini(prompt string, temperature *float64, base64Data, dataMimeType *string) (string, error)
QueryGemini processes a prompt with optional temperature, base64-encoded data, and MIME type for the data.
Click to show internal directories.
Click to hide internal directories.