google

package
v0.0.0-...-23024c7 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

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

Chat initiates a chat session with Gemini

func (*GeminiClient) Close

func (c *GeminiClient) Close()

Close closes the Gemini client

func (*GeminiClient) GenerateImage

func (c *GeminiClient) GenerateImage(ctx context.Context, prompt string) ([]byte, error)

GenerateImage generates an image based on text prompt using Gemini Pro Vision

func (*GeminiClient) GenerateText

func (c *GeminiClient) GenerateText(ctx context.Context, prompt string) (string, error)

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

Jump to

Keyboard shortcuts

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