Documentation
¶
Index ¶
Constants ¶
View Source
const ( SystemChannel = "system" SystemTypeSubagentResult = "subagent_result" SystemMetaType = "system_type" SystemMetaTaskID = "task_id" SystemMetaTaskLabel = "task_label" SystemMetaOriginChannel = "origin_channel" SystemMetaOriginChatID = "origin_chat_id" SystemMetaOriginSender = "origin_sender_id" SystemMetaStatus = "status" )
Variables ¶
This section is empty.
Functions ¶
func NewRequestID ¶ added in v0.1.5
func NewRequestID() string
NewRequestID creates a request id for tracing.
func RequestIDFromContext ¶ added in v0.1.5
RequestIDFromContext reads request id from context.
Types ¶
type InboundMessage ¶
type InboundMessage struct {
Channel string
SenderID string
ChatID string
SessionID string
Content string
Timestamp time.Time
Media []string
Metadata map[string]any
RequestID string
}
InboundMessage received from a channel
func NewSubagentResultInbound ¶ added in v0.3.0
func NewSubagentResultInbound(taskID, label, originChannel, originChatID, originSenderID, result, requestID string, runErr error) *InboundMessage
NewSubagentResultInbound creates a normalized system message for async subagent callbacks.
func (*InboundMessage) SessionKey ¶
func (m *InboundMessage) SessionKey() string
SessionKey returns unique session identifier
type MessageBus ¶
type MessageBus struct {
// contains filtered or unexported fields
}
MessageBus handles message routing between channels and agent
func NewMessageBus ¶
func NewMessageBus(bufferSize int) *MessageBus
NewMessageBus creates a new message bus
func (*MessageBus) Inbound ¶
func (b *MessageBus) Inbound() <-chan *InboundMessage
Inbound returns the inbound channel for consuming
func (*MessageBus) Outbound ¶
func (b *MessageBus) Outbound() <-chan *OutboundMessage
Outbound returns the outbound channel for consuming
func (*MessageBus) PublishInbound ¶
func (b *MessageBus) PublishInbound(msg *InboundMessage)
PublishInbound sends a message to the agent
func (*MessageBus) PublishOutbound ¶
func (b *MessageBus) PublishOutbound(msg *OutboundMessage)
PublishOutbound sends a message to channels
Click to show internal directories.
Click to hide internal directories.