gemini

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

Package gemini implements access to Google's Gemini model.

Client implements llm.Embedder. Use NewClient to connect.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Scrub

func Scrub(req *http.Request) error

Scrub is a request scrubber for use with rsc.io/httprr.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

A Client represents a connection to Gemini.

func NewClient

func NewClient(lg *slog.Logger, sdb secret.DB, hc *http.Client) (*Client, error)

NewClient returns a connection to Gemini, using the given logger and HTTP client. It expects to find a secret of the form "AIza..." or "user:AIza..." in sdb under the name "ai.google.dev".

func (*Client) EmbedDocs

func (c *Client) EmbedDocs(docs []llm.EmbedDoc) ([]llm.Vector, error)

EmbedDocs returns the vector embeddings for the docs, implementing llm.Embedder.

Jump to

Keyboard shortcuts

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