callmanager

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package callmanager orchestrates voice calls using the omnivoice stack.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallState

type CallState struct {
	ID              string
	Call            callsystem.Call
	StartTime       time.Time
	Conversation    []ConversationTurn
	LastUserMessage string
	// contains filtered or unexported fields
}

CallState represents the state of an active call.

func (*CallState) AddTurn

func (cs *CallState) AddTurn(role, content string)

AddTurn adds a conversation turn.

func (*CallState) Duration

func (cs *CallState) Duration() time.Duration

Duration returns the call duration.

type ConversationTurn

type ConversationTurn struct {
	Role      string // "assistant" or "user"
	Content   string
	Timestamp time.Time
}

ConversationTurn represents a single turn in the conversation.

type Manager

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

Manager orchestrates voice calls using the omnivoice stack.

func New

func New(cfg *config.Config) (*Manager, error)

New creates a new call manager.

func (*Manager) Close

func (m *Manager) Close() error

Close shuts down the call manager.

func (*Manager) ContinueCall

func (m *Manager) ContinueCall(ctx context.Context, callID, message string) (string, error)

ContinueCall continues an existing call with a new message.

func (*Manager) EndCall

func (m *Manager) EndCall(ctx context.Context, callID, message string) (time.Duration, error)

EndCall ends an existing call with a final message.

func (*Manager) GetCall

func (m *Manager) GetCall(callID string) *CallState

GetCall returns the state of a call.

func (*Manager) Initialize

func (m *Manager) Initialize(publicURL string) error

Initialize sets up the omnivoice providers. Call this after ngrok is started and publicURL is known.

func (*Manager) InitiateCall

func (m *Manager) InitiateCall(ctx context.Context, message string) (*CallState, string, error)

InitiateCall starts a new call to the user and speaks a message.

func (*Manager) SpeakToUser

func (m *Manager) SpeakToUser(ctx context.Context, callID, message string) error

SpeakToUser speaks to the user without waiting for a response.

func (*Manager) Transport

func (m *Manager) Transport() interface{}

Transport returns the Twilio transport provider for WebSocket handling.

Jump to

Keyboard shortcuts

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