Documentation
¶
Overview ¶
Package remoteview provides types for observing and controlling remote Pando instances over the IPC ZeroMQ bus.
Index ¶
- type Event
- type RemoteControl
- func (rc *RemoteControl) GetSession(ctx context.Context, sessionID string) (protocol.SessionPayload, error)
- func (rc *RemoteControl) Interrupt(ctx context.Context, sessionID string) error
- func (rc *RemoteControl) ListSessions(ctx context.Context) ([]protocol.SessionPayload, error)
- func (rc *RemoteControl) Ping(ctx context.Context) (protocol.PingResult, error)
- func (rc *RemoteControl) SendMessage(ctx context.Context, sessionID, content string) error
- func (rc *RemoteControl) SwitchSession(ctx context.Context, sessionID string) error
- type RemoteSession
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
// Topic is the ZMQ topic string (e.g. "message.append", "llm.token").
Topic string
// Payload contains the raw JSON payload of the event.
Payload json.RawMessage
}
Event is a live event received from a remote instance's PUB stream.
type RemoteControl ¶
type RemoteControl struct {
// contains filtered or unexported fields
}
RemoteControl wraps an ipc.Client with typed methods for controlling a remote Pando instance over the ROUTER/DEALER JSON-RPC channel.
func NewRemoteControl ¶
func NewRemoteControl(ctx context.Context, rpcEndpoint string) (*RemoteControl, error)
NewRemoteControl creates a RemoteControl that sends RPC calls to rpcEndpoint (e.g. "tcp://127.0.0.1:5552").
func (*RemoteControl) GetSession ¶
func (rc *RemoteControl) GetSession(ctx context.Context, sessionID string) (protocol.SessionPayload, error)
GetSession returns details for a single session on the remote instance.
func (*RemoteControl) Interrupt ¶
func (rc *RemoteControl) Interrupt(ctx context.Context, sessionID string) error
Interrupt cancels the running LLM call for the given session on the remote instance.
func (*RemoteControl) ListSessions ¶
func (rc *RemoteControl) ListSessions(ctx context.Context) ([]protocol.SessionPayload, error)
ListSessions returns the list of sessions on the remote instance.
func (*RemoteControl) Ping ¶
func (rc *RemoteControl) Ping(ctx context.Context) (protocol.PingResult, error)
Ping checks that the remote instance is alive and returns its status.
func (*RemoteControl) SendMessage ¶
func (rc *RemoteControl) SendMessage(ctx context.Context, sessionID, content string) error
SendMessage sends a user message to the specified session on the remote instance.
func (*RemoteControl) SwitchSession ¶
func (rc *RemoteControl) SwitchSession(ctx context.Context, sessionID string) error
SwitchSession activates the given sessionID on the remote instance.
type RemoteSession ¶
type RemoteSession struct {
// contains filtered or unexported fields
}
RemoteSession subscribes to a remote instance's PUB stream and keeps a local mirror of the session state via an initial state.sync RPC bootstrap.
func NewRemoteSession ¶
func NewRemoteSession(ctx context.Context, instanceID, sessionID, pubEndpoint, rpcEndpoint string) (*RemoteSession, error)
NewRemoteSession creates a RemoteSession for the given instanceID and session. pubEndpoint and rpcEndpoint are tcp:// addresses (e.g. "tcp://127.0.0.1:5551"). The caller must invoke Sync to bootstrap the initial state.
func (*RemoteSession) InstanceID ¶
func (rs *RemoteSession) InstanceID() string
InstanceID returns the remote instance identifier.
func (*RemoteSession) Messages ¶
func (rs *RemoteSession) Messages() <-chan Event
Messages returns a read-only channel that receives live events (message.append, llm.token, session.update, etc.) from the remote instance. The channel is closed when the context used in NewRemoteSession is cancelled.
func (*RemoteSession) Mirror ¶
func (rs *RemoteSession) Mirror() []protocol.SessionPayload
Mirror returns the cached list of sessions from the last Sync call.
func (*RemoteSession) SessionID ¶
func (rs *RemoteSession) SessionID() string
SessionID returns the session identifier this view is tracking.