interfaces

package
v0.34.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type A2AInterface

type A2AInterface struct {
	*asteros.BaseInterface
	// contains filtered or unexported fields
}

A2AInterface Agent-to-Agent Interface A2AInterface 提供 Agent 之间的直接通信能力, 支持消息传递、状态查询和协作。

func NewA2AInterface

func NewA2AInterface(opts *A2AInterfaceOptions) *A2AInterface

NewA2AInterface 创建 A2A Interface

func (*A2AInterface) BroadcastMessage

func (i *A2AInterface) BroadcastMessage(ctx context.Context, fromID, message string) error

BroadcastMessage 广播消息给所有 Agents

func (*A2AInterface) ListAgents

func (i *A2AInterface) ListAgents() []string

ListAgents 列出所有可用的 Agents

func (*A2AInterface) OnAgentRegistered

func (i *A2AInterface) OnAgentRegistered(ag *agent.Agent) error

OnAgentRegistered Agent 注册事件

func (*A2AInterface) OnRoomRegistered added in v0.13.0

func (i *A2AInterface) OnRoomRegistered(r *core.Room) error

OnRoomRegistered Room 注册事件

func (*A2AInterface) OnWorkflowRegistered

func (i *A2AInterface) OnWorkflowRegistered(wf workflow.Agent) error

OnWorkflowRegistered Workflow 注册事件

func (*A2AInterface) QueryAgent

func (i *A2AInterface) QueryAgent(agentID string) (map[string]any, error)

QueryAgent 查询 Agent 状态

func (*A2AInterface) SendMessage

func (i *A2AInterface) SendMessage(ctx context.Context, fromID, toID, message string) error

SendMessage 发送消息给指定 Agent

func (*A2AInterface) Start

func (i *A2AInterface) Start(ctx context.Context, os *asteros.AsterOS) error

Start 启动 A2A Interface

func (*A2AInterface) Stop

func (i *A2AInterface) Stop(ctx context.Context) error

Stop 停止 A2A Interface

type A2AInterfaceOptions

type A2AInterfaceOptions struct {
	// GRPCPort gRPC 服务端口
	GRPCPort int

	// EnableLogging 是否启用日志
	EnableLogging bool

	// EnableDiscovery 是否启用服务发现
	EnableDiscovery bool
}

A2AInterfaceOptions A2A Interface 配置

type AGUIInterface

type AGUIInterface struct {
	*asteros.BaseInterface
	// contains filtered or unexported fields
}

AGUIInterface Agent GUI Interface AGUIInterface 连接到 Aster 控制平面 UI, 提供可视化的 Agent 管理和监控界面。

func NewAGUIInterface

func NewAGUIInterface(opts *AGUIInterfaceOptions) *AGUIInterface

NewAGUIInterface 创建 AGUI Interface

func (*AGUIInterface) GetControlPlaneURL

func (i *AGUIInterface) GetControlPlaneURL() string

GetControlPlaneURL 获取控制平面 URL

func (*AGUIInterface) IsConnected

func (i *AGUIInterface) IsConnected() bool

IsConnected 检查是否已连接(公开方法)

func (*AGUIInterface) OnAgentRegistered

func (i *AGUIInterface) OnAgentRegistered(ag *agent.Agent) error

OnAgentRegistered Agent 注册事件

func (*AGUIInterface) OnRoomRegistered added in v0.13.0

func (i *AGUIInterface) OnRoomRegistered(r *core.Room) error

OnRoomRegistered Room 注册事件

func (*AGUIInterface) OnWorkflowRegistered

func (i *AGUIInterface) OnWorkflowRegistered(wf workflow.Agent) error

OnWorkflowRegistered Workflow 注册事件

func (*AGUIInterface) Start

func (i *AGUIInterface) Start(ctx context.Context, os *asteros.AsterOS) error

Start 启动 AGUI Interface

func (*AGUIInterface) Stop

func (i *AGUIInterface) Stop(ctx context.Context) error

Stop 停止 AGUI Interface

type AGUIInterfaceOptions

type AGUIInterfaceOptions struct {
	// ControlPlaneURL 控制平面 URL
	ControlPlaneURL string

	// APIKey API Key
	APIKey string

	// EnableLogging 是否启用日志
	EnableLogging bool

	// SyncInterval 同步间隔
	SyncInterval time.Duration

	// EnableAutoSync 是否启用自动同步
	EnableAutoSync bool
}

AGUIInterfaceOptions AGUI Interface 配置

type HTTPInterface

type HTTPInterface struct {
	*asteros.BaseInterface
	// contains filtered or unexported fields
}

HTTPInterface HTTP REST API Interface HTTPInterface 是默认的 HTTP REST API 接口, 提供标准的 RESTful API 端点。

func NewHTTPInterface

func NewHTTPInterface(opts *HTTPInterfaceOptions) *HTTPInterface

NewHTTPInterface 创建 HTTP Interface

func (*HTTPInterface) OnAgentRegistered

func (i *HTTPInterface) OnAgentRegistered(agent *agent.Agent) error

OnAgentRegistered Agent 注册事件

func (*HTTPInterface) OnRoomRegistered added in v0.13.0

func (i *HTTPInterface) OnRoomRegistered(r *core.Room) error

OnRoomRegistered Room 注册事件

func (*HTTPInterface) OnWorkflowRegistered

func (i *HTTPInterface) OnWorkflowRegistered(wf workflow.Agent) error

OnWorkflowRegistered Workflow 注册事件

func (*HTTPInterface) Start

func (i *HTTPInterface) Start(ctx context.Context, os *asteros.AsterOS) error

Start 启动 HTTP Interface

func (*HTTPInterface) Stop

func (i *HTTPInterface) Stop(ctx context.Context) error

Stop 停止 HTTP Interface

type HTTPInterfaceOptions

type HTTPInterfaceOptions struct {
	// Port HTTP 服务端口(如果与 AsterOS 主端口不同)
	Port int

	// EnableLogging 是否启用日志
	EnableLogging bool

	// CustomRoutes 自定义路由
	CustomRoutes func(os *asteros.AsterOS)
}

HTTPInterfaceOptions HTTP Interface 配置

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL