Documentation ¶
Overview ¶
Package gemini provides communication with Gemini.
Package gemini provides communication with Gemini.
Package gemini provides communication with Gemini.
Index ¶
- func Question(apiKey, text string, images []string) (string, error)
- func QuestionStream(apiKey, text string, images []string) (chan answerForStream, error)
- type Chat
- func (this *Chat) GetHistory() []chatHistory
- func (this *Chat) GetHistoryWithImages() []chatHistory
- func (this *Chat) SendMessage(text string, images []string) (string, error)
- func (this *Chat) SendMessageStream(text string, images []string) (chan answerForStream, error)
- func (this *Chat) Start(apiKey string) error
- func (this *Chat) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Chat ¶
type Chat struct {
// contains filtered or unexported fields
}
Chat is a struct that provides chat.
func (*Chat) GetHistory ¶
func (this *Chat) GetHistory() []chatHistory
GetHistory returns the history for messages without images.
ex) history := chat.GetHistory()
func (*Chat) GetHistoryWithImages ¶
func (this *Chat) GetHistoryWithImages() []chatHistory
GetHistory returns the history of messages with images.
ex) history := chat.GetHistoryWithImages()
func (*Chat) SendMessage ¶
SendMessage is to send a message or image.
ex 1) answer, err := chat.SendMessage("who are you?", nil) ex 2) answer, err := chat.SendMessage("let me know your opinion", []string{"test/image-01.webp"})
func (*Chat) SendMessageStream ¶
SendMessageStream is to send a message or image and receive it as a stream.
ex) channel, err := chat.SendMessageStream("please say something encouraging", nil)