Documentation ¶
Index ¶
- type GeminiClient
- func (c *GeminiClient) Chat(ctx context.Context) (*genai.ChatSession, error)
- func (c *GeminiClient) Close()
- func (c *GeminiClient) GenerateImage(ctx context.Context, prompt string) ([]byte, error)
- func (c *GeminiClient) GenerateText(ctx context.Context, prompt string) (string, error)
- func (c *GeminiClient) SendMessage(ctx context.Context, chat *genai.ChatSession, message string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GeminiClient ¶
type GeminiClient struct {
// contains filtered or unexported fields
}
GeminiClient represents a client for interacting with Google Cloud Gemini API
func NewGeminiClient ¶
func NewGeminiClient(ctx context.Context, apiKey string) (*GeminiClient, error)
NewGeminiClient creates a new Gemini API client
func (*GeminiClient) Chat ¶
func (c *GeminiClient) Chat(ctx context.Context) (*genai.ChatSession, error)
Chat initiates a chat session with Gemini
func (*GeminiClient) GenerateImage ¶
GenerateImage generates an image based on text prompt using Gemini Pro Vision
func (*GeminiClient) GenerateText ¶
GenerateText generates text response based on prompt
func (*GeminiClient) SendMessage ¶
func (c *GeminiClient) SendMessage(ctx context.Context, chat *genai.ChatSession, message string) (string, error)
SendMessage sends a message in a chat session and returns the response
Click to show internal directories.
Click to hide internal directories.