assistant

package
v0.32.17 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultHotkey     = "Ctrl+Option+Space"
	DefaultAudioInput = "default"
)
View Source
const DefaultLaunchAgentLabel = launchagent.DefaultAssistantLabel

Variables

This section is empty.

Functions

func BuildLaunchAgentPlist

func BuildLaunchAgentPlist(cfg LaunchAgentConfig) string

func DefaultLaunchAgentPath

func DefaultLaunchAgentPath(label string) (string, error)

func InstallLaunchAgent

func InstallLaunchAgent(path string, content string) error

func Start

func Start(ctx context.Context, opts StartOptions) error

Types

type DoctorCheck

type DoctorCheck struct {
	Name  string `json:"name"`
	Path  string `json:"path,omitempty"`
	Found bool   `json:"found"`
	Error string `json:"error,omitempty"`
}

type DoctorOptions

type DoctorOptions struct {
	LookupPath    func(file string) (string, error)
	WhisperBinary string
	FFmpegBinary  string
	TTSBinary     string
}

type DoctorReport

type DoctorReport struct {
	OK      bool          `json:"ok"`
	Checks  []DoctorCheck `json:"checks"`
	Missing []string      `json:"missing,omitempty"`
	Notes   []string      `json:"notes,omitempty"`
}

func RunDoctor

func RunDoctor(opts DoctorOptions) DoctorReport

type LaunchAgentConfig

type LaunchAgentConfig = launchagent.Config

type PushToTalkState

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

func (*PushToTalkState) HandlePressed

func (s *PushToTalkState) HandlePressed() bool

func (*PushToTalkState) HandleReleased

func (s *PushToTalkState) HandleReleased() bool

func (*PushToTalkState) Recording

func (s *PushToTalkState) Recording() bool

type Speaker

type Speaker interface {
	Speak(ctx context.Context, text string) error
}

type StartOptions

type StartOptions struct {
	ServerURL       string
	SessionID       string
	APIToken        string
	WorkspaceDir    string
	Hotkey          string
	AudioInput      string
	WhisperBin      string
	WhisperModel    string
	WhisperLanguage string
	FFmpegBin       string
	TTSBin          string
	Stdin           io.Reader
	Stdout          io.Writer
	Stderr          io.Writer
}

type Transcriber

type Transcriber interface {
	Transcribe(ctx context.Context, audioPath string) (string, error)
}

type VoiceChatClient

type VoiceChatClient interface {
	Chat(ctx context.Context, message string, sessionID string) (assistantReply string, nextSessionID string, err error)
}

type VoiceTurnDeps

type VoiceTurnDeps struct {
	Transcriber Transcriber
	ChatClient  VoiceChatClient
	Speaker     Speaker
	SessionID   string
}

type VoiceTurnResult

type VoiceTurnResult struct {
	Transcript     string
	AssistantReply string
	SessionID      string
	TTSError       string
}

func RunTextTurn

func RunTextTurn(ctx context.Context, deps VoiceTurnDeps, text string) (VoiceTurnResult, error)

func RunVoiceTurn

func RunVoiceTurn(ctx context.Context, deps VoiceTurnDeps, audioPath string) (VoiceTurnResult, error)

Jump to

Keyboard shortcuts

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