Documentation
¶
Index ¶
- Constants
- func ValidateDtmfNumDigits(numDigits int) error
- type AgentOptions
- type CardCaptureDeclinedError
- type CardCollectionRestartError
- type FactoryInfo
- type GetAddressOptions
- type GetAddressResult
- type GetAddressTask
- type GetCardNumberOptions
- type GetCardNumberResult
- type GetCardNumberTask
- type GetCreditCardOptions
- type GetCreditCardResult
- type GetCreditCardTask
- type GetDOBOptions
- type GetDOBResult
- type GetDOBTask
- type GetDtmfOptions
- type GetDtmfResult
- type GetDtmfTask
- type GetEmailOptions
- type GetEmailResult
- type GetEmailTask
- type GetExpirationDateOptions
- type GetExpirationDateResult
- type GetExpirationDateTask
- type GetNameOptions
- type GetNameResult
- type GetNameTask
- type GetPhoneNumberOptions
- type GetPhoneNumberResult
- type GetPhoneNumberTask
- type GetSecurityCodeOptions
- type GetSecurityCodeResult
- type GetSecurityCodeTask
- type OutOfScopeError
- type TaskCompletedEvent
- type TaskGroup
- type TaskGroupResult
- type WarmTransferOptions
- type WarmTransferResult
- type WarmTransferTask
Constants ¶
View Source
const AddressInstructions = addressInstructionsBeforeConfirmation + addressConfirmationInstruction + "\n" + addressInstructionsAfterConfirmation
View Source
const CardNumberInstructions = `` /* 726-byte string literal not displayed */
View Source
const CreditCardInstructions = "*none*"
View Source
const EmailInstructions = emailInstructionsBeforeConfirmation + emailConfirmationInstruction + "\n" + emailInstructionsAfterConfirmation
View Source
const ExpirationDateInstructions = `` /* 779-byte string literal not displayed */
View Source
const PhoneNumberInstructions = "You are only a single step in a broader system, responsible solely for capturing a phone number.\n" +
"Handle input as noisy voice transcription. Expect that users will say phone numbers aloud with formats like:\n" +
"- '555 123 4567'\n" +
"- 'five five five, one two three, four five six seven'\n" +
"- '+1 555 123 4567'\n" +
"- 'area code 555, 123 4567'\n" +
"- '555-123-4567'\n" +
"Normalize common spoken patterns silently:\n" +
"- Convert spoken digits to their numeric form: 'five' → 5, 'zero' → 0, 'oh' → 0.\n" +
"- Remove filler words, pauses, and hesitations.\n" +
"- Strip dashes, spaces, parentheses, and dots from the number.\n" +
"- Recognize 'plus' at the start as the international prefix `+`.\n" +
"- Recognize 'area code' as a prefix for the area code digits.\n" +
"Don't mention corrections. Treat inputs as possibly imperfect but fix them silently.\n" +
"Call `update_phone_number` at the first opportunity whenever you form a new hypothesis about the phone number. (before asking any questions or providing any answers.)\n" +
"Don't invent phone numbers, stick strictly to what the user said.\n" +
phoneNumberConfirmationInstruction + "\n" +
"If the number is unclear or invalid, or it takes too much back-and-forth, prompt for it in parts: first the area code, then the remaining digits.\n" +
"Ask the user to confirm the updated phone number without repeating it back.\n" +
"Ignore unrelated input and avoid going off-topic. Do not generate markdown, greetings, or unnecessary commentary.\n" +
"Avoid verbosity by not sharing example phone numbers or formats unless prompted to do so. Do not deviate from the goal of collecting the user's phone number.\n" +
"Always explicitly invoke a tool when applicable. Do not simulate tool usage, no real action is taken unless the tool is explicitly called."
View Source
const SecurityCodeInstructions = `` /* 711-byte string literal not displayed */
View Source
const WarmTransferBaseInstructions = warmTransferPersona + `
# Context
In the conversation, user refers to the human agent, caller refers to the person who's transcript is included.
Remember, you are not speaking to the caller right now, you are speaking to the human agent.
## Conversation history with caller
%s
## End of conversation history with caller
Once the human agent has confirmed, you should call the tool ` + "`connect_to_caller`" + ` to connect them to the caller.
You are talking to the human agent now, start by giving them a summary of the conversation so far, and answer any questions they might have.`
Variables ¶
This section is empty.
Functions ¶
func ValidateDtmfNumDigits ¶ added in v0.0.15
Types ¶
type AgentOptions ¶ added in v0.1.8
type CardCaptureDeclinedError ¶ added in v0.0.15
type CardCaptureDeclinedError struct {
Reason string
}
func (*CardCaptureDeclinedError) Error ¶ added in v0.0.15
func (e *CardCaptureDeclinedError) Error() string
type CardCollectionRestartError ¶ added in v0.0.15
type CardCollectionRestartError struct {
Reason string
}
func (*CardCollectionRestartError) Error ¶ added in v0.0.15
func (e *CardCollectionRestartError) Error() string
type FactoryInfo ¶
type FactoryInfo struct {
ID string
Description string
TaskFactory func() agent.AgentInterface
}
type GetAddressOptions ¶ added in v0.0.15
type GetAddressOptions struct {
AgentOptions
RequireConfirmation bool
RequireConfirmationSet bool
RequireExplicitAsk bool
ExtraInstructions string
Instructions *beta.InstructionParts
ChatContext *llm.ChatContext
Tools []llm.Tool
}
type GetAddressResult ¶
type GetAddressResult struct {
Address string
}
type GetAddressTask ¶
type GetAddressTask struct {
agent.AgentTask[*GetAddressResult]
RequireConfirmation bool
RequireConfirmationSet bool
RequireExplicitAsk bool
// contains filtered or unexported fields
}
func NewGetAddressTask ¶
func NewGetAddressTask(opts GetAddressOptions) *GetAddressTask
func (*GetAddressTask) OnEnter ¶
func (t *GetAddressTask) OnEnter()
type GetCardNumberOptions ¶ added in v0.1.8
type GetCardNumberResult ¶ added in v0.0.15
type GetCardNumberTask ¶ added in v0.0.15
type GetCardNumberTask struct {
agent.AgentTask[*GetCardNumberResult]
RequireConfirmation bool
RequireConfirmationSet bool
RequireExplicitAsk bool
ExtraInstructions string
// contains filtered or unexported fields
}
func NewGetCardNumberTask ¶ added in v0.0.15
func NewGetCardNumberTask(requireConfirmation ...bool) *GetCardNumberTask
func NewGetCardNumberTaskWithOptions ¶ added in v0.1.8
func NewGetCardNumberTaskWithOptions(opts GetCardNumberOptions) *GetCardNumberTask
func (*GetCardNumberTask) OnEnter ¶ added in v0.0.15
func (t *GetCardNumberTask) OnEnter()
type GetCreditCardOptions ¶ added in v0.1.8
type GetCreditCardOptions struct {
AgentOptions
RequireConfirmation bool
RequireConfirmationSet bool
ExtraInstructions string
ChatContext *llm.ChatContext
Tools []llm.Tool
}
type GetCreditCardResult ¶ added in v0.0.15
type GetCreditCardTask ¶ added in v0.0.15
type GetCreditCardTask struct {
agent.AgentTask[*GetCreditCardResult]
RequireConfirmation bool
RequireConfirmationSet bool
ExtraInstructions string
}
func NewGetCreditCardTask ¶ added in v0.0.15
func NewGetCreditCardTask(requireConfirmation ...bool) *GetCreditCardTask
func NewGetCreditCardTaskWithOptions ¶ added in v0.1.8
func NewGetCreditCardTaskWithOptions(opts GetCreditCardOptions) *GetCreditCardTask
func (*GetCreditCardTask) OnEnter ¶ added in v0.0.15
func (t *GetCreditCardTask) OnEnter()
type GetDOBOptions ¶ added in v0.0.15
type GetDOBOptions struct {
AgentOptions
ExtraInstructions string
IncludeTime bool
RequireConfirmation bool
RequireConfirmationSet bool
RequireExplicitAsk bool
ChatContext *llm.ChatContext
Tools []llm.Tool
}
type GetDOBResult ¶ added in v0.0.15
type GetDOBTask ¶ added in v0.0.15
type GetDOBTask struct {
agent.AgentTask[*GetDOBResult]
ExtraInstructions string
IncludeTime bool
RequireConfirmation bool
RequireConfirmationSet bool
RequireExplicitAsk bool
// contains filtered or unexported fields
}
func NewGetDOBTask ¶ added in v0.0.15
func NewGetDOBTask(opts GetDOBOptions) *GetDOBTask
func (*GetDOBTask) OnEnter ¶ added in v0.0.15
func (t *GetDOBTask) OnEnter()
type GetDtmfOptions ¶ added in v0.0.15
type GetDtmfResult ¶
type GetDtmfResult struct {
UserInput string
}
type GetDtmfTask ¶
type GetDtmfTask struct {
agent.AgentTask[*GetDtmfResult]
NumDigits int
AskForConfirmation bool
DtmfInputTimeout time.Duration
DtmfStopEvent beta.DtmfEvent
// contains filtered or unexported fields
}
func NewGetDtmfTask ¶
func NewGetDtmfTask(numDigits int, askConfirmation bool) (*GetDtmfTask, error)
func NewGetDtmfTaskWithOptions ¶ added in v0.0.15
func NewGetDtmfTaskWithOptions(opts GetDtmfOptions) (*GetDtmfTask, error)
func (*GetDtmfTask) OnEnter ¶
func (t *GetDtmfTask) OnEnter()
func (*GetDtmfTask) OnExit ¶
func (t *GetDtmfTask) OnExit()
type GetEmailOptions ¶ added in v0.0.15
type GetEmailOptions struct {
AgentOptions
RequireConfirmation bool
RequireConfirmationSet bool
RequireExplicitAsk bool
ExtraInstructions string
Instructions *beta.InstructionParts
ChatContext *llm.ChatContext
Tools []llm.Tool
}
type GetEmailResult ¶
type GetEmailResult struct {
Email string
}
type GetEmailTask ¶
type GetEmailTask struct {
agent.AgentTask[*GetEmailResult]
RequireConfirmation bool
RequireConfirmationSet bool
RequireExplicitAsk bool
// contains filtered or unexported fields
}
func NewGetEmailTask ¶
func NewGetEmailTask(opts GetEmailOptions) *GetEmailTask
func (*GetEmailTask) OnEnter ¶
func (t *GetEmailTask) OnEnter()
type GetExpirationDateOptions ¶ added in v0.1.8
type GetExpirationDateResult ¶ added in v0.0.15
type GetExpirationDateResult struct {
Date string
}
type GetExpirationDateTask ¶ added in v0.0.15
type GetExpirationDateTask struct {
agent.AgentTask[*GetExpirationDateResult]
RequireConfirmation bool
RequireConfirmationSet bool
RequireExplicitAsk bool
ExtraInstructions string
// contains filtered or unexported fields
}
func NewGetExpirationDateTask ¶ added in v0.0.15
func NewGetExpirationDateTask(requireConfirmation ...bool) *GetExpirationDateTask
func NewGetExpirationDateTaskWithOptions ¶ added in v0.1.8
func NewGetExpirationDateTaskWithOptions(opts GetExpirationDateOptions) *GetExpirationDateTask
func (*GetExpirationDateTask) OnEnter ¶ added in v0.0.15
func (t *GetExpirationDateTask) OnEnter()
type GetNameOptions ¶ added in v0.0.15
type GetNameResult ¶ added in v0.0.15
type GetNameTask ¶ added in v0.0.15
type GetNameTask struct {
agent.AgentTask[*GetNameResult]
RequireConfirmation bool
RequireConfirmationSet bool
RequireExplicitAsk bool
CollectFirstName bool
CollectMiddleName bool
CollectLastName bool
VerifySpelling bool
// contains filtered or unexported fields
}
func NewGetNameTask ¶ added in v0.0.15
func NewGetNameTask(opts GetNameOptions) *GetNameTask
func (*GetNameTask) OnEnter ¶ added in v0.0.15
func (t *GetNameTask) OnEnter()
type GetPhoneNumberOptions ¶ added in v0.0.15
type GetPhoneNumberOptions struct {
AgentOptions
ExtraInstructions string
RequireConfirmation bool
RequireConfirmationSet bool
RequireExplicitAsk bool
ChatContext *llm.ChatContext
Tools []llm.Tool
}
type GetPhoneNumberResult ¶ added in v0.0.15
type GetPhoneNumberResult struct {
PhoneNumber string
}
type GetPhoneNumberTask ¶ added in v0.0.15
type GetPhoneNumberTask struct {
agent.AgentTask[*GetPhoneNumberResult]
ExtraInstructions string
RequireConfirmation bool
RequireConfirmationSet bool
RequireExplicitAsk bool
// contains filtered or unexported fields
}
func NewGetPhoneNumberTask ¶ added in v0.0.15
func NewGetPhoneNumberTask(opts GetPhoneNumberOptions) *GetPhoneNumberTask
func (*GetPhoneNumberTask) OnEnter ¶ added in v0.0.15
func (t *GetPhoneNumberTask) OnEnter()
type GetSecurityCodeOptions ¶ added in v0.1.8
type GetSecurityCodeResult ¶ added in v0.0.15
type GetSecurityCodeResult struct {
SecurityCode string
}
type GetSecurityCodeTask ¶ added in v0.0.15
type GetSecurityCodeTask struct {
agent.AgentTask[*GetSecurityCodeResult]
RequireConfirmation bool
RequireConfirmationSet bool
RequireExplicitAsk bool
ExtraInstructions string
// contains filtered or unexported fields
}
func NewGetSecurityCodeTask ¶ added in v0.0.15
func NewGetSecurityCodeTask(requireConfirmation ...bool) *GetSecurityCodeTask
func NewGetSecurityCodeTaskWithOptions ¶ added in v0.1.8
func NewGetSecurityCodeTaskWithOptions(opts GetSecurityCodeOptions) *GetSecurityCodeTask
func (*GetSecurityCodeTask) OnEnter ¶ added in v0.0.15
func (t *GetSecurityCodeTask) OnEnter()
type OutOfScopeError ¶
type OutOfScopeError struct {
TargetTaskIDs []string
}
func (*OutOfScopeError) Error ¶
func (e *OutOfScopeError) Error() string
type TaskCompletedEvent ¶ added in v0.1.8
type TaskCompletedEvent struct {
AgentTask agent.AgentInterface
TaskID string
Result any
}
type TaskGroup ¶
type TaskGroup struct {
agent.AgentTask[*TaskGroupResult]
SummarizeChatCtx bool
ReturnExceptions bool
VisitedTasks map[string]struct{}
RegisteredTasks []FactoryInfo
OnTaskCompleted func(taskID string, result any) error
OnTaskCompletedEvent func(TaskCompletedEvent) error
// contains filtered or unexported fields
}
func NewTaskGroup ¶
type TaskGroupResult ¶
type WarmTransferOptions ¶ added in v0.0.15
type WarmTransferOptions struct {
AgentOptions
TargetPhone string
TargetPhoneNumber string
TrunkID string
TrunkIDSet bool
SipConnection *livekit.SIPOutboundConfig
SipNumber string
SipNumberSet bool
SipHeaders map[string]string
Dtmf string
RingingTimeout time.Duration
RingingTimeoutSet bool
HoldAudio interface{}
DisableHoldAudio bool
ChatContext *llm.ChatContext
ExtraInstructions string
Instructions *beta.InstructionParts
Tools []llm.Tool
}
type WarmTransferResult ¶
type WarmTransferResult struct {
HumanAgentIdentity string
}
type WarmTransferTask ¶
type WarmTransferTask struct {
agent.AgentTask[*WarmTransferResult]
TargetPhoneNumber string
SipTrunkID string
SipConnection *livekit.SIPOutboundConfig
SipNumber string
SipHeaders map[string]string
Dtmf string
RingingTimeout time.Duration
RingingTimeoutSet bool
HoldAudio interface{}
// contains filtered or unexported fields
}
func NewWarmTransferTask ¶
func NewWarmTransferTask(targetPhone string, trunkId string, chatCtx *llm.ChatContext, extraInstructions string) (*WarmTransferTask, error)
func NewWarmTransferTaskWithOptions ¶ added in v0.0.15
func NewWarmTransferTaskWithOptions(opts WarmTransferOptions) (*WarmTransferTask, error)
func (*WarmTransferTask) ConnectToCaller ¶
func (t *WarmTransferTask) ConnectToCaller() error
func (*WarmTransferTask) OnEnter ¶
func (t *WarmTransferTask) OnEnter()
func (*WarmTransferTask) OnExit ¶
func (t *WarmTransferTask) OnExit()
Click to show internal directories.
Click to hide internal directories.