compiled

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package compiled provides interfaces for compiled Go skills.

This package re-exports types from github.com/plexusone/omniskill/skill for backwards compatibility, adding only omniagent-specific extensions like StorageAware.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParametersToJSONSchema added in v0.6.0

func ParametersToJSONSchema(params map[string]Parameter) map[string]any

ParametersToJSONSchema converts parameters to JSON Schema format. This is a convenience wrapper around skill.ParametersToJSONSchema.

Types

type Parameter

type Parameter = skill.Parameter

Parameter is an alias for skill.Parameter.

type Registry

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

Registry manages compiled skills.

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a new skill registry.

func (*Registry) All

func (r *Registry) All() []Skill

All returns all registered skills.

func (*Registry) AllTools

func (r *Registry) AllTools() []skill.Tool

AllTools returns all tools from all registered skills.

func (*Registry) CloseAll

func (r *Registry) CloseAll() error

CloseAll closes all registered skills.

func (*Registry) Count

func (r *Registry) Count() int

Count returns the number of registered skills.

func (*Registry) FindTool

func (r *Registry) FindTool(name string) (skill.Tool, Skill, bool)

FindTool finds a tool by name across all skills.

func (*Registry) Get

func (r *Registry) Get(name string) (Skill, bool)

Get returns a skill by name.

func (*Registry) InitAll

func (r *Registry) InitAll(ctx context.Context) error

InitAll initializes all registered skills.

func (*Registry) InjectStorage

func (r *Registry) InjectStorage(storage kvs.Store)

InjectStorage injects storage into all storage-aware skills.

func (*Registry) Register

func (r *Registry) Register(s Skill) error

Register adds a skill to the registry.

func (*Registry) ToolCount

func (r *Registry) ToolCount() int

ToolCount returns the total number of tools across all skills.

type Skill

type Skill interface {
	// Name returns the skill identifier (e.g., "invest", "weather").
	Name() string

	// Description returns a human-readable description of the skill.
	Description() string

	// Tools returns the tools provided by this skill.
	Tools() []skill.Tool

	// Init initializes the skill. Called once when the agent starts.
	Init(ctx context.Context) error

	// Close releases resources. Called when the agent shuts down.
	Close() error
}

Skill is the interface that compiled skills implement. This is compatible with skill.Skill from omniskill.

type SkillInfo

type SkillInfo struct {
	Name        string
	Description string
	ToolCount   int
	Tools       []ToolInfo
}

SkillInfo provides metadata about a skill for introspection.

func Info

func Info(s Skill) SkillInfo

Info returns metadata about the skill.

type StorageAware

type StorageAware interface {
	SetStorage(s kvs.Store)
}

StorageAware is an optional interface for skills that need storage. If a skill implements this interface, the agent will inject the storage backend after creation and before Init() is called.

type Tool

type Tool = skill.FuncTool

Tool is an alias for skill.FuncTool. Use skill.NewTool() to create new tools.

func NewTool added in v0.6.0

func NewTool(name, description string, params map[string]Parameter, handler ToolHandler) *Tool

NewTool creates a new tool. This is a convenience wrapper around skill.NewTool.

type ToolHandler

type ToolHandler = skill.ToolFunc

ToolHandler is an alias for skill.ToolFunc.

type ToolInfo

type ToolInfo struct {
	Name        string
	Description string
}

ToolInfo provides metadata about a tool.

Jump to

Keyboard shortcuts

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