32 lines
1.1 KiB
Go
32 lines
1.1 KiB
Go
|
|
package contract
|
||
|
|
|
||
|
|
import "context"
|
||
|
|
|
||
|
|
// BusinessReadContext identifies the customer bound to the current support
|
||
|
|
// conversation. Host tools must use these trusted values instead of accepting
|
||
|
|
// customer identifiers from model-generated arguments.
|
||
|
|
type BusinessReadContext struct {
|
||
|
|
ConversationID int64
|
||
|
|
CustomerType string
|
||
|
|
CustomerID int64
|
||
|
|
CustomerExternalID string
|
||
|
|
CustomerName string
|
||
|
|
RequestMessageID int64
|
||
|
|
RequestID string
|
||
|
|
CheckPointID string
|
||
|
|
AccessProof *CustomerAccessProof
|
||
|
|
}
|
||
|
|
|
||
|
|
// BusinessReadTool lets the host expose a narrowly scoped, read-only business
|
||
|
|
// query to AI Agent without coupling the customer-service module to host data.
|
||
|
|
type BusinessReadTool struct {
|
||
|
|
Code string
|
||
|
|
Description string
|
||
|
|
CustomerTypes []string
|
||
|
|
InputSchema map[string]any
|
||
|
|
// MatchIntent lets the host require a fresh read for messages whose answer
|
||
|
|
// must not rely on stale conversational text. It must be side-effect free.
|
||
|
|
MatchIntent func(string) bool
|
||
|
|
Execute func(context.Context, BusinessReadContext, map[string]any) (any, error)
|
||
|
|
}
|