ivr

package
v0.0.13 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentState

type AgentState string

AgentState represents the agent's state in the session (mirrored from agent package)

const (
	AgentStateIdle      AgentState = "idle"
	AgentStateListening AgentState = "listening"
	AgentStateSpeaking  AgentState = "speaking"
)

type IVRActivity

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

func NewIVRActivity

func NewIVRActivity(session IVRSession) *IVRActivity

func (*IVRActivity) OnAgentStateChanged

func (i *IVRActivity) OnAgentStateChanged(oldState, newState AgentState)

func (*IVRActivity) OnUserInputTranscribed

func (i *IVRActivity) OnUserInputTranscribed(ev *UserInputTranscribedEvent)

func (*IVRActivity) OnUserStateChanged

func (i *IVRActivity) OnUserStateChanged(oldState, newState UserState)

func (*IVRActivity) Start

func (i *IVRActivity) Start()

func (*IVRActivity) Stop

func (i *IVRActivity) Stop()

func (*IVRActivity) Tools

func (i *IVRActivity) Tools() []interface{}

type IVRSession

type IVRSession interface {
	GenerateReply(ctx context.Context, userInput string, allowInterruptions bool) (any, error)
	GetPublisher() interface {
		Identity() string
		PublishData(data []byte, topic string, destinationSIDs []string) error
	}
}

IVRSession interface defines the methods needed by IVRActivity from AgentSession

type LoopDetector

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

func NewLoopDetector

func NewLoopDetector() *LoopDetector

func (*LoopDetector) AddChunk

func (l *LoopDetector) AddChunk(chunk string)

func (*LoopDetector) CheckLoopDetection

func (l *LoopDetector) CheckLoopDetection() bool

func (*LoopDetector) Reset

func (l *LoopDetector) Reset()

type SendDTMFTool

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

SendDTMFTool implementation (mirrored from beta tools to avoid cycle)

func NewSendDTMFTool

func NewSendDTMFTool(publisher interface {
	PublishData(data []byte, topic string, destinationSIDs []string) error
}) *SendDTMFTool

func (*SendDTMFTool) Args

func (t *SendDTMFTool) Args() any

func (*SendDTMFTool) Description

func (t *SendDTMFTool) Description() string

func (*SendDTMFTool) Execute

func (t *SendDTMFTool) Execute(ctx context.Context, args any) (any, error)

func (*SendDTMFTool) ID

func (t *SendDTMFTool) ID() string

func (*SendDTMFTool) Name

func (t *SendDTMFTool) Name() string

func (*SendDTMFTool) Parameters

func (t *SendDTMFTool) Parameters() map[string]any

type UserInputTranscribedEvent

type UserInputTranscribedEvent struct {
	Transcript string
	IsFinal    bool
}

UserInputTranscribedEvent represents a transcription event (mirrored from agent package)

type UserState

type UserState string

UserState represents the user's state in the session (mirrored from agent package)

const (
	UserStateListening UserState = "listening"
	UserStateSpeaking  UserState = "speaking"
	UserStateAway      UserState = "away"
)

Jump to

Keyboard shortcuts

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