gemini

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: MIT Imports: 8 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 New

func New(opts ...Option) (c *Client, err error)

func (*Client) Completion

func (c *Client) Completion(ctx context.Context, content string) (*core.Response, error)

Completion is a method on the Client struct that takes a context.Context and a string argument

func (*Client) GetSummaryPrefix

func (c *Client) GetSummaryPrefix(ctx context.Context, content string) (*core.Response, error)

GetSummaryPrefix is an API call to get a summary prefix using function call.

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option is an interface that specifies instrumentation configuration options.

func WithMaxTokens

func WithMaxTokens(val int) Option

WithMaxTokens returns a new Option that sets the max tokens for the client configuration. The maximum number of tokens to generate in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length.

func WithModel

func WithModel(val string) Option

WithModel is a function that returns an Option, which sets the model field of the config struct.

func WithTemperature

func WithTemperature(val float32) Option

WithTemperature returns a new Option that sets the temperature for the client configuration. What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.

func WithToken

func WithToken(val string) Option

WithToken is a function that returns an Option, which sets the token field of the config struct.

func WithTopP

func WithTopP(val float32) Option

WithTopP returns a new Option that sets the topP for the client configuration.

Jump to

Keyboard shortcuts

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