conf

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: MIT Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallKit

func CallKit(tool any, kit string, method string, args ...any) (any, error)

func CreateAgent

func CreateAgent(ctx context.Context, vars *api.Vars, name string, input *api.UserInput) (*api.Agent, error)

func Default

func Default(def, value any) any

Default returns the given value if it's non-nil and non-zero value; otherwise, it returns the default value provided.

func GetArrayProp

func GetArrayProp(key string, props map[string]any) ([]string, error)

func GetIntProp

func GetIntProp(key string, props map[string]any) (int, error)

func GetStrProp

func GetStrProp(key string, props map[string]any) (string, error)

func ListAgents

func ListAgents(ctx context.Context, app *api.AppConfig) (map[string]*api.AgentsConfig, error)

func ListMcpTools

func ListMcpTools(tc *api.ToolsConfig) ([]*api.ToolFunc, error)

func ListModels

func ListModels(ctx context.Context, app *api.AppConfig) (map[string]*api.ModelsConfig, error)

func ListTools

func ListTools(ctx context.Context, app *api.AppConfig) (map[string]*api.ToolFunc, error)

func LoadAgentsAsset

func LoadAgentsAsset(ctx context.Context, as api.AssetStore, root string, packs map[string]*api.AgentsConfig) error

func LoadAgentsConfig

func LoadAgentsConfig(ctx context.Context, app *api.AppConfig) (map[string]*api.AgentsConfig, error)

func LoadAgentsData

func LoadAgentsData(data [][]byte) (*api.AgentsConfig, error)

LoadAgentsConfig loads the agent configuration from the provided YAML data.

func LoadFileAgentsConfig

func LoadFileAgentsConfig(ctx context.Context, base string, packs map[string]*api.AgentsConfig) error

func LoadFileModelsConfig

func LoadFileModelsConfig(ctx context.Context, base string, aliases map[string]*api.ModelsConfig) error

func LoadFileToolsConfig

func LoadFileToolsConfig(ctx context.Context, base string, kits map[string]*api.ToolsConfig) error

func LoadModelsAsset

func LoadModelsAsset(as api.AssetStore, base string, m map[string]*api.ModelsConfig) error

func LoadModelsData

func LoadModelsData(data [][]byte) (*api.ModelsConfig, error)

func LoadResourceAgentsConfig

func LoadResourceAgentsConfig(ctx context.Context, fs embed.FS, packs map[string]*api.AgentsConfig) error

func LoadResourceModelsConfig

func LoadResourceModelsConfig(fs embed.FS, aliases map[string]*api.ModelsConfig) error

func LoadResourceToolsConfig

func LoadResourceToolsConfig(ctx context.Context, fs embed.FS, kits map[string]*api.ToolsConfig) error

func LoadToolData

func LoadToolData(data [][]byte) (*api.ToolsConfig, error)

func LoadToolsAsset

func LoadToolsAsset(ctx context.Context, as api.AssetStore, base string, kits map[string]*api.ToolsConfig) error

func LoadToolsConfig

func LoadToolsConfig(ctx context.Context, app *api.AppConfig) (map[string]*api.ToolsConfig, error)

TODO return early

func LoadWebAgentsConfig

func LoadWebAgentsConfig(ctx context.Context, resources []*api.Resource, packs map[string]*api.AgentsConfig) error

func LoadWebModelsConfig

func LoadWebModelsConfig(ctx context.Context, resources []*api.Resource, aliases map[string]*api.ModelsConfig) error

func LoadWebToolsConfig

func LoadWebToolsConfig(ctx context.Context, resources []*api.Resource, kits map[string]*api.ToolsConfig) error

func NewAgentCreator

func NewAgentCreator() api.AgentCreator

func NewAgentHandler

func NewAgentHandler() func(*api.Vars, *api.Agent) api.Handler

func NewToolCaller

func NewToolCaller() api.ToolCaller

func Spread

func Spread(val any) string

Spread concatenates the elements to create a single string.

Types

type FileContent

type FileContent struct {
	MimeType string
	Content  []byte

	// Optional message to LLM
	Message string
}

