platform

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package platform provides runtime platform abstractions for omniagent.

Platforms define how the agent is deployed and run. The standalone platform runs a local HTTP server with WebSocket and webhook support. Future platforms may include AWS Lambda, Bedrock AgentCore, or other serverless environments.

Example Usage

// Create standalone platform
p, _ := standalone.New(standalone.Config{
    Address: ":8080",
    Channels: channelConfig,
})

// Run the platform with an agent
err := p.Run(ctx, myAgent)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Health

type Health struct {
	Status  string         `json:"status"` // "healthy", "degraded", "unhealthy"
	Details map[string]any `json:"details,omitempty"`
}

Health represents platform health status.

func Degraded

func Degraded(details map[string]any) Health

Degraded returns a degraded status with details.

func Healthy

func Healthy() Health

Healthy returns a healthy status.

func Unhealthy

func Unhealthy(details map[string]any) Health

Unhealthy returns an unhealthy status with details.

type HealthChecker

type HealthChecker interface {
	// Health returns the platform health status.
	Health(ctx context.Context) Health
}

HealthChecker provides health check capability.

type Lifecycle

type Lifecycle interface {
	// OnStart is called when the platform starts.
	OnStart(ctx context.Context) error

	// OnStop is called when the platform stops.
	OnStop(ctx context.Context) error
}

Lifecycle provides optional lifecycle hooks for platforms.

type Platform

type Platform interface {
	// Run starts the platform and blocks until context is cancelled.
	// The agent is used to process incoming messages.
	Run(ctx context.Context, agent *agent.Agent) error

	// Name returns the platform identifier (e.g., "standalone", "lambda").
	Name() string
}

Platform defines the runtime environment for an agent. Implementations handle server lifecycle, message routing, and platform-specific integrations.

Directories

Path Synopsis
Package standalone provides a standalone HTTP server platform for omniagent.
Package standalone provides a standalone HTTP server platform for omniagent.

Jump to

Keyboard shortcuts

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