Documentation ¶
Overview ¶
Package gemini provides communication with Gemini.
Package gemini provides communication with Gemini.
Package gemini provides communication with Gemini.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Question ¶
Question is to send a message or image.
ex) answer, err := gemini.Question("gemini-1.5-flash", API_KEY, "who are you?", nil)
func QuestionStream ¶
QuestionStream is to send a message or image and receive it as a stream.
ex) channel, err := gemini.QuestionStream("gemini-1.5-flash", API_KEY, "please say something encouraging", nil)
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) 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)