services

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QrySequenceKnn   = "" /* 178-byte string literal not displayed */
	QryFindMediaById = "SELECT * from `%s` WHERE id = '%s'"
	QryGetSegment    = "SELECT sequence, start, `end`, script FROM `%s`, UNNEST(segments) as s WHERE id = '%s' and s.sequence = %d"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MediaService

type MediaService struct {
	BigqueryClient *bigquery.Client
	DatasetName    string
	MediaTable     string
}

func (*MediaService) Get

func (s *MediaService) Get(ctx context.Context, id string) (media *model.Media, err error)

Get returns a media object by id, or an error if it doesn't exist

func (*MediaService) GetFQN

func (s *MediaService) GetFQN() string

GetFQN returns the fully qualified BQ Table Name

func (*MediaService) GetSegment

func (s *MediaService) GetSegment(ctx context.Context, id string, segmentSequence int) (segment *model.Segment, err error)

GetSegment returns a segment in a specified media type by its sequence number

type SearchService

type SearchService struct {
	BigqueryClient *bigquery.Client
	EmbeddingModel *genai.Models
	ModelName      string
	DatasetName    string
	MediaTable     string
	EmbeddingTable string
}

func (*SearchService) FindSegments

func (s *SearchService) FindSegments(ctx context.Context, query string, maxResults int) (out []*model.SegmentMatchResult, err error)

Jump to

Keyboard shortcuts

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