gemini

package
v0.0.0-...-9042912 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 7 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
}

Client is the Gemini API client that implements the Paraphraser interface.

func NewClient

func NewClient(cfg *Config) *Client

func (*Client) Paraphrase

func (c *Client) Paraphrase(ctx context.Context, tone string, text string) (string, error)

Paraphrase builds a prompt to paraphrase the given text to sound more like the given tone and sends the corresponding request to Gemini API.

type Config

type Config struct {
	ApiKey      string  `envconfig:"GEMINI_API_KEY"`
	Temperature float32 `envconfig:"GEMINI_TEMPERATURE" default:"0.9"`
}

Config contains the configuration for the Gemini API client.

func ConfigFromEnv

func ConfigFromEnv() *Config

ConfigFromEnv loads the configuration from the environment variables.

Jump to

Keyboard shortcuts

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