googai

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(ctx context.Context) (*Client, error)

func (*Client) Embed

func (cl *Client) Embed(ctx context.Context, req *EmbedRequest, rsp *EmbedResponse) error

Embed generates embeddings for one or more documents in a single request

func (*Client) EmbedSingle added in v0.1.0

func (cl *Client) EmbedSingle(ctx context.Context, text string, model llm.ServiceName) (llm.Embedding, int64, error)

EmbedSingle is a convenience method for single document embedding

type EmbedRequest

type EmbedRequest struct {
	Documents []string
	Model     llm.ServiceName
}

func (*EmbedRequest) Validate added in v0.1.0

func (req *EmbedRequest) Validate() error

type EmbedResponse added in v0.1.0

type EmbedResponse struct {
	Embeddings             []llm.Embedding
	BillableCharacterCount int64
}

Jump to

Keyboard shortcuts

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