runtimeapi

package
v0.6.124 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvBaseURL = "ALICE_RUNTIME_API_BASE_URL"
	EnvToken   = "ALICE_RUNTIME_API_TOKEN"
	EnvBin     = "ALICE_RUNTIME_BIN"

	HeaderReceiveIDType   = "X-Alice-Receive-Id-Type"
	HeaderReceiveID       = "X-Alice-Receive-Id"
	HeaderSourceMessageID = "X-Alice-Source-Message-Id"
	HeaderActorUserID     = "X-Alice-Actor-User-Id"
	HeaderActorOpenID     = "X-Alice-Actor-Open-Id"
	HeaderChatType        = "X-Alice-Chat-Type"
	HeaderSessionKey      = "X-Alice-Session-Key"
)

Variables

This section is empty.

Functions

func BaseURL

func BaseURL(addr string) string

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(baseURL, token string) *Client

func (*Client) CreateGoal added in v0.6.95

func (c *Client) CreateGoal(ctx context.Context, session sessionctx.SessionContext, req CreateGoalRequest) (map[string]any, error)

func (*Client) CreateTask

func (c *Client) CreateTask(ctx context.Context, session sessionctx.SessionContext, req CreateTaskRequest) (map[string]any, error)

func (*Client) DeleteGoal added in v0.6.95

func (c *Client) DeleteGoal(ctx context.Context, session sessionctx.SessionContext) (map[string]any, error)

func (*Client) DeleteTask

func (c *Client) DeleteTask(ctx context.Context, session sessionctx.SessionContext, taskID string) (map[string]any, error)

func (*Client) GetGoal added in v0.6.95

func (c *Client) GetGoal(ctx context.Context, session sessionctx.SessionContext) (map[string]any, error)

func (*Client) GetTask

func (c *Client) GetTask(ctx context.Context, session sessionctx.SessionContext, taskID string) (map[string]any, error)

func (*Client) GoalComplete added in v0.6.95

func (c *Client) GoalComplete(ctx context.Context, session sessionctx.SessionContext) (map[string]any, error)

func (*Client) GoalPause added in v0.6.95

func (c *Client) GoalPause(ctx context.Context, session sessionctx.SessionContext) (map[string]any, error)

func (*Client) GoalResume added in v0.6.95

func (c *Client) GoalResume(ctx context.Context, session sessionctx.SessionContext) (map[string]any, error)

func (*Client) IsEnabled

func (c *Client) IsEnabled() bool

func (*Client) ListTasks

func (c *Client) ListTasks(ctx context.Context, session sessionctx.SessionContext, status string, limit int) (map[string]any, error)

func (*Client) PatchTask

func (c *Client) PatchTask(
	ctx context.Context,
	session sessionctx.SessionContext,
	taskID string,
	contentType string,
	patchBody []byte,
) (map[string]any, error)

func (*Client) SendFile

func (c *Client) SendFile(ctx context.Context, session sessionctx.SessionContext, req FileRequest) (map[string]any, error)

func (*Client) SendImage

func (c *Client) SendImage(ctx context.Context, session sessionctx.SessionContext, req ImageRequest) (map[string]any, error)

type CreateGoalRequest added in v0.6.95

type CreateGoalRequest struct {
	Objective  string `json:"objective"`
	DeadlineIn string `json:"deadline_in,omitempty"`
}

CreateGoalRequest is the API payload for creating or replacing a long-running goal.

type CreateTaskRequest

type CreateTaskRequest struct {
	Prompt         string                `json:"prompt"`
	EverySeconds   int                   `json:"every_seconds,omitempty"`
	CronExpr       string                `json:"cron,omitempty"`
	MaxRuns        int                   `json:"max_runs,omitempty"`
	Fresh          bool                  `json:"fresh,omitempty"`
	Title          string                `json:"title,omitempty"`
	ResumeThreadID string                `json:"resume_thread_id,omitempty"`
	ManageMode     automation.ManageMode `json:"manage_mode,omitempty"`
	NextRunAt      time.Time             `json:"next_run_at,omitempty"`
	Enabled        *bool                 `json:"enabled,omitempty"`
}

type FileRequest

type FileRequest struct {
	FileKey  string `json:"file_key,omitempty"`
	Path     string `json:"path,omitempty"`
	FileName string `json:"file_name,omitempty"`
	Caption  string `json:"caption,omitempty"`
}

type GoalExecutor added in v0.6.95

type GoalExecutor interface {
	ExecuteGoal(ctx context.Context, scope automation.Scope) error
}

type ImageRequest

type ImageRequest struct {
	ImageKey string `json:"image_key,omitempty"`
	Path     string `json:"path,omitempty"`
	Caption  string `json:"caption,omitempty"`
}

type Sender

type Sender = messaging.RuntimeSender

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(
	addr, token string,
	sender Sender,
	automationStore *automation.Store,
	cfg config.Config,
) *Server

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

func (*Server) SetGoalExecutor added in v0.6.95

func (s *Server) SetGoalExecutor(executor GoalExecutor)

func (*Server) UpdateRuntimeConfig added in v0.3.17

func (s *Server) UpdateRuntimeConfig(cfg config.Config)

Jump to

Keyboard shortcuts

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