vertex

package
v0.0.0-...-a0e9b24 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: MIT Imports: 13 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) ExtractTextFromAudio

func (ai *AI) ExtractTextFromAudio(ctx context.Context, filePath string) (string, error)

ExtractTextFromAudio extracts text from a given audio file. The filePath parameter specifies the path to the audio file. It returns a string containing the extracted text and an error if any issue occurs.

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) GeneratePresentationFromText

func (ai *AI) GeneratePresentationFromText(ctx context.Context, preprompt string, content []byte) (*structure.Presentation, error)

GeneratePresentationFromText generates a presentation from a pre-prompt and given text content. The preprompt parameter allows customization of the presentation context. The content parameter is a byte array representing the content of the presentation. It returns a Presentation object representing the generated presentation, and any error encountered.

func (*AI) GenerateSlide

func (ai *AI) GenerateSlide(ctx context.Context, preprompt string, content []byte) (*structure.Slide, error)

GenerateSlide generates a slide from a pre-prompt and specific content. The preprompt parameter allows customization of the slide context. The content parameter is a byte array representing the content to include in the slide. It returns a Slide object representing the generated slide, and any error encountered.

func (*AI) SimpleQuery

func (ai *AI) SimpleQuery(ctx context.Context, prompt string) (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