gemini

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatSession

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

ChatSession represents a gemini-pro powered chat session.

func NewChatSession

func NewChatSession(ctx context.Context, apiKey string) (*ChatSession, error)

NewChatSession returns a new ChatSession.

func (*ChatSession) ClearHistory

func (c *ChatSession) ClearHistory()

ClearHistory clears chat history.

func (*ChatSession) Close

func (c *ChatSession) Close() error

Close closes the genai.Client.

func (*ChatSession) SendMessage

func (c *ChatSession) SendMessage(input string) (*genai.GenerateContentResponse, error)

SendMessage sends a request to the model as part of a chat session.

func (*ChatSession) SendMessageStream

func (c *ChatSession) SendMessageStream(input string) *genai.GenerateContentResponseIterator

SendMessageStream is like SendMessage, but with a streaming request.

Jump to

Keyboard shortcuts

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