https://mimesniff.spec.whatwg.org/

type FuncKit

type FuncKit struct {
}

func (*FuncKit) AgentInfo

func (r *FuncKit) AgentInfo(ctx context.Context, vars *api.Vars, _ string, args map[string]any) (string, error)

func (*FuncKit) AgentTransfer

func (r *FuncKit) AgentTransfer(_ context.Context, _ *api.Vars, _ string, args map[string]any) (*api.Result, error)

func (*FuncKit) ConvertTime

func (r *FuncKit) ConvertTime(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

func (*FuncKit) GetCurrentTime

func (r *FuncKit) GetCurrentTime(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

func (*FuncKit) GetLocalTimezone

func (r *FuncKit) GetLocalTimezone(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

func (*FuncKit) ListAgents

func (r *FuncKit) ListAgents(ctx context.Context, vars *api.Vars, _ string, _ map[string]any) (string, error)

type LLMAdapter

type LLMAdapter func(context.Context, *llm.Request) (*llm.Response, error)

TODO

type LocalSystem

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

func (LocalSystem) Call

func (ls LocalSystem) Call(ctx context.Context, vars *api.Vars, f *api.ToolFunc, args map[string]any) (*api.Result, error)

type McpClient

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

func NewMcpClient

func NewMcpClient(cfg *api.ConnectorConfig) *McpClient

func (*McpClient) Connect

func (r *McpClient) Connect(ctx context.Context) (*mcp.ClientSession, error)

type SystemKit

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

func (*SystemKit) Cd

func (r *SystemKit) Cd(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

func (*SystemKit) Confirm

func (r *SystemKit) Confirm(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

func (*SystemKit) CreateDirectory

func (r *SystemKit) CreateDirectory(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

func (*SystemKit) Env

func (r *SystemKit) Env(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

func (*SystemKit) GetFileInfo

func (r *SystemKit) GetFileInfo(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

func (*SystemKit) HomeDir

func (r *SystemKit) HomeDir(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

func (*SystemKit) ListCommands

func (r *SystemKit) ListCommands(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

func (*SystemKit) ListDirectory

func (r *SystemKit) ListDirectory(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

func (*SystemKit) Man

func (r *SystemKit) Man(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

func (*SystemKit) Pwd

func (r *SystemKit) Pwd(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

func (*SystemKit) ReadFile

func (r *SystemKit) ReadFile(ctx context.Context, vars *api.Vars, name string, args map[string]any) (*FileContent, error)

ReadFile returns mime type and the raw file content

func (*SystemKit) RenameFile

func (r *SystemKit) RenameFile(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

func (*SystemKit) RepoDir

func (r *SystemKit) RepoDir(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

func (*SystemKit) Run

func (r *SystemKit) Run(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

func (*SystemKit) SearchFiles

func (r *SystemKit) SearchFiles(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

func (*SystemKit) TempDir

func (r *SystemKit) TempDir(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

func (*SystemKit) Uname

func (r *SystemKit) Uname(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

func (*SystemKit) Which

func (r *SystemKit) Which(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

func (*SystemKit) WhoAmI

func (r *SystemKit) WhoAmI(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

func (*SystemKit) WorkspaceDir

func (r *SystemKit) WorkspaceDir(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

func (*SystemKit) WriteFile

func (r *SystemKit) WriteFile(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

type WebKit

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

func (*WebKit) BingSearch

func (r *WebKit) BingSearch(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

Search the web using Bing.

func (*WebKit) BraveSearch

func (r *WebKit) BraveSearch(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

Search the web using Brave.

func (*WebKit) DdgSearch

func (r *WebKit) DdgSearch(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

Search the web using DuckDuckGo.

func (*WebKit) DownloadContent

func (r *WebKit) DownloadContent(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

func (*WebKit) FetchContent

func (r *WebKit) FetchContent(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

func (*WebKit) GoogleSearch

func (r *WebKit) GoogleSearch(ctx context.Context, vars *api.Vars, name string, args map[string]any) (string, error)

Search the web using Google.

Jump to

Keyboard shortcuts

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