generate

package
v0.0.0-...-683bc26 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGemini

func GetGemini(text string, config helper.Config) (string, error)

Types

type Candidate

type Candidate struct {
	Content          Content          `json:"content"`
	FinishReason     string           `json:"finishReason"`
	Index            int              `json:"index"`
	SafetyRatings    []SafetyRating   `json:"safetyRatings"`
	CitationMetadata CitationMetadata `json:"citationMetadata"`
}

type CitationMetadata

type CitationMetadata struct {
	CitationSources []CitationSource `json:"citationSources"`
}

type CitationSource

type CitationSource struct {
	StartIndex int    `json:"startIndex"`
	EndIndex   int    `json:"endIndex"`
	URI        string `json:"uri"`
	License    string `json:"license"`
}

type Content

type Content struct {
	Role  string        `json:"role"`
	Parts []ContentPart `json:"parts"`
}

Content struct represents the content object in the request body

type ContentPart

type ContentPart struct {
	Text string `json:"text"`
}

ContentPart struct represents a part of the content

type GenerateContentRequest

type GenerateContentRequest struct {
	Contents []Content `json:"contents"`
}

GenerateContentRequest struct represents the request body for generateContent

type ModuleGenerate

type ModuleGenerate interface {
	GetInstagramProfile(username string) instagram.InstagramProfile
	GenerateRoast(profile instagram.InstagramProfile) (string, error)
	WrapText(text string, width int) []string
}

func NewGenerate

func NewGenerate(config helper.Config) ModuleGenerate

type Response

type Response struct {
	Candidates    []Candidate    `json:"candidates"`
	UsageMetadata map[string]int `json:"usageMetadata"`
}

type SafetyRating

type SafetyRating struct {
	Category    string `json:"category"`
	Probability string `json:"probability"`
}

Jump to

Keyboard shortcuts

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