vertexai

package
v0.0.0-...-be64758 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Embedder

func Embedder(name string) *ai.EmbedderAction

Embedder returns the ai.EmbedderAction with the given name. It returns nil if the embedder was not configured.

func Init

func Init(ctx context.Context, cfg Config) (err error)

func Model

func Model(name string) *ai.ModelAction

Model returns the ai.ModelAction with the given name. It returns nil if the model was not configured.

Types

type Config

type Config struct {
	// The project holding the resources.
	ProjectID string
	// The location of the resources.
	// Defaults to "us-central1".
	Location string
	// Generative models to provide.
	Models []string
	// Embedding models to provide.
	Embedders []string
}

Config provides configuration options for the Init function.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL