gemini

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2025 License: Apache-2.0 Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gemini contains code that is common to both the Google AI and Vertex AI plugins.

Index

Constants

View Source
const (
	GoogleAIProvider = "googleai"
	VertexAIProvider = "vertexai"
)

Variables

View Source
var (
	// BasicText describes model capabilities for text-only Gemini models.
	BasicText = ai.ModelSupports{
		Multiturn:  true,
		Tools:      true,
		ToolChoice: true,
		SystemRole: true,
		Media:      false,
	}

	//  Multimodal describes model capabilities for multimodal Gemini models.
	Multimodal = ai.ModelSupports{
		Multiturn:  true,
		Tools:      true,
		ToolChoice: true,
		SystemRole: true,
		Media:      true,
	}

	GenkitClientHeader = http.Header{
						// contains filtered or unexported fields
	}
)

Functions

func DefineEmbedder added in v0.3.0

func DefineEmbedder(g *genkit.Genkit, client *genai.Client, name string) ai.Embedder

DefineEmbedder defines embeddings for the provided contents and embedder model

func DefineModel added in v0.3.0

func DefineModel(g *genkit.Genkit, client *genai.Client, name string, info ai.ModelInfo) ai.Model

DefineModel defines a model in the registry

func Generate added in v0.3.0

func Generate(
	ctx context.Context,
	client *genai.Client,
	model string,
	input *ai.ModelRequest,
	cb func(context.Context, *ai.ModelResponseChunk) error,
) (*ai.ModelResponse, error)

Generate requests a generate call to the specified model with the provided configuration

Types

type EmbedOptions added in v0.3.0

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