common

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: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FileCheckRetries = 2
	FileCheckDelay   = 2 * time.Second
	CommandSeparator = " "
)
View Source
const (
	StepCompleted               = "completed"
	GENERATE_PROXY_STEP         = "ims_generate_proxy"
	CONTENT_LENGTH_STEP         = "ims_content_length"
	CONTENT_TYPE_STEP           = "ims_content_type"
	CONTENT_SUMMARY_STEP        = "ims_content_summary"
	SEGMENT_SUMMARY_STEP_PREFIX = "ims_segment_summary_"
	PERSIST_STEP                = "ims_persist"
	EMBEDDING_STEP              = "ims_generate_embeddings"
)
View Source
const (
	GENAI_INPUT_FILE_TYPE = "video/mp4"
)

Variables

This section is empty.

Functions

func Getenv

func Getenv(key, fallback string) string

Types

type BasicRunConfig

type BasicRunConfig struct {
	InputFile   string
	InputBucket string
	MountPoint  string
	Ctx         context.Context
	// contains filtered or unexported fields
}

func NewBasicRunConfig

func NewBasicRunConfig() (*BasicRunConfig, error)

func (*BasicRunConfig) GetStepStatusByKey

func (config *BasicRunConfig) GetStepStatusByKey(stepKey string) *StepStatus

func (*BasicRunConfig) GetStepsOutput

func (config *BasicRunConfig) GetStepsOutput(stepKeys []string) map[string]string

func (*BasicRunConfig) GetStepsStatus

func (config *BasicRunConfig) GetStepsStatus(stepKeys []string) map[string]string

func (*BasicRunConfig) GetStorageClient

func (config *BasicRunConfig) GetStorageClient() *storage.Client

func (*BasicRunConfig) SetStorageClient

func (config *BasicRunConfig) SetStorageClient(storageClient *storage.Client)

type BasicStepConfig

type BasicStepConfig struct {
	BasicRunConfig *BasicRunConfig
	StepKey        string
	StepLogic      func() (string, error)
}

func NewBasicStepConfig

func NewBasicStepConfig(basicRunConfig *BasicRunConfig, stepKey string, stepLogic func() (string, error)) *BasicStepConfig

func (*BasicStepConfig) RunStep

func (config *BasicStepConfig) RunStep()

func (*BasicStepConfig) StepCompleted

func (config *BasicStepConfig) StepCompleted() bool

func (*BasicStepConfig) UpdateGCSObjectMetadata

func (config *BasicStepConfig) UpdateGCSObjectMetadata(metadata map[string]string) (string, error)

type CommandStepConfig

type CommandStepConfig struct {
	BasicStepConfig
	CommandPath        string
	ArgsStringTemplate string
	CommandLogic       func(string) (string, error)
}

func NewCommandStepConfig

func NewCommandStepConfig(basicRunConfig *BasicRunConfig, stepKey, commandPath, argsStringTemplate string, commandLogic func(string) (string, error)) *CommandStepConfig

type GenAICounter

type GenAICounter struct {
	InputCounter  metric.Int64Counter
	OutputCounter metric.Int64Counter
	RetryCounter  metric.Int64Counter
}

type GenaiRunConfig

type GenaiRunConfig struct {
	BasicRunConfig
	CloudConfig        *cloud.Config
	AgentModels        map[string]*cloud.QuotaAwareGenerativeAIModel
	TemplateService    *cloud.TemplateService
	Meter              metric.Meter
	GenAIClient        *genai.Client
	GenAIContentCaches map[string]*genai.CachedContent
	BigQueryClient     *bigquery.Client
	GenAIEmbedding     *genai.Models
}

func NewGenaiRunConfig

func NewGenaiRunConfig() (*GenaiRunConfig, error)

func (*GenaiRunConfig) GetInputFileGCSURI

func (config *GenaiRunConfig) GetInputFileGCSURI() string

type GenaiStepConfig

type GenaiStepConfig struct {
	BasicStepConfig
	GenaiRunConfig *GenaiRunConfig
	Counters       *GenAICounter
}

func NewGenaiStepConfig

func NewGenaiStepConfig(stepKey string, genaiRunConfig *GenaiRunConfig, stepLogic func() (string, error)) (*GenaiStepConfig, error)

func (*GenaiStepConfig) GetGenaiContentCache

func (config *GenaiStepConfig) GetGenaiContentCache(modelName string, systemInstruction *genai.Content) (*genai.CachedContent, error)

func (*GenaiStepConfig) GetGenaiContentCacheWithChunk

func (config *GenaiStepConfig) GetGenaiContentCacheWithChunk(modelName string, systemInstruction *genai.Content, startOffsetSec int, endOffsetSec int) (*genai.CachedContent, error)

type RunConfig

type RunConfig struct {
	InputFile       string
	InputBucket     string
	StepMetadataKey string
	MountPoint      string
	Ctx             context.Context
}

type StepStatus

type StepStatus struct {
	Output string `json:"output"`
	Status string `json:"status"`
}

Jump to

Keyboard shortcuts

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