vertexai

package
v0.0.0-...-c57c120 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AI

type AI struct {
	Client *genai.Client
	Gemini *genai.GenerativeModel
	Token  string
	// contains filtered or unexported fields
}

func NewAI

func NewAI(ctx context.Context, projectID, locationID, modelID string) *AI

func (*AI) GenerateImageFromText

func (ai *AI) GenerateImageFromText(ctx context.Context, prompt string) (image.Image, error)

GenerateImageFromText generates an image from a given text prompt. The prompt parameter provides the description of the image to generate. It returns the generated image as an image.Image object, and any error encountered.

func (*AI) SimpleQuery

func (ai *AI) SimpleQuery(ctx context.Context, prompt string) (string, error)

SimpleQuery to the AI model

func (*AI) SimpleQueryPng

func (ai *AI) SimpleQueryPng(ctx context.Context, prompt string, image []byte) (string, error)

SimpleQuery to the AI model

Jump to

Keyboard shortcuts

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