genai

package
v0.0.0-...-5e98ae3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MODEL_NAME = "gemini-1.5-flash-001"

var MODEL_NAME = "gemini-pro" var MODEL_NAME = "gemini-1.5-pro-preview-0409"

Functions

This section is empty.

Types

type ClientOptions

type ClientOptions struct {
	ApiKey    string
	Region    string
	ProjectId string
}

type GeminiClient

type GeminiClient struct {
	GenClient
	ApiKey string
}

func NewGeminiClient

func NewGeminiClient(apiKey string) *GeminiClient

func (*GeminiClient) Summarize

func (gc *GeminiClient) Summarize(s string) (string, error)

func (*GeminiClient) TokenCount

func (gc *GeminiClient) TokenCount(s string) int

type GenClient

type GenClient interface {
	TokenCount(s string) int
	Summarize(s string) (string, error)
}

type VertexClient

type VertexClient struct {
	GenClient
	Opts ClientOptions
}

func NewVertexClient

func NewVertexClient(opts ClientOptions) *VertexClient

func (*VertexClient) Summarize

func (gc *VertexClient) Summarize(s string) (string, error)

func (*VertexClient) TokenCount

func (gc *VertexClient) TokenCount(s string) int

Jump to

Keyboard shortcuts

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