Documentation
¶
Overview ¶
Package gemini contains code that is common to both the Google AI and Vertex AI plugins.
Index ¶
- Constants
- Variables
- func DefineEmbedder(g *genkit.Genkit, client *genai.Client, name string) ai.Embedder
- func DefineModel(g *genkit.Genkit, client *genai.Client, name string, info ai.ModelInfo) ai.Model
- func Generate(ctx context.Context, client *genai.Client, model string, ...) (*ai.ModelResponse, error)
- type EmbedOptions
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
DefineEmbedder defines embeddings for the provided contents and embedder model
func DefineModel ¶ added in v0.3.0
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.
Click to show internal directories.
Click to hide internal directories.