services

package
v0.0.0-...-e8bb10f Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModelName = "gemini-1.5-flash-001"
)

Variables

View Source
var GenaiClient *genai.Client

Functions

func CreateGenAIClient

func CreateGenAIClient() error

func GenerateContentFromFile

func GenerateContentFromFile(
	c context.Context,
	file *multipart.FileHeader,
) (*genai.GenerateContentResponse, error)

func GetStories

func GetStories(userID string) ([]string, error)

func LoadChatHistory

func LoadChatHistory(userID, sessionID string) ([]*genai.Content, error)

LoadChatHistory loads chat history from PostgreSQL database

func LoadMessages

func LoadMessages(sessionID string) ([]models.Message, error)

LoadMessage load messages from PostgreSQL database

func SaveFileData

func SaveFileData(userID, sessionID string, file *multipart.FileHeader) error

func SaveMessage

func SaveMessage(userID, sessionID string, message models.Message) error

SaveMessage save message to PostgreSQL database

Types

This section is empty.

Jump to

Keyboard shortcuts

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