agentservice

package
v0.28.6 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AgentsMDMessage

func AgentsMDMessage(content, path string) taskengine.Message

Types

type Agent

type Agent interface {
	Capabilities(ctx context.Context) (*AgentCapabilities, error)
	SessionNew(ctx context.Context, name string) (string, error)
	SessionList(ctx context.Context) ([]*SessionInfo, error)
	SessionLoad(ctx context.Context, name string) (contenoxSessionID string, messages []taskengine.Message, err error)
	SessionEnsureDefault(ctx context.Context) (string, error)
	Prompt(ctx context.Context, req PromptRequest) (*PromptResponse, error)
}

func New

func New(deps Deps) Agent

type AgentCapabilities

type AgentCapabilities struct {
	LocalTools      []string
	MCPServers      []string
	SupportsSession bool
}

type Deps

type Deps struct {
	Engine      *enginesvc.Engine
	DB          libdb.DBManager
	WorkspaceID string
	Identity    string
}

type NoopObserver

type NoopObserver struct{}

func (NoopObserver) OnStepCompleted

func (NoopObserver) OnStepCompleted(taskengine.CapturedStateUnit)

type Observer

type Observer interface {
	OnStepCompleted(step taskengine.CapturedStateUnit)
}

type PromptRequest

type PromptRequest struct {
	SessionID      string
	Input          string
	InputType      taskengine.DataType
	InputValue     any
	Chain          *taskengine.TaskChainDefinition
	TemplateVars   map[string]string
	HistoryTrim    int
	Observer       Observer
	AgentsMD       string
	AgentsMDSource string
}

type PromptResponse

type PromptResponse struct {
	Output     any
	OutputType taskengine.DataType
	Steps      []taskengine.CapturedStateUnit
	StopReason StopReason
}

type SessionInfo

type SessionInfo struct {
	ID           string
	Name         string
	MessageCount int
	IsActive     bool
}

type StopReason

type StopReason string
const (
	StopEndTurn         StopReason = "end_turn"
	StopMaxTokens       StopReason = "max_tokens"
	StopMaxTurnRequests StopReason = "max_turn_requests"
	StopCancelled       StopReason = "cancelled"
)

func InferStopReason

func InferStopReason(err error, steps []taskengine.CapturedStateUnit) StopReason

Jump to

Keyboard shortcuts

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