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) 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.
Click to show internal directories.
Click to hide internal directories.