agentservice

package
v1.0.0-rc.15 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AgentsMDMessage

func AgentsMDMessage(content, path string) taskengine.Message

func ComposeUserInput added in v0.36.0

func ComposeUserInput(input string, contextBundle map[string]any) string

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)
	SessionResume(ctx context.Context, name string) (contenoxSessionID string, err error)
	SessionDelete(ctx context.Context, name string) 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
	// Images and Audio are attachments riding this turn's user message.
	Images         []taskengine.ImagePart
	Audio          []taskengine.AudioPart
	InputType      taskengine.DataType
	InputValue     any
	Chain          *taskengine.TaskChainDefinition
	TemplateVars   map[string]string
	ToolsAllowlist []string
	ContextLength  int
	HistoryTrim    int
	Observer       Observer
	AgentsMD       string
	AgentsMDSource string

	Context map[string]any

	ChainRef 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