Documentation
¶
Index ¶
- type AgentState
- type IVRActivity
- func (i *IVRActivity) OnAgentStateChanged(oldState, newState AgentState)
- func (i *IVRActivity) OnUserInputTranscribed(ev *UserInputTranscribedEvent)
- func (i *IVRActivity) OnUserStateChanged(oldState, newState UserState)
- func (i *IVRActivity) Start()
- func (i *IVRActivity) Stop()
- func (i *IVRActivity) Tools() []interface{}
- type IVRSession
- type LoopDetector
- type SendDTMFTool
- type UserInputTranscribedEvent
- type UserState
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) 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 ¶
UserInputTranscribedEvent represents a transcription event (mirrored from agent package)
Click to show internal directories.
Click to hide internal directories.