mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
639b32703a
* Support streaming * fix: stream pico reasoning updates Route Pico reasoning through the active streamer and hide empty thought placeholders. * fix: harden configured streaming delivery * fix ci * fix split issue
41 lines
1.2 KiB
Go
41 lines
1.2 KiB
Go
// PicoClaw - Ultra-lightweight personal AI agent
|
|
|
|
package adapters
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/sipeed/picoclaw/pkg/agent/interfaces"
|
|
"github.com/sipeed/picoclaw/pkg/bus"
|
|
)
|
|
|
|
// messageBusAdapter wraps *bus.MessageBus to implement interfaces.MessageBus.
|
|
type messageBusAdapter struct {
|
|
inner *bus.MessageBus
|
|
}
|
|
|
|
// NewMessageBus creates an adapter for *bus.MessageBus.
|
|
func NewMessageBus(inner *bus.MessageBus) interfaces.MessageBus {
|
|
return &messageBusAdapter{inner: inner}
|
|
}
|
|
|
|
func (a *messageBusAdapter) PublishInbound(ctx context.Context, msg bus.InboundMessage) error {
|
|
return a.inner.PublishInbound(ctx, msg)
|
|
}
|
|
|
|
func (a *messageBusAdapter) PublishOutbound(ctx context.Context, msg bus.OutboundMessage) error {
|
|
return a.inner.PublishOutbound(ctx, msg)
|
|
}
|
|
|
|
func (a *messageBusAdapter) PublishOutboundMedia(ctx context.Context, msg bus.OutboundMediaMessage) error {
|
|
return a.inner.PublishOutboundMedia(ctx, msg)
|
|
}
|
|
|
|
func (a *messageBusAdapter) GetStreamer(ctx context.Context, channel, chatID, sessionKey string) (bus.Streamer, bool) {
|
|
return a.inner.GetStreamer(ctx, channel, chatID, sessionKey)
|
|
}
|
|
|
|
func (a *messageBusAdapter) InboundChan() <-chan bus.InboundMessage {
|
|
return a.inner.InboundChan()
|
|
}
|