infrastructure

package
v0.227.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFileService added in v0.178.1

func NewFileService() agentdomain.FileService

NewFileService creates a new file service

Types

type DirectoryFrameSource added in v0.178.1

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

DirectoryFrameSource serves the newest image file under a configured directory - the integration surface for camera daemons and anything else that drops frames on disk. An optional retention sweep (max_files/max_age) runs after each read; omit retention when the producer manages cleanup.

func NewDirectoryFrameSource added in v0.178.1

func NewDirectoryFrameSource(name string, cfg config.VisionSourceConfig, images agentdomain.ImageService) *DirectoryFrameSource

NewDirectoryFrameSource creates a frame source over cfg.Path. The retention max_age was validated at config load, so a parse failure here means zero (no age limit).

func (*DirectoryFrameSource) GetLatestFrame added in v0.178.1

func (d *DirectoryFrameSource) GetLatestFrame() (*agentdomain.Frame, error)

GetLatestFrame returns the newest image file in the directory by mtime.

type FileService added in v0.207.0

type FileService struct{}

FileService implements agentdomain.FileService

func (*FileService) ListProjectFiles added in v0.207.0

func (s *FileService) ListProjectFiles() ([]string, error)

ListProjectFiles returns the files under the current directory, followed by the user's ~/.infer files (as "~/.infer/<path>").

func (*FileService) ReadFile added in v0.207.0

func (s *FileService) ReadFile(path string) (string, error)

ReadFile reads the content of a file

func (*FileService) ValidateFile added in v0.207.0

func (s *FileService) ValidateFile(path string) error

ValidateFile checks if a file path is valid and accessible

type ImageService added in v0.178.1

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

ImageService handles image operations including file-based image loading and base64 encoding Note: Direct clipboard support requires platform-specific dependencies and is not yet implemented

func NewImageService added in v0.178.1

func NewImageService(cfg *config.Config, client sdk.Client) *ImageService

NewImageService creates a new image service

func (*ImageService) CreateImageVariation added in v0.178.1

func (s *ImageService) CreateImageVariation(ctx context.Context, model, imagePath, size string) (string, error)

CreateImageVariation creates a variation of the image at imagePath using model ("provider/name") and returns the path of the saved PNG. A blank size is omitted from the request, leaving the provider's own default.

func (*ImageService) EditImage added in v0.178.1

func (s *ImageService) EditImage(ctx context.Context, model, prompt, imagePath, quality, size, maskPath string) (string, error)

EditImage edits the image at imagePath using prompt and model ("provider/name") and returns the path of the saved PNG. A blank quality or size is omitted from the request, leaving the provider's own default. A non-empty maskPath points to a PNG whose transparent (alpha=0) areas mark the editable region; all other pixels are preserved exactly.

func (*ImageService) GenerateImage added in v0.178.1

func (s *ImageService) GenerateImage(ctx context.Context, model, prompt, quality, size string) (string, error)

GenerateImage generates an image from prompt using model ("provider/name") and returns the path of the saved PNG. A blank quality or size is omitted from the request, leaving the provider's own default.

func (*ImageService) IsImageFile added in v0.178.1

func (s *ImageService) IsImageFile(filePath string) bool

IsImageFile checks if a file is a supported image format

func (*ImageService) ReadImageFromBinary added in v0.178.1

func (s *ImageService) ReadImageFromBinary(imageData []byte, filename string) (*agentdomain.ImageAttachment, error)

ReadImageFromBinary reads an image from binary data and returns it as a base64 attachment

func (*ImageService) ReadImageFromFile added in v0.178.1

func (s *ImageService) ReadImageFromFile(filePath string) (*agentdomain.ImageAttachment, error)

ReadImageFromFile reads an image from a file path and returns it as a base64 attachment

func (*ImageService) ReadImageFromURL added in v0.178.1

func (s *ImageService) ReadImageFromURL(imageURL string) (*agentdomain.ImageAttachment, error)

ReadImageFromURL fetches an image from a URL and returns it as a base64 attachment. URLs reach this from untrusted sources (LLM tool arguments), so only http(s) to public addresses is allowed.

type MusicService added in v0.206.0

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

MusicService composes music clips through the gateway's Music API (POST /v1/audio/music), so requests show up in gateway logs and traces. It implements agentdomain.MusicService.

func NewMusicService added in v0.206.0

func NewMusicService(cfg *config.Config, client sdk.Client) *MusicService

NewMusicService creates a new gateway-backed music service.

func (*MusicService) Compose added in v0.206.0

func (s *MusicService) Compose(ctx context.Context, prompt, outPath string, seconds *float32, instrumental *bool) error

Compose generates a music clip for prompt using the configured text_to_music.model ("provider/model"), writing MP3 audio to outPath (the gateway music providers serve mp3; WAV is not offered by elevenlabs). A non-nil seconds caps the clip length; a non-nil instrumental requests a clip without vocals. Errors name the configured model so a gateway without the endpoint (or a provider that rejects it) is diagnosable.

type SFXService added in v0.206.0

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

SFXService generates sound effects through the gateway's SFX API (POST /v1/audio/sfx), so requests show up in gateway logs and traces. It implements agentdomain.SoundEffectService.

func NewSFXService added in v0.206.0

func NewSFXService(cfg *config.Config, client sdk.Client) *SFXService

NewSFXService creates a new gateway-backed sound-effect service.

func (*SFXService) Generate added in v0.206.0

func (s *SFXService) Generate(ctx context.Context, prompt, outPath string, seconds *float32, loop *bool) error

Generate produces a sound effect for prompt using the configured text_to_sfx.model ("provider/model"), writing MP3 audio to outPath. A non-nil seconds caps the clip length; a non-nil loop requests a seamless loop. Errors name the configured model so a gateway without the endpoint (or a provider that rejects it) is diagnosable.

type SpeechService added in v0.186.0

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

SpeechService synthesizes speech through the gateway's Audio API (POST /v1/audio/speech), so requests show up in gateway logs and traces. It implements agentdomain.SpeechService.

func NewSpeechService added in v0.186.0

func NewSpeechService(cfg *config.Config, client sdk.Client) *SpeechService

NewSpeechService creates a new gateway-backed speech service.

func (*SpeechService) Synthesize added in v0.186.0

func (s *SpeechService) Synthesize(ctx context.Context, text, voiceSamplePath, outPath string) error

Synthesize generates speech for text using the configured text_to_speech.model ("provider/model") and voice, writing WAV audio to outPath. A non-empty voiceSamplePath is sent as a reference sample for zero-shot voice cloning on providers that support it.

type VideoService added in v0.206.0

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

VideoService renders video clips through the gateway's Videos API (POST /v1/videos, GET /v1/videos/{id}, GET /v1/videos/{id}/content), so requests show up in gateway logs and traces. It implements agentdomain.VideoService.

func NewVideoService added in v0.206.0

func NewVideoService(cfg *config.Config, client sdk.Client) *VideoService

NewVideoService creates a new gateway-backed video service.

func (*VideoService) Render added in v0.206.0

func (s *VideoService) Render(ctx context.Context, request agentdomain.VideoRequest, outPath string) error

Render creates the video job for request, polls it until it completes and writes the downloaded MP4 content to outPath. An avatar request (audio set) is a lip-synced talking clip rendered with text_to_video.avatar_model; any other request is rendered with text_to_video.model. Errors name the configured model so a gateway without the endpoint (or a provider that rejects it) is diagnosable.

Jump to

Keyboard shortcuts

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