gemini

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AI added in v0.4.0

type AI interface {
	Ask(prompt string) (string, error)
}

func NewAPI added in v0.4.0

func NewAPI(l *zerolog.Logger, apiKey string) AI

NewWeb creates a new Gemini AI instance. Cookies is all the cookies from a browser session

func NewWeb added in v0.4.0

func NewWeb(l *zerolog.Logger, cookies Cookies) AI

NewWeb creates a new Gemini AI instance. Cookies is all the cookies from a browser session

type Cookies

type Cookies map[string]string

type Gemini

type Gemini struct {
	Cookies map[string]string

	// Timeout in seconds
	TimeoutSnim0e int
	TimeoutQuery  int
	// contains filtered or unexported fields
}

Gemini is the main struct for the Gemini AI

func (*Gemini) Ask

func (b *Gemini) Ask(prompt string) (string, error)

Ask generates a Gemini AI response and returns it to the user

func (*Gemini) CommitCookies

func (g *Gemini) CommitCookies(cfgFilePath string)

commit the cookies to the config file

func (*Gemini) RotateCookies

func (g *Gemini) RotateCookies()

type GeminiAPI added in v0.4.0

type GeminiAPI struct {

	// Timeout in seconds
	TimeoutQuery int
	// contains filtered or unexported fields
}

GeminiAPI is the main struct for the Gemini AI API

func (*GeminiAPI) Ask added in v0.4.0

func (b *GeminiAPI) Ask(prompt string) (string, error)

Ask generates a Gemini AI response and returns it to the user

type Log

type Log struct {
	*zerolog.Logger
}

Log is a wrapper around zerolog.Logger to make it compatible with resty

func (Log) Debugf

func (l Log) Debugf(msg string, args ...interface{})

Debugf implements resty.Logger interface

func (Log) Errorf

func (l Log) Errorf(msg string, args ...interface{})

Errorf implements resty.Logger interface

func (Log) Fatalf

func (l Log) Fatalf(msg string, args ...interface{})

Fatalf implements resty.Logger interface

func (Log) Infof

func (l Log) Infof(msg string, args ...interface{})

Infof implements resty.Logger interface

func (Log) Warnf

func (l Log) Warnf(msg string, args ...interface{})

Warnf implements resty.Logger interface

Jump to

Keyboard shortcuts

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