Documentation
¶
Index ¶
- Constants
- func ActionNameFromFile(file string) string
- func Cat(a, b, sep string) string
- func ClearAllEnv(keeps []string)
- func GetInput(ctx context.Context, argv []string) (*api.InputConfig, error)
- func GetUserInput(ctx context.Context, cfg *api.InputConfig) (*api.UserInput, error)
- func NewAgentScriptRunner(sw *Swarm, agent *api.Agent) api.ActionRunner
- func NewAgentToolRunner(sw *Swarm, user string, agent *api.Agent) api.ActionRunner
- func NewTemplate(sw *Swarm, agent *api.Agent) *template.Template
- func NewToolSystem(rte *api.ActionRTEnv) (api.ToolSystem, error)
- func NilSafe[T any](ptr *T) T
- func ParseSpecialChars(args []string) *api.InputConfig
- func RunCoreUtil(sw *Swarm, cmd string, a []string) string
- type AIKit
- func (r *AIKit) BuildContext(ctx context.Context, vars *api.Vars, tf string, args api.ArgMap) (any, error)
- func (r *AIKit) BuildPrompt(ctx context.Context, vars *api.Vars, tf string, args api.ArgMap) (string, error)
- func (r *AIKit) BuildQuery(ctx context.Context, vars *api.Vars, tf string, args api.ArgMap) (string, error)
- func (r *AIKit) Call(ctx context.Context, vars *api.Vars, tf *api.ToolFunc, args map[string]any) (any, error)
- func (r *AIKit) CallLlm(ctx context.Context, vars *api.Vars, tf string, args map[string]any) (*api.Result, error)
- func (r *AIKit) GetAgentInfo(ctx context.Context, vars *api.Vars, _ string, args map[string]any) (string, error)
- func (r *AIKit) GetToolInfo(ctx context.Context, vars *api.Vars, tf string, args map[string]any) (string, error)
- func (r *AIKit) ListAgents(ctx context.Context, vars *api.Vars, tf string, args map[string]any) (string, error)
- func (r *AIKit) ListMessages(ctx context.Context, vars *api.Vars, tf string, args map[string]any) (string, error)
- func (r *AIKit) ListModels(ctx context.Context, vars *api.Vars, tf string, args map[string]any) (string, error)
- func (r *AIKit) ListTools(ctx context.Context, vars *api.Vars, tf string, args map[string]any) (string, error)
- func (r *AIKit) NewAgent(ctx context.Context, vars *api.Vars, tf string, args map[string]any) (*api.Result, error)
- func (r *AIKit) ReadAgentConfig(ctx context.Context, vars *api.Vars, _ string, args api.ArgMap) (*api.AppConfig, error)
- func (r *AIKit) ReadToolConfig(ctx context.Context, vars *api.Vars, tf string, args map[string]any) (any, error)
- func (r *AIKit) ReloadAgent(ctx context.Context, _ *api.Vars, _ string, args map[string]any) (*api.Result, error)
- func (r *AIKit) SaveMessages(_ context.Context, _ *api.Vars, _ string, args api.ArgMap) (*api.Result, error)
- func (r *AIKit) SpawnAgent(ctx context.Context, vars *api.Vars, _ string, args api.ArgMap) (*api.Result, error)
- func (r *AIKit) TransferAgent(_ context.Context, _ *api.Vars, _ string, args map[string]any) (*api.Result, error)
- type AgentCacheKey
- type AgentScriptRunner
- type AgentToolRunner
- type ConfigLoader
- func (r *ConfigLoader) Create(ctx context.Context, packname api.Packname) (*api.Agent, error)
- func (r *ConfigLoader) CreateTool(tid string) (*api.ToolFunc, error)
- func (r *ConfigLoader) LoadAgentConfig(packname api.Packname) (*api.AppConfig, error)
- func (r *ConfigLoader) LoadConfig(s string) (*api.AppConfig, error)
- func (r *ConfigLoader) LoadContent(s string) error
- func (r *ConfigLoader) LoadToolConfig(kn api.Kitname) (*api.AppConfig, error)
- func (r *ConfigLoader) NewAgent(c *api.AgentConfig, pn api.Packname) (*api.Agent, error)
- type KitKey
- type ListCacheKey
- type Swarm
- func (sw *Swarm) CreateAgent(ctx context.Context, parent *api.Agent, packname api.Packname, config []byte) (*api.Agent, error)
- func (sw *Swarm) Exec(ctx context.Context, input any) (*api.Result, error)
- func (sw *Swarm) Format(ctx context.Context, argm map[string]any) (*api.Result, error)
- func (sw *Swarm) Init(rte *api.ActionRTEnv) error
- func (sw *Swarm) LoadScript(v string) (string, error)
- func (sw *Swarm) Parse(ctx context.Context, input any) (api.ArgMap, error)
Constants ¶
const ( // read from clipboard ClipinRedirect = "{" // read from clipboard and wait, allowing multiple copy // until Ctrl-D is entered ClipinRedirect2 = "{{" // write to clipboard, overwriting its content ClipoutRedirect = "}" // append to clipboard ClipoutRedirect2 = "}}" )
clipboard redirection
const StdinRedirect = "-"
stdin
Variables ¶
This section is empty.
Functions ¶
func ActionNameFromFile ¶ added in v0.1.1
Return agent/kit name:
- agent: pack[/sub]
- tool: kit:name
if the path matches the following pattern: agents/pack/agent.yaml agents/pack/pack.yaml agents/pack/sub.yaml
tools/kit/name.yaml
func ClearAllEnv ¶ added in v0.1.1
func ClearAllEnv(keeps []string)
ClearAllEnv clears all environment variables execep for the keeps
func GetUserInput ¶ added in v0.1.1
GetUserInput collects user input for the agent. It prefers a direct message from the command line flag (--message), otherwise, it determines the input source (stdin, clipboard, editor) and collects input accordingly. It also attaches any provided files or template file if provided.
func NewAgentScriptRunner ¶ added in v0.1.1
func NewAgentScriptRunner(sw *Swarm, agent *api.Agent) api.ActionRunner
func NewAgentToolRunner ¶ added in v0.1.1
func NewTemplate ¶ added in v0.11.1
https://pkg.go.dev/text/template https://masterminds.github.io/sprig/
func NewToolSystem ¶ added in v0.1.1
func NewToolSystem(rte *api.ActionRTEnv) (api.ToolSystem, error)
func ParseSpecialChars ¶ added in v0.1.1
func ParseSpecialChars(args []string) *api.InputConfig
parse special char sequence for stdin/clipboard they can: + be at the end of the args + be in any order + be multiple instances
Types ¶
type AIKit ¶ added in v0.1.1
type AIKit struct {
// contains filtered or unexported fields
}
func (*AIKit) BuildContext ¶ added in v0.1.1
func (*AIKit) BuildPrompt ¶ added in v0.1.1
func (*AIKit) BuildQuery ¶ added in v0.1.1
func (*AIKit) GetAgentInfo ¶ added in v0.1.1
func (*AIKit) GetToolInfo ¶ added in v0.1.1
func (*AIKit) ListAgents ¶ added in v0.1.1
func (*AIKit) ListMessages ¶ added in v0.1.1
func (*AIKit) ListModels ¶ added in v0.1.1
func (*AIKit) ReadAgentConfig ¶ added in v0.1.1
func (*AIKit) ReadToolConfig ¶ added in v0.1.1
func (*AIKit) ReloadAgent ¶ added in v0.12.1
func (*AIKit) SaveMessages ¶ added in v0.1.1
func (*AIKit) SpawnAgent ¶ added in v0.1.1
func (r *AIKit) SpawnAgent(ctx context.Context, vars *api.Vars, _ string, args api.ArgMap) (*api.Result, error)
agent can be invoked directly by name with kit name "agent:" /agent:pack/sub and agent__pack__sub as tool id by LLM this tool serves as a simple interface for LLM tool calls. agent is required. actions defatult to the following if not set: entrypoint: "ai:new_agent", "ai:build_query", "ai:build_prompt", "ai:build_context", "ai:call_llm"
type AgentCacheKey ¶ added in v0.1.1
type AgentScriptRunner ¶ added in v0.1.1
type AgentScriptRunner struct {
// contains filtered or unexported fields
}
type AgentToolRunner ¶ added in v0.1.1
type AgentToolRunner struct {
// contains filtered or unexported fields
}
type ConfigLoader ¶ added in v0.1.1
type ConfigLoader struct {
// contains filtered or unexported fields
}
func NewConfigLoader ¶ added in v0.1.1
func NewConfigLoader(rte *api.ActionRTEnv) *ConfigLoader
func (*ConfigLoader) CreateTool ¶ added in v0.1.1
func (r *ConfigLoader) CreateTool(tid string) (*api.ToolFunc, error)
func (*ConfigLoader) LoadAgentConfig ¶ added in v0.1.1
func (*ConfigLoader) LoadConfig ¶ added in v0.1.1
func (r *ConfigLoader) LoadConfig(s string) (*api.AppConfig, error)
load config for agent/tool
func (*ConfigLoader) LoadContent ¶ added in v0.1.1
func (r *ConfigLoader) LoadContent(s string) error
func (*ConfigLoader) LoadToolConfig ¶ added in v0.1.1
func (*ConfigLoader) NewAgent ¶ added in v0.1.1
func (r *ConfigLoader) NewAgent(c *api.AgentConfig, pn api.Packname) (*api.Agent, error)
type ListCacheKey ¶ added in v0.1.1
type Swarm ¶
type Swarm struct {
// session id
ID string
User *api.User
Secrets api.SecretStore
Assets api.AssetManager
Tools api.ToolSystem
Adapters api.AdapterRegistry
Blobs api.BlobStore
OS vos.System
Workspace vfs.Workspace
History api.MemStore
Log api.CallLogger
//
Vars *api.Vars
}
func (*Swarm) CreateAgent ¶ added in v0.11.1
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
https://pkg.go.dev/modernc.org/sqlite https://sqlite.org/docs.html
|
https://pkg.go.dev/modernc.org/sqlite https://sqlite.org/docs.html |
|
Package flag implements command-line flag parsing.
|
Package flag implements command-line flag parsing. |
|
llm
|
|
|
standard/agents/web
command
|
|
|
tool
|
|
|
sequentialthinking
command
|
|
|
web/ddg
https://github.com/tmc/langchaingo/blob/main/tools/duckduckgo/internal/client.go https://github.com/tmc/langchaingo?tab=MIT-1-ov-file#readme
|
https://github.com/tmc/langchaingo/blob/main/tools/duckduckgo/internal/client.go https://github.com/tmc/langchaingo?tab=MIT-1-ov-file#readme |
|
web/scrape
https://github.com/tmc/langchaingo/blob/main/tools/scraper/scraper.go https://github.com/tmc/langchaingo?tab=MIT-1-ov-file#readme
|
https://github.com/tmc/langchaingo/blob/main/tools/scraper/scraper.go https://github.com/tmc/langchaingo?tab=MIT-1-ov-file#readme |