openai

package
v0.0.0-...-f2b87e9 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtistSongPair

type ArtistSongPair struct {
	ArtistName string `json:"artistName"`
	SongTitle  string `json:"songTitle"`
}

type ExtractArtistAndSongBody

type ExtractArtistAndSongBody struct {
	VideoTitles []string `json:"videoTitles"`
}

type OpenAIClient

type OpenAIClient struct {
	AppContext *utils.AppContext
}

func NewOpenAIClient

func NewOpenAIClient(appCtx *utils.AppContext) *OpenAIClient

func (*OpenAIClient) ExtractArtistAndSongFromVideoTitle

func (c *OpenAIClient) ExtractArtistAndSongFromVideoTitle(videoTitles []string) ([]ArtistSongPair, error)

Prompts the OpenAI API with a list of video titles from which it will extract artist names and song titles

type OpenAIHandler

type OpenAIHandler struct {
	// contains filtered or unexported fields
}

func NewOpenAIHandler

func NewOpenAIHandler(openAIService *OpenAIService) *OpenAIHandler

func (*OpenAIHandler) ExtractArtistAndSongFromVideoTitleHandler

func (h *OpenAIHandler) ExtractArtistAndSongFromVideoTitleHandler(c *gin.Context)

type OpenAIService

type OpenAIService struct {
	OpenAIClient *OpenAIClient
}

func NewOpenAIService

func NewOpenAIService(openAIClient *OpenAIClient) *OpenAIService

func (*OpenAIService) ExtractArtistAndSongFromVideoTitle

func (s *OpenAIService) ExtractArtistAndSongFromVideoTitle(videoTitles []string) ([]ArtistSongPair, error)

Jump to

Keyboard shortcuts

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