gemini

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts ...ai.ClientOption) (ai.AI, error)

func NewWithClient

func NewWithClient(client *genai.Client, model string) ai.AI

Types

type ChatResponse

type ChatResponse struct {
	*genai.GenerateContentResponse
}

func (*ChatResponse) Results

func (resp *ChatResponse) Results() (res []string)

func (*ChatResponse) String added in v1.0.2

func (resp *ChatResponse) String() string

type ChatSession

type ChatSession struct {
	// contains filtered or unexported fields
}

func (*ChatSession) Chat

func (session *ChatSession) Chat(ctx context.Context, parts ...string) (ai.ChatResponse, error)

func (*ChatSession) ChatStream

func (session *ChatSession) ChatStream(ctx context.Context, parts ...string) (ai.ChatStream, error)

func (*ChatSession) History added in v1.0.2

func (session *ChatSession) History() (history []ai.Message)

type ChatStream

type ChatStream struct {
	// contains filtered or unexported fields
}

func (*ChatStream) Close added in v1.0.2

func (stream *ChatStream) Close() error

func (*ChatStream) Next

func (stream *ChatStream) Next() (ai.ChatResponse, error)

type Gemini

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

func (*Gemini) Chat

func (ai *Gemini) Chat(ctx context.Context, parts ...string) (ai.ChatResponse, error)

func (*Gemini) ChatSession

func (ai *Gemini) ChatSession() ai.ChatSession

func (*Gemini) ChatStream

func (ai *Gemini) ChatStream(ctx context.Context, parts ...string) (ai.ChatStream, error)

func (Gemini) LLMs added in v1.0.6

func (Gemini) LLMs() ai.LLMs

func (*Gemini) Model added in v1.0.10

func (gemini *Gemini) Model(ctx context.Context) (string, error)

func (*Gemini) SetCount

func (ai *Gemini) SetCount(i int32)

func (*Gemini) SetLimit

func (gemini *Gemini) SetLimit(limit rate.Limit)

func (*Gemini) SetMaxTokens

func (ai *Gemini) SetMaxTokens(i int32)

func (*Gemini) SetModel

func (ai *Gemini) SetModel(model string)

func (*Gemini) SetTemperature

func (ai *Gemini) SetTemperature(f float32)

func (*Gemini) SetTopP

func (ai *Gemini) SetTopP(f float32)

Jump to

Keyboard shortcuts

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