gemini

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

gemini implements an API client for Google's Gemini LLM (https://ai.google.dev/gemini-api/docs)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*client.Client
	// contains filtered or unexported fields
}

func New

func New(ApiKey string, opts ...client.ClientOpt) (*Client, error)

Create a new client

func (*Client) ListModels

func (c *Client) ListModels(ctx context.Context) ([]Model, error)

ListModels returns all the models

func (*Client) Model

func (gemini *Client) Model(ctx context.Context, name string) llm.Model

Return a model by name, or nil if not found. Panics on error.

func (*Client) Models

func (gemini *Client) Models(ctx context.Context) ([]llm.Model, error)

Return the models

func (Client) Name

func (Client) Name() string

Return the name of the agent

type Model

type Model struct {
	Name                       string   `json:"name"`
	Version                    string   `json:"version"`
	DisplayName                string   `json:"displayName"`
	Description                string   `json:"description"`
	InputTokenLimit            uint64   `json:"inputTokenLimit"`
	OutputTokenLimit           uint64   `json:"outputTokenLimit"`
	SupportedGenerationMethods []string `json:"supportedGenerationMethods"`
	Temperature                float64  `json:"temperature"`
	TopP                       float64  `json:"topP"`
	TopK                       uint64   `json:"topK"`
}

Jump to

Keyboard shortcuts

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