Documentation
¶
Index ¶
- func DefineEmbedder(name string) *ai.Embedder
- func DefineModel(name string, caps *ai.ModelCapabilities) (*ai.Model, error)
- func Embedder(name string) *ai.Embedder
- func Init(ctx context.Context, projectID, location string) error
- func IsKnownModel(name string) bool
- func KnownModels() []string
- func Model(name string) *ai.Model
- type EmbedOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefineEmbedder ¶
DefineModel defines an embedder with the given name.
func DefineModel ¶
DefineModel defines an unknown model with the given name. The second argument describes the capability of the model. Use IsKnownModel to determine if a model is known.
func Embedder ¶
Embedder returns the ai.Embedder with the given name. It returns nil if the embedder was not configured.
func Init ¶
Init initializes the plugin and all known models and embedders. After calling Init, you may call DefineModel and DefineEmbedder to create and register any additional generative models and embedders
func IsKnownModel ¶
IsKnownModel reports whether a model is known to this plugin.
func KnownModels ¶
func KnownModels() []string
KnownModels returns a slice of all known model names.
Types ¶
type EmbedOptions ¶
type EmbedOptions struct { // Document title. Title string `json:"title,omitempty"` // Task type: RETRIEVAL_QUERY, RETRIEVAL_DOCUMENT, and so forth. // See the Vertex AI text embedding docs. TaskType string `json:"task_type,omitempty"` }
EmbedOptions are options for the Vertex AI embedder. Set ai.EmbedRequest.Options to a value of type *EmbedOptions